[dpdk-stable] patch 'net/mlx5: fix flow items size calculation' has been queued to stable release 19.11.4
Luca Boccassi
bluca at debian.org
Mon Aug 10 13:00:47 CEST 2020
On Mon, 2020-08-10 at 07:27 +0000, Raslan Darawsheh wrote:
> Hi Luca,
>
> please be noted that with this change you'll get a compilation failure when debug is enabled for MLX5,
> if we don't have this patch backported before it
> http://patches.dpdk.org/patch/74534/
>
>
> Kindest regards
> Raslan Darawsheh
Thanks, that patch is included already as well, so everything should be
good
> From: luca.boccassi at gmail.com <luca.boccassi at gmail.com>
> Sent: Thursday, August 6, 2020 12:53 PM
> To: Raslan Darawsheh <rasland at mellanox.com>
> Cc: Slava Ovsiienko <viacheslavo at mellanox.com>; dpdk stable <stable at dpdk.org>
> Subject: patch 'net/mlx5: fix flow items size calculation' has been queued to stable release 19.11.4
>
> Hi,
>
> FYI, your patch has been queued to stable release 19.11.4
>
> Note it hasn't been pushed to https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdpdk.org%2Fbrowse%2Fdpdk-stable&data=02%7C01%7Crasland%40mellanox.com%7C1c9c6e447cb242871ce408d839ef3c65%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C637323046965820421&sdata=%2Fxuhw7GFWJK3JMQ5aLmI6Ml%2BXzpVNoJatg89ECB5XeM%3D&reserved=0 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 <rasland at mellanox.com>
> 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 <rasland at mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
> ---
> 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 <rte_ip.h>
> #include <rte_gre.h>
> #include <rte_vxlan.h>
> +#include <rte_mpls.h>
>
> #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,
More information about the stable
mailing list