summaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5
diff options
context:
space:
mode:
authorHuy Nguyen <huyn@mellanox.com>2019-06-28 22:35:58 +0000
committerSaeed Mahameed <saeedm@mellanox.com>2019-07-01 16:40:30 -0700
commit386e75af995c3aec475a2185b919bf46af396bfc (patch)
tree3644dc088dd1d067c21177365c34b703eda72be4 /include/linux/mlx5
parentb8ca123860ee556a8d42ab8c5c2afa469817a813 (diff)
downloadlinux-386e75af995c3aec475a2185b919bf46af396bfc.tar.gz
linux-386e75af995c3aec475a2185b919bf46af396bfc.tar.bz2
linux-386e75af995c3aec475a2185b919bf46af396bfc.zip
net/mlx5: Rename mlx5_pci_dev_type to mlx5_coredev_type
Rename mlx5_pci_dev_type to mlx5_coredev_type to distinguish different mlx5 device types. mlx5_coredev_type represents mlx5_core_dev instance type. Hence keep mlx5_coredev_type in mlx5_core_dev structure. Signed-off-by: Huy Nguyen <huyn@mellanox.com> Signed-off-by: Vu Pham <vuhuong@mellanox.com> Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r--include/linux/mlx5/driver.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 2ff624a91e3d..155b8cbe1cc9 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -182,6 +182,11 @@ enum port_state_policy {
MLX5_POLICY_INVALID = 0xffffffff
};
+enum mlx5_coredev_type {
+ MLX5_COREDEV_PF,
+ MLX5_COREDEV_VF
+};
+
struct mlx5_field_desc {
struct dentry *dent;
int i;
@@ -567,7 +572,6 @@ struct mlx5_priv {
struct mlx5_core_sriov sriov;
struct mlx5_lag *lag;
struct mlx5_devcom *devcom;
- unsigned long pci_dev_data;
struct mlx5_core_roce roce;
struct mlx5_fc_stats fc_stats;
struct mlx5_rl_table rl_table;
@@ -646,6 +650,7 @@ struct mlx5_vxlan;
struct mlx5_core_dev {
struct device *device;
+ enum mlx5_coredev_type coredev_type;
struct pci_dev *pdev;
/* sync pci state */
struct mutex pci_status_mutex;
@@ -1079,9 +1084,9 @@ enum {
MLX5_PCI_DEV_IS_VF = 1 << 0,
};
-static inline int mlx5_core_is_pf(struct mlx5_core_dev *dev)
+static inline bool mlx5_core_is_pf(struct mlx5_core_dev *dev)
{
- return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF);
+ return dev->coredev_type == MLX5_COREDEV_PF;
}
static inline bool mlx5_core_is_ecpf(struct mlx5_core_dev *dev)