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 0241FA0093 for ; Tue, 19 May 2020 15:06:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC13D1D603; Tue, 19 May 2020 15:06:54 +0200 (CEST) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by dpdk.org (Postfix) with ESMTP id 3876F1D658 for ; Tue, 19 May 2020 15:06:52 +0200 (CEST) Received: by mail-wm1-f50.google.com with SMTP id z72so3492334wmc.2 for ; Tue, 19 May 2020 06:06:52 -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=JJSOL03tqsDGAk27UuBwdisDu6ToZzbgUSMAoyoY0VM=; b=DoW5anNecPr5Ko7Nl6AfE6kGrCAJvvA0AqOn1TdB9C2tmPWE584keVazXrSNyKLH/d vdfNbWmUjoclCE/kgX7m5elqejP9iELWaj4C/jACgY5WZzqt2yGNWmie+ZJGbUaWga3B vHh8+m6FSvYVVa81d039zcoGLwbG01EJed01Bg4rn9N3ONrm2hXPfn2+kHkjS0aceEE4 NtOVLCK3GOApOzHOQbPFjwqKWV43Jbsx2Q3mj6ksN+YcqlvAaG0/hnaOdMyc78QF6WDD GV4+X5Mq4Dh+l1/zsIkaQkNQySdWf+bKdGUAUhtdJPDnUMO4sbOyFT9UduSJTIB1HnOY QdDA== 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=JJSOL03tqsDGAk27UuBwdisDu6ToZzbgUSMAoyoY0VM=; b=NqrBB82WH0yb3zWVyDvq34yHZg538+DWuIPz8X8xfkGTEYAXMOr71MBhHPb8PGtDIg AcXYrp6GyPlK6+MA7XEodXraEt2oEcFsRYU+qLXaRtwiJmt1JWH0WcJxK0yruGyPv36K wciOFIiiLX+dEefyjmtDsk18FpWTaZzQD1sON5l6LlTzJnHXhK3OoyOOw+d25yo/Q2Nm 5CyBJjM+J0tP/fSYKZZMndXEzIt+wl+bLgxe+NC8y4mJy4YABGynt2g1DTZduHpdgRNa 6XaXlDHTxB5qUmiZyH7WXJ8Il3TMaeFdzz6hcyasD7uaTzeqgK78AE/pokUyJEvGAkqk 9gGw== X-Gm-Message-State: AOAM532jqIiHGhB8kKkaD1I77hNfK9GXR5tPn+Anq+qsrYZTtxwvvI3h L7e7nofUBsbgNsgm/DDnJ8c= X-Google-Smtp-Source: ABdhPJxLjCACpHqAXTYuUZFziF24hCwpjice0nNFMEFowbELFfe//5KG0++GKki+PjQmPAyTcfh/MA== X-Received: by 2002:a1c:4d17:: with SMTP id o23mr5393010wmh.87.1589893611895; Tue, 19 May 2020 06:06:51 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 10sm3964293wmw.26.2020.05.19.06.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:06:51 -0700 (PDT) From: luca.boccassi@gmail.com To: Raslan Darawsheh Cc: Matan Azrad , dpdk stable Date: Tue, 19 May 2020 14:02:35 +0100 Message-Id: <20200519130549.112823-20-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix validation of VXLAN/VXLAN-GPE specs' has been queued to stable release 19.11.3 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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 c469619b7a66c2ae5a0052d56833d5d74fe01307 Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Mon, 23 Mar 2020 16:21:33 +0200 Subject: [PATCH] net/mlx5: fix validation of VXLAN/VXLAN-GPE specs [ upstream commit c79ab350a8976718d477d616f06678872a29b1b2 ] Trying to create zero spec for vni wasn't allowed, to avoid matching all packets from previous layer (udp). This behavior is incorrect, since VXLAN is being identified through the outer UDP destination port. Currently, if the user didn't specify outer UDP destination port the PMD will automatically match only on outer UDP port of 4798, and if the user want to match on some none standard port he need to specify it explicitly in the rule. This removes the limitation of vni spec to be able to match any vni. Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function") Signed-off-by: Raslan Darawsheh Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 4e957d9862..55f514af30 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1817,7 +1817,6 @@ mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item, uint32_t vlan_id; uint8_t vni[4]; } id = { .vlan_id = 0, }; - uint32_t vlan_id = 0; if (item_flags & MLX5_FLOW_LAYER_TUNNEL) @@ -1844,23 +1843,8 @@ mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item, return ret; if (spec) { memcpy(&id.vni[1], spec->vni, 3); - vlan_id = id.vlan_id; memcpy(&id.vni[1], mask->vni, 3); - vlan_id &= id.vlan_id; } - /* - * Tunnel id 0 is equivalent as not adding a VXLAN layer, if - * only this layer is defined in the Verbs specification it is - * interpreted as wildcard and all packets will match this - * rule, if it follows a full stack layer (ex: eth / ipv4 / - * udp), all packets matching the layers before will also - * match this rule. To avoid such situation, VNI 0 is - * currently refused. - */ - if (!vlan_id) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ITEM, item, - "VXLAN vni cannot be 0"); if (!(item_flags & MLX5_FLOW_LAYER_OUTER)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -1899,7 +1883,6 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, uint32_t vlan_id; uint8_t vni[4]; } id = { .vlan_id = 0, }; - uint32_t vlan_id = 0; if (!priv->config.l3_vxlan_en) return rte_flow_error_set(error, ENOTSUP, @@ -1937,22 +1920,8 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, "VxLAN-GPE protocol" " not supported"); memcpy(&id.vni[1], spec->vni, 3); - vlan_id = id.vlan_id; memcpy(&id.vni[1], mask->vni, 3); - vlan_id &= id.vlan_id; } - /* - * Tunnel id 0 is equivalent as not adding a VXLAN layer, if only this - * layer is defined in the Verbs specification it is interpreted as - * wildcard and all packets will match this rule, if it follows a full - * stack layer (ex: eth / ipv4 / udp), all packets matching the layers - * before will also match this rule. To avoid such situation, VNI 0 - * is currently refused. - */ - if (!vlan_id) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ITEM, item, - "VXLAN-GPE vni cannot be 0"); if (!(item_flags & MLX5_FLOW_LAYER_OUTER)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:45.425256106 +0100 +++ 0020-net-mlx5-fix-validation-of-VXLAN-VXLAN-GPE-specs.patch 2020-05-19 14:04:44.132646850 +0100 @@ -1,8 +1,10 @@ -From c79ab350a8976718d477d616f06678872a29b1b2 Mon Sep 17 00:00:00 2001 +From c469619b7a66c2ae5a0052d56833d5d74fe01307 Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Mon, 23 Mar 2020 16:21:33 +0200 Subject: [PATCH] net/mlx5: fix validation of VXLAN/VXLAN-GPE specs +[ upstream commit c79ab350a8976718d477d616f06678872a29b1b2 ] + Trying to create zero spec for vni wasn't allowed, to avoid matching all packets from previous layer (udp). This behavior is incorrect, since VXLAN is being identified @@ -17,7 +19,6 @@ vni. Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function") -Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh Acked-by: Matan Azrad @@ -26,10 +27,10 @@ 1 file changed, 31 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c -index 41072da6df..2ef6558495 100644 +index 4e957d9862..55f514af30 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c -@@ -1836,7 +1836,6 @@ mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item, +@@ -1817,7 +1817,6 @@ mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item, uint32_t vlan_id; uint8_t vni[4]; } id = { .vlan_id = 0, }; @@ -37,7 +38,7 @@ if (item_flags & MLX5_FLOW_LAYER_TUNNEL) -@@ -1863,23 +1862,8 @@ mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item, +@@ -1844,23 +1843,8 @@ mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item, return ret; if (spec) { memcpy(&id.vni[1], spec->vni, 3); @@ -61,7 +62,7 @@ if (!(item_flags & MLX5_FLOW_LAYER_OUTER)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, -@@ -1918,7 +1902,6 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, +@@ -1899,7 +1883,6 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, uint32_t vlan_id; uint8_t vni[4]; } id = { .vlan_id = 0, }; @@ -69,7 +70,7 @@ if (!priv->config.l3_vxlan_en) return rte_flow_error_set(error, ENOTSUP, -@@ -1956,22 +1939,8 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, +@@ -1937,22 +1920,8 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, "VxLAN-GPE protocol" " not supported"); memcpy(&id.vni[1], spec->vni, 3);