From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 797A6A04DB for ; Thu, 15 Oct 2020 08:23:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57A041DC79; Thu, 15 Oct 2020 08:23:47 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id A3A511DC79 for ; Thu, 15 Oct 2020 08:23:44 +0200 (CEST) IronPort-SDR: NRZu/btvbFMNM+Ev6enH/UZK+j54voEPbTt4MwZntfo7v/gKK/Y5hdhJHGsCQdfsGU/8fSi6eE 1UC9bAq/8aIw== X-IronPort-AV: E=McAfee;i="6000,8403,9774"; a="166333996" X-IronPort-AV: E=Sophos;i="5.77,378,1596524400"; d="scan'208";a="166333996" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 23:23:42 -0700 IronPort-SDR: S37RrZ7h5yDqqBTOwidsThYHqKUBOKjEddULCyLypOaYqspHt3wrnQ9ff/bJixhQZwIasJbSU/ luHnEexwNEKA== X-IronPort-AV: E=Sophos;i="5.77,378,1596524400"; d="scan'208";a="345961117" Received: from unknown (HELO intel.sh.intel.com) ([10.239.255.60]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 23:23:40 -0700 From: Junyu Jiang To: shougangx.wang@intel.com Cc: Junyu Jiang , stable@dpdk.org Date: Thu, 15 Oct 2020 06:15:36 +0000 Message-Id: <20201015061536.17639-1-junyux.jiang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] app/testpmd: fix flow flush with invalid port X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- app/test-pmd/config.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index fe31a9d52..cc4527386 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1775,16 +1775,17 @@ port_flow_flush(portid_t port_id) struct rte_port *port = &ports[port_id]; int ret = 0; + if (port_id_is_invalid(port_id, ENABLED_WARN) || + port_id == (portid_t)RTE_PORT_ALL) + return -EINVAL; + 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