patches for DPDK stable branches
 help / color / Atom feed
From: Junyu Jiang <junyux.jiang@intel.com>
To: dev@dpdk.org
Cc: Suanming Mou <suanmingm@nvidia.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Junyu Jiang <junyux.jiang@intel.com>,
	stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2] app/testpmd: fix flow flush with invalid port
Date: Fri, 16 Oct 2020 02:03:10 +0000
Message-ID: <20201016020310.51272-1-junyux.jiang@intel.com> (raw)
In-Reply-To: <20201014083005.64428-1-junyux.jiang@intel.com>

There is no error info displayed when running flow flush
command with invalid port. This patch fixed the issue.

Fixes: 2a449871a12d ("app/testpmd: align behaviour of multi-port detach")
Cc: stable@dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Reviewed-by: Suanming Mou <suanmingm@nvidia.com>
---
 app/test-pmd/config.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index fe31a9d52..541952ab8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1772,19 +1772,22 @@ int
 port_flow_flush(portid_t port_id)
 {
 	struct rte_flow_error error;
-	struct rte_port *port = &ports[port_id];
+	struct rte_port *port;
 	int ret = 0;
 
+	if (port_id_is_invalid(port_id, ENABLED_WARN) ||
+		port_id == (portid_t)RTE_PORT_ALL)
+		return -EINVAL;
+
+	port = &ports[port_id];
+
 	if (port->flow_list == NULL)
 		return ret;
 
 	/* Poisoning to make sure PMDs update it in case of error. */
 	memset(&error, 0x44, sizeof(error));
 	if (rte_flow_flush(port_id, &error)) {
-		ret = port_flow_complain(&error);
-		if (port_id_is_invalid(port_id, DISABLED_WARN) ||
-		    port_id == (portid_t)RTE_PORT_ALL)
-			return ret;
+		port_flow_complain(&error);
 	}
 
 	while (port->flow_list) {
-- 
2.17.1


  parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14  8:30 [dpdk-stable] [PATCH] " Junyu Jiang
2020-10-14 10:16 ` [dpdk-stable] [dpdk-dev] " Suanming Mou
2020-10-15 22:14   ` Ferruh Yigit
2020-10-16  1:27     ` Jiang, JunyuX
2020-10-16  2:03 ` Junyu Jiang [this message]
2020-10-16 13:04   ` [dpdk-stable] [PATCH v2] " Ferruh Yigit

Reply instructions:

You may reply publically 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=20201016020310.51272-1-junyux.jiang@intel.com \
    --to=junyux.jiang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --cc=wenzhuo.lu@intel.com \
    /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

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox