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 9C6DAA04DD for ; Wed, 28 Oct 2020 11:48:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 929D1C9FE; Wed, 28 Oct 2020 11:48:58 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by dpdk.org (Postfix) with ESMTP id BBB5BC9FE for ; Wed, 28 Oct 2020 11:48:57 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id d3so4293791wma.4 for ; Wed, 28 Oct 2020 03:48:57 -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=QS2U0Cs//AiYUX1PUddDA7LKtjN/Sxe+NVsWVtoui2c=; b=JOLHbZCNNUp+DwOZS+M0PnGDuAnnyoMoBnRsn8Isji5tT7icASDNd/uwhz499w2axh R8El15kxkPFqpGeaG2j0xPFIWCOYglBZbQsxQD/3aAShYXybQC4M449vQpyapaC9Sn3M gNBZoWkw8g/YFeUVgb4J0g9hPUlr2pqj2mfFpdD6t1QsfcZTI6BQwTEysIFNWLWt5aMr L0VFKAaTzEkEdtcXXtmLTGpBr1YmqIRwnEmOQaRQTAwxoTjml9t1Ym3t90WcNCs7dCtn U+YWRjSvanTS2xG3L97/8JBqbBr1dHY8/TUy1VOfSVsxESROdN3YWix4EYbc2TGIfgmX EXRw== 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=QS2U0Cs//AiYUX1PUddDA7LKtjN/Sxe+NVsWVtoui2c=; b=VIlOrpPfw6OQ63WMQnIvPyUrbrcpwzmLrxphPppwAX523YrJZDUjbwZHFSX6c05PlT tY4avwKwammNJdyX6vRr8e1QYoKGKKmDot+0yhwCVtdZDfTzJR/iyqCKqyVSRrdKYu7T z18Uvff4KjVuY41wmnHbJA1wxRxygG4VPPVtiQK/khJF1B2T8Q41VtI3NCNwYTHuAVkz cvynl+zYPB1mfhC0Bveofe/Kpqt9gU3qyWpB+Ab14pt92DgoRTMW8RA3iROStpUKn58m BAtC3IrCfCGvNlEEfBtCnQHRQkANscTGQuKPiiz0JdMtrOXXQvkia7wwM/GmWbz3rSz7 /XuA== X-Gm-Message-State: AOAM530fxNL88HUUUkYd/qvJ7cNzysa4eeiyyasJQMt2P6WvW8nL26dL xYdMaZBpmC1lKpRGuSSgsgVgwG6aDFtidKPo X-Google-Smtp-Source: ABdhPJx+zFyPrQ3iP3xIxNz68VZKqJmnvixVGYNw00sHCOGmMQax7IldMOwUjND/JLuJlNLRy91ewA== X-Received: by 2002:a1c:a555:: with SMTP id o82mr4471530wme.188.1603882136519; Wed, 28 Oct 2020 03:48:56 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id g83sm5728604wmf.15.2020.10.28.03.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:48:55 -0700 (PDT) From: luca.boccassi@gmail.com To: Hyong Youb Kim Cc: John Daley , dpdk stable Date: Wed, 28 Oct 2020 10:43:33 +0000 Message-Id: <20201028104606.3504127-54-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/enic: ignore VLAN inner type when it is zero' 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 9b4b0577cdfb4a3c3155dd9b0efe6d46ec25ce3f Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Wed, 9 Sep 2020 07:00:04 -0700 Subject: [PATCH] net/enic: ignore VLAN inner type when it is zero [ upstream commit 473e9407a4d7a365074d9b0618a8f1eccef291b5 ] When a VLAN pattern is present, the flow handler always copies its inner_type to the match buffer regardless of its value (i.e. HW matches inner_type against packet's inner ethertype). When inner_type spec and mask are both 0, adding it to the match buffer is usually harmless but breaks the following pattern used in some applications like OVS-DPDK. flow create 0 ingress ... pattern eth ... type is 0x0800 / vlan tci spec 0x2 tci mask 0xefff / ipv4 / end actions count / of_pop_vlan / ... The VLAN pattern's inner_type is 0. And the outer eth pattern's type actually specifies the inner ethertype. The outer ethertype (0x0800) is first copied to the match buffer. Then, the driver copies inner_type (0) to the match buffer, which overwrites the existing 0x0800 with 0 and breaks the app usage above. Simply ignore inner_type when it is 0, which is the correct behavior. As a byproduct, the driver can support the usage like the above. Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_fm_flow.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c index e8d5927674..5b456f20d4 100644 --- a/drivers/net/enic/enic_fm_flow.c +++ b/drivers/net/enic/enic_fm_flow.c @@ -349,8 +349,11 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg) eth_mask = (void *)&fm_mask->l2.eth; eth_val = (void *)&fm_data->l2.eth; - /* Outer TPID cannot be matched */ - if (eth_mask->ether_type) + /* + * Outer TPID cannot be matched. If inner_type is 0, use what is + * in the eth header. + */ + if (eth_mask->ether_type && mask->inner_type) return -ENOTSUP; /* @@ -358,8 +361,10 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg) * L2, regardless of vlan stripping settings. So, the inner type * from vlan becomes the ether type of the eth header. */ - eth_mask->ether_type = mask->inner_type; - eth_val->ether_type = spec->inner_type; + if (mask->inner_type) { + eth_mask->ether_type = mask->inner_type; + eth_val->ether_type = spec->inner_type; + } fm_data->fk_header_select |= FKH_ETHER | FKH_QTAG; fm_mask->fk_header_select |= FKH_ETHER | FKH_QTAG; fm_data->fk_vlan = rte_be_to_cpu_16(spec->tci); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:13.461581270 +0000 +++ 0054-net-enic-ignore-VLAN-inner-type-when-it-is-zero.patch 2020-10-28 10:35:11.520830259 +0000 @@ -1,8 +1,10 @@ -From 473e9407a4d7a365074d9b0618a8f1eccef291b5 Mon Sep 17 00:00:00 2001 +From 9b4b0577cdfb4a3c3155dd9b0efe6d46ec25ce3f Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Wed, 9 Sep 2020 07:00:04 -0700 Subject: [PATCH] net/enic: ignore VLAN inner type when it is zero +[ upstream commit 473e9407a4d7a365074d9b0618a8f1eccef291b5 ] + When a VLAN pattern is present, the flow handler always copies its inner_type to the match buffer regardless of its value (i.e. HW matches inner_type against packet's inner ethertype). When inner_type @@ -25,7 +27,6 @@ above. Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API") -Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley @@ -34,10 +35,10 @@ 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c -index ee671e11df..94e39a94bf 100644 +index e8d5927674..5b456f20d4 100644 --- a/drivers/net/enic/enic_fm_flow.c +++ b/drivers/net/enic/enic_fm_flow.c -@@ -392,8 +392,11 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg) +@@ -349,8 +349,11 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg) eth_mask = (void *)&fm_mask->l2.eth; eth_val = (void *)&fm_data->l2.eth; @@ -51,7 +52,7 @@ return -ENOTSUP; /* -@@ -401,8 +404,10 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg) +@@ -358,8 +361,10 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg) * L2, regardless of vlan stripping settings. So, the inner type * from vlan becomes the ether type of the eth header. */