From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3C5C42E50; Wed, 12 Jul 2023 09:50:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBF1440A7D; Wed, 12 Jul 2023 09:50:35 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id CF0E3406BA; Wed, 12 Jul 2023 09:50:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689148235; x=1720684235; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xyIfhqcCA6B8FFy2DElWqdKL2+a9CkQvqyoH4SIR9zA=; b=UkLFxYcLUqpnQhabN3PtKKL47/0f4jULScGTGxzYTFKQ9eZEaof6CYUi M4tntUB2Rek2QspdZ0eZW1CT6K6yJVS0oCjsIIvSVAY5FpjhzirEA4Ts6 GgU+L1AhIxX2mh1oOHeZLJTFcNX5MGJq4oXqQO5ClMrtVmcvg+QcBbGZK TeSyfltXZtHZ2FPGCHrNwQtmBeuk35YKtY7rzfl1jsP+hIGh0J8TYTxO8 jCD81/W/QrbfOO+KJw2aU+7PKOATJ2Gzd9ioC0lbey6kpEJ9GF6+Bjfjp h1K9HSfxuaYBGGYwjRbfViiggKTrj9KR/UTG5sjXWjPwUWnDhmOnGL4rK g==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="367448177" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="367448177" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 00:50:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="715463117" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="715463117" Received: from dpdk-wenjing-02.sh.intel.com ([10.67.119.75]) by orsmga007.jf.intel.com with ESMTP; 12 Jul 2023 00:50:31 -0700 From: Wenjing Qiao To: jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, Wenjing Qiao , stable@dpdk.org Subject: [PATCH v2] net/iavf: fix vlan offload strip flag inconsistency Date: Wed, 12 Jul 2023 07:48:32 +0000 Message-Id: <20230712074831.1252086-1-wenjing.qiao@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230707075802.620018-1-wenjing.qiao@intel.com> References: <20230707075802.620018-1-wenjing.qiao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org For i40e in-tree kernel driver, it will set strip on when setting filter on. To be consistent with dpdk, disable strip again. Fixes: cb25d4323fbf ("net/avf: enable MAC VLAN and promisc ops") Cc: stable@dpdk.org Signed-off-by: Wenjing Qiao --- Depends-on: patch-129488 ("common/iavf: fix hw mac type for 710 NIC") --- drivers/net/iavf/iavf_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 00b963128b..d5dfa019f7 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1361,6 +1361,7 @@ iavf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); + struct rte_eth_conf *dev_conf = &dev->data->dev_conf; int err; if (adapter->closed) @@ -1379,6 +1380,17 @@ iavf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) err = iavf_add_del_vlan(adapter, vlan_id, on); if (err) return -EIO; + /* for i40e in-tree kernel driver, it will set strip on when setting + * filter on. To be consistent with dpdk, disable strip again. + */ + if (adapter->hw.mac.type == IAVF_MAC_XL710 || + adapter->hw.mac.type == IAVF_MAC_X722_VF) { + if (on && !(dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP)) { + err = iavf_disable_vlan_strip(adapter); + if (err) + return -EIO; + } + } return 0; } -- 2.34.1