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 442A3A00BE; Tue, 28 Apr 2020 07:52:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D327D1D169; Tue, 28 Apr 2020 07:52:25 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C0DD61C2DB for ; Tue, 28 Apr 2020 07:52:23 +0200 (CEST) IronPort-SDR: d1HNpysTl/g7JF9QCX91f1zePqpBD4IaEpaIvoHV7AO++qNs2KuA6Y6CDJsXEC8Jp8upOALm5X Bt3Wg17O0xqA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2020 22:52:22 -0700 IronPort-SDR: BDX/+9+ebLF9TaQTN7HbAFI+FLYHwC4b6olxA1GnoF0Es3P1ng8ZmwmGfAS48xX8dYCzw1IELm dSJfHZdeSBvA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,326,1583222400"; d="scan'208";a="404577836" Received: from npg-dpdk-cvl-simeisu-118d193.sh.intel.com ([10.67.110.186]) by orsmga004.jf.intel.com with ESMTP; 27 Apr 2020 22:52:20 -0700 From: Simei Su To: qi.z.zhang@intel.com, xiaolong.ye@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org, yahui.cao@intel.com, simei.su@intel.com Date: Tue, 28 Apr 2020 13:49:19 +0800 Message-Id: <1588052959-296702-1-git-send-email-simei.su@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/iavf: fix VF reset issue for FDIR rule X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" After VF reset, FDIR rule still takes effect. To solve the issue, this patch adds to flush all flows before flow uninit. VIRTCHNL sends message to PF by Admin Queue, so flow flush should be implemented before Admin Queue shut down. Fixes: c6ea8bd9f11f ("net/iavf: support generic flow") Signed-off-by: Simei Su --- drivers/net/iavf/iavf_ethdev.c | 1 + drivers/net/iavf/iavf_generic_flow.c | 4 +--- drivers/net/iavf/iavf_generic_flow.h | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 117fbc5..e09efff 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1431,6 +1431,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); iavf_dev_stop(dev); + iavf_flow_flush(dev, NULL); iavf_shutdown_adminq(hw); /* disable uio intr before callback unregister */ rte_intr_disable(intr_handle); diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c index bca1ffe..8c66ac8 100644 --- a/drivers/net/iavf/iavf_generic_flow.c +++ b/drivers/net/iavf/iavf_generic_flow.c @@ -34,8 +34,6 @@ static struct rte_flow *iavf_flow_create(struct rte_eth_dev *dev, static int iavf_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, struct rte_flow_error *error); -static int iavf_flow_flush(struct rte_eth_dev *dev, - struct rte_flow_error *error); static int iavf_flow_query(struct rte_eth_dev *dev, struct rte_flow *flow, const struct rte_flow_action *actions, @@ -966,7 +964,7 @@ struct iavf_pattern_match_item * return ret; } -static int +int iavf_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) { diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h index c41ca1b..978d071 100644 --- a/drivers/net/iavf/iavf_generic_flow.h +++ b/drivers/net/iavf/iavf_generic_flow.h @@ -306,6 +306,8 @@ struct iavf_flow_parser_node { void iavf_register_flow_engine(struct iavf_flow_engine *engine); int iavf_flow_init(struct iavf_adapter *ad); void iavf_flow_uninit(struct iavf_adapter *ad); +int iavf_flow_flush(struct rte_eth_dev *dev, + struct rte_flow_error *error); int iavf_register_parser(struct iavf_flow_parser *parser, struct iavf_adapter *ad); void iavf_unregister_parser(struct iavf_flow_parser *parser, -- 1.8.3.1