aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/device.h
diff options
context:
space:
mode:
authorGal Pressman <galp@mellanox.com>2016-12-08 16:03:31 +0200
committerSaeed Mahameed <saeedm@mellanox.com>2017-01-19 23:19:59 +0200
commit71862561f3a62015a11de16d1c306481e8415c08 (patch)
tree857e6e11eca5f2b4beccfde120212b519daf22a8 /include/linux/mlx5/device.h
parentnet/mlx5: Implement PCAM, MCAM access register commands (diff)
downloadlinux-dev-71862561f3a62015a11de16d1c306481e8415c08.tar.xz
linux-dev-71862561f3a62015a11de16d1c306481e8415c08.zip
net/mlx5: Query and cache PCAM, MCAM registers on initialization
On load_one, we now cache our capabilities registers internally, similar to QUERY_HCA_CAP. Capabilities can later be queried using macros introduced in this patch. Signed-off-by: Gal Pressman <galp@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/device.h')
-rw-r--r--include/linux/mlx5/device.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 79f38e67fe2f..f21528abfb74 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -1081,6 +1081,12 @@ enum mlx5_mcam_feature_groups {
#define MLX5_CAP_QOS(mdev, cap)\
MLX5_GET(qos_cap, mdev->hca_caps_cur[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)
+
enum {
MLX5_CMD_STAT_OK = 0x0,
MLX5_CMD_STAT_INT_ERR = 0x1,