DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@mellanox.com>
To: dev@dpdk.org, Matan Azrad <matan@mellanox.com>,
	Raslan Darawsheh <rasland@mellanox.com>
Cc: Ophir Munk <ophirmu@mellanox.com>
Subject: [dpdk-dev] [PATCH v1 7/8] net/mlx5: add mlx5 header file specific to Linux
Date: Wed,  3 Jun 2020 15:06:01 +0000
Message-ID: <20200603150602.4686-8-ophirmu@mellanox.com> (raw)
In-Reply-To: <20200603150602.4686-1-ophirmu@mellanox.com>

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 <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/Makefile        |  1 +
 drivers/net/mlx5/linux/mlx5_os.h | 18 ++++++++++++++++++
 drivers/net/mlx5/mlx5.c          |  3 +--
 drivers/net/mlx5/mlx5.h          |  5 +++--
 4 files changed, 23 insertions(+), 4 deletions(-)
 create mode 100644 drivers/net/mlx5/linux/mlx5_os.h

diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 115b66c..41ab73e 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 0000000..f310f17
--- /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 f62ad12..16ab8b0 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 f5d9aad..eca4472 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. */
-- 
2.8.4


  parent reply	other threads:[~2020-06-03 15:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 15:05 [dpdk-dev] [PATCH v1 0/8] mlx5 PMD multi OS support Ophir Munk
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 1/8] net/mlx5: rename mlx5 ibv shared struct Ophir Munk
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 2/8] net/mlx5: add mlx5 Linux specific file with getter functions Ophir Munk
2020-06-08 11:20   ` Ferruh Yigit
2020-06-09  8:40     ` Ophir Munk
2020-06-09  8:43       ` Ferruh Yigit
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 3/8] drivers: remove mlx5 protection domain dependency on ibv Ophir Munk
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 4/8] net/mlx5: remove attributes dependency on ibv and dv Ophir Munk
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 5/8] net/mlx5: remove umem field dependency on dv Ophir Munk
2020-06-03 15:06 ` [dpdk-dev] [PATCH v1 6/8] net/mlx5: refactor PCI probing under Linux Ophir Munk
2020-06-03 15:06 ` Ophir Munk [this message]
2020-06-08 11:31   ` [dpdk-dev] [PATCH v1 7/8] net/mlx5: add mlx5 header file specific to Linux Ferruh Yigit
2020-06-09  8:44     ` Ophir Munk
2020-06-09 11:48       ` Ferruh Yigit
2020-06-09 14:49         ` Ophir Munk
2020-06-03 15:06 ` [dpdk-dev] [PATCH v1 8/8] net/mlx5: remove ibv dependency in spawn struct Ophir Munk
2020-06-07  8:49 ` [dpdk-dev] [PATCH v1 0/8] mlx5 PMD multi OS support Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200603150602.4686-8-ophirmu@mellanox.com \
    --to=ophirmu@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=rasland@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git