DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rongqiang XIE <xie.rongqiang@zte.com.cn>
To: bruce.richardson@intel.com
Cc: dev@dpdk.org, Rongqiang XIE <xie.rongqiang@zte.com.cn>
Subject: [dpdk-dev] [PATCH] lib/lib_eal:add mellanox kernel driver type
Date: Wed, 23 Aug 2017 10:48:01 +0800	[thread overview]
Message-ID: <201708230251.v7N2pSSi009414@mse01.zte.com.cn> (raw)

When use bond function in mellanox driver environment, we call the
find_port_id_by_pci_addr() function,if we don't add mellanox kernel
driver type in enum rte_kernel_driver, the function will return -1
because kdrv unknown, so we add the mellanox driver type, and when
scan the pci, fill the kdrv to fix this problem.

Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
---
 lib/librte_eal/common/include/rte_dev.h | 2 ++
 lib/librte_eal/linuxapp/eal/eal_pci.c   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 5386d3a..067ad07 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -123,6 +123,8 @@ enum rte_kernel_driver {
 	RTE_KDRV_VFIO,
 	RTE_KDRV_UIO_GENERIC,
 	RTE_KDRV_NIC_UIO,
+	RTE_KDRV_MLX4,
+	RTE_KDRV_MLX5,
 	RTE_KDRV_NONE,
 };
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 8951ce7..31c8ec1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -349,6 +349,10 @@
 			dev->kdrv = RTE_KDRV_IGB_UIO;
 		else if (!strcmp(driver, "uio_pci_generic"))
 			dev->kdrv = RTE_KDRV_UIO_GENERIC;
+		else if (!strcmp(driver, "mlx4_core"))
+			dev->kdrv = RTE_KDRV_MLX4;
+		else if (!strcmp(driver, "mlx5_core"))
+			dev->kdrv = RTE_KDRV_MLX5;
 		else
 			dev->kdrv = RTE_KDRV_UNKNOWN;
 	} else
-- 
1.8.3.1

             reply	other threads:[~2017-08-23  2:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23  2:48 Rongqiang XIE [this message]
2017-08-23  8:04 ` Gaëtan Rivet
2017-10-09 17:27   ` Thomas Monjalon
  -- strict thread matches above, loose matches on Subject: below --
2017-08-23  1:57 Rongqiang XIE

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=201708230251.v7N2pSSi009414@mse01.zte.com.cn \
    --to=xie.rongqiang@zte.com.cn \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).