diff options
author | 2018-05-21 22:12:55 -0700 | |
---|---|---|
committer | 2018-05-23 14:26:19 -0400 | |
commit | 51c1df83e35ce0e24ca10037c73245cb4c8ac11a (patch) | |
tree | dba3bba3824446b244618897a4f1568eb6b1290c /drivers/net/ethernet/netronome/nfp/nfp_net_main.c | |
parent | nfp: use split in naming of PCIe PF ports (diff) | |
download | linux-dev-51c1df83e35ce0e24ca10037c73245cb4c8ac11a.tar.xz linux-dev-51c1df83e35ce0e24ca10037c73245cb4c8ac11a.zip |
nfp: assign vNIC id as phys_port_name of vNICs which are not ports
When NFP is modelled as a switch we assign phys_port_name to respective
port(representor )s:
vNIC0 - | - PF port (pf%d) MAC/PHY (p%d[s%d]) - |E==
In most cases there is only one vNIC for communication with the switch.
If there is more than one we need to be able to identify them. Use %d
as phys_port_name of the vNICs.
We don't have to pass ID to nfp_net_debugfs_vnic_add() separately any
more.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_net_main.c')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c index b98422112385..28516eecccc8 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c @@ -178,11 +178,13 @@ nfp_net_pf_init_vnic(struct nfp_pf *pf, struct nfp_net *nn, unsigned int id) { int err; + nn->id = id; + err = nfp_net_init(nn); if (err) return err; - nfp_net_debugfs_vnic_add(nn, pf->ddir, id); + nfp_net_debugfs_vnic_add(nn, pf->ddir); if (nn->port) { err = nfp_devlink_port_register(pf->app, nn->port); |