diff options
| author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2019-05-16 17:30:55 +0000 |
|---|---|---|
| committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2019-05-16 17:30:55 +0000 |
| commit | 5fd5a4bb46f60e61bf57dc7cdef59d413987baa3 (patch) | |
| tree | b529847907e1f5fa245926555b42f830d3136e06 /sys/dev/mlx5 | |
| parent | a8dca8952a7f559788baa094cb92a1c4e1955a8d (diff) | |
Notes
Diffstat (limited to 'sys/dev/mlx5')
| -rw-r--r-- | sys/dev/mlx5/device.h | 6 | ||||
| -rw-r--r-- | sys/dev/mlx5/driver.h | 2 | ||||
| -rw-r--r-- | sys/dev/mlx5/mlx5_core/mlx5_fw.c | 14 |
3 files changed, 22 insertions, 0 deletions
diff --git a/sys/dev/mlx5/device.h b/sys/dev/mlx5/device.h index ed9323561d81..8efac5a3f267 100644 --- a/sys/dev/mlx5/device.h +++ b/sys/dev/mlx5/device.h @@ -1048,6 +1048,12 @@ enum mlx5_mcam_feature_groups { MLX5_GET(qos_cap,\ mdev->hca_caps_max[MLX5_CAP_QOS], cap) +#define MLX5_CAP_PCAM_FEATURE(mdev, fld) \ + MLX5_GET(pcam_reg, (mdev)->caps.pcam, feature_cap_mask.enhanced_features.fld) + +#define MLX5_CAP_MCAM_FEATURE(mdev, fld) \ + MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_feature_cap_mask.enhanced_features.fld) + #define MLX5_CAP_QCAM_REG(mdev, fld) \ MLX5_GET(qcam_reg, (mdev)->caps.qcam, qos_access_reg_cap_mask.reg_cap.fld) diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h index 0530b0ffddb8..c46acda825ec 100644 --- a/sys/dev/mlx5/driver.h +++ b/sys/dev/mlx5/driver.h @@ -673,6 +673,8 @@ struct mlx5_core_dev { u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; struct { + u32 pcam[MLX5_ST_SZ_DW(pcam_reg)]; + u32 mcam[MLX5_ST_SZ_DW(mcam_reg)]; u32 qcam[MLX5_ST_SZ_DW(qcam_reg)]; u32 fpga[MLX5_ST_SZ_DW(fpga_cap)]; } caps; diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fw.c b/sys/dev/mlx5/mlx5_core/mlx5_fw.c index 31962cad8212..94597b6d421e 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fw.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fw.c @@ -117,6 +117,20 @@ static int mlx5_get_qcam_reg(struct mlx5_core_dev *dev) MLX5_QCAM_REGS_FIRST_128); } +static int mlx5_get_pcam_reg(struct mlx5_core_dev *dev) +{ + return mlx5_query_pcam_reg(dev, dev->caps.pcam, + MLX5_PCAM_FEATURE_ENHANCED_FEATURES, + MLX5_PCAM_REGS_5000_TO_507F); +} + +static int mlx5_get_mcam_reg(struct mlx5_core_dev *dev) +{ + return mlx5_query_mcam_reg(dev, dev->caps.mcam, + MLX5_MCAM_FEATURE_ENHANCED_FEATURES, + MLX5_MCAM_REGS_FIRST_128); +} + int mlx5_query_hca_caps(struct mlx5_core_dev *dev) { int err; |
