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 41FFEA0351 for ; Thu, 6 Aug 2020 11:58:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3BB5A1C0AE; Thu, 6 Aug 2020 11:58:51 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 8E7CB1C123 for ; Thu, 6 Aug 2020 11:58:49 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id c15so7169803wrs.11 for ; Thu, 06 Aug 2020 02:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qkRLehNIzaNF2VmaIUB+BHUg2tauXN+m0LSyOClEOEg=; b=lSa4FMMdoLDNKcJzwAkNFhummflszublpXNA2Q987JdHn+U+ThhvD3JW6rQoUIHyaQ vJmCWgexL/NQfMtcVjoSQC47cp/O7R+TGteNCZfgTFpp1Nn81fkV3QzYX9S6fsTePUZ0 Z9qHEyEY0Ekcid+8C+WW2ViOx73iCyfmB+7pBFTUmFMIsd4XYQx+U1RHEwnGg2By3UnI gLMyzqBbB9SXpUzqjBIqCMyh+MpJp3tHqYhgyvQDsccgtG3W9Op9HnhnLrVfNskgzjBX Bqd6NbSp3W2uQgmgeGFGmBS6acl6/34bhKI1JPLsxx3UqrlxUGoaEW9PYQGFBqbGt74V jjvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qkRLehNIzaNF2VmaIUB+BHUg2tauXN+m0LSyOClEOEg=; b=fZo/04Fg3FfpKZ0hPxLmccuuI5suF55x1CM6lQJWqWhJuO6kJ+J9BKtdqIBFRvnvON tB/ti30catpY6mzwmld+hhZw0/5qp7AYEdsBJ2KihdToE0cuA5EzB7zNYsgCFBm2XByI 51gV/3Nwx1kOGAY7k1GeLeRLAGsd8V+YxsCkEAtJbH8PLdsRAgLrTQ/2AHuOdb1EkY06 +EZGaye7ZiryRfnxlJAsDahnrM+kzCf633Lpj8A7BTFDhsAs5RsJtgCs+O+cNUMMhg/D m8VPVNBBPPs/z+zrHZB+UbbpmnHMOI5X79ZOzUsaE2LIYVncgIuy/KBW7/Waka6VYynY 0eGw== X-Gm-Message-State: AOAM530h38j2xxHa19Ls9QhS63QmgXWpWEsyM7S+veXGU/sVWd7Ubkbc zjLcwY4FwYxBq5anwuw7ts8gQlB/p1A= X-Google-Smtp-Source: ABdhPJxtvtOFoZ3R4cLu/J5EcV9CR/nJcpT2DNC79xXNpxE3s8rK++ZwpKUciXVTJOeiOJsNBxqejg== X-Received: by 2002:adf:ab55:: with SMTP id r21mr6372687wrc.332.1596707929245; Thu, 06 Aug 2020 02:58:49 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id l1sm6084870wrb.12.2020.08.06.02.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 02:58:48 -0700 (PDT) From: luca.boccassi@gmail.com To: Wei Zhao Cc: Qiming Yang , dpdk stable Date: Thu, 6 Aug 2020 10:53:52 +0100 Message-Id: <20200806095411.774624-24-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200806095411.774624-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> <20200806095411.774624-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e: enable QinQ stripping' has been queued to stable release 19.11.4 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" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/08/20. 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. Thanks. Luca Boccassi --- >From 628f34b05e58aa1a9e1fe24e4fac5a7f470d2ed7 Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Fri, 24 Jul 2020 15:01:37 +0800 Subject: [PATCH] net/i40e: enable QinQ stripping [ upstream commit c52ff36686a408fd5196452380e359120c2d1ed5 ] This patch enable i40e outer vlan strip on and off in QinQ mode with mask bit of DEV_RX_OFFLOAD_QINQ_STRIP, users can use "vlan set qinq_strip on 0" to enable or "vlan set qinq_strip off 0" to disable i40e outer vlan strip when try with testpmd app. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Wei Zhao Reviewed-by: Qiming Yang --- drivers/net/i40e/i40e_ethdev.c | 45 +++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 5081cab4f..144758ef8 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -47,6 +47,8 @@ #define ETH_I40E_VF_MSG_CFG "vf_msg_cfg" #define I40E_CLEAR_PXE_WAIT_MS 200 +#define I40E_VSI_TSR_QINQ_STRIP 0x4010 +#define I40E_VSI_TSR(_i) (0x00050800 + ((_i) * 4)) /* Maximun number of capability elements */ #define I40E_MAX_CAP_ELE_NUM 128 @@ -3864,6 +3866,39 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev, return ret; } +/* Configure outer vlan stripping on or off in QinQ mode */ +static int +i40e_vsi_config_outer_vlan_stripping(struct i40e_vsi *vsi, bool on) +{ + struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); + int ret = I40E_SUCCESS; + uint32_t reg; + + if (vsi->vsi_id >= I40E_MAX_NUM_VSIS) { + PMD_DRV_LOG(ERR, "VSI ID exceeds the maximum"); + return -EINVAL; + } + + /* Configure for outer VLAN RX stripping */ + reg = I40E_READ_REG(hw, I40E_VSI_TSR(vsi->vsi_id)); + + if (on) + reg |= I40E_VSI_TSR_QINQ_STRIP; + else + reg &= ~I40E_VSI_TSR_QINQ_STRIP; + + ret = i40e_aq_debug_write_register(hw, + I40E_VSI_TSR(vsi->vsi_id), + reg, NULL); + if (ret < 0) { + PMD_DRV_LOG(ERR, "Failed to update VSI_TSR[%d]", + vsi->vsi_id); + return I40E_ERR_CONFIG; + } + + return ret; +} + static int i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask) { @@ -3900,6 +3935,14 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask) i40e_vsi_config_double_vlan(vsi, FALSE); } + if (mask & ETH_QINQ_STRIP_MASK) { + /* Enable or disable outer VLAN stripping */ + if (rxmode->offloads & DEV_RX_OFFLOAD_QINQ_STRIP) + i40e_vsi_config_outer_vlan_stripping(vsi, TRUE); + else + i40e_vsi_config_outer_vlan_stripping(vsi, FALSE); + } + return 0; } @@ -6078,6 +6121,7 @@ i40e_dev_init_vlan(struct rte_eth_dev *dev) /* Apply vlan offload setting */ mask = ETH_VLAN_STRIP_MASK | + ETH_QINQ_STRIP_MASK | ETH_VLAN_FILTER_MASK | ETH_VLAN_EXTEND_MASK; ret = i40e_vlan_offload_set(dev, mask); @@ -10479,7 +10523,6 @@ i40e_configure_registers(struct i40e_hw *hw) } } -#define I40E_VSI_TSR(_i) (0x00050800 + ((_i) * 4)) #define I40E_VSI_TSR_QINQ_CONFIG 0xc030 #define I40E_VSI_L2TAGSTXVALID(_i) (0x00042800 + ((_i) * 4)) #define I40E_VSI_L2TAGSTXVALID_QINQ 0xab -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-08-06 10:53:16.739049155 +0100 +++ 0024-net-i40e-enable-QinQ-stripping.patch 2020-08-06 10:53:15.808597560 +0100 @@ -1,8 +1,10 @@ -From c52ff36686a408fd5196452380e359120c2d1ed5 Mon Sep 17 00:00:00 2001 +From 628f34b05e58aa1a9e1fe24e4fac5a7f470d2ed7 Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Fri, 24 Jul 2020 15:01:37 +0800 Subject: [PATCH] net/i40e: enable QinQ stripping +[ upstream commit c52ff36686a408fd5196452380e359120c2d1ed5 ] + This patch enable i40e outer vlan strip on and off in QinQ mode with mask bit of DEV_RX_OFFLOAD_QINQ_STRIP, users can use "vlan set qinq_strip on 0" to enable or "vlan set @@ -10,7 +12,6 @@ try with testpmd app. Fixes: 4861cde46116 ("i40e: new poll mode driver") -Cc: stable@dpdk.org Signed-off-by: Wei Zhao Reviewed-by: Qiming Yang @@ -19,10 +20,10 @@ 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c -index 6bcce3386..88f4fe353 100644 +index 5081cab4f..144758ef8 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c -@@ -48,6 +48,8 @@ +@@ -47,6 +47,8 @@ #define ETH_I40E_VF_MSG_CFG "vf_msg_cfg" #define I40E_CLEAR_PXE_WAIT_MS 200 @@ -31,7 +32,7 @@ /* Maximun number of capability elements */ #define I40E_MAX_CAP_ELE_NUM 128 -@@ -3979,6 +3981,39 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev, +@@ -3864,6 +3866,39 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev, return ret; } @@ -71,7 +72,7 @@ static int i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask) { -@@ -4015,6 +4050,14 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask) +@@ -3900,6 +3935,14 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask) i40e_vsi_config_double_vlan(vsi, FALSE); } @@ -86,7 +87,7 @@ return 0; } -@@ -6193,6 +6236,7 @@ i40e_dev_init_vlan(struct rte_eth_dev *dev) +@@ -6078,6 +6121,7 @@ i40e_dev_init_vlan(struct rte_eth_dev *dev) /* Apply vlan offload setting */ mask = ETH_VLAN_STRIP_MASK | @@ -94,7 +95,7 @@ ETH_VLAN_FILTER_MASK | ETH_VLAN_EXTEND_MASK; ret = i40e_vlan_offload_set(dev, mask); -@@ -10874,7 +10918,6 @@ i40e_configure_registers(struct i40e_hw *hw) +@@ -10479,7 +10523,6 @@ i40e_configure_registers(struct i40e_hw *hw) } }