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 6053BA0555 for ; Thu, 9 Jun 2022 13:38:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B09440220; Thu, 9 Jun 2022 13:38:11 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 884E840220 for ; Thu, 9 Jun 2022 13:38:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654774690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4vAlYZ7gNy3vfWdgCHVcaNdWyIgFNDZ1I1th8X3O0Hc=; b=WQRQhFndnbmqq1LK41hJevbdbGjswwIcudGCuSuVQig5Txi0bnCwXclGSHmNZu/OqMSNGf pEMF382nyY96LUL7F1J1Q1FdoQQjkgNE4NRY5FViQrkvXPeo7sTjsyauoURr8ReUeqJxF0 CPmWfbJP3pKTdFo+0OmV4fdCDDudhYE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-8-y2nzzr-_NJu7QWOWz35bdg-1; Thu, 09 Jun 2022 07:38:07 -0400 X-MC-Unique: y2nzzr-_NJu7QWOWz35bdg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A852B294EDCA; Thu, 9 Jun 2022 11:38:06 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.195.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71A0C18EA3; Thu, 9 Jun 2022 11:38:05 +0000 (UTC) From: Kevin Traynor To: Peng Zhang Cc: Yong Xu , Chaoyong He , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , dpdk stable Subject: patch 'net/nfp: fix disabling VLAN stripping' has been queued to stable release 21.11.2 Date: Thu, 9 Jun 2022 12:36:28 +0100 Message-Id: <20220609113701.386938-41-ktraynor@redhat.com> In-Reply-To: <20220609113701.386938-1-ktraynor@redhat.com> References: <20220609113701.386938-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/13/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/19854d0a91feb99cfbb0b1ebc09f6662fad161e0 Thanks. Kevin --- >From 19854d0a91feb99cfbb0b1ebc09f6662fad161e0 Mon Sep 17 00:00:00 2001 From: Peng Zhang Date: Thu, 26 May 2022 16:34:44 +0200 Subject: [PATCH] net/nfp: fix disabling VLAN stripping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 7988cdca98940faa80d3e030c1b9811bcdd4c67d ] "vlan set strip off 0" can't work, due to the incorrect usage of the mask, it just represent that the status is changed or not, not represent offloaded or not, so that the driver send the error control message to the nic. Now, by first inspect the mask of things that changed, and then change the requested state if VLAN stripping according the requested offload status. So this change can fix this bug. Fixes: d4a27a3b092a ("nfp: add basic features") Signed-off-by: Peng Zhang Signed-off-by: Yong Xu Signed-off-by: Chaoyong He Signed-off-by: Niklas Söderlund --- drivers/net/nfp/nfp_common.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index b26770dbfb..57c50ec475 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -966,20 +966,23 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask) uint32_t new_ctrl, update; struct nfp_net_hw *hw; + struct rte_eth_conf *dev_conf; int ret; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); - new_ctrl = 0; + dev_conf = &dev->data->dev_conf; + new_ctrl = hw->ctrl; - /* Enable vlan strip if it is not configured yet */ - if ((mask & RTE_ETH_VLAN_STRIP_OFFLOAD) && - !(hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN)) - new_ctrl = hw->ctrl | NFP_NET_CFG_CTRL_RXVLAN; + /* + * Vlan stripping setting + * Enable or disable VLAN stripping + */ + if (mask & RTE_ETH_VLAN_STRIP_MASK) { + if (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) + new_ctrl |= NFP_NET_CFG_CTRL_RXVLAN; + else + new_ctrl &= ~NFP_NET_CFG_CTRL_RXVLAN; + } - /* Disable vlan strip just if it is configured */ - if (!(mask & RTE_ETH_VLAN_STRIP_OFFLOAD) && - (hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN)) - new_ctrl = hw->ctrl & ~NFP_NET_CFG_CTRL_RXVLAN; - - if (new_ctrl == 0) + if (new_ctrl == hw->ctrl) return 0; -- 2.34.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-09 12:34:30.733408674 +0100 +++ 0041-net-nfp-fix-disabling-VLAN-stripping.patch 2022-06-09 12:34:29.749980647 +0100 @@ -1 +1 @@ -From 7988cdca98940faa80d3e030c1b9811bcdd4c67d Mon Sep 17 00:00:00 2001 +From 19854d0a91feb99cfbb0b1ebc09f6662fad161e0 Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 7988cdca98940faa80d3e030c1b9811bcdd4c67d ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index be68c25fb8..34e3a03edd 100644 +index b26770dbfb..57c50ec475 100644 @@ -33 +34 @@ -@@ -990,20 +990,23 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask) +@@ -966,20 +966,23 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask)