aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/switchdev.h
diff options
context:
space:
mode:
authorRoopa Prabhu <roopa@cumulusnetworks.com>2015-01-30 01:40:13 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-02 02:16:34 -0500
commit8a44dbb202617aa66968ba74fdabf1b654dfe661 (patch)
tree4699440e3aa9dfc43f25ccddb8ccd288fea09ed4 /include/net/switchdev.h
parentadd511b38266aa10c1079f9248854e6a415c4dc2 (diff)
swdevice: add new apis to set and del bridge port attributes
This patch adds two new api's netdev_switch_port_bridge_setlink and netdev_switch_port_bridge_dellink to offload bridge port attributes to switch port (The names of the apis look odd with 'switch_port_bridge', but am more inclined to change the prefix of the api to something else. Will take any suggestions). The api's look at the NETIF_F_HW_SWITCH_OFFLOAD feature flag to pass bridge port attributes to the port device. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/switchdev.h')
-rw-r--r--include/net/switchdev.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 205e63698da9..cfcdac2e5d25 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -43,7 +43,14 @@ int register_netdev_switch_notifier(struct notifier_block *nb);
43int unregister_netdev_switch_notifier(struct notifier_block *nb); 43int unregister_netdev_switch_notifier(struct notifier_block *nb);
44int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev, 44int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev,
45 struct netdev_switch_notifier_info *info); 45 struct netdev_switch_notifier_info *info);
46 46int netdev_switch_port_bridge_setlink(struct net_device *dev,
47 struct nlmsghdr *nlh, u16 flags);
48int netdev_switch_port_bridge_dellink(struct net_device *dev,
49 struct nlmsghdr *nlh, u16 flags);
50int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
51 struct nlmsghdr *nlh, u16 flags);
52int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
53 struct nlmsghdr *nlh, u16 flags);
47#else 54#else
48 55
49static inline int netdev_switch_parent_id_get(struct net_device *dev, 56static inline int netdev_switch_parent_id_get(struct net_device *dev,
@@ -74,6 +81,34 @@ static inline int call_netdev_switch_notifiers(unsigned long val, struct net_dev
74 return NOTIFY_DONE; 81 return NOTIFY_DONE;
75} 82}
76 83
84static inline int netdev_switch_port_bridge_setlink(struct net_device *dev,
85 struct nlmsghdr *nlh,
86 u16 flags)
87{
88 return -EOPNOTSUPP;
89}
90
91static inline int netdev_switch_port_bridge_dellink(struct net_device *dev,
92 struct nlmsghdr *nlh,
93 u16 flags)
94{
95 return -EOPNOTSUPP;
96}
97
98static inline int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
99 struct nlmsghdr *nlh,
100 u16 flags)
101{
102 return 0;
103}
104
105static inline int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
106 struct nlmsghdr *nlh,
107 u16 flags)
108{
109 return 0;
110}
111
77#endif 112#endif
78 113
79#endif /* _LINUX_SWITCHDEV_H_ */ 114#endif /* _LINUX_SWITCHDEV_H_ */