diff options
author | Scott Feldman <sfeldma@gmail.com> | 2015-07-18 21:24:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-20 21:32:44 -0400 |
commit | 1a3b2ec93d4277b121979321b4024b438cb09504 (patch) | |
tree | c57bf0a7563a0cfcdcda3c08ca90591c15d21f0a /include/net/switchdev.h | |
parent | d754f98b502ad9a8c7570d494e1eaa0e6bc0350c (diff) |
switchdev: add offload_fwd_mark generator helper
skb->offload_fwd_mark and dev->offload_fwd_mark are 32-bit and should be
unique for device and may even be unique for a sub-set of ports within
device, so add switchdev helper function to generate unique marks based on
port's switch ID and group_ifindex. group_ifindex would typically be the
container dev's ifindex, such as the bridge's ifindex.
The generator uses a global hash table to store offload_fwd_marks hashed by
{switch ID, group_ifindex} key.
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/switchdev.h')
-rw-r--r-- | include/net/switchdev.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index d5671f118bfc..89da8934519b 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
@@ -157,6 +157,9 @@ int switchdev_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], | |||
157 | int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, | 157 | int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, |
158 | struct net_device *dev, | 158 | struct net_device *dev, |
159 | struct net_device *filter_dev, int idx); | 159 | struct net_device *filter_dev, int idx); |
160 | void switchdev_port_fwd_mark_set(struct net_device *dev, | ||
161 | struct net_device *group_dev, | ||
162 | bool joining); | ||
160 | 163 | ||
161 | #else | 164 | #else |
162 | 165 | ||
@@ -271,6 +274,12 @@ static inline int switchdev_port_fdb_dump(struct sk_buff *skb, | |||
271 | return -EOPNOTSUPP; | 274 | return -EOPNOTSUPP; |
272 | } | 275 | } |
273 | 276 | ||
277 | static inline void switchdev_port_fwd_mark_set(struct net_device *dev, | ||
278 | struct net_device *group_dev, | ||
279 | bool joining) | ||
280 | { | ||
281 | } | ||
282 | |||
274 | #endif | 283 | #endif |
275 | 284 | ||
276 | #endif /* _LINUX_SWITCHDEV_H_ */ | 285 | #endif /* _LINUX_SWITCHDEV_H_ */ |