[02/35] mlx5/windows: add mlx5 macros for fs name and path
Checks
Commit Message
From: Ophir Munk <ophirmu@nvidia.com>
ibdev_name and ibdev_path sizes are defined in Windows DevX differently from the
sizes used in Linux with IBV_SYSFS_NAME_MAX and IBV_SYSFS_PATH_MAX.
Added MLX5_FS_NAME_MAX and MLX5_FS_NAME_PATH in mlx5_os.h for both OSs.
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/linux/mlx5_os.h | 4 ++--
drivers/net/mlx5/mlx5.h | 4 ++--
drivers/net/mlx5/windows/mlx5_os.h | 17 +++++++++++++++++
3 files changed, 21 insertions(+), 4 deletions(-)
create mode 100644 drivers/net/mlx5/windows/mlx5_os.h
@@ -10,8 +10,8 @@
/* verb enumerations translations to local enums. */
enum {
- DEV_SYSFS_NAME_MAX = IBV_SYSFS_NAME_MAX + 1,
- DEV_SYSFS_PATH_MAX = IBV_SYSFS_PATH_MAX + 1
+ MLX5_FS_NAME_MAX = IBV_SYSFS_NAME_MAX + 1,
+ MLX5_FS_PATH_MAX = IBV_SYSFS_PATH_MAX + 1
};
#define PCI_DRV_FLAGS (RTE_PCI_DRV_INTR_LSC | \
@@ -701,8 +701,8 @@ struct mlx5_dev_ctx_shared {
void *pd; /* Protection Domain. */
uint32_t pdn; /* Protection Domain number. */
uint32_t tdn; /* Transport Domain number. */
- char ibdev_name[DEV_SYSFS_NAME_MAX]; /* SYSFS dev name. */
- char ibdev_path[DEV_SYSFS_PATH_MAX]; /* SYSFS dev path for secondary */
+ char ibdev_name[MLX5_FS_NAME_MAX]; /* SYSFS dev name. */
+ char ibdev_path[MLX5_FS_PATH_MAX]; /* SYSFS dev path for secondary */
struct mlx5_dev_attr device_attr; /* Device properties. */
int numa_node; /* Numa node of backing physical device. */
LIST_ENTRY(mlx5_dev_ctx_shared) mem_event_cb;
new file mode 100644
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2020 Mellanox Technologies, Ltd
+ */
+
+#ifndef RTE_PMD_MLX5_OS_H_
+#define RTE_PMD_MLX5_OS_H_
+
+#include "mlx5_win_ext.h"
+
+enum {
+ MLX5_FS_NAME_MAX = MLX5_DEVX_DEVICE_NAME_SIZE + 1,
+ MLX5_FS_PATH_MAX = MLX5_DEVX_DEVICE_PNP_SIZE + 1
+};
+
+#define PCI_DRV_FLAGS 0
+
+#endif /* RTE_PMD_MLX5_OS_H_ */