Skip to content

Commit a7159a3

Browse files
committed
Merge branch 'mlxsw-bridge-vlan-offloading'
Ido Schimmel says: ==================== This patchset introduces support for the offloading of 802.1D bridges between VLAN devices. These can either be VLAN devices configured on top of the physical ports or on top of LAG devices. Patches 1-2 deal with the necessary infrastructure changes needed in order to enable the above. The main change is that switchdev drivers can now know the device from which the switchdev op originated from. Patches 3-10 lay the groundwork for 802.1D bridges support in the mlxsw driver, with patch 4 doing most of the heavy lifting. Patch 11 finally offloads these bridges to hardware by listening to the notifications sent when the VLAN device joins or leaves a bridge. It is very similar to the already existing 802.1Q bridge we support. Patches 12-14 add minor modifications to allow one to bridge a VLAN device configured on top of LAG. ==================== Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2 parents 335b320 + 272c447 commit a7159a3

File tree

14 files changed

+1001
-162
lines changed

14 files changed

+1001
-162
lines changed

drivers/net/ethernet/mellanox/mlxsw/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ config MLXSW_SWITCHX2
4141

4242
config MLXSW_SPECTRUM
4343
tristate "Mellanox Technologies Spectrum support"
44-
depends on MLXSW_CORE && NET_SWITCHDEV
44+
depends on MLXSW_CORE && NET_SWITCHDEV && VLAN_8021Q
4545
default m
4646
---help---
4747
This driver supports Mellanox Technologies Spectrum Ethernet

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -396,24 +396,24 @@ static inline void mlxsw_reg_sfd_rec_pack(char *payload, int rec_index,
396396

397397
static inline void mlxsw_reg_sfd_uc_pack(char *payload, int rec_index,
398398
enum mlxsw_reg_sfd_rec_policy policy,
399-
const char *mac, u16 vid,
399+
const char *mac, u16 fid_vid,
400400
enum mlxsw_reg_sfd_rec_action action,
401401
u8 local_port)
402402
{
403403
mlxsw_reg_sfd_rec_pack(payload, rec_index,
404404
MLXSW_REG_SFD_REC_TYPE_UNICAST,
405405
policy, mac, action);
406406
mlxsw_reg_sfd_uc_sub_port_set(payload, rec_index, 0);
407-
mlxsw_reg_sfd_uc_fid_vid_set(payload, rec_index, vid);
407+
mlxsw_reg_sfd_uc_fid_vid_set(payload, rec_index, fid_vid);
408408
mlxsw_reg_sfd_uc_system_port_set(payload, rec_index, local_port);
409409
}
410410

411411
static inline void mlxsw_reg_sfd_uc_unpack(char *payload, int rec_index,
412-
char *mac, u16 *p_vid,
412+
char *mac, u16 *p_fid_vid,
413413
u8 *p_local_port)
414414
{
415415
mlxsw_reg_sfd_rec_mac_memcpy_from(payload, rec_index, mac);
416-
*p_vid = mlxsw_reg_sfd_uc_fid_vid_get(payload, rec_index);
416+
*p_fid_vid = mlxsw_reg_sfd_uc_fid_vid_get(payload, rec_index);
417417
*p_local_port = mlxsw_reg_sfd_uc_system_port_get(payload, rec_index);
418418
}
419419

@@ -438,6 +438,13 @@ MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_sub_port, MLXSW_REG_SFD_BASE_LEN, 16, 8,
438438
MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_fid_vid, MLXSW_REG_SFD_BASE_LEN, 0, 16,
439439
MLXSW_REG_SFD_REC_LEN, 0x08, false);
440440

441+
/* reg_sfd_uc_lag_lag_vid
442+
* Indicates VID in case of vFIDs. Reserved for FIDs.
443+
* Access: RW
444+
*/
445+
MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_lag_vid, MLXSW_REG_SFD_BASE_LEN, 16, 12,
446+
MLXSW_REG_SFD_REC_LEN, 0x0C, false);
447+
441448
/* reg_sfd_uc_lag_lag_id
442449
* LAG Identifier - pointer into the LAG descriptor table.
443450
* Access: RW
@@ -448,15 +455,16 @@ MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_lag_id, MLXSW_REG_SFD_BASE_LEN, 0, 10,
448455
static inline void
449456
mlxsw_reg_sfd_uc_lag_pack(char *payload, int rec_index,
450457
enum mlxsw_reg_sfd_rec_policy policy,
451-
const char *mac, u16 vid,
452-
enum mlxsw_reg_sfd_rec_action action,
458+
const char *mac, u16 fid_vid,
459+
enum mlxsw_reg_sfd_rec_action action, u16 lag_vid,
453460
u16 lag_id)
454461
{
455462
mlxsw_reg_sfd_rec_pack(payload, rec_index,
456463
MLXSW_REG_SFD_REC_TYPE_UNICAST_LAG,
457464
policy, mac, action);
458465
mlxsw_reg_sfd_uc_lag_sub_port_set(payload, rec_index, 0);
459-
mlxsw_reg_sfd_uc_lag_fid_vid_set(payload, rec_index, vid);
466+
mlxsw_reg_sfd_uc_lag_fid_vid_set(payload, rec_index, fid_vid);
467+
mlxsw_reg_sfd_uc_lag_lag_vid_set(payload, rec_index, lag_vid);
460468
mlxsw_reg_sfd_uc_lag_lag_id_set(payload, rec_index, lag_id);
461469
}
462470

0 commit comments

Comments
 (0)