[ovs-dev] [PATCH 2/4] netdev-dpdk: Fix dpdk_mp leak in case of EEXIST.

Fischetti, Antonio antonio.fischetti at intel.com
Tue Oct 31 13:28:02 UTC 2017


LGTM 
Acked-by: Antonio Fischetti <antonio.fischetti at intel.com>

> -----Original Message-----
> From: Ilya Maximets [mailto:i.maximets at samsung.com]
> Sent: Monday, October 30, 2017 12:53 PM
> To: ovs-dev at openvswitch.org
> Cc: Heetae Ahn <heetae82.ahn at samsung.com>; Fischetti, Antonio
> <antonio.fischetti at intel.com>; Loftus, Ciara <ciara.loftus at intel.com>;
> Kavanagh, Mark B <mark.b.kavanagh at intel.com>; Stokes, Ian
> <ian.stokes at intel.com>; Wojciechowicz, RobertX
> <robertx.wojciechowicz at intel.com>; Ilya Maximets <i.maximets at samsung.com>
> Subject: [PATCH 2/4] netdev-dpdk: Fix dpdk_mp leak in case of EEXIST.
> 
> CC: Robert Wojciechowicz <robertx.wojciechowicz at intel.com>
> CC: Antonio Fischetti <antonio.fischetti at intel.com>
> Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
> Fixes: b6b26021d2e2 ("netdev-dpdk: fix management of pre-existing mempools.")
> Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
> ---
>  lib/netdev-dpdk.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 1e9d78f..ba6add2 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -649,6 +649,12 @@ netdev_dpdk_mempool_configure(struct netdev_dpdk *dev)
>           * Update dev with the new values. */
>          dev->mtu = dev->requested_mtu;
>          dev->max_packet_len = MTU_TO_FRAME_LEN(dev->mtu);
> +        /* 'mp' should contain pointer to the mempool already owned by netdev.
> +         * Otherwise something went completely wrong. */
> +        ovs_assert(dev->dpdk_mp);
> +        ovs_assert(dev->dpdk_mp->mp == mp->mp);
> +        /* Free the returned struct dpdk_mp because it will not be used. */
> +        rte_free(mp);
>          return EEXIST;
>      } else {
>          /* A new mempool was created, release the previous one. */
> --
> 2.7.4



More information about the dev mailing list