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 110A0A0351 for ; Thu, 6 Aug 2020 11:58:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 089BA1C0AE; Thu, 6 Aug 2020 11:58:15 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 037241C0AE for ; Thu, 6 Aug 2020 11:58:13 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id g8so8293215wmk.3 for ; Thu, 06 Aug 2020 02:58:13 -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=GU6E6TG/fgb4mkCJrmIJ04Mf9xSdnfBhYZd7HO03VRk=; b=rlVgOAEuNq9lzjEP8Tn2AmUvzBbT3B+B9uIkaUmF4uBeQlkdpBaE3KuWSeVgpYSPPw kD3WuvR9hsvbEKvqCg3B++DP/oI6RdunDakSgEnr3ZBxVJA4Qgx/pQTwZI8xlyh1ZR6h cVJOiY2eMb7oEMI3+sBoRphyi/GkBFKgzPgAq0s3VOJqdCmfeTTC0TrFoB4FTLbnnu37 YmiWUHPbX5vGHhHRpRgmXumln7hA9MPTyC1njlFvm/3mo9sSP/j7gsauJCP5wu065g/W vSR2Iwp8fNmOa68OREZuLtRH9T1tQNoALzcL1XUCeqsD51gWL6WCxNgwL4yV+aOIODSz WirA== 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=GU6E6TG/fgb4mkCJrmIJ04Mf9xSdnfBhYZd7HO03VRk=; b=tWdIXJZ8XBIvticuexjJtUzFY8OgAYhEl4GVQcvnOSv2m8TwjBzB71j6XEzpPjfPIA 1hV1Y3XgI8LywBq5u/xn12BjaHrD+fjTvDod6xxnv28Xz/LvyO8Yw6VrICFaEeidSfZp WpKJ9sw4x/FcNDM4mYwo141qQUECi8bIF9ZQKWKu9wx/MMuMmnMa9M1lV7Gq4gmWmobm 3cHWneWFD8vBr9asGh+f6oPKvRxaFSqEXvYredQd3EPaDDahRaYWZ5fU2rUPPjEJEfPo zPgRMm9SJiA2hy08Vsc0NUrLTZA/T0VcYqxUNwi21LeBcrBJB/hJIRc8nd5x9Uw7aiKj ydiQ== X-Gm-Message-State: AOAM532yaY3AytwRXkeIZ0QIIAKR3oGQ5c3tWpH2UOb5YiwviDQ/UidC hBMIeZOjrWdTT3AbuLaz8HY= X-Google-Smtp-Source: ABdhPJzezLKeoo6v4jhhi8H3jRJkblALethybMJ8uh1tO9Q2s3mCKPBwfUa1WBAPEkYGSKxcPJ62cw== X-Received: by 2002:a1c:2b04:: with SMTP id r4mr6876651wmr.76.1596707893678; Thu, 06 Aug 2020 02:58:13 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 69sm6260223wmb.8.2020.08.06.02.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 02:58:13 -0700 (PDT) From: luca.boccassi@gmail.com To: Raslan Darawsheh Cc: Viacheslav Ovsiienko , dpdk stable Date: Thu, 6 Aug 2020 10:53:39 +0100 Message-Id: <20200806095411.774624-11-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200806095411.774624-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> <20200806095411.774624-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix flow items size calculation' has been queued to stable release 19.11.4 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/08/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 e8df8d9adc133f10e896bd7d7ca62ca237222bbb Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Thu, 16 Jul 2020 15:14:55 +0300 Subject: [PATCH] net/mlx5: fix flow items size calculation [ upstream commit d13f9760866884d81563624fbf160f3054b70f19 ] flow_dv_get_item_len returns the actual header size of an rte_flow item. Changing any of the structs for rte_flow items by adding or removing some extra fields will break this function. This fixes the behavior by returning the actual header size of each item. Fixes: 34d41b7aa3bf ("net/mlx5: add VXLAN encap action to Direct Verbs") Signed-off-by: Raslan Darawsheh Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index bfb27a602..e40cf3c2a 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "mlx5.h" #include "mlx5_defs.h" @@ -2661,7 +2662,7 @@ flow_dv_push_vlan_action_resource_register return 0; } /** - * Get the size of specific rte_flow_item_type + * Get the size of specific rte_flow_item_type hdr size * * @param[in] item_type * Tested rte_flow_item_type. @@ -2670,43 +2671,39 @@ flow_dv_push_vlan_action_resource_register * sizeof struct item_type, 0 if void or irrelevant. */ static size_t -flow_dv_get_item_len(const enum rte_flow_item_type item_type) +flow_dv_get_item_hdr_len(const enum rte_flow_item_type item_type) { size_t retval; switch (item_type) { case RTE_FLOW_ITEM_TYPE_ETH: - retval = sizeof(struct rte_flow_item_eth); + retval = sizeof(struct rte_ether_hdr); break; case RTE_FLOW_ITEM_TYPE_VLAN: - retval = sizeof(struct rte_flow_item_vlan); + retval = sizeof(struct rte_vlan_hdr); break; case RTE_FLOW_ITEM_TYPE_IPV4: - retval = sizeof(struct rte_flow_item_ipv4); + retval = sizeof(struct rte_ipv4_hdr); break; case RTE_FLOW_ITEM_TYPE_IPV6: - retval = sizeof(struct rte_flow_item_ipv6); + retval = sizeof(struct rte_ipv6_hdr); break; case RTE_FLOW_ITEM_TYPE_UDP: - retval = sizeof(struct rte_flow_item_udp); + retval = sizeof(struct rte_udp_hdr); break; case RTE_FLOW_ITEM_TYPE_TCP: - retval = sizeof(struct rte_flow_item_tcp); + retval = sizeof(struct rte_tcp_hdr); break; case RTE_FLOW_ITEM_TYPE_VXLAN: - retval = sizeof(struct rte_flow_item_vxlan); + case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: + retval = sizeof(struct rte_vxlan_hdr); break; case RTE_FLOW_ITEM_TYPE_GRE: - retval = sizeof(struct rte_flow_item_gre); - break; case RTE_FLOW_ITEM_TYPE_NVGRE: - retval = sizeof(struct rte_flow_item_nvgre); - break; - case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: - retval = sizeof(struct rte_flow_item_vxlan_gpe); + retval = sizeof(struct rte_gre_hdr); break; case RTE_FLOW_ITEM_TYPE_MPLS: - retval = sizeof(struct rte_flow_item_mpls); + retval = sizeof(struct rte_mpls_hdr); break; case RTE_FLOW_ITEM_TYPE_VOID: /* Fall through. */ default: @@ -2759,7 +2756,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "invalid empty data"); for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) { - len = flow_dv_get_item_len(items->type); + len = flow_dv_get_item_hdr_len(items->type); if (len + temp_size > MLX5_ENCAP_MAX_LEN) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-08-06 10:53:16.212439477 +0100 +++ 0011-net-mlx5-fix-flow-items-size-calculation.patch 2020-08-06 10:53:15.728595976 +0100 @@ -1,8 +1,10 @@ -From d13f9760866884d81563624fbf160f3054b70f19 Mon Sep 17 00:00:00 2001 +From e8df8d9adc133f10e896bd7d7ca62ca237222bbb Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Thu, 16 Jul 2020 15:14:55 +0300 Subject: [PATCH] net/mlx5: fix flow items size calculation +[ upstream commit d13f9760866884d81563624fbf160f3054b70f19 ] + flow_dv_get_item_len returns the actual header size of an rte_flow item. @@ -13,7 +15,6 @@ of each item. Fixes: 34d41b7aa3bf ("net/mlx5: add VXLAN encap action to Direct Verbs") -Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh Acked-by: Viacheslav Ovsiienko @@ -22,18 +23,18 @@ 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c -index f0cc7ad1a..e7f0a12ac 100644 +index bfb27a602..e40cf3c2a 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c -@@ -20,6 +20,7 @@ +@@ -27,6 +27,7 @@ + #include + #include #include - #include - #include +#include - #include - #include -@@ -2866,7 +2867,7 @@ flow_dv_push_vlan_action_resource_register + #include "mlx5.h" + #include "mlx5_defs.h" +@@ -2661,7 +2662,7 @@ flow_dv_push_vlan_action_resource_register return 0; } /** @@ -42,7 +43,7 @@ * * @param[in] item_type * Tested rte_flow_item_type. -@@ -2875,43 +2876,39 @@ flow_dv_push_vlan_action_resource_register +@@ -2670,43 +2671,39 @@ flow_dv_push_vlan_action_resource_register * sizeof struct item_type, 0 if void or irrelevant. */ static size_t @@ -97,7 +98,7 @@ break; case RTE_FLOW_ITEM_TYPE_VOID: /* Fall through. */ default: -@@ -2964,7 +2961,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, +@@ -2759,7 +2756,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "invalid empty data"); for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {