patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yliu@fridaylinux.org>
To: Moti Haimovsky <motih@mellanox.com>
Cc: Pascal Mazon <pascal.mazon@6wind.com>, dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/tap: fix cleanup on allocation failure' has been queued to LTS release 17.11.1
Date: Sun, 11 Feb 2018 12:02:47 +0800	[thread overview]
Message-ID: <1518321771-23153-1-git-send-email-yliu@fridaylinux.org> (raw)

Hi,

FYI, your patch has been queued to LTS release 17.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/13/18. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 344d489593d878837c45815ba5b8cf3ef5689826 Mon Sep 17 00:00:00 2001
From: Moti Haimovsky <motih@mellanox.com>
Date: Mon, 5 Feb 2018 18:17:20 +0200
Subject: [PATCH] net/tap: fix cleanup on allocation failure

[ upstream commit cb7e68da630abe7bb7b69885cc2a1a8e6d705943 ]

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")

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.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 036028f..b8187f9 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1240,13 +1240,13 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name,
 	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;
@@ -1416,6 +1416,11 @@ error_remote:
 	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));
 
-- 
2.7.4

             reply	other threads:[~2018-02-11  4:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11  4:02 Yuanhan Liu [this message]
2018-02-11  4:02 ` [dpdk-stable] patch 'net/bnxt: fix Rx checksum flags' " Yuanhan Liu
2018-02-11  4:02 ` [dpdk-stable] patch 'net/bnxt: fix return code in MAC address set' " Yuanhan Liu
2018-02-11  4:02 ` [dpdk-stable] patch 'net/i40e: check multi-driver option parsing' " Yuanhan Liu
2018-02-11  4:02 ` [dpdk-stable] patch 'app/testpmd: fix flow director filter' " Yuanhan Liu

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=1518321771-23153-1-git-send-email-yliu@fridaylinux.org \
    --to=yliu@fridaylinux.org \
    --cc=motih@mellanox.com \
    --cc=pascal.mazon@6wind.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).