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 2/7] net/mlx5: use direct API to find port by device
Date: Sun, 28 Jun 2020 13:55:38 +0000 [thread overview]
Message-ID: <AM0PR05MB6707856E3168F0DCDE695BC9C2910@AM0PR05MB6707.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1592998387-28181-2-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 2:33 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>
> Subject: [dpdk-dev] [PATCH 2/7] net/mlx5: use direct API to find port by
> device
>
> Using RTE_ETH_FOREACH_DEV_OF loop is not necessary when the driver
> wants
> to find only the first match.
>
> Use rte_eth_find_next_of to find it.
>
> Signed-off-by: Michael Baum <michaelba@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
> drivers/net/mlx5/mlx5_mr.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
> index adbe07c..3b781b6 100644
> --- a/drivers/net/mlx5/mlx5_mr.c
> +++ b/drivers/net/mlx5/mlx5_mr.c
> @@ -313,9 +313,10 @@ struct mr_update_mp_data {
> {
> uint16_t port_id;
>
> - RTE_ETH_FOREACH_DEV_OF(port_id, &pdev->device)
> - return &rte_eth_devices[port_id];
> - return NULL;
> + port_id = rte_eth_find_next_of(0, &pdev->device);
> + if (port_id == RTE_MAX_ETHPORTS)
> + return NULL;
> + return &rte_eth_devices[port_id];
> }
>
> /**
> --
> 1.8.3.1
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
next prev parent reply other threads:[~2020-06-28 13:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 11:33 [dpdk-dev] [PATCH 1/7] common/mlx5: fix code arrangement in tag allocation Michael Baum
2020-06-24 11:33 ` [dpdk-dev] [PATCH 2/7] net/mlx5: use direct API to find port by device Michael Baum
2020-06-28 13:55 ` Raslan Darawsheh [this message]
2020-06-24 11:33 ` [dpdk-dev] [PATCH 3/7] net/mlx5: fix iterator type in Rx queue management Michael Baum
2020-06-24 11:33 ` [dpdk-dev] [PATCH 4/7] net/mlx4: use anonymous DV allocator argument Michael Baum
2020-06-24 11:33 ` [dpdk-dev] [PATCH 5/7] net/mlx4: remove useless assignment Michael Baum
2020-06-24 11:33 ` [dpdk-dev] [PATCH 6/7] common/mlx5: " Michael Baum
2020-06-29 8:44 ` Raslan Darawsheh
2020-06-24 11:33 ` [dpdk-dev] [PATCH 7/7] net/mlx5: use anonymous DV allocator argument 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=AM0PR05MB6707856E3168F0DCDE695BC9C2910@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).