mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
Fix mempool names to reflect socket id.
Create mempool names by considering also the NUMA socket number.
So a name reflects what socket the mempool is allocated on.
This change is needed for the NUMA-awareness feature.
CC: Mark B Kavanagh <mark.b.kavanagh@intel.com>
CC: Aaron Conole <aconole@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reported-by: Ciara Loftus <ciara.loftus@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
Fixes: d555d9bded
("netdev-dpdk: Create separate memory pool for each port.")
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
This commit is contained in:
committed by
Ian Stokes
parent
b6b26021d2
commit
f06546a51d
@@ -499,8 +499,8 @@ dpdk_mp_name(struct dpdk_mp *dmp)
|
||||
{
|
||||
uint32_t h = hash_string(dmp->if_name, 0);
|
||||
char *mp_name = xcalloc(RTE_MEMPOOL_NAMESIZE, sizeof *mp_name);
|
||||
int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_%x_%d_%u",
|
||||
h, dmp->mtu, dmp->mp_size);
|
||||
int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_%x_%d_%d_%u",
|
||||
h, dmp->socket_id, dmp->mtu, dmp->mp_size);
|
||||
if (ret < 0 || ret >= RTE_MEMPOOL_NAMESIZE) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -534,10 +534,11 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool *mp_exists)
|
||||
do {
|
||||
char *mp_name = dpdk_mp_name(dmp);
|
||||
|
||||
VLOG_DBG("Requesting a mempool of %u mbufs for netdev %s "
|
||||
"with %d Rx and %d Tx queues.",
|
||||
dmp->mp_size, dev->up.name,
|
||||
dev->requested_n_rxq, dev->requested_n_txq);
|
||||
VLOG_DBG("Port %s: Requesting a mempool of %u mbufs "
|
||||
"on socket %d for %d Rx and %d Tx queues.",
|
||||
dev->up.name, dmp->mp_size,
|
||||
dev->requested_socket_id,
|
||||
dev->requested_n_rxq, dev->requested_n_txq);
|
||||
|
||||
dmp->mp = rte_pktmbuf_pool_create(mp_name, dmp->mp_size,
|
||||
MP_CACHE_SZ,
|
||||
|
Reference in New Issue
Block a user