From patchwork Sun Sep 27 07:26:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Zhang X-Patchwork-Id: 78908 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7FBFFA04BC; Sun, 27 Sep 2020 09:48:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8BCF81D949; Sun, 27 Sep 2020 09:47:32 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id BBA621D93F for ; Sun, 27 Sep 2020 09:47:29 +0200 (CEST) IronPort-SDR: 1u7uvnB/+cIIySe+0z+gM6SwP2HWI88R3f5E9dJUFTUuH6PlBC502rnKUEjIJWgkTLRHAdQuq9 IE8ngk4DRB5w== X-IronPort-AV: E=McAfee;i="6000,8403,9756"; a="223438302" X-IronPort-AV: E=Sophos;i="5.77,309,1596524400"; d="scan'208";a="223438302" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2020 00:47:28 -0700 IronPort-SDR: JT4TkeJIg7+RpboWjxxl8L92/T2pJlth0jX7+VMtD9plx/6Yvtwrbhznau/aOn6EAeStOTPVY0 uoiHJ9wxnONw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,309,1596524400"; d="scan'208";a="323939451" Received: from intel-npg-odc-srv03.cd.intel.com ([10.240.178.138]) by orsmga002.jf.intel.com with ESMTP; 27 Sep 2020 00:47:26 -0700 From: Robin Zhang To: dev@dpdk.org Cc: beilei.xing@intel.com, jingjing.wu@intel.com, qiming.yang@intel.com, stevex.yang@intel.com, Robin Zhang Date: Sun, 27 Sep 2020 07:26:23 +0000 Message-Id: <20200927072626.28374-6-robinx.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200927072626.28374-1-robinx.zhang@intel.com> References: <20200927072626.28374-1-robinx.zhang@intel.com> Subject: [dpdk-dev] [PATCH 5/8] net/iavf: add workaround promiscuous disable 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" In scenario of Kernel Driver runs on PF and PMD runs on VF, PMD exit doesn't disable promiscuous mode, this will cause vlan filter set by Kernel Driver will not take effect. This patch will fix it, add promiscuous disable at device disable. Signed-off-by: Robin Zhang --- drivers/net/iavf/iavf_ethdev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 3b3829f75..b32302c43 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1428,6 +1428,15 @@ iavf_dev_close(struct rte_eth_dev *dev) iavf_dev_stop(dev); iavf_flow_flush(dev, NULL); iavf_flow_uninit(adapter); + + /* + * disable promiscuous mode before reset vf + * it is a workaround solution when work with kernel driver + * and it is not the normal way + */ + if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled) + iavf_config_promisc(adapter, false, false); + iavf_shutdown_adminq(hw); /* disable uio intr before callback unregister */ rte_intr_disable(intr_handle);