Lines Matching refs:vid

86 	u16 vid;  in mlxsw_sp_port_stp_state_set()  local
109 for_each_set_bit(vid, mlxsw_sp_port->active_vlans, VLAN_N_VID) in mlxsw_sp_port_stp_state_set()
110 mlxsw_reg_spms_vid_pack(spms_pl, vid, spms_state); in mlxsw_sp_port_stp_state_set()
168 u16 vid, last_visited_vid; in mlxsw_sp_port_uc_flood_set() local
171 for_each_set_bit(vid, mlxsw_sp_port->active_vlans, VLAN_N_VID) { in mlxsw_sp_port_uc_flood_set()
172 err = __mlxsw_sp_port_flood_set(mlxsw_sp_port, vid, vid, set, in mlxsw_sp_port_uc_flood_set()
175 last_visited_vid = vid; in mlxsw_sp_port_uc_flood_set()
183 for_each_set_bit(vid, mlxsw_sp_port->active_vlans, last_visited_vid) in mlxsw_sp_port_uc_flood_set()
184 __mlxsw_sp_port_flood_set(mlxsw_sp_port, vid, vid, !set, true); in mlxsw_sp_port_uc_flood_set()
274 static int mlxsw_sp_port_pvid_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid) in mlxsw_sp_port_pvid_set() argument
279 mlxsw_reg_spvid_pack(spvid_pl, mlxsw_sp_port->local_port, vid); in mlxsw_sp_port_pvid_set()
335 u16 vid; in mlxsw_sp_port_add_vids() local
338 for (vid = vid_begin; vid <= vid_end; vid++) { in mlxsw_sp_port_add_vids()
339 err = mlxsw_sp_port_add_vid(dev, 0, vid); in mlxsw_sp_port_add_vids()
346 for (vid--; vid >= vid_begin; vid--) in mlxsw_sp_port_add_vids()
347 mlxsw_sp_port_kill_vid(dev, 0, vid); in mlxsw_sp_port_add_vids()
358 u16 vid, vid_e; in __mlxsw_sp_port_vlans_add() local
368 for (vid = vid_begin; vid <= vid_end; vid++) { in __mlxsw_sp_port_vlans_add()
369 if (!test_bit(vid, mlxsw_sp->active_fids)) { in __mlxsw_sp_port_vlans_add()
370 err = mlxsw_sp_fid_create(mlxsw_sp, vid); in __mlxsw_sp_port_vlans_add()
373 vid); in __mlxsw_sp_port_vlans_add()
382 true, vid, vid); in __mlxsw_sp_port_vlans_add()
385 vid); in __mlxsw_sp_port_vlans_add()
391 err = mlxsw_sp_port_fid_map(mlxsw_sp_port, vid); in __mlxsw_sp_port_vlans_add()
393 netdev_err(dev, "Failed to map FID=%d", vid); in __mlxsw_sp_port_vlans_add()
405 for (vid = vid_begin; vid <= vid_end; in __mlxsw_sp_port_vlans_add()
406 vid += MLXSW_REG_SPVM_REC_MAX_COUNT) { in __mlxsw_sp_port_vlans_add()
407 vid_e = min((u16) (vid + MLXSW_REG_SPVM_REC_MAX_COUNT - 1), in __mlxsw_sp_port_vlans_add()
410 err = mlxsw_sp_port_vlan_set(mlxsw_sp_port, vid, vid_e, true, in __mlxsw_sp_port_vlans_add()
414 vid, vid_e); in __mlxsw_sp_port_vlans_add()
419 vid = vid_begin; in __mlxsw_sp_port_vlans_add()
420 if (flag_pvid && mlxsw_sp_port->pvid != vid) { in __mlxsw_sp_port_vlans_add()
421 err = mlxsw_sp_port_pvid_set(mlxsw_sp_port, vid); in __mlxsw_sp_port_vlans_add()
424 vid); in __mlxsw_sp_port_vlans_add()
427 mlxsw_sp_port->pvid = vid; in __mlxsw_sp_port_vlans_add()
431 for (vid = vid_begin; vid <= vid_end; vid++) in __mlxsw_sp_port_vlans_add()
432 set_bit(vid, mlxsw_sp_port->active_vlans); in __mlxsw_sp_port_vlans_add()
454 const char *mac, u16 vid, bool adding, in mlxsw_sp_port_fdb_op() argument
462 if (!vid) in mlxsw_sp_port_fdb_op()
463 vid = mlxsw_sp_port->pvid; in mlxsw_sp_port_fdb_op()
475 mac, vid, MLXSW_REG_SFD_REC_ACTION_NOP, in mlxsw_sp_port_fdb_op()
492 return mlxsw_sp_port_fdb_op(mlxsw_sp_port, fdb->addr, fdb->vid, in mlxsw_sp_port_fdb_static_add()
525 u16 vid; in mlxsw_sp_port_kill_vids() local
528 for (vid = vid_begin; vid <= vid_end; vid++) { in mlxsw_sp_port_kill_vids()
529 err = mlxsw_sp_port_kill_vid(dev, 0, vid); in mlxsw_sp_port_kill_vids()
541 u16 vid, vid_e; in __mlxsw_sp_port_vlans_del() local
551 for (vid = vid_begin; vid <= vid_end; in __mlxsw_sp_port_vlans_del()
552 vid += MLXSW_REG_SPVM_REC_MAX_COUNT) { in __mlxsw_sp_port_vlans_del()
553 vid_e = min((u16) (vid + MLXSW_REG_SPVM_REC_MAX_COUNT - 1), in __mlxsw_sp_port_vlans_del()
555 err = mlxsw_sp_port_vlan_set(mlxsw_sp_port, vid, vid_e, false, in __mlxsw_sp_port_vlans_del()
559 vid, vid_e); in __mlxsw_sp_port_vlans_del()
572 vid); in __mlxsw_sp_port_vlans_del()
587 for (vid = vid_begin; vid <= vid_end; vid++) { in __mlxsw_sp_port_vlans_del()
589 err = mlxsw_sp_port_fid_unmap(mlxsw_sp_port, vid); in __mlxsw_sp_port_vlans_del()
591 netdev_err(dev, "Failed to unmap FID=%d", vid); in __mlxsw_sp_port_vlans_del()
598 for (vid = vid_begin; vid <= vid_end; vid++) in __mlxsw_sp_port_vlans_del()
599 clear_bit(vid, mlxsw_sp_port->active_vlans); in __mlxsw_sp_port_vlans_del()
615 return mlxsw_sp_port_fdb_op(mlxsw_sp_port, fdb->addr, fdb->vid, in mlxsw_sp_port_fdb_static_del()
648 u16 vid; in mlxsw_sp_port_fdb_dump() local
678 mlxsw_reg_sfd_uc_unpack(sfd_pl, i, mac, &vid, in mlxsw_sp_port_fdb_dump()
683 fdb->vid = vid; in mlxsw_sp_port_fdb_dump()
701 u16 vid; in mlxsw_sp_port_vlan_dump() local
704 for_each_set_bit(vid, mlxsw_sp_port->active_vlans, VLAN_N_VID) { in mlxsw_sp_port_vlan_dump()
706 if (vid == mlxsw_sp_port->pvid) in mlxsw_sp_port_vlan_dump()
708 vlan->vid_begin = vid; in mlxsw_sp_port_vlan_dump()
709 vlan->vid_end = vid; in mlxsw_sp_port_vlan_dump()
756 u16 vid; in mlxsw_sp_fdb_notify_mac_process() local
759 mlxsw_reg_sfn_mac_unpack(sfn_pl, rec_index, mac, &vid, &local_port); in mlxsw_sp_fdb_notify_mac_process()
766 err = mlxsw_sp_port_fdb_op(mlxsw_sp_port, mac, vid, in mlxsw_sp_fdb_notify_mac_process()
779 info.vid = vid; in mlxsw_sp_fdb_notify_mac_process()