net/mlx5: add macros for file name and path
authorTal Shnaiderman <talshn@nvidia.com>
Mon, 28 Dec 2020 12:32:29 +0000 (14:32 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 15:03:07 +0000 (16:03 +0100)
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
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/windows/mlx5_os.h [new file with mode: 0644]

index 759def2..f38c2f3 100644 (file)
@@ -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 | \
index a9db597..e579474 100644 (file)
@@ -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;
diff --git a/drivers/net/mlx5/windows/mlx5_os.h b/drivers/net/mlx5/windows/mlx5_os.h
new file mode 100644 (file)
index 0000000..b94f588
--- /dev/null
@@ -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_ */