From: Ophir Munk Date: Wed, 3 Jun 2020 15:06:01 +0000 (+0000) Subject: net/mlx5: add Linux-specific header file X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=10f3581dfddea87083527fe01f9bcb691bd16474;p=dpdk.git net/mlx5: add Linux-specific header file File drivers/net/linux/mlx5_os.h is added. It includes specific Linux definitions such as PCI driver flags, link state changes interrupts, link removal interrupts, etc. Signed-off-by: Ophir Munk Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index 115b66cc25..41ab73e5c9 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -41,6 +41,7 @@ CFLAGS += -g CFLAGS += -I$(RTE_SDK)/drivers/common/mlx5 CFLAGS += -I$(RTE_SDK)/drivers/common/mlx5/linux CFLAGS += -I$(RTE_SDK)/drivers/net/mlx5 +CFLAGS += -I$(RTE_SDK)/drivers/net/mlx5/linux CFLAGS += -I$(BUILDDIR)/drivers/common/mlx5 CFLAGS += -D_BSD_SOURCE CFLAGS += -D_DEFAULT_SOURCE diff --git a/drivers/net/mlx5/linux/mlx5_os.h b/drivers/net/mlx5/linux/mlx5_os.h new file mode 100644 index 0000000000..f310f17730 --- /dev/null +++ b/drivers/net/mlx5/linux/mlx5_os.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2015 6WIND S.A. + * Copyright 2020 Mellanox Technologies, Ltd + */ + +#ifndef RTE_PMD_MLX5_OS_H_ +#define RTE_PMD_MLX5_OS_H_ + +/* verb enumerations translations to local enums. */ +enum { + DEV_SYSFS_NAME_MAX = IBV_SYSFS_NAME_MAX, + DEV_SYSFS_PATH_MAX = IBV_SYSFS_PATH_MAX +}; + +#define PCI_DRV_FLAGS (RTE_PCI_DRV_INTR_LSC | \ + RTE_PCI_DRV_INTR_RMV | \ + RTE_PCI_DRV_PROBE_AGAIN) +#endif /* RTE_PMD_MLX5_OS_H_ */ diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index f62ad12a94..16ab8b0cf6 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -2114,8 +2114,7 @@ struct rte_pci_driver mlx5_driver = { .remove = mlx5_pci_remove, .dma_map = mlx5_dma_map, .dma_unmap = mlx5_dma_unmap, - .drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_INTR_RMV | - RTE_PCI_DRV_PROBE_AGAIN, + .drv_flags = PCI_DRV_FLAGS, }; /** diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index f5d9aad2f4..eca44725f6 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -41,6 +41,7 @@ #include "mlx5_defs.h" #include "mlx5_utils.h" +#include "mlx5_os.h" #include "mlx5_autoconf.h" enum mlx5_ipool_index { @@ -536,8 +537,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[IBV_SYSFS_NAME_MAX]; /* IB device name. */ - char ibdev_path[IBV_SYSFS_PATH_MAX]; /* IB device path for secondary */ + char ibdev_name[DEV_SYSFS_NAME_MAX]; /* SYSFS dev name. */ + char ibdev_path[DEV_SYSFS_PATH_MAX]; /* SYSFS dev path for secondary */ struct mlx5_dev_attr device_attr; /* Device properties. */ LIST_ENTRY(mlx5_dev_ctx_shared) mem_event_cb; /**< Called by memory event callback. */