From: Raslan Darawsheh <rasland@mellanox.com>
To: Michael Baum <michaelba@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Matan Azrad <matan@mellanox.com>,
Slava Ovsiienko <viacheslavo@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: use anonymous DV allocator argument
Date: Mon, 29 Jun 2020 08:44:43 +0000 [thread overview]
Message-ID: <AM0PR05MB6707CE3C428104BDB4BC7317C26E0@AM0PR05MB6707.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1593006401-6275-1-git-send-email-michaelba@mellanox.com>
Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Michael Baum
> Sent: Wednesday, June 24, 2020 4:47 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>
> Subject: [dpdk-dev] [PATCH] net/mlx5: use anonymous DV allocator
> argument
>
> The mlx5_dev_spawn function defines an struct mlx5dv_ctx_allocators type
> variable several hundred rows after it starts, with the only use it
> being passed as a parameter to the mlx5_glue->dv_set_context_attr
> function.
> However, according to DPDK Coding Style Guidelines, variables should be
> declared at the start of a block of code rather than in the middle.
> Therefore, to improve the Coding Style, the variable is passed directly
> to the function without declaring it before.
>
> Signed-off-by: Michael Baum <michaelba@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
> drivers/net/mlx5/linux/mlx5_os.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/mlx5/linux/mlx5_os.c
> b/drivers/net/mlx5/linux/mlx5_os.c
> index f0147e6..2dc57b2 100644
> --- a/drivers/net/mlx5/linux/mlx5_os.c
> +++ b/drivers/net/mlx5/linux/mlx5_os.c
> @@ -988,14 +988,13 @@
> TAILQ_INIT(&priv->flow_meters);
> TAILQ_INIT(&priv->flow_meter_profiles);
> /* Hint libmlx5 to use PMD allocator for data plane resources */
> - struct mlx5dv_ctx_allocators alctr = {
> - .alloc = &mlx5_alloc_verbs_buf,
> - .free = &mlx5_free_verbs_buf,
> - .data = priv,
> - };
> mlx5_glue->dv_set_context_attr(sh->ctx,
> - MLX5DV_CTX_ATTR_BUF_ALLOCATORS,
> - (void *)((uintptr_t)&alctr));
> + MLX5DV_CTX_ATTR_BUF_ALLOCATORS,
> + (void *)((uintptr_t)&(struct mlx5dv_ctx_allocators){
> + .alloc = &mlx5_alloc_verbs_buf,
> + .free = &mlx5_free_verbs_buf,
> + .data = priv,
> + }));
> /* Bring Ethernet device up. */
> DRV_LOG(DEBUG, "port %u forcing Ethernet interface up",
> eth_dev->data->port_id);
> --
> 1.8.3.1
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
next prev parent reply other threads:[~2020-06-29 8:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 13:46 Michael Baum
2020-06-29 8:44 ` Raslan Darawsheh [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-24 13:36 Michael Baum
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=AM0PR05MB6707CE3C428104BDB4BC7317C26E0@AM0PR05MB6707.eurprd05.prod.outlook.com \
--to=rasland@mellanox.com \
--cc=dev@dpdk.org \
--cc=matan@mellanox.com \
--cc=michaelba@mellanox.com \
--cc=viacheslavo@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).