Skip to content

Commit cfdcbce

Browse files
Gal PressmanSaeed Mahameed
authored andcommitted
net/mlx5: Expose PCAM, MCAM registers infrastructure
PCAM: Ports capabilities mask register. MCAM: Management capabilities mask register. PCAM and MCAM registers will provide information regarding firmware support for different features, in order to avoid cases where new driver combined with old firmware results in syndromes (for ex. PCIe counters before this patchset). Signed-off-by: Gal Pressman <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8a27174 commit cfdcbce

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed

include/linux/mlx5/device.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,22 @@ enum mlx5_cap_type {
970970
MLX5_CAP_NUM
971971
};
972972

973+
enum mlx5_pcam_reg_groups {
974+
MLX5_PCAM_REGS_5000_TO_507F = 0x0,
975+
};
976+
977+
enum mlx5_pcam_feature_groups {
978+
MLX5_PCAM_FEATURE_ENHANCED_FEATURES = 0x0,
979+
};
980+
981+
enum mlx5_mcam_reg_groups {
982+
MLX5_MCAM_REGS_FIRST_128 = 0x0,
983+
};
984+
985+
enum mlx5_mcam_feature_groups {
986+
MLX5_MCAM_FEATURE_ENHANCED_FEATURES = 0x0,
987+
};
988+
973989
/* GET Dev Caps macros */
974990
#define MLX5_CAP_GEN(mdev, cap) \
975991
MLX5_GET(cmd_hca_cap, mdev->hca_caps_cur[MLX5_CAP_GENERAL], cap)

include/linux/mlx5/driver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,14 @@ enum {
121121
MLX5_REG_PVLC = 0x500f,
122122
MLX5_REG_PCMR = 0x5041,
123123
MLX5_REG_PMLP = 0x5002,
124+
MLX5_REG_PCAM = 0x507f,
124125
MLX5_REG_NODE_DESC = 0x6001,
125126
MLX5_REG_HOST_ENDIANNESS = 0x7004,
126127
MLX5_REG_MCIA = 0x9014,
127128
MLX5_REG_MLCR = 0x902b,
128129
MLX5_REG_MTPPS = 0x9053,
129130
MLX5_REG_MTPPSE = 0x9054,
131+
MLX5_REG_MCAM = 0x907f,
130132
};
131133

132134
enum mlx5_dcbx_oper_mode {

include/linux/mlx5/mlx5_ifc.h

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
826826
u8 nic_flow_table[0x1];
827827
u8 eswitch_flow_table[0x1];
828828
u8 early_vf_enable[0x1];
829-
u8 reserved_at_1a9[0x2];
829+
u8 mcam_reg[0x1];
830+
u8 pcam_reg[0x1];
830831
u8 local_ca_ack_delay[0x5];
831832
u8 port_module_event[0x1];
832833
u8 reserved_at_1b1[0x1];
@@ -7481,6 +7482,63 @@ struct mlx5_ifc_peir_reg_bits {
74817482
u8 error_type[0x8];
74827483
};
74837484

7485+
struct mlx5_ifc_pcam_enhanced_features_bits {
7486+
u8 reserved_at_0[0x7e];
7487+
7488+
u8 ppcnt_discard_group[0x1];
7489+
u8 ppcnt_statistical_group[0x1];
7490+
};
7491+
7492+
struct mlx5_ifc_pcam_reg_bits {
7493+
u8 reserved_at_0[0x8];
7494+
u8 feature_group[0x8];
7495+
u8 reserved_at_10[0x8];
7496+
u8 access_reg_group[0x8];
7497+
7498+
u8 reserved_at_20[0x20];
7499+
7500+
union {
7501+
u8 reserved_at_0[0x80];
7502+
} port_access_reg_cap_mask;
7503+
7504+
u8 reserved_at_c0[0x80];
7505+
7506+
union {
7507+
struct mlx5_ifc_pcam_enhanced_features_bits enhanced_features;
7508+
u8 reserved_at_0[0x80];
7509+
} feature_cap_mask;
7510+
7511+
u8 reserved_at_1c0[0xc0];
7512+
};
7513+
7514+
struct mlx5_ifc_mcam_enhanced_features_bits {
7515+
u8 reserved_at_0[0x7f];
7516+
7517+
u8 pcie_performance_group[0x1];
7518+
};
7519+
7520+
struct mlx5_ifc_mcam_reg_bits {
7521+
u8 reserved_at_0[0x8];
7522+
u8 feature_group[0x8];
7523+
u8 reserved_at_10[0x8];
7524+
u8 access_reg_group[0x8];
7525+
7526+
u8 reserved_at_20[0x20];
7527+
7528+
union {
7529+
u8 reserved_at_0[0x80];
7530+
} mng_access_reg_cap_mask;
7531+
7532+
u8 reserved_at_c0[0x80];
7533+
7534+
union {
7535+
struct mlx5_ifc_mcam_enhanced_features_bits enhanced_features;
7536+
u8 reserved_at_0[0x80];
7537+
} mng_feature_cap_mask;
7538+
7539+
u8 reserved_at_1c0[0x80];
7540+
};
7541+
74847542
struct mlx5_ifc_pcap_reg_bits {
74857543
u8 reserved_at_0[0x8];
74867544
u8 local_port[0x8];

0 commit comments

Comments
 (0)