Lines Matching full: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()
40 if (vg->pvid == v->vid) in __vlan_add_pvid()
45 vg->pvid = v->vid; in __vlan_add_pvid()
50 static bool __vlan_delete_pvid(struct net_bridge_vlan_group *vg, u16 vid) in __vlan_delete_pvid() argument
52 if (vg->pvid != vid) in __vlan_delete_pvid()
76 ret = __vlan_delete_pvid(vg, v->vid); in __vlan_add_flags()
95 err = br_switchdev_port_vlan_add(dev, v->vid, flags, extack); in __vlan_vid_add()
97 return vlan_vid_add(dev, br->vlan_proto, v->vid); in __vlan_vid_add()
116 if (v->vid < vent->vid) in __vlan_add_list()
137 err = br_switchdev_port_vlan_del(dev, v->vid); in __vlan_vid_del()
139 vlan_vid_del(dev, br->vlan_proto, v->vid); in __vlan_vid_del()
147 br_vlan_get_master(struct net_bridge *br, u16 vid, in br_vlan_get_master() argument
154 masterv = br_vlan_find(vg, vid); in br_vlan_get_master()
159 if (br_vlan_add(br, vid, 0, &changed, extack)) in br_vlan_get_master()
161 masterv = br_vlan_find(vg, vid); in br_vlan_get_master()
257 err = br_vlan_add(br, v->vid, in __vlan_add()
264 br_vlan_notify(br, NULL, v->vid, 0, in __vlan_add()
268 masterv = br_vlan_get_master(br, v->vid, extack); in __vlan_add()
285 err = br_switchdev_port_vlan_add(dev, v->vid, flags, extack); in __vlan_add()
292 err = br_fdb_insert(br, p, dev->dev_addr, v->vid); in __vlan_add()
312 nbp_vlan_set_vlan_dev_state(p, v->vid); in __vlan_add()
318 br_fdb_find_delete_local(br, p, dev->dev_addr, v->vid); in __vlan_add()
334 br_switchdev_port_vlan_del(dev, v->vid); in __vlan_add()
355 __vlan_delete_pvid(vg, v->vid); in __vlan_del()
361 err = br_switchdev_port_vlan_del(v->br->dev, v->vid); in __vlan_del()
377 nbp_vlan_set_vlan_dev_state(p, v->vid); in __vlan_del()
405 v_start = vlan->vid; in __vlan_flush()
406 } else if (vlan->vid - v_end != 1) { in __vlan_flush()
409 v_start = vlan->vid; in __vlan_flush()
411 v_end = vlan->vid; in __vlan_flush()
428 u16 vid; in br_handle_vlan() local
438 br_vlan_get_tag(skb, &vid); in br_handle_vlan()
439 v = br_vlan_find(vg, vid); in br_handle_vlan()
476 struct sk_buff *skb, u16 *vid, in __allowed_ingress() argument
495 if (!br_vlan_get_tag(skb, vid)) { in __allowed_ingress()
507 *vid = 0; in __allowed_ingress()
517 if (!*vid) { in __allowed_ingress()
520 /* Frame had a tag with VID 0 or did not have a tag. in __allowed_ingress()
530 *vid = pvid; in __allowed_ingress()
536 * At this point, we know that skb->vlan_tci VID in __allowed_ingress()
538 * We update only VID field and preserve PCP field. in __allowed_ingress()
552 v = br_vlan_find(vg, *vid); in __allowed_ingress()
579 u16 *vid, u8 *state) in br_allowed_ingress() argument
589 return __allowed_ingress(br, vg, skb, vid, state); in br_allowed_ingress()
597 u16 vid; in br_allowed_egress() local
603 br_vlan_get_tag(skb, &vid); in br_allowed_egress()
604 v = br_vlan_find(vg, vid); in br_allowed_egress()
613 bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid) in br_should_learn() argument
627 if (!br_vlan_get_tag(skb, vid) && skb->vlan_proto != br->vlan_proto) in br_should_learn()
628 *vid = 0; in br_should_learn()
630 if (!*vid) { in br_should_learn()
631 *vid = br_get_pvid(vg); in br_should_learn()
632 if (!*vid || in br_should_learn()
639 v = br_vlan_find(vg, *vid); in br_should_learn()
654 err = br_switchdev_port_vlan_add(br->dev, vlan->vid, flags, extack); in br_vlan_add_existing()
666 vlan->vid); in br_vlan_add_existing()
685 br_switchdev_port_vlan_del(br->dev, vlan->vid); in br_vlan_add_existing()
690 * Must be called with vid in range from 1 to 4094 inclusive.
693 int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags, bool *changed, in br_vlan_add() argument
704 vlan = br_vlan_find(vg, vid); in br_vlan_add()
718 vlan->vid = vid; in br_vlan_add()
736 * Must be called with vid in range from 1 to 4094 inclusive.
738 int br_vlan_delete(struct net_bridge *br, u16 vid) in br_vlan_delete() argument
746 v = br_vlan_find(vg, vid); in br_vlan_delete()
750 br_fdb_find_delete_local(br, NULL, br->dev->dev_addr, vid); in br_vlan_delete()
751 br_fdb_delete_by_port(br, NULL, vid, 0); in br_vlan_delete()
771 struct net_bridge_vlan *br_vlan_find(struct net_bridge_vlan_group *vg, u16 vid) in br_vlan_find() argument
776 return br_vlan_lookup(&vg->vlan_hash, vid); in br_vlan_find()
871 err = vlan_vid_add(p->dev, proto, vlan->vid); in __br_vlan_set_proto()
887 vlan_vid_del(p->dev, oldproto, vlan->vid); in __br_vlan_set_proto()
894 vlan_vid_del(p->dev, proto, vlan->vid); in __br_vlan_set_proto()
899 vlan_vid_del(p->dev, proto, vlan->vid); in __br_vlan_set_proto()
951 static bool vlan_default_pvid(struct net_bridge_vlan_group *vg, u16 vid) in vlan_default_pvid() argument
955 if (vid != vg->pvid) in vlan_default_pvid()
958 v = br_vlan_lookup(&vg->vlan_hash, vid); in vlan_default_pvid()
1197 * Must be called with vid in range from 1 to 4094 inclusive.
1200 int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags, in nbp_vlan_add() argument
1209 vlan = br_vlan_find(nbp_vlan_group(port), vid); in nbp_vlan_add()
1212 ret = br_switchdev_port_vlan_add(port->dev, vid, flags, extack); in nbp_vlan_add()
1224 vlan->vid = vid; in nbp_vlan_add()
1236 * Must be called with vid in range from 1 to 4094 inclusive.
1238 int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) in nbp_vlan_delete() argument
1244 v = br_vlan_find(nbp_vlan_group(port), vid); in nbp_vlan_delete()
1247 br_fdb_find_delete_local(port->br, port, port->dev->dev_addr, vid); in nbp_vlan_delete()
1248 br_fdb_delete_by_port(port->br, port, vid, 0); in nbp_vlan_delete()
1330 int br_vlan_get_info(const struct net_device *dev, u16 vid, in br_vlan_get_info() argument
1346 v = br_vlan_find(vg, vid); in br_vlan_get_info()
1350 p_vinfo->vid = vid; in br_vlan_get_info()
1352 if (vid == br_get_pvid(vg)) in br_vlan_get_info()
1383 u16 vid; member
1394 vlan_dev_priv(dev)->vlan_id == data->vid) { in br_vlan_match_bind_vlan_dev_fn()
1403 br_vlan_get_upper_bind_vlan_dev(struct net_device *dev, u16 vid) in br_vlan_get_upper_bind_vlan_dev() argument
1406 .vid = vid, in br_vlan_get_upper_bind_vlan_dev()
1428 u16 vid = vlan_dev_priv(vlan_dev)->vlan_id; in br_vlan_set_vlan_dev_state() local
1440 if (br_vlan_find(vg, vid) && br_vlan_is_dev_up(p->dev)) { in br_vlan_set_vlan_dev_state()
1460 vlan->vid); in br_vlan_set_all_vlan_dev_state()
1522 static void nbp_vlan_set_vlan_dev_state(struct net_bridge_port *p, u16 vid) in nbp_vlan_set_vlan_dev_state() argument
1529 vlan_dev = br_vlan_get_upper_bind_vlan_dev(p->br->dev, vid); in nbp_vlan_set_vlan_dev_state()
1618 static bool br_vlan_fill_vids(struct sk_buff *skb, u16 vid, u16 vid_range, in br_vlan_fill_vids() argument
1631 info.vid = vid; in br_vlan_fill_vids()
1640 if (vid_range && vid < vid_range && in br_vlan_fill_vids()
1673 u16 vid, u16 vid_range, in br_vlan_notify() argument
1715 v = br_vlan_find(vg, vid); in br_vlan_notify()
1720 if (br_get_pvid(vg) == v->vid) in br_vlan_notify()
1729 if (!br_vlan_fill_vids(skb, vid, vid_range, v, flags, false)) in br_vlan_notify()
1746 return v_curr->vid - range_end->vid == 1 && in br_vlan_can_enter_range()
1810 if (dump_stats || v->vid == pvid || in br_vlan_dump_dev()
1814 if (!br_vlan_fill_vids(skb, range_start->vid, in br_vlan_dump_dev()
1815 range_end->vid, range_start, in br_vlan_dump_dev()
1821 idx += range_end->vid - range_start->vid + 1; in br_vlan_dump_dev()
1834 !br_vlan_fill_vids(skb, range_start->vid, range_end->vid, in br_vlan_dump_dev()
1952 if (!br_vlan_valid_id(vinfo->vid, extack)) in br_vlan_rtm_process_one()
1956 vrange_end.vid = nla_get_u16(tb[BRIDGE_VLANDB_ENTRY_RANGE]); in br_vlan_rtm_process_one()
1965 if (!br_vlan_valid_id(vinfo->vid, extack) || in br_vlan_rtm_process_one()
2000 range_start = br_vlan_find(vg, vinfo_last->vid); in br_vlan_rtm_process_one()
2001 range_end = br_vlan_find(vg, vinfo->vid); in br_vlan_rtm_process_one()
2003 range_start = br_vlan_find(vg, vinfo->vid); in br_vlan_rtm_process_one()