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 98F8EA0524 for ; Fri, 5 Feb 2021 12:37:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8FD9A4067B; Fri, 5 Feb 2021 12:37:58 +0100 (CET) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id E4A89188A48 for ; Fri, 5 Feb 2021 12:37:57 +0100 (CET) Received: by mail-wr1-f50.google.com with SMTP id d16so7272079wro.11 for ; Fri, 05 Feb 2021 03:37:57 -0800 (PST) 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=fbUHPJzxlU9KEuhpWFsj6xGykjhwSNv/tUjN1rO1glw=; b=jpJHfE1Kv7Jtard7d1NM6Wm6LfRU3f9E9r6JuuWTwCeQmzBbdeUd4JMFEG5s0qA0uW NLV4+XJGDJ7IbnpMur9Lzu+dzcQ5ZVi+ZtR2PDv94pGXK57igPGbtSHce4kVTEmYsnkS PvfQrk9BfHLOKw59EMObEIp3X0P5kkUPK3O5ZOLp1vkHIUrw7JhARPacO3KoOvRsP/yp Zc7k7YtN+OWNMhe+n7XV9TU4WFqQ6Hs+dHPoXMIhKkA0o4euYvMjJ/AkTcA1utb4Y9n1 9Zhi/C46cyXqB7Y/ZBFImyzF7Gw/+iad8yfGBSw0C+XaQC+dd8Fz2/q0DtgN97E4sDpr yQmQ== 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=fbUHPJzxlU9KEuhpWFsj6xGykjhwSNv/tUjN1rO1glw=; b=qXU479JFMDL+WHtaUm64M74C16ndbuzP8PiVuFRD4w6vv1or5FnoXa8JncbiMkzquf siFqCt7II0gWDJRcgpPjTQSzta0L8e+ressIfc/HBtDrF15PKQuVdRyyfOnL8KG3Yq4o O+Pz1DCyM5DY/35SS4cvFbegLg0WoqpX9kftdMpeE/au1jHyL4IeQEHjijpja2FobHv6 CrpRydK4XH2q9YjpxIW6iI8y7HNQXWB7TZjjdeZLUFiNbBrT+mdR4R1Symez9big5hcd NRL6hjh00W01LairXCQzeGrn2MVbMDKjsh0i6WcZzZ8ac3/fpX0/kw8RrvPwyyqyrUP6 NClA== X-Gm-Message-State: AOAM531RX3NY1Alce13572w47WeylNftqCQ3FyTitbsIreNwvavRLQDU t1kkrpAiZYgeT7wCmAx2RRc= X-Google-Smtp-Source: ABdhPJx7mCxsI4gXIUpwVqFWmjVCQ8eXVUWNDko5fUxFKspfSS1GnLeVC/BgVtSYyflDISYlF+mk2A== X-Received: by 2002:adf:d0d2:: with SMTP id z18mr4767537wrh.70.1612525077721; Fri, 05 Feb 2021 03:37:57 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id t18sm11589342wrr.56.2021.02.05.03.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:37:56 -0800 (PST) From: luca.boccassi@gmail.com To: Shiri Kuzin Cc: Matan Azrad , dpdk stable Date: Fri, 5 Feb 2021 11:18:45 +0000 Message-Id: <20210205111920.1272063-239-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: refuse empty VLAN in flow pattern' has been queued to stable release 20.11.1 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/045b01fde474efc3ccc8bd6818ac4889fa60dc53 Thanks. Luca Boccassi --- >From 045b01fde474efc3ccc8bd6818ac4889fa60dc53 Mon Sep 17 00:00:00 2001 From: Shiri Kuzin Date: Tue, 19 Jan 2021 19:07:00 +0200 Subject: [PATCH] net/mlx5: refuse empty VLAN in flow pattern [ upstream commit b6aaaa22aeb66cda787d0e0280742da3d735def3 ] In verbs, an empty VLAN is equivalent to a packet without VLAN layer, hence, the VLAN item should not be empty and this case is rejected. However, the case for ether type of VLAN without following VLAN item was not validated, allowing the creation of a flow with empty VLAN item. To fix this issue a validation was added requiring ether type of VLAN will be followed with VLAN item. Fixes: 0b1edd21cd78 ("net/mlx5: refuse empty VLAN flow specification") Signed-off-by: Shiri Kuzin Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_verbs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index 59291fbd09..bd060e9d44 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -1247,6 +1247,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, uint64_t last_item = 0; uint8_t next_protocol = 0xff; uint16_t ether_type = 0; + bool is_empty_vlan = false; if (items == NULL) return -1; @@ -1274,6 +1275,8 @@ flow_verbs_validate(struct rte_eth_dev *dev, ether_type &= ((const struct rte_flow_item_eth *) items->mask)->type; + if (ether_type == RTE_BE16(RTE_ETHER_TYPE_VLAN)) + is_empty_vlan = true; ether_type = rte_be_to_cpu_16(ether_type); } else { ether_type = 0; @@ -1299,6 +1302,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, } else { ether_type = 0; } + is_empty_vlan = false; break; case RTE_FLOW_ITEM_TYPE_IPV4: ret = mlx5_flow_validate_item_ipv4 @@ -1410,6 +1414,10 @@ flow_verbs_validate(struct rte_eth_dev *dev, } item_flags |= last_item; } + if (is_empty_vlan) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "VLAN matching without vid specification is not supported"); for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { switch (actions->type) { case RTE_FLOW_ACTION_TYPE_VOID: -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:39.718462322 +0000 +++ 0239-net-mlx5-refuse-empty-VLAN-in-flow-pattern.patch 2021-02-05 11:18:29.238699337 +0000 @@ -1 +1 @@ -From b6aaaa22aeb66cda787d0e0280742da3d735def3 Mon Sep 17 00:00:00 2001 +From 045b01fde474efc3ccc8bd6818ac4889fa60dc53 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b6aaaa22aeb66cda787d0e0280742da3d735def3 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index 205b05783c..b442b9b91c 100644 +index 59291fbd09..bd060e9d44 100644 @@ -29 +30 @@ -@@ -1256,6 +1256,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, +@@ -1247,6 +1247,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, @@ -37 +38 @@ -@@ -1283,6 +1284,8 @@ flow_verbs_validate(struct rte_eth_dev *dev, +@@ -1274,6 +1275,8 @@ flow_verbs_validate(struct rte_eth_dev *dev, @@ -46 +47 @@ -@@ -1308,6 +1311,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, +@@ -1299,6 +1302,7 @@ flow_verbs_validate(struct rte_eth_dev *dev, @@ -54 +55 @@ -@@ -1419,6 +1423,10 @@ flow_verbs_validate(struct rte_eth_dev *dev, +@@ -1410,6 +1414,10 @@ flow_verbs_validate(struct rte_eth_dev *dev,