[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR13MB3705F818D9B6B25D73C2DCB2FC8E9@DM6PR13MB3705.namprd13.prod.outlook.com>
Date: Thu, 30 Mar 2023 01:32:27 +0000
From: Yinjun Zhang <yinjun.zhang@...igine.com>
To: Leon Romanovsky <leon@...nel.org>,
Louis Peens <louis.peens@...igine.com>
CC: David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <simon.horman@...igine.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
oss-drivers <oss-drivers@...igine.com>
Subject: RE: [PATCH net-next 1/2] nfp: initialize netdev's dev_port with
correct id
On Wed, 29 Mar 2023 21:49:59 +0300, Leon Romanovsky wrote:
> On Wed, Mar 29, 2023 at 04:45:47PM +0200, Louis Peens wrote:
> > From: Yinjun Zhang <yinjun.zhang@...igine.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?
No functionality fault, just cannot rename netdev as expected when the
udev rules use `dev_port` attribute as the example below.
> I have no idea what does it mean "different devices that share the same
> function".
That's how it's commented for the `dev_port` field of struct netdev:
* @dev_port: Used to differentiate devices that share
* the same function
I think it's used when single pci function instantiates more than one netdev.
Ref: 3f85944fe207 ("net: Add sysfs file for port number")
>
> 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"
> >
Powered by blists - more mailing lists