Lines Matching refs:vid

11 static void nbp_vlan_set_vlan_dev_state(struct net_bridge_port *p, u16 vid);
17 u16 vid = *(u16 *)arg->key; in br_vlan_cmp() local
19 return vle->vid != vid; in br_vlan_cmp()
24 .key_offset = offsetof(struct net_bridge_vlan, vid),
32 static struct net_bridge_vlan *br_vlan_lookup(struct rhashtable *tbl, u16 vid) in br_vlan_lookup() argument
34 return rhashtable_lookup_fast(tbl, &vid, br_vlan_rht_params); in br_vlan_lookup()
37 static bool __vlan_add_pvid(struct net_bridge_vlan_group *vg, u16 vid) in __vlan_add_pvid() argument
39 if (vg->pvid == vid) in __vlan_add_pvid()
43 vg->pvid = vid; in __vlan_add_pvid()
48 static bool __vlan_delete_pvid(struct net_bridge_vlan_group *vg, u16 vid) in __vlan_delete_pvid() argument
50 if (vg->pvid != vid) in __vlan_delete_pvid()
72 ret = __vlan_add_pvid(vg, v->vid); in __vlan_add_flags()
74 ret = __vlan_delete_pvid(vg, v->vid); in __vlan_add_flags()
93 err = br_switchdev_port_vlan_add(dev, v->vid, flags, extack); in __vlan_vid_add()
95 return vlan_vid_add(dev, br->vlan_proto, v->vid); in __vlan_vid_add()
114 if (v->vid < vent->vid) in __vlan_add_list()
135 err = br_switchdev_port_vlan_del(dev, v->vid); in __vlan_vid_del()
137 vlan_vid_del(dev, br->vlan_proto, v->vid); in __vlan_vid_del()
145 br_vlan_get_master(struct net_bridge *br, u16 vid, in br_vlan_get_master() argument
152 masterv = br_vlan_find(vg, vid); in br_vlan_get_master()
157 if (br_vlan_add(br, vid, 0, &changed, extack)) in br_vlan_get_master()
159 masterv = br_vlan_find(vg, vid); in br_vlan_get_master()
255 err = br_vlan_add(br, v->vid, in __vlan_add()
262 masterv = br_vlan_get_master(br, v->vid, extack); in __vlan_add()
277 err = br_switchdev_port_vlan_add(dev, v->vid, flags, extack); in __vlan_add()
284 err = br_fdb_insert(br, p, dev->dev_addr, v->vid); in __vlan_add()
301 nbp_vlan_set_vlan_dev_state(p, v->vid); in __vlan_add()
307 br_fdb_find_delete_local(br, p, dev->dev_addr, v->vid); in __vlan_add()
323 br_switchdev_port_vlan_del(dev, v->vid); in __vlan_add()
344 __vlan_delete_pvid(vg, v->vid); in __vlan_del()
350 err = br_switchdev_port_vlan_del(v->br->dev, v->vid); in __vlan_del()
366 nbp_vlan_set_vlan_dev_state(p, v->vid); in __vlan_del()
399 u16 vid; in br_handle_vlan() local
409 br_vlan_get_tag(skb, &vid); in br_handle_vlan()
410 v = br_vlan_find(vg, vid); in br_handle_vlan()
447 struct sk_buff *skb, u16 *vid) in __allowed_ingress() argument
465 if (!br_vlan_get_tag(skb, vid)) { in __allowed_ingress()
477 *vid = 0; in __allowed_ingress()
487 if (!*vid) { in __allowed_ingress()
500 *vid = pvid; in __allowed_ingress()
516 v = br_vlan_find(vg, *vid); in __allowed_ingress()
537 u16 *vid) in br_allowed_ingress() argument
547 return __allowed_ingress(br, vg, skb, vid); in br_allowed_ingress()
555 u16 vid; in br_allowed_egress() local
561 br_vlan_get_tag(skb, &vid); in br_allowed_egress()
562 v = br_vlan_find(vg, vid); in br_allowed_egress()
570 bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid) in br_should_learn() argument
583 if (!br_vlan_get_tag(skb, vid) && skb->vlan_proto != br->vlan_proto) in br_should_learn()
584 *vid = 0; in br_should_learn()
586 if (!*vid) { in br_should_learn()
587 *vid = br_get_pvid(vg); in br_should_learn()
588 if (!*vid) in br_should_learn()
594 if (br_vlan_find(vg, *vid)) in br_should_learn()
608 err = br_switchdev_port_vlan_add(br->dev, vlan->vid, flags, extack); in br_vlan_add_existing()
620 vlan->vid); in br_vlan_add_existing()
639 br_switchdev_port_vlan_del(br->dev, vlan->vid); in br_vlan_add_existing()
647 int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags, bool *changed, in br_vlan_add() argument
658 vlan = br_vlan_find(vg, vid); in br_vlan_add()
672 vlan->vid = vid; in br_vlan_add()
692 int br_vlan_delete(struct net_bridge *br, u16 vid) in br_vlan_delete() argument
700 v = br_vlan_find(vg, vid); in br_vlan_delete()
704 br_fdb_find_delete_local(br, NULL, br->dev->dev_addr, vid); in br_vlan_delete()
705 br_fdb_delete_by_port(br, NULL, vid, 0); in br_vlan_delete()
725 struct net_bridge_vlan *br_vlan_find(struct net_bridge_vlan_group *vg, u16 vid) in br_vlan_find() argument
730 return br_vlan_lookup(&vg->vlan_hash, vid); in br_vlan_find()
825 err = vlan_vid_add(p->dev, proto, vlan->vid); in __br_vlan_set_proto()
841 vlan_vid_del(p->dev, oldproto, vlan->vid); in __br_vlan_set_proto()
848 vlan_vid_del(p->dev, proto, vlan->vid); in __br_vlan_set_proto()
853 vlan_vid_del(p->dev, proto, vlan->vid); in __br_vlan_set_proto()
905 static bool vlan_default_pvid(struct net_bridge_vlan_group *vg, u16 vid) in vlan_default_pvid() argument
909 if (vid != vg->pvid) in vlan_default_pvid()
912 v = br_vlan_lookup(&vg->vlan_hash, vid); in vlan_default_pvid()
1139 int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags, in nbp_vlan_add() argument
1148 vlan = br_vlan_find(nbp_vlan_group(port), vid); in nbp_vlan_add()
1151 ret = br_switchdev_port_vlan_add(port->dev, vid, flags, extack); in nbp_vlan_add()
1163 vlan->vid = vid; in nbp_vlan_add()
1177 int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) in nbp_vlan_delete() argument
1183 v = br_vlan_find(nbp_vlan_group(port), vid); in nbp_vlan_delete()
1186 br_fdb_find_delete_local(port->br, port, port->dev->dev_addr, vid); in nbp_vlan_delete()
1187 br_fdb_delete_by_port(port->br, port, vid, 0); in nbp_vlan_delete()
1262 int br_vlan_get_info(const struct net_device *dev, u16 vid, in br_vlan_get_info() argument
1278 v = br_vlan_find(vg, vid); in br_vlan_get_info()
1282 p_vinfo->vid = vid; in br_vlan_get_info()
1284 if (vid == br_get_pvid(vg)) in br_vlan_get_info()
1315 u16 vid; member
1326 vlan_dev_priv(dev)->vlan_id == data->vid) { in br_vlan_match_bind_vlan_dev_fn()
1335 br_vlan_get_upper_bind_vlan_dev(struct net_device *dev, u16 vid) in br_vlan_get_upper_bind_vlan_dev() argument
1338 .vid = vid, in br_vlan_get_upper_bind_vlan_dev()
1357 u16 vid = vlan_dev_priv(vlan_dev)->vlan_id; in br_vlan_set_vlan_dev_state() local
1369 if (br_vlan_find(vg, vid) && br_vlan_is_dev_up(p->dev)) { in br_vlan_set_vlan_dev_state()
1389 vlan->vid); in br_vlan_set_all_vlan_dev_state()
1448 static void nbp_vlan_set_vlan_dev_state(struct net_bridge_port *p, u16 vid) in nbp_vlan_set_vlan_dev_state() argument
1455 vlan_dev = br_vlan_get_upper_bind_vlan_dev(p->br->dev, vid); in nbp_vlan_set_vlan_dev_state()