#include #include #include #include #include #include #include "br_private.h" static int br_switchdev_mark_get(struct net_bridge *br, struct net_device *dev) { struct net_bridge_port *p; /* dev is yet to be added to the port list. */ list_for_each_entry(p, &br->port_list, list) { if (switchdev_port_same_parent_id(dev, p->dev)) return p->offload_fwd_mark; } return ++br->offload_fwd_mark; } int nbp_switchdev_mark_set(struct net_bridge_port *p) { struct switchdev_attr attr = { .orig_dev = p->dev, .id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID, }; int err; ASSERT_RTNL(); err = switchdev_port_attr_get(p->dev, &attr); if (err) { if (err == -EOPNOTSUPP) return 0; return err; } p->offload_fwd_mark = br_switchdev_mark_get(p->br, p->dev); return 0; } void nbp_switchdev_frame_mark(const struct net_bridge_port *p, struct sk_buff *skb) { if (skb->offload_fwd_mark && !WARN_ON_ONCE(!p->offload_fwd_mark)) BR_INPUT_SKB_CB(skb)->offload_fwd_mark = p->offload_fwd_mark; } bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p, const struct sk_buff *skb) { return !skb->offload_fwd_mark || BR_INPUT_SKB_CB(skb)->offload_fwd_mark != p->offload_fwd_mark; } ut type='submit' value='switch'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
tton' href='/cgit.cgi/linux/net-next.git/log/include/uapi/rdma/cxgb3-abi.h?id=2883aaea363f7a897ff06d2e6c73ae7aae285bcb'>logplain
AgeCommit message (Expand)AuthorFilesLines
-rw-r--r--cxgb4-abi.h2488logplain
d---------hfi73logplain
-rw-r--r--hns-abi.h1795logplain
-rw-r--r--ib_user_cm.h6526logplain
-rw-r--r--ib_user_mad.h8791logplain
-rw-r--r--ib_user_sa.h2222logplain
-rw-r--r--ib_user_verbs.h21586logplain
-rw-r--r--mlx4-abi.h2864logplain