[ovs-dev] [dpdk patch 3/8] netdev-dpdk: Make memory pool name contain the socket id.

Alex Wang alexw at nicira.com
Tue Aug 12 04:56:38 UTC 2014


This commit makes the memory pool name contain the socket id.
Since dpdk library do not allow creation of memory pool with
same name, this commit serves as a simple way of making each
name unique.

Signed-off-by: Alex Wang <alexw at nicira.com>
Acked-by: Thomas Graf <tgraf at noironetworks.com>
---
 lib/netdev-dpdk.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 7298334..109006f 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -300,7 +300,8 @@ dpdk_mp_get(int socket_id, int mtu) OVS_REQUIRES(dpdk_mutex)
     dmp->mtu = mtu;
     dmp->refcount = 1;
 
-    if (snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_mp_%d", dmp->mtu) < 0) {
+    if (snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_mp_%d_%d", dmp->mtu,
+                 dmp->socket_id) < 0) {
         return NULL;
     }
 
-- 
1.7.9.5




More information about the dev mailing list