From: Leon Romanovsky <leon@kernel.org>
To: Louis Peens <louis.peens@corigine.com>
Cc: David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <simon.horman@corigine.com>,
netdev@vger.kernel.org, oss-drivers@corigine.com,
Yinjun Zhang <yinjun.zhang@corigine.com>
Subject: Re: [PATCH net-next 1/2] nfp: initialize netdev's dev_port with correct id
Date: Wed, 29 Mar 2023 21:49:59 +0300 [thread overview]
Message-ID: <20230329184959.GC831478@unreal> (raw)
In-Reply-To: <20230329144548.66708-2-louis.peens@corigine.com>
On Wed, Mar 29, 2023 at 04:45:47PM +0200, Louis Peens wrote:
> From: Yinjun Zhang <yinjun.zhang@corigine.com>
>
> `dev_port` is used to differentiate devices that share the same
> function, which is the case in most of NFP NICs.
And how did it work without dev_port?
I have no idea what does it mean "different devices that share the same
function".
Thanks
>
> In some customized scenario, `dev_port` is used to rename netdev
> instead of `phys_port_name`, which requires to initialize it
> correctly to get expected netdev name.
>
> Example rules using `dev_port`:
>
> SUBSYSTEM=="net", ACTION=="add", KERNELS=="0000:e1:00.0", ATTR{dev_port}=="0", NAME:="ens8np0"
> SUBSYSTEM=="net", ACTION=="add", KERNELS=="0000:e1:00.0", ATTR{dev_port}=="1", NAME:="ens8np1"
>
> Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
> Acked-by: Simon Horman <simon.horman@corigine.com>
> Signed-off-by: Louis Peens <louis.peens@corigine.com>
> ---
> drivers/net/ethernet/netronome/nfp/nfp_port.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.c b/drivers/net/ethernet/netronome/nfp/nfp_port.c
> index 4f2308570dcf..54640bcb70fb 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_port.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_port.c
> @@ -189,6 +189,7 @@ int nfp_port_init_phy_port(struct nfp_pf *pf, struct nfp_app *app,
>
> port->eth_port = &pf->eth_tbl->ports[id];
> port->eth_id = pf->eth_tbl->ports[id].index;
> + port->netdev->dev_port = id;
> if (pf->mac_stats_mem)
> port->eth_stats =
> pf->mac_stats_mem + port->eth_id * NFP_MAC_STATS_SIZE;
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-03-29 18:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 14:45 [PATCH net-next 0/2] Small series of enhancements Louis Peens
2023-03-29 14:45 ` [PATCH net-next 1/2] nfp: initialize netdev's dev_port with correct id Louis Peens
2023-03-29 18:49 ` Leon Romanovsky [this message]
2023-03-30 1:32 ` Yinjun Zhang
2023-03-29 19:22 ` Jakub Kicinski
2023-03-30 1:40 ` Yinjun Zhang
2023-03-30 2:38 ` Jakub Kicinski
2023-03-30 2:52 ` Yinjun Zhang
2023-03-30 3:10 ` Jakub Kicinski
2023-03-30 3:27 ` Yinjun Zhang
2023-03-30 3:58 ` Jakub Kicinski
2023-03-29 14:45 ` [PATCH net-next 2/2] nfp: separate the port's upper state with lower phy state Louis Peens
2023-03-29 18:52 ` Leon Romanovsky
2023-03-30 1:48 ` Yinjun Zhang
2023-03-29 19:24 ` Jakub Kicinski
2023-03-30 1:56 ` Yinjun Zhang
2023-03-30 2:41 ` Jakub Kicinski
2023-03-30 2:57 ` Yinjun Zhang
2023-03-30 3:12 ` Jakub Kicinski
2023-03-30 3:33 ` Yinjun Zhang
2023-03-30 4:00 ` Jakub Kicinski
2023-03-30 5:55 ` Yinjun Zhang
2023-03-30 17:30 ` Jakub Kicinski
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=20230329184959.GC831478@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=louis.peens@corigine.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.com \
--cc=simon.horman@corigine.com \
--cc=yinjun.zhang@corigine.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).