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 A96E1A04DD for ; Wed, 18 Nov 2020 17:38:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C328DC97A; Wed, 18 Nov 2020 17:38:28 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 2C9194C90 for ; Wed, 18 Nov 2020 17:38:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605717506; 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=BFmsEYHMVZkFaWjkNLycpmFqXr/tWOnHgjk/goQ5/I4=; b=Qyx++ftCi/Z2cm8seKX6DwC6Y0bWhaD+EcG9KTwh1zil8gS5JOurixSfoWE4P5bF2RRqbz 4i0RznBQplOxirjBB/K0y06FNmqn4VJ9K8B1TkBimq4nmS9c/7KeMMAnLaLZAD5qzLq4ra rhXdXCax/lVNV0d5wHl0jktnzYCXSRM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-413-ZyduRyFhPHqAxILKtv6hZw-1; Wed, 18 Nov 2020 11:38:22 -0500 X-MC-Unique: ZyduRyFhPHqAxILKtv6hZw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3482010766BA; Wed, 18 Nov 2020 16:38:21 +0000 (UTC) Received: from rh.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B9195C1A3; Wed, 18 Nov 2020 16:38:19 +0000 (UTC) From: Kevin Traynor To: Beilei Xing Cc: Jeff Guo , dpdk stable Date: Wed, 18 Nov 2020 16:35:50 +0000 Message-Id: <20201118163558.1101823-64-ktraynor@redhat.com> In-Reply-To: <20201118163558.1101823-1-ktraynor@redhat.com> References: <20201118163558.1101823-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] patch 'net/i40e: fix flow director for eth + VLAN pattern' has been queued to LTS release 18.11.11 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 LTS release 18.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/0e6226e729f8a27aaace8e5f3701cb1af46a6e08 Thanks. Kevin. --- >From 0e6226e729f8a27aaace8e5f3701cb1af46a6e08 Mon Sep 17 00:00:00 2001 From: Beilei Xing Date: Tue, 27 Oct 2020 14:21:47 +0800 Subject: [PATCH] net/i40e: fix flow director for eth + VLAN pattern [ upstream commit 81aebb47d1895ae34c7469faa2544433cc9bf6a6 ] Currently, can't create more than one following flow for ETH + VLAN pattern. 1. flow create 0 ingress pattern eth / vlan vid is 350 / end actions queue index 2 / end 2. flow create 0 ingress pattern eth / vlan vid is 351 / end actions queue index 3 / end The root cause is the vlan_tci is not set correctly, it will cause the keys of both of the two flows are the same. Fixes: 42044b69c67d ("net/i40e: support input set selection for FDIR") Signed-off-by: Beilei Xing Acked-by: Jeff Guo --- drivers/net/i40e/i40e_flow.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index e5c42144e0..2198473411 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -28,5 +28,8 @@ #define I40E_IPV6_FRAG_HEADER 44 #define I40E_TENANT_ARRAY_NUM 3 -#define I40E_TCI_MASK 0xFFFF +#define I40E_VLAN_TCI_MASK 0xFFFF +#define I40E_VLAN_PRI_MASK 0xE000 +#define I40E_VLAN_CFI_MASK 0x1000 +#define I40E_VLAN_VID_MASK 0x0FFF static int i40e_flow_validate(struct rte_eth_dev *dev, @@ -2566,10 +2569,20 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, RTE_ASSERT(!(input_set & I40E_INSET_LAST_ETHER_TYPE)); if (vlan_spec && vlan_mask) { - if (vlan_mask->tci == - rte_cpu_to_be_16(I40E_TCI_MASK)) { - input_set |= I40E_INSET_VLAN_INNER; - filter->input.flow_ext.vlan_tci = - vlan_spec->tci; + if (vlan_mask->tci != + rte_cpu_to_be_16(I40E_VLAN_TCI_MASK) && + vlan_mask->tci != + rte_cpu_to_be_16(I40E_VLAN_PRI_MASK) && + vlan_mask->tci != + rte_cpu_to_be_16(I40E_VLAN_CFI_MASK) && + vlan_mask->tci != + rte_cpu_to_be_16(I40E_VLAN_VID_MASK)) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Unsupported TCI mask."); } + input_set |= I40E_INSET_VLAN_INNER; + filter->input.flow_ext.vlan_tci = + vlan_spec->tci; } if (vlan_spec && vlan_mask && vlan_mask->inner_type) { @@ -3395,8 +3408,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev, if (vlan_spec && vlan_mask) { if (vlan_mask->tci == - rte_cpu_to_be_16(I40E_TCI_MASK)) + rte_cpu_to_be_16(I40E_VLAN_TCI_MASK)) filter->inner_vlan = rte_be_to_cpu_16(vlan_spec->tci) & - I40E_TCI_MASK; + I40E_VLAN_TCI_MASK; filter_type |= ETH_TUNNEL_FILTER_IVLAN; } @@ -3626,8 +3639,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev, if (vlan_spec && vlan_mask) { if (vlan_mask->tci == - rte_cpu_to_be_16(I40E_TCI_MASK)) + rte_cpu_to_be_16(I40E_VLAN_TCI_MASK)) filter->inner_vlan = rte_be_to_cpu_16(vlan_spec->tci) & - I40E_TCI_MASK; + I40E_VLAN_TCI_MASK; filter_type |= ETH_TUNNEL_FILTER_IVLAN; } @@ -4246,5 +4259,5 @@ i40e_flow_parse_rss_pattern(__rte_unused struct rte_eth_dev *dev, if (vlan_spec && vlan_mask) { if (vlan_mask->tci == - rte_cpu_to_be_16(I40E_TCI_MASK)) { + rte_cpu_to_be_16(I40E_VLAN_TCI_MASK)) { info->region[0].user_priority[0] = (rte_be_to_cpu_16( -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-18 16:33:39.136469561 +0000 +++ 0064-net-i40e-fix-flow-director-for-eth-VLAN-pattern.patch 2020-11-18 16:33:37.991215102 +0000 @@ -1 +1 @@ -From 81aebb47d1895ae34c7469faa2544433cc9bf6a6 Mon Sep 17 00:00:00 2001 +From 0e6226e729f8a27aaace8e5f3701cb1af46a6e08 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 81aebb47d1895ae34c7469faa2544433cc9bf6a6 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 8e7a9989b3..5bec0c7a84 100644 +index e5c42144e0..2198473411 100644 @@ -40 +41 @@ -@@ -2706,10 +2709,20 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, +@@ -2566,10 +2569,20 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, @@ -66 +67 @@ -@@ -3895,8 +3908,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev, +@@ -3395,8 +3408,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev, @@ -77 +78 @@ -@@ -4126,8 +4139,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev, +@@ -3626,8 +3639,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev, @@ -88 +89 @@ -@@ -4801,5 +4814,5 @@ i40e_flow_parse_rss_pattern(__rte_unused struct rte_eth_dev *dev, +@@ -4246,5 +4259,5 @@ i40e_flow_parse_rss_pattern(__rte_unused struct rte_eth_dev *dev,