@@ -883,6 +883,99 @@ static inline void mlxsw_reg_spmlr_pack(char *payload, u8 local_port,
883
883
mlxsw_reg_spmlr_learn_mode_set (payload , mode );
884
884
}
885
885
886
+ /* SVFA - Switch VID to FID Allocation Register
887
+ * --------------------------------------------
888
+ * Controls the VID to FID mapping and {Port, VID} to FID mapping for
889
+ * virtualized ports.
890
+ */
891
+ #define MLXSW_REG_SVFA_ID 0x201C
892
+ #define MLXSW_REG_SVFA_LEN 0x10
893
+
894
+ static const struct mlxsw_reg_info mlxsw_reg_svfa = {
895
+ .id = MLXSW_REG_SVFA_ID ,
896
+ .len = MLXSW_REG_SVFA_LEN ,
897
+ };
898
+
899
+ /* reg_svfa_swid
900
+ * Switch partition ID.
901
+ * Access: Index
902
+ */
903
+ MLXSW_ITEM32 (reg , svfa , swid , 0x00 , 24 , 8 );
904
+
905
+ /* reg_svfa_local_port
906
+ * Local port number.
907
+ * Access: Index
908
+ *
909
+ * Note: Reserved for 802.1Q FIDs.
910
+ */
911
+ MLXSW_ITEM32 (reg , svfa , local_port , 0x00 , 16 , 8 );
912
+
913
+ enum mlxsw_reg_svfa_mt {
914
+ MLXSW_REG_SVFA_MT_VID_TO_FID ,
915
+ MLXSW_REG_SVFA_MT_PORT_VID_TO_FID ,
916
+ };
917
+
918
+ /* reg_svfa_mapping_table
919
+ * Mapping table:
920
+ * 0 - VID to FID
921
+ * 1 - {Port, VID} to FID
922
+ * Access: Index
923
+ *
924
+ * Note: Reserved for SwitchX-2.
925
+ */
926
+ MLXSW_ITEM32 (reg , svfa , mapping_table , 0x00 , 8 , 3 );
927
+
928
+ /* reg_svfa_v
929
+ * Valid.
930
+ * Valid if set.
931
+ * Access: RW
932
+ *
933
+ * Note: Reserved for SwitchX-2.
934
+ */
935
+ MLXSW_ITEM32 (reg , svfa , v , 0x00 , 0 , 1 );
936
+
937
+ /* reg_svfa_fid
938
+ * Filtering ID.
939
+ * Access: RW
940
+ */
941
+ MLXSW_ITEM32 (reg , svfa , fid , 0x04 , 16 , 16 );
942
+
943
+ /* reg_svfa_vid
944
+ * VLAN ID.
945
+ * Access: Index
946
+ */
947
+ MLXSW_ITEM32 (reg , svfa , vid , 0x04 , 0 , 12 );
948
+
949
+ /* reg_svfa_counter_set_type
950
+ * Counter set type for flow counters.
951
+ * Access: RW
952
+ *
953
+ * Note: Reserved for SwitchX-2.
954
+ */
955
+ MLXSW_ITEM32 (reg , svfa , counter_set_type , 0x08 , 24 , 8 );
956
+
957
+ /* reg_svfa_counter_index
958
+ * Counter index for flow counters.
959
+ * Access: RW
960
+ *
961
+ * Note: Reserved for SwitchX-2.
962
+ */
963
+ MLXSW_ITEM32 (reg , svfa , counter_index , 0x08 , 0 , 24 );
964
+
965
+ static inline void mlxsw_reg_svfa_pack (char * payload , u8 local_port ,
966
+ enum mlxsw_reg_svfa_mt mt , bool valid ,
967
+ u16 fid , u16 vid )
968
+ {
969
+ MLXSW_REG_ZERO (svfa , payload );
970
+ local_port = mt == MLXSW_REG_SVFA_MT_VID_TO_FID ? 0 : local_port ;
971
+ mlxsw_reg_svfa_swid_set (payload , 0 );
972
+ mlxsw_reg_svfa_local_port_set (payload , local_port );
973
+ mlxsw_reg_svfa_mapping_table_set (payload , mt );
974
+ mlxsw_reg_svfa_v_set (payload , valid );
975
+ mlxsw_reg_svfa_fid_set (payload , fid );
976
+ mlxsw_reg_svfa_vid_set (payload , vid );
977
+ }
978
+
886
979
/* SFMR - Switch FID Management Register
887
980
* -------------------------------------
888
981
* Creates and configures FIDs.
@@ -2146,6 +2239,8 @@ static inline const char *mlxsw_reg_id_str(u16 reg_id)
2146
2239
return "SFTR" ;
2147
2240
case MLXSW_REG_SPMLR_ID :
2148
2241
return "SPMLR" ;
2242
+ case MLXSW_REG_SVFA_ID :
2243
+ return "SVFA" ;
2149
2244
case MLXSW_REG_SFMR_ID :
2150
2245
return "SFMR" ;
2151
2246
case MLXSW_REG_PMLP_ID :
0 commit comments