mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 15:25:22 +00:00
netdev-dpdk: manage failure in mempool name creation.
In case a mempool name could not be generated log a message
and return a null mempool pointer to the caller.
CC: Mark B Kavanagh <mark.b.kavanagh@intel.com>
CC: Darrell Ball <dlu998@gmail.com>
CC: Ciara Loftus <ciara.loftus@intel.com>
CC: Kevin Traynor <ktraynor@redhat.com>
CC: Aaron Conole <aconole@redhat.com>
Fixes: d555d9bded
("netdev-dpdk: Create separate memory pool for each port.")
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
This commit is contained in:
committed by
Ian Stokes
parent
837c1761be
commit
65056fd796
@@ -502,6 +502,9 @@ dpdk_mp_name(struct dpdk_mp *dmp)
|
|||||||
int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_%x_%d_%d_%u",
|
int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_%x_%d_%d_%u",
|
||||||
h, dmp->socket_id, dmp->mtu, dmp->mp_size);
|
h, dmp->socket_id, dmp->mtu, dmp->mp_size);
|
||||||
if (ret < 0 || ret >= RTE_MEMPOOL_NAMESIZE) {
|
if (ret < 0 || ret >= RTE_MEMPOOL_NAMESIZE) {
|
||||||
|
VLOG_DBG("snprintf returned %d. Failed to generate a mempool "
|
||||||
|
"name for \"%s\". Hash:0x%x, mtu:%d, mbufs:%u.",
|
||||||
|
ret, dmp->if_name, h, dmp->mtu, dmp->mp_size);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return mp_name;
|
return mp_name;
|
||||||
@@ -533,6 +536,10 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool *mp_exists)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
char *mp_name = dpdk_mp_name(dmp);
|
char *mp_name = dpdk_mp_name(dmp);
|
||||||
|
if (!mp_name) {
|
||||||
|
rte_free(dmp);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
VLOG_DBG("Port %s: Requesting a mempool of %u mbufs "
|
VLOG_DBG("Port %s: Requesting a mempool of %u mbufs "
|
||||||
"on socket %d for %d Rx and %d Tx queues.",
|
"on socket %d for %d Rx and %d Tx queues.",
|
||||||
|
Reference in New Issue
Block a user