[ovs-dev] [PATCH v7 4/6] netdev-dpdk: manage failure in mempool name creation.

Kevin Traynor ktraynor at redhat.com
Thu Oct 19 10:33:28 UTC 2017


On 10/18/2017 05:01 PM, antonio.fischetti at intel.com wrote:
> 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 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>
> 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 7c550f2..a3b4638 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("Failed to generate a mempool name for \"%s\". "
> +            "Hash:0x%x, mtu:%d, mbufs:%u, %s",
> +            dmp->if_name, h, dmp->mtu, dmp->mp_size, ovs_strerror(ret));

ovs_strerror(ret) look to be wrong

>          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;
> +        }

This looks like a fix, so should have Fixes: in commit message.

>  
>          VLOG_DBG("Requesting a mempool of %u mbufs for netdev %s "
>                   "with %d Rx and %d Tx queues, socket id:%d.",
> 



More information about the dev mailing list