diff options
author | Jakub Kicinski | 2017-06-27 09:50:20 +0200 |
---|---|---|
committer | David S. Miller | 2017-06-27 21:48:48 +0200 |
commit | 38edbf6f5da4f87741e73b74dc323706827e83e0 (patch) | |
tree | 91f890f23197eca7d010fcf9bbac7bc2c9fe2393 /drivers/net/ethernet/netronome/nfp/nfp_port.h | |
parent | nfp: add nfp_app cleanup callback and make flower use it (diff) | |
download | kernel-qcow2-linux-38edbf6f5da4f87741e73b74dc323706827e83e0.tar.gz kernel-qcow2-linux-38edbf6f5da4f87741e73b74dc323706827e83e0.tar.xz kernel-qcow2-linux-38edbf6f5da4f87741e73b74dc323706827e83e0.zip |
nfp: spawn nfp_ports for PF and VF ports
nfp_port is an abstraction which is supposed to allow us sharing
code between different netdev types (vNIC vs repr). Spawn ports
for PFs and VFs to enable this sharing.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_port.h')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_port.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.h b/drivers/net/ethernet/netronome/nfp/nfp_port.h index f472bea4ec2b..57d852a4ca59 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_port.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_port.h @@ -47,10 +47,14 @@ struct nfp_port; * state when port disappears because of FW fault or config * change * @NFP_PORT_PHYS_PORT: external NIC port + * @NFP_PORT_PF_PORT: logical port of PCI PF + * @NFP_PORT_VF_PORT: logical port of PCI VF */ enum nfp_port_type { NFP_PORT_INVALID, NFP_PORT_PHYS_PORT, + NFP_PORT_PF_PORT, + NFP_PORT_VF_PORT, }; /** @@ -72,6 +76,8 @@ enum nfp_port_flags { * @dl_port: devlink port structure * @eth_id: for %NFP_PORT_PHYS_PORT port ID in NFP enumeration scheme * @eth_port: for %NFP_PORT_PHYS_PORT translated ETH Table port entry + * @pf_id: for %NFP_PORT_PF_PORT, %NFP_PORT_VF_PORT ID of the PCI PF (0-3) + * @vf_id: for %NFP_PORT_VF_PORT ID of the PCI VF within @pf_id * @port_list: entry on pf's list of ports */ struct nfp_port { @@ -84,8 +90,18 @@ struct nfp_port { struct devlink_port dl_port; - unsigned int eth_id; - struct nfp_eth_table_port *eth_port; + union { + /* NFP_PORT_PHYS_PORT */ + struct { + unsigned int eth_id; + struct nfp_eth_table_port *eth_port; + }; + /* NFP_PORT_PF_PORT, NFP_PORT_VF_PORT */ + struct { + unsigned int pf_id; + unsigned int vf_id; + }; + }; struct list_head port_list; }; |