All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@nvidia.com>
To: Gregory Etelson <getelson@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>,
	Raslan Darawsheh <rasland@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix flow descriptor allocation in Direct Verbs mode.
Date: Tue, 8 Dec 2020 02:58:25 +0000	[thread overview]
Message-ID: <BY5PR12MB43248BB05D07C1B02C335EBAA1CD0@BY5PR12MB4324.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20201207142738.27945-1-getelson@nvidia.com>

Hi Gregory,

>-----Original Message-----
>From: Gregory Etelson <getelson@nvidia.com>
>Sent: Monday, December 7, 2020 10:28 PM
>To: dev@dpdk.org
>Cc: Gregory Etelson <getelson@nvidia.com>; Matan Azrad
><matan@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>; Slava
>Ovsiienko <viacheslavo@nvidia.com>; Shahaf Shuler <shahafs@nvidia.com>;
>Xueming(Steven) Li <xuemingl@nvidia.com>
>Subject: [PATCH] net/mlx5: fix flow descriptor allocation in Direct Verbs mode.
>
>Initialize flow descriptor tunnel member during flow creation.
>Prevent access to stale data and pointers when flow descriptor is reallocated
>after relase.
>
>Fixes: 8bb81f2649b1 ("net/mlx5: use thread specific flow workspace")
The initialization issue is introduced in earlier patch.

>
>Signed-off-by: Gregory Etelson <getelson@nvidia.com>
>Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
>---
> drivers/net/mlx5/mlx5_flow_dv.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
>diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
>b/drivers/net/mlx5/mlx5_flow_dv.c index aa21ff9613..c72f97e05f 100644
>--- a/drivers/net/mlx5/mlx5_flow_dv.c
>+++ b/drivers/net/mlx5/mlx5_flow_dv.c
>@@ -6232,8 +6232,9 @@ flow_dv_prepare(struct rte_eth_dev *dev,
> 				   "not enough memory to create flow handle");
> 		return NULL;
> 	}
>-	MLX5_ASSERT(wks->flow_idx + 1 < RTE_DIM(wks->flows));
>+	MLX5_ASSERT(wks->flow_idx - 1 < RTE_DIM(wks->flows));
wks->flow_idx is used as "next available index", should it be "wks->flow_idx < RTE_DIM(...)"?

> 	dev_flow = &wks->flows[wks->flow_idx++];
>+	memset(dev_flow, 0, sizeof(*dev_flow));
> 	dev_flow->handle = dev_handle;
> 	dev_flow->handle_idx = handle_idx;
> 	/*
>@@ -6245,12 +6246,6 @@ flow_dv_prepare(struct rte_eth_dev *dev,
> 	 */
> 	dev_flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param) -
> 				  MLX5_ST_SZ_BYTES(fte_match_set_misc4);
>-	/*
>-	 * The matching value needs to be cleared to 0 before using. In the
>-	 * past, it will be automatically cleared when using rte_*alloc
>-	 * API. The time consumption will be almost the same as before.
>-	 */
>-	memset(dev_flow->dv.value.buf, 0,
>MLX5_ST_SZ_BYTES(fte_match_param));
> 	dev_flow->ingress = attr->ingress;
> 	dev_flow->dv.transfer = attr->transfer;
> 	return dev_flow;
>--
>2.29.2


  reply	other threads:[~2020-12-08  2:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 14:27 [dpdk-dev] [PATCH] net/mlx5: fix flow descriptor allocation in Direct Verbs mode Gregory Etelson
2020-12-08  2:58 ` Xueming(Steven) Li [this message]
2020-12-08  8:17 ` [dpdk-dev] [PATCH v2] " Gregory Etelson
2020-12-08  8:40   ` Xueming(Steven) Li
2020-12-15 11:10   ` Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY5PR12MB43248BB05D07C1B02C335EBAA1CD0@BY5PR12MB4324.namprd12.prod.outlook.com \
    --to=xuemingl@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=getelson@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.