[ovs-dev] [PATCH v8 4/6] netdev-dpdk: manage failure in mempool name creation.
Fischetti, Antonio
antonio.fischetti at intel.com
Thu Oct 19 17:58:52 UTC 2017
> -----Original Message-----
> From: Stokes, Ian
> Sent: Thursday, October 19, 2017 6:23 PM
> To: Fischetti, Antonio <antonio.fischetti at intel.com>; dev at openvswitch.org
> Subject: RE: [ovs-dev] [PATCH v8 4/6] 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.
> >
>
> Now that I look at this, is it the case that the issues have been resolved in
> patches 1 and 2 but this is a clean up patch for something that might happen?
[Antonio] Exactly. All the issues we saw:
- issue with vhostuserclient in a PVP test
- issue of new MTU not displayed when an existing mempool is returned.
- issue with the NUMA-Aware usecase
get resolved by patches #1 and #2.
All remaining patches are small improvements or just cosmetics.
This patch would be a small improvement to manage the unlikely event of a name creation failure that 'might' happen.
So this has nothing to do with the issues listed above. I added this patch to the series because - after looking at the code - I thought it would be good to track and manage an empty mempool name, just to be extra-safe.
>
>
> > CC: Mark B Kavanagh <mark.b.kavanagh at intel.com>
> > CC: Darrell Ball <dlu998 at gmail.com>
> > CC: Ciara Loftus <ciara.loftus at intel.com>
> > CC: Kevin Traynor <ktraynor at redhat.com>
> > CC: Aaron Conole <aconole at redhat.com>
> > Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each
> > port.")
> > Signed-off-by: Antonio Fischetti <antonio.fischetti at intel.com>
> > ---
> > lib/netdev-dpdk.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index dc1e9c3..6fc6e1b
> > 100644
> > --- a/lib/netdev-dpdk.c
> > +++ b/lib/netdev-dpdk.c
> > @@ -502,6 +502,9 @@ dpdk_mp_name(struct dpdk_mp *dmp)
> > 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) {
> > + 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 mp_name;
> > @@ -533,6 +536,10 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool
> > *mp_exists)
> >
> > do {
> > 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 "
> > "on socket %d for %d Rx and %d Tx queues.",
> > --
> > 2.4.11
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
More information about the dev
mailing list