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 7FE4AA04C0 for ; Wed, 14 Oct 2020 11:10:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 598D41DB37; Wed, 14 Oct 2020 11:10:34 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 4697D1D666; Wed, 14 Oct 2020 11:10:30 +0200 (CEST) IronPort-SDR: dfGiWiRXAJkMitUwyiLqk4/NQD7Bjn0oC+oRK5ZXRfgwtA6BClR7yn5uXWLCs1xMEn0djcSIrM w2WzYvUMPo3g== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="166128408" X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="166128408" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 02:10:26 -0700 IronPort-SDR: ytV8ci8q19LB7uPK92OKMnc9VmLF6okrRu/lGRW4qcNLqTPZ8AQfSuc6xj2jlWdctFFxwTmPOy u8ewINFq2zew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="314099248" Received: from qat_cpm20_vlan01.sh.intel.com ([10.67.97.38]) by orsmga003.jf.intel.com with ESMTP; 14 Oct 2020 02:10:24 -0700 From: Junyu Jiang To: dev@dpdk.org Cc: Beilei Xing , Wenzhuo Lu , Junyu Jiang , stable@dpdk.org Date: Wed, 14 Oct 2020 16:30:05 +0800 Message-Id: <20201014083005.64428-1-junyux.jiang@intel.com> X-Mailer: git-send-email 2.13.6 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