patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Pascal Mazon <pascal.mazon@6wind.com>
To: Moti Haimovsky <motih@mellanox.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH] net/tap: fix res cleanup when tap create fails
Date: Wed, 7 Feb 2018 17:00:51 +0100	[thread overview]
Message-ID: <b2e89749-d541-5d6a-1231-bcba2372e44a@6wind.com> (raw)
In-Reply-To: <1517847440-42660-1-git-send-email-motih@mellanox.com>

Acked-by: Pascal Mazon <pascal.mazon@6wind.com>

On 05/02/2018 17:17, Moti Haimovsky wrote:
> This patch complements the partial cleanup done inside
> eth_dev_tap_create when the routine failed.
> Such a failure left a non-functional device attached to the system.
>
> Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev")
> Cc: stable@dpdk.org
>
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> ---
>  drivers/net/tap/rte_eth_tap.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index dc3847e..8931dec 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -1347,13 +1347,13 @@ enum ioctl_mode {
>  	data = rte_zmalloc_socket(tap_name, sizeof(*data), 0, numa_node);
>  	if (!data) {
>  		RTE_LOG(ERR, PMD, "TAP Failed to allocate data\n");
> -		goto error_exit;
> +		goto error_exit_nodev;
>  	}
>  
>  	dev = rte_eth_vdev_allocate(vdev, sizeof(*pmd));
>  	if (!dev) {
>  		RTE_LOG(ERR, PMD, "TAP Unable to allocate device struct\n");
> -		goto error_exit;
> +		goto error_exit_nodev;
>  	}
>  
>  	pmd = dev->data->dev_private;
> @@ -1524,6 +1524,11 @@ enum ioctl_mode {
>  	tap_flow_implicit_flush(pmd, NULL);
>  
>  error_exit:
> +	if (pmd->ioctl_sock > 0)
> +		close(pmd->ioctl_sock);
> +	rte_eth_dev_release_port(dev);
> +
> +error_exit_nodev:
>  	RTE_LOG(ERR, PMD, "TAP Unable to initialize %s\n",
>  		rte_vdev_device_name(vdev));
>  

  reply	other threads:[~2018-02-07 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 16:17 Moti Haimovsky
2018-02-07 16:00 ` Pascal Mazon [this message]
2018-02-08 12:28   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2e89749-d541-5d6a-1231-bcba2372e44a@6wind.com \
    --to=pascal.mazon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=motih@mellanox.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).