All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matej Vido <vido@cesnet.cz>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: dev@dpdk.org, nhorman@tuxdriver.com, thomas.monjalon@6wind.com
Subject: Re: [RFC] drivers: advertise kmod dependencies in pmdinfo
Date: Tue, 30 Aug 2016 10:40:52 +0200	[thread overview]
Message-ID: <8dfb056d-7b71-4fae-72c5-ef47383619a2@cesnet.cz> (raw)
In-Reply-To: <1472217646-26219-1-git-send-email-olivier.matz@6wind.com>

On 26.08.2016 15:20, Olivier Matz wrote:

> 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>
> ---
>
> In this RFC, I supposed that all PCI drivers require a the loading of a
> uio/vfio module (except mlx*), this may be wrong.
> Comments are welcome!
>
>
>   buildtools/pmdinfogen/pmdinfogen.c      |  1 +
>   buildtools/pmdinfogen/pmdinfogen.h      |  1 +
>   drivers/crypto/qat/rte_qat_cryptodev.c  |  2 ++
>   drivers/net/bnx2x/bnx2x_ethdev.c        |  4 ++++
>   drivers/net/bnxt/bnxt_ethdev.c          |  2 ++
>   drivers/net/cxgbe/cxgbe_ethdev.c        |  2 ++
>   drivers/net/e1000/em_ethdev.c           |  2 ++
>   drivers/net/e1000/igb_ethdev.c          |  4 ++++
>   drivers/net/ena/ena_ethdev.c            |  2 ++
>   drivers/net/enic/enic_ethdev.c          |  2 ++
>   drivers/net/fm10k/fm10k_ethdev.c        |  2 ++
>   drivers/net/i40e/i40e_ethdev.c          |  2 ++
>   drivers/net/i40e/i40e_ethdev_vf.c       |  2 ++
>   drivers/net/ixgbe/ixgbe_ethdev.c        |  4 ++++
>   drivers/net/mlx4/mlx4.c                 |  2 ++
>   drivers/net/mlx5/mlx5.c                 |  3 +++
>   drivers/net/nfp/nfp_net.c               |  2 ++
>   drivers/net/qede/qede_ethdev.c          |  4 ++++
>   drivers/net/szedata2/rte_eth_szedata2.c |  2 ++
>   drivers/net/thunderx/nicvf_ethdev.c     |  2 ++
>   drivers/net/virtio/virtio_ethdev.c      |  2 ++
>   drivers/net/vmxnet3/vmxnet3_ethdev.c    |  2 ++
>   lib/librte_eal/common/include/rte_dev.h | 14 ++++++++++++++
>   tools/dpdk-pmdinfo.py                   |  5 ++++-
>   24 files changed, 69 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/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
> index 483d789..409e71f 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,
> +	"uio,igb_uio:uio,uio_pci_generic:vfio,vfio-pci");
Hi Olivier,

szedata2 doesn't require uio/vfio modules. Instead the following lines 
could be used:

+DRIVER_REGISTER_KMOD_DEP(RTE_SZEDATA2_DRIVER_NAME,
+	"combo6core,combov3,szedata2,szedata2_cv3");


Thanks,
Matej

[..]
> diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
> index 95789f9..b721dc3 100644
> --- a/lib/librte_eal/common/include/rte_dev.h
> +++ b/lib/librte_eal/common/include/rte_dev.h
> @@ -203,6 +203,20 @@ 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 list the name of kernel modules, separated by commas. The
> + * order is important. If several modules lists are possible, they are
> + * separated by colons.
> + *
> + * Example: "uio,igb_uio:uio,uio_pci_generic" means either "uio,igb_uio"
> + * or "uio,uio_pci_generic".
> + */
> +#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 3db9819..17bfed4 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:]

  reply	other threads:[~2016-08-30  8:40 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 13:20 [RFC] drivers: advertise kmod dependencies in pmdinfo Olivier Matz
2016-08-30  8:40 ` Matej Vido [this message]
2016-08-30  8:56   ` Olivier Matz
2016-08-30 13:23 ` [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 ` [PATCH] " Olivier Matz
2016-09-16  9:49   ` 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   ` [PATCH v2] " Olivier Matz
2016-11-22 10:27     ` Adrien Mazarguil
2016-11-22 10:31       ` Olivier Matz
2016-12-15 13:46     ` [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=8dfb056d-7b71-4fae-72c5-ef47383619a2@cesnet.cz \
    --to=vido@cesnet.cz \
    --cc=dev@dpdk.org \
    --cc=nhorman@tuxdriver.com \
    --cc=olivier.matz@6wind.com \
    --cc=thomas.monjalon@6wind.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.