]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: improve order of interfaces in breakout mode
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 4 Jul 2017 09:27:19 +0000 (02:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Jul 2017 08:13:07 +0000 (09:13 +0100)
commit9b0dd170e6fe6df893e5d8571a6415c4540a75e0
treea66168f7c31fca85731c4969186f5eb45097dff3
parentbf6528c3870e00cdcbdbb7ceb7a48d6fd1ba240f
nfp: improve order of interfaces in breakout mode

For historical reasons we enumerate the vNICs in order.  This means
that if user configures breakout on a multiport card, the first
interface of the second port will have its MAC address changed.

What's worse, when moved from static information (HWInfo) to using
management FW (NSP), more features started depending on the port ids.
Right now in case of breakout first subport of the second port and
second subport of the first port will have their link info swapped.

Revise the ordering scheme so that first subport maintains its address.
Side effect of this change is that we will use base lane ids in
devlink (i.e. 40G ports will be 4 ids apart), e.g.:

pci/0000:04:00.0/0: type eth netdev p6p1
pci/0000:04:00.0/4: type eth netdev p6p2

Note that behaviour of phys_port_id is not changed since there is
a separate id number for the subport there.

Fixes: 1024ff65ff7a ("nfp: support port splitting via devlink")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_main.h
drivers/net/ethernet/netronome/nfp/nfp_net_main.c
drivers/net/ethernet/netronome/nfp/nfp_port.c