summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/netronome/nfp/nfp_port.h
diff options
context:
space:
mode:
authorSimon Horman2017-06-29 22:08:12 +0200
committerDavid S. Miller2017-07-01 17:51:32 +0200
commit8f15df600dff00c8f28c8588bdd4dca55dff690b (patch)
tree3e781736505532d6c82a8041f3b7f1b313dff2ce /drivers/net/ethernet/netronome/nfp/nfp_port.h
parentnet: switchdev: add SET_SWITCHDEV_OPS helper (diff)
downloadkernel-qcow2-linux-8f15df600dff00c8f28c8588bdd4dca55dff690b.tar.gz
kernel-qcow2-linux-8f15df600dff00c8f28c8588bdd4dca55dff690b.tar.xz
kernel-qcow2-linux-8f15df600dff00c8f28c8588bdd4dca55dff690b.zip
nfp: add phys_switch_id support
Add phys_switch_id support by allowing lookup of SWITCHDEV_ATTR_ID_PORT_PARENT_ID via the nfp_repr_port_attr_get switchdev operation. This is visible to user-space in the phys_switch_id attribute of a netdev. e.g. cd /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 find . -name phys_switch_id | xargs grep . ./net/eth3/phys_switch_id:00154d1300bd ./net/eth4/phys_switch_id:00154d1300bd ./net/eth2/phys_switch_id:00154d1300bd grep: ./net/eth5/phys_switch_id: Operation not supported In the above eth2 and eth3 and representor netdevs for the first and second physical port. eth4 is the representor for the PF. And eth5 is the PF netdev. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.h b/drivers/net/ethernet/netronome/nfp/nfp_port.h
index 57d852a4ca59..1ceef5d4a744 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_port.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_port.h
@@ -106,6 +106,8 @@ struct nfp_port {
struct list_head port_list;
};
+extern const struct switchdev_ops nfp_port_switchdev_ops;
+
struct nfp_port *nfp_port_from_netdev(struct net_device *netdev);
struct nfp_port *
nfp_port_from_id(struct nfp_pf *pf, enum nfp_port_type type, unsigned int id);