netdev-dpdk: Make memory pool name contain the socket id.
authorAlex Wang <alexw@nicira.com>
Tue, 17 Jun 2014 00:19:11 +0000 (17:19 -0700)
committerAlex Wang <alexw@nicira.com>
Tue, 2 Sep 2014 22:46:57 +0000 (15:46 -0700)
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@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
lib/netdev-dpdk.c

index c166ed6..2feec70 100644 (file)
@@ -303,7 +303,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;
     }