From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org, nhorman@tuxdriver.com
Cc: thomas.monjalon@6wind.com, vido@cesnet.cz, fiona.trahe@intel.com,
stephen@networkplumber.org
Subject: [dpdk-dev] [PATCH] drivers: advertise kmod dependencies in pmdinfo
Date: Thu, 15 Sep 2016 16:22:35 +0200 [thread overview]
Message-ID: <1473949355-6787-1-git-send-email-olivier.matz@6wind.com> (raw)
In-Reply-To: <1472217646-26219-1-git-send-email-olivier.matz@6wind.com>
Add a new macro DRIVER_REGISTER_KMOD_DEP() that allows a driver to
declare the list of kernel modules required to run properly.
Today, most PCI drivers require uio/vfio.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
rfc -> v1:
- the kmod information can be per-device using a modalias-like
pattern
- change syntax to use '&' and '|' instead of ',' and ':'
- remove useless prerequisites in kmod lis: no need to
specify both uio and uio_pci_generic, only the latter is
required
- update kmod list in szedata2 driver
- remove kmod list in qat driver: it requires more than just loading
a kmod, which is described in documentation
buildtools/pmdinfogen/pmdinfogen.c | 1 +
buildtools/pmdinfogen/pmdinfogen.h | 1 +
drivers/net/bnx2x/bnx2x_ethdev.c | 2 ++
drivers/net/bnxt/bnxt_ethdev.c | 1 +
drivers/net/cxgbe/cxgbe_ethdev.c | 1 +
drivers/net/e1000/em_ethdev.c | 1 +
drivers/net/e1000/igb_ethdev.c | 2 ++
drivers/net/ena/ena_ethdev.c | 1 +
drivers/net/enic/enic_ethdev.c | 1 +
drivers/net/fm10k/fm10k_ethdev.c | 1 +
drivers/net/i40e/i40e_ethdev.c | 1 +
drivers/net/i40e/i40e_ethdev_vf.c | 1 +
drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
drivers/net/mlx4/mlx4.c | 1 +
drivers/net/mlx5/mlx5.c | 1 +
drivers/net/nfp/nfp_net.c | 1 +
drivers/net/qede/qede_ethdev.c | 2 ++
drivers/net/szedata2/rte_eth_szedata2.c | 2 ++
drivers/net/thunderx/nicvf_ethdev.c | 1 +
drivers/net/virtio/virtio_ethdev.c | 1 +
drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
lib/librte_eal/common/include/rte_dev.h | 25 +++++++++++++++++++++++++
tools/dpdk-pmdinfo.py | 5 ++++-
23 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c
index e1bf2e4..1e5b6f3 100644
--- a/buildtools/pmdinfogen/pmdinfogen.c
+++ b/buildtools/pmdinfogen/pmdinfogen.c
@@ -269,6 +269,7 @@ struct opt_tag {
static const struct opt_tag opt_tags[] = {
{"_param_string_export", "params"},
+ {"_kmod_dep_export", "kmod"},
};
static int complete_pmd_entry(struct elf_info *info, struct pmd_driver *drv)
diff --git a/buildtools/pmdinfogen/pmdinfogen.h b/buildtools/pmdinfogen/pmdinfogen.h
index 1da2966..2fab2aa 100644
--- a/buildtools/pmdinfogen/pmdinfogen.h
+++ b/buildtools/pmdinfogen/pmdinfogen.h
@@ -85,6 +85,7 @@ else \
enum opt_params {
PMD_PARAM_STRING = 0,
+ PMD_KMOD_DEP,
PMD_OPT_MAX
};
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index f3ab355..e422388 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -667,5 +667,7 @@ static struct rte_driver rte_bnx2xvf_driver = {
PMD_REGISTER_DRIVER(rte_bnx2x_driver, bnx2x);
DRIVER_REGISTER_PCI_TABLE(bnx2x, pci_id_bnx2x_map);
+DRIVER_REGISTER_KMOD_DEP(bnx2x, "* igb_uio | uio_pci_generic | vfio");
PMD_REGISTER_DRIVER(rte_bnx2xvf_driver, bnx2xvf);
DRIVER_REGISTER_PCI_TABLE(bnx2xvf, pci_id_bnx2xvf_map);
+DRIVER_REGISTER_KMOD_DEP(bnx2xvf, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3795fac..cc9e2b2 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1068,3 +1068,4 @@ static struct rte_driver bnxt_pmd_drv = {
PMD_REGISTER_DRIVER(bnxt_pmd_drv, bnxt);
DRIVER_REGISTER_PCI_TABLE(bnxt, bnxt_pci_id_map);
+DRIVER_REGISTER_KMOD_DEP(bnxt, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 9208a61..4bdf0ea 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -1068,4 +1068,5 @@ static struct rte_driver rte_cxgbe_driver = {
PMD_REGISTER_DRIVER(rte_cxgbe_driver, cxgb4);
DRIVER_REGISTER_PCI_TABLE(cxgb4, cxgb4_pci_tbl);
+DRIVER_REGISTER_KMOD_DEP(cxgb4, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index ad104ed..7bb51d4 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1806,3 +1806,4 @@ struct rte_driver em_pmd_drv = {
PMD_REGISTER_DRIVER(em_pmd_drv, em);
DRIVER_REGISTER_PCI_TABLE(em, pci_id_em_map);
+DRIVER_REGISTER_KMOD_DEP(em, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 4e9e6a3..ba5f5e2 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -5257,5 +5257,7 @@ eth_igb_configure_msix_intr(struct rte_eth_dev *dev)
PMD_REGISTER_DRIVER(pmd_igb_drv, igb);
DRIVER_REGISTER_PCI_TABLE(igb, pci_id_igb_map);
+DRIVER_REGISTER_KMOD_DEP(igb, "* igb_uio | uio_pci_generic | vfio");
PMD_REGISTER_DRIVER(pmd_igbvf_drv, igbvf);
DRIVER_REGISTER_PCI_TABLE(igbvf, pci_id_igbvf_map);
+DRIVER_REGISTER_KMOD_DEP(igbvf, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index ac0803d..8c1ba69 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1709,3 +1709,4 @@ struct rte_driver ena_pmd_drv = {
PMD_REGISTER_DRIVER(ena_pmd_drv, ena);
DRIVER_REGISTER_PCI_TABLE(ena, pci_id_ena_map);
+DRIVER_REGISTER_KMOD_DEP(ena, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 47b07c9..6ef3a39 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -642,3 +642,4 @@ static struct rte_driver rte_enic_driver = {
PMD_REGISTER_DRIVER(rte_enic_driver, enic);
DRIVER_REGISTER_PCI_TABLE(enic, pci_id_enic_map);
+DRIVER_REGISTER_KMOD_DEP(enic, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 01f4a72..b1b3179 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3086,3 +3086,4 @@ static struct rte_driver rte_fm10k_driver = {
PMD_REGISTER_DRIVER(rte_fm10k_driver, fm10k);
DRIVER_REGISTER_PCI_TABLE(fm10k, pci_id_fm10k_map);
+DRIVER_REGISTER_KMOD_DEP(fm10k, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index d0aeb70..20b5fd4 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -723,6 +723,7 @@ static struct rte_driver rte_i40e_driver = {
PMD_REGISTER_DRIVER(rte_i40e_driver, i40e);
DRIVER_REGISTER_PCI_TABLE(i40e, pci_id_i40e_map);
+DRIVER_REGISTER_KMOD_DEP(i40e, "* igb_uio | uio_pci_generic | vfio");
/*
* Initialize registers for flexible payload, which should be set by NVM.
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index a616ae0..ccad3b5 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1586,6 +1586,7 @@ static struct rte_driver rte_i40evf_driver = {
PMD_REGISTER_DRIVER(rte_i40evf_driver, i40evf);
DRIVER_REGISTER_PCI_TABLE(i40evf, pci_id_i40evf_map);
+DRIVER_REGISTER_KMOD_DEP(i40evf, "* igb_uio | uio_pci_generic | vfio");
static int
i40evf_dev_configure(struct rte_eth_dev *dev)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index fb618ef..2b837dc 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -7421,5 +7421,7 @@ static struct rte_driver rte_ixgbevf_driver = {
PMD_REGISTER_DRIVER(rte_ixgbe_driver, ixgbe);
DRIVER_REGISTER_PCI_TABLE(ixgbe, pci_id_ixgbe_map);
+DRIVER_REGISTER_KMOD_DEP(ixgbe, "* igb_uio | uio_pci_generic | vfio");
PMD_REGISTER_DRIVER(rte_ixgbevf_driver, ixgbevf);
DRIVER_REGISTER_PCI_TABLE(ixgbevf, pci_id_ixgbevf_map);
+DRIVER_REGISTER_KMOD_DEP(ixgbevf, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 304c846..b211c37 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -5948,3 +5948,4 @@ static struct rte_driver rte_mlx4_driver = {
PMD_REGISTER_DRIVER(rte_mlx4_driver, mlx4);
DRIVER_REGISTER_PCI_TABLE(mlx4, mlx4_pci_id_map);
+DRIVER_REGISTER_KMOD_DEP(mlx4, "* ib_uverbs & mlx4_en & mlx4_ib");
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index d96a9af..05fc2e2 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -763,3 +763,4 @@ static struct rte_driver rte_mlx5_driver = {
PMD_REGISTER_DRIVER(rte_mlx5_driver, mlx5);
DRIVER_REGISTER_PCI_TABLE(mlx5, mlx5_pci_id_map);
+DRIVER_REGISTER_KMOD_DEP(mlx5, "* ib_uverbs & mlx5_ib");
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 82e3e4e..0d60baa 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2488,6 +2488,7 @@ static struct rte_driver rte_nfp_net_driver = {
PMD_REGISTER_DRIVER(rte_nfp_net_driver, nfp);
DRIVER_REGISTER_PCI_TABLE(nfp, pci_id_nfp_net_map);
+DRIVER_REGISTER_KMOD_DEP(nfp, "* igb_uio | uio_pci_generic | vfio");
/*
* Local variables:
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 82e44b8..ded45c8 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1530,5 +1530,7 @@ static struct rte_driver rte_qede_driver = {
PMD_REGISTER_DRIVER(rte_qede_driver, qede);
DRIVER_REGISTER_PCI_TABLE(qede, pci_id_qede_map);
+DRIVER_REGISTER_KMOD_DEP(qede, "* igb_uio | uio_pci_generic | vfio");
PMD_REGISTER_DRIVER(rte_qedevf_driver, qedevf);
DRIVER_REGISTER_PCI_TABLE(qedevf, pci_id_qedevf_map);
+DRIVER_REGISTER_KMOD_DEP(qedevf, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 483d789..dac0157 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1602,3 +1602,5 @@ static struct rte_driver rte_szedata2_driver = {
PMD_REGISTER_DRIVER(rte_szedata2_driver, RTE_SZEDATA2_DRIVER_NAME);
DRIVER_REGISTER_PCI_TABLE(RTE_SZEDATA2_DRIVER_NAME, rte_szedata2_pci_id_table);
+DRIVER_REGISTER_KMOD_DEP(RTE_SZEDATA2_DRIVER_NAME,
+ "* combo6core & combov3 & szedata2 & szedata2_cv3");
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 4f875c0..6d0af41 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1785,3 +1785,4 @@ static struct rte_driver rte_nicvf_driver = {
PMD_REGISTER_DRIVER(rte_nicvf_driver, thunderx_nicvf);
DRIVER_REGISTER_PCI_TABLE(thunderx_nicvf, pci_id_nicvf_map);
+DRIVER_REGISTER_KMOD_DEP(thunderx_nicvf, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 07d6449..3b6ce5e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1570,3 +1570,4 @@ static struct rte_driver rte_virtio_driver = {
PMD_REGISTER_DRIVER(rte_virtio_driver, virtio_net);
DRIVER_REGISTER_PCI_TABLE(virtio_net, pci_id_virtio_map);
+DRIVER_REGISTER_KMOD_DEP(virtio_net, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 5874215..feff79c 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -955,3 +955,4 @@ static struct rte_driver rte_vmxnet3_driver = {
PMD_REGISTER_DRIVER(rte_vmxnet3_driver, vmxnet3);
DRIVER_REGISTER_PCI_TABLE(vmxnet3, pci_id_vmxnet3_map);
+DRIVER_REGISTER_KMOD_DEP(vmxnet3, "* igb_uio | uio_pci_generic | vfio");
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 95789f9..1f3e0cc 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -203,6 +203,31 @@ RTE_STR(table)
static const char DRV_EXP_TAG(name, param_string_export)[] \
__attribute__((used)) = str
+/**
+ * Advertise the list of kernel modules required to run this driver
+ *
+ * This string lists the kernel modules required for the devices
+ * associated to a PMD. The format of each line of the string is:
+ * "<device-pattern> <kmod-expression>".
+ *
+ * The possible formats for the device pattern are:
+ * "*" all devices supported by this driver
+ * "pci:*" all PCI devices supported by this driver
+ * "pci:v8086:d*:sv*:sd*" all PCI devices supported by this driver
+ * whose vendor id is 0x8086.
+ *
+ * The format of the kernel modules list is a parenthesed expression
+ * containing logical-and (&) and logical-or (|).
+ *
+ * The device pattern and the kmod expression are separated by a space.
+ *
+ * Example:
+ * - "* igb_uio | uio_pci_generic | vfio"
+ */
+#define DRIVER_REGISTER_KMOD_DEP(name, str) \
+static const char DRV_EXP_TAG(name, kmod_dep_export)[] \
+__attribute__((used)) = str
+
#ifdef __cplusplus
}
#endif
diff --git a/tools/dpdk-pmdinfo.py b/tools/dpdk-pmdinfo.py
index dcc8db8..9ff76a2 100755
--- a/tools/dpdk-pmdinfo.py
+++ b/tools/dpdk-pmdinfo.py
@@ -312,7 +312,10 @@ class ReadElf(object):
global raw_output
global pcidb
- optional_pmd_info = [{'id': 'params', 'tag': 'PMD PARAMETERS'}]
+ optional_pmd_info = [
+ {'id': 'params', 'tag': 'PMD PARAMETERS'},
+ {'id': 'kmod', 'tag': 'PMD KMOD DEPENDENCIES'}
+ ]
i = mystring.index("=")
mystring = mystring[i + 2:]
--
2.8.1
next prev parent reply other threads:[~2016-09-15 14:22 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 13:20 [dpdk-dev] [RFC] " Olivier Matz
2016-08-30 8:40 ` Matej Vido
2016-08-30 8:56 ` Olivier Matz
2016-08-30 13:23 ` [dpdk-dev] [dpdk-dev, RFC] " Neil Horman
2016-08-31 9:21 ` Olivier Matz
2016-08-31 13:27 ` Neil Horman
2016-08-31 13:39 ` Olivier Matz
2016-09-01 12:55 ` Trahe, Fiona
2016-09-01 17:35 ` Neil Horman
2016-09-01 17:41 ` Stephen Hemminger
2016-09-01 19:15 ` Neil Horman
2016-09-02 9:19 ` Trahe, Fiona
2016-09-02 13:33 ` Neil Horman
2016-09-02 13:52 ` Trahe, Fiona
2016-09-02 14:15 ` Neil Horman
2016-09-02 16:13 ` Olivier Matz
2016-09-02 10:55 ` Thomas Monjalon
2016-09-15 14:22 ` Olivier Matz [this message]
2016-09-16 9:49 ` [dpdk-dev] [PATCH] " Trahe, Fiona
2016-09-16 14:26 ` David Marchand
2016-09-19 8:17 ` Bruce Richardson
2016-09-19 12:25 ` Olivier Matz
2016-11-22 9:50 ` [dpdk-dev] [PATCH v2] " Olivier Matz
2016-11-22 10:27 ` Adrien Mazarguil
2016-11-22 10:31 ` Olivier Matz
2016-12-15 13:46 ` [dpdk-dev] [PATCH v3] " Olivier Matz
2016-12-15 14:52 ` Ferruh Yigit
2016-12-16 9:36 ` Olivier Matz
2016-12-19 13:30 ` Thomas Monjalon
2016-12-15 16:09 ` Neil Horman
2016-12-15 17:22 ` Stephen Hemminger
2016-12-16 9:22 ` Olivier Matz
2016-12-16 12:37 ` Neil Horman
2016-12-16 13:04 ` Bruce Richardson
2016-12-16 14:19 ` Ferruh Yigit
2016-12-19 12:42 ` Neil Horman
2016-12-19 14:12 ` Ferruh Yigit
2016-12-16 8:23 ` Adrien Mazarguil
2016-12-20 17:26 ` Thomas Monjalon
2016-12-21 9:21 ` Andrew Rybchenko
2016-12-21 11:37 ` Neil Horman
2016-12-21 11:40 ` Andrew Rybchenko
2016-12-22 11:04 ` Ferruh Yigit
2016-12-22 11:35 ` Andrew Rybchenko
2016-12-22 12:07 ` Ferruh Yigit
2016-12-22 12:08 ` Andrew Rybchenko
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=1473949355-6787-1-git-send-email-olivier.matz@6wind.com \
--to=olivier.matz@6wind.com \
--cc=dev@dpdk.org \
--cc=fiona.trahe@intel.com \
--cc=nhorman@tuxdriver.com \
--cc=stephen@networkplumber.org \
--cc=thomas.monjalon@6wind.com \
--cc=vido@cesnet.cz \
/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).