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 5D067A04DD for ; Wed, 28 Oct 2020 11:47:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 44C78CA12; Wed, 28 Oct 2020 11:47:41 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id C1576CA12 for ; Wed, 28 Oct 2020 11:47:39 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id n18so5152311wrs.5 for ; Wed, 28 Oct 2020 03:47:39 -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=8CDpLPKyH6gt8loldyQPlaRLZKjpdnKhaqVURPBtWpk=; b=iwq0af0jImLTxEQ9WRSI4BBu3wI6gmNifdqTX3CV/fvNCFSnL8rnMZjsvqHWngj1R7 WoADXlDRzJlEDd4KtDk0Y2uSzgPx05OLtu6qdU4jh2rilkYEJxwqbdDIJJA6DRDJr2tg CFqoeBqZggiYtFVJl9ydPEfvcS8jQwy1UaYfNKDpzgSPvGFVjeUPwaerDEgbcAN3e3HJ TRoqjL6GyXYXYuFsem8o6gRwHfjcjVenrPSyeVrx1hcTjhP2WVo10YuMCMIaRt8GPjD7 ntpgXYaeeqSmE/TiVqLMVg87l1xSUSR/wikMT/r1kyzKyXQCYrjqeGV80p2OzPyaXi56 OxPg== 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=8CDpLPKyH6gt8loldyQPlaRLZKjpdnKhaqVURPBtWpk=; b=HdlnqXmmdgWYILOFd4dCYALf9I/h3LPec651gWn9KCcaiLB5eMP4F/nFhiB2VzYC51 iQOa+M+4a5/bXKvsk4WF8cJMyiMhEQgPkI5TY4XocTqOsvKjFlG6XalMHUs3NZARpqv6 0gQ9VWHtue7UaPmspg9dIj8vhO1IASsk6Gy6kPxkqNXYKeslX9msvJL9CvEgsCe77/LC hzIYIMzY4zqJTJJzdUpmkyV53TIQK3vkt4yvjCyuXYBb4tQgo4Dj8EwtQPuND9/Jp5pb D4vgP1fMKYGVylVPjEAh0e/afyUvLpTjQKxdlgVkDlO4gAhbc6EweMP8uz7ttR98vrWi WD0g== X-Gm-Message-State: AOAM53151oeLJhqxmvxB36ZSkj4Q4WcLDJ3uX9lUO0FBZkbjXiIhuhRx QfMsvmGdT8v8dj52/rX7rb0= X-Google-Smtp-Source: ABdhPJxrHbBto7MUYq/z37eFLkNKmm8ow/T7e6DMNq3iwYam8+Rbfs9AOPI6t4dOGzL+wBwidYdJKQ== X-Received: by 2002:adf:a553:: with SMTP id j19mr8070896wrb.349.1603882058510; Wed, 28 Oct 2020 03:47:38 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id c18sm6284331wrt.10.2020.10.28.03.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:47:37 -0700 (PDT) From: luca.boccassi@gmail.com To: Guinan Sun Cc: Przemyslaw Patynowski , Qi Zhang , dpdk stable Date: Wed, 28 Oct 2020 10:43:09 +0000 Message-Id: <20201028104606.3504127-30-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e/base: fix Rx only for unicast promisc on VLAN' has been queued to stable release 19.11.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/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 4b0dfbac70b79c215c89ced4bc66565b4f2d565c Mon Sep 17 00:00:00 2001 From: Guinan Sun Date: Sat, 12 Sep 2020 03:00:36 +0000 Subject: [PATCH] net/i40e/base: fix Rx only for unicast promisc on VLAN [ upstream commit 2972fc3f4000108cf48b49389851278abb35425a ] Set promiscuous mode to rx traffic only if VSI has VLANs configured. Rename misleading PROMISC_TX bit to proper name. Added I40E_AQC_SET_VSI_PROMISC_RX_ONLY during VSI unicast promiscuous mode configuration with port VLAN. Aligned unicast promiscuous with VLAN to the one without VLAN. Previously other VFs could listen to unicast tx traffic of other VFs. Fixes: 8db9e2a1b232 ("i40e: base driver") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Guinan Sun Acked-by: Qi Zhang --- drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +- drivers/net/i40e/base/i40e_common.c | 36 +++++++++++++++++++------ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index cd7f24cf14..48f93313bd 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -1215,7 +1215,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 -#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 +#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000 __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 2172ea12fc..f179306e2e 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -2222,6 +2222,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, return status; } +/** + * i40e_hw_ver_ge + * @hw: pointer to the hw struct + * @maj: api major value + * @min: api minor value + * + * Assert whether current HW api version is greater/equal than provided. + **/ +static bool i40e_hw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min) +{ + if (hw->aq.api_maj_ver > maj || + (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min)) + return true; + return false; +} + /** * i40e_aq_add_vsi * @hw: pointer to the hw struct @@ -2347,18 +2363,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; - if (rx_only_promisc && - (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1))) - flags |= I40E_AQC_SET_VSI_PROMISC_TX; + if (rx_only_promisc && i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); - if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1)) - cmd->valid_flags |= CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_TX); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); @@ -2490,11 +2504,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); - if (enable) + if (enable) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + if (i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; + } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:12.724760888 +0000 +++ 0030-net-i40e-base-fix-Rx-only-for-unicast-promisc-on-VLA.patch 2020-10-28 10:35:11.468829494 +0000 @@ -1,8 +1,10 @@ -From 2972fc3f4000108cf48b49389851278abb35425a Mon Sep 17 00:00:00 2001 +From 4b0dfbac70b79c215c89ced4bc66565b4f2d565c Mon Sep 17 00:00:00 2001 From: Guinan Sun Date: Sat, 12 Sep 2020 03:00:36 +0000 Subject: [PATCH] net/i40e/base: fix Rx only for unicast promisc on VLAN +[ upstream commit 2972fc3f4000108cf48b49389851278abb35425a ] + Set promiscuous mode to rx traffic only if VSI has VLANs configured. Rename misleading PROMISC_TX bit to proper name. Added I40E_AQC_SET_VSI_PROMISC_RX_ONLY during VSI unicast promiscuous @@ -11,7 +13,6 @@ Previously other VFs could listen to unicast tx traffic of other VFs. Fixes: 8db9e2a1b232 ("i40e: base driver") -Cc: stable@dpdk.org Signed-off-by: Przemyslaw Patynowski Signed-off-by: Guinan Sun @@ -22,10 +23,10 @@ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h -index 65831ea7ab..2ca41db5d3 100644 +index cd7f24cf14..48f93313bd 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h -@@ -1222,7 +1222,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { +@@ -1215,7 +1215,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 @@ -35,10 +36,10 @@ #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c -index 15f4e91a40..cd8b27e407 100644 +index 2172ea12fc..f179306e2e 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c -@@ -2270,6 +2270,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, +@@ -2222,6 +2222,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, return status; } @@ -61,7 +62,7 @@ /** * i40e_aq_add_vsi * @hw: pointer to the hw struct -@@ -2395,18 +2411,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, +@@ -2347,18 +2363,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; @@ -85,7 +86,7 @@ cmd->seid = CPU_TO_LE16(seid); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); -@@ -2538,11 +2552,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, +@@ -2490,11 +2504,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_vsi_promiscuous_modes);