From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id 97EA29620 for ; Thu, 19 May 2016 12:52:57 +0200 (CEST) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so1.wedos.net (Postfix) with ESMTPSA id 3r9SZx1wyxzBY7; Thu, 19 May 2016 12:52:57 +0200 (CEST) Date: Thu, 19 May 2016 12:51:13 +0200 From: Jan Viktorin To: Neil Horman Cc: dev@dpdk.org, Bruce Richardson , Thomas Monjalon , Stephen Hemminger , Panu Matilainen Message-ID: <20160519125113.0b12ef9a@pcviktorin.fit.vutbr.cz> In-Reply-To: <1463605687-649-3-git-send-email-nhorman@tuxdriver.com> References: <1463605687-649-3-git-send-email-nhorman@tuxdriver.com> Organization: RehiveTech MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [dpdk-dev, PATCHv2, 2/4] drivers: Update driver registration macro usage X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 10:52:57 -0000 Hello Neil, just few notes... (sorry if you've recevied this twice, importing mbox files from patchwork always changes my default From: field) On Wed, 18 May 2016 17:08:05 -0400 Neil Horman wrote: > Modify the PMD_REGISTER_DRIVER macro, bifurcating it into two > (PMD_REGISTER_DRIVER_PDEV and PMD_REGISTER_DRIVER_VDEV. Both of these do the > same thing the origional macro did, but both add the definition of a string I could not find any of those: PMD_REGISTER_DRIVER_PDEV, PMD_REGISTER_DRIVER_VDEV in this patch. I think the message is misleading... I am interested as this may lead to merge conflicts when generalizing rte_pci_device/driver and stuff around it. > variable that informs interested parties of the name of the pmd, and the former > also defines an second string that holds the symbol name of the pci table that > is registered by this pmd. > > pmdinfo uses this information to extract hardware support from an object file > and create a json string to make hardware support info discoverable later. > > Signed-off-by: Neil Horman > CC: Bruce Richardson > CC: Thomas Monjalon > CC: Stephen Hemminger > CC: Panu Matilainen > > --- > drivers/Makefile | 2 ++ > drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 4 +++- > drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 4 +++- > drivers/crypto/null/null_crypto_pmd.c | 4 +++- > drivers/crypto/qat/rte_qat_cryptodev.c | 4 +++- > drivers/crypto/snow3g/rte_snow3g_pmd.c | 4 +++- > drivers/net/af_packet/rte_eth_af_packet.c | 4 +++- > drivers/net/bnx2x/bnx2x_ethdev.c | 6 ++++-- > drivers/net/bonding/rte_eth_bond_pmd.c | 7 ++++++- > drivers/net/cxgbe/cxgbe_ethdev.c | 4 +++- > drivers/net/e1000/em_ethdev.c | 3 ++- > drivers/net/e1000/igb_ethdev.c | 6 ++++-- > drivers/net/ena/ena_ethdev.c | 3 ++- > drivers/net/enic/enic_ethdev.c | 3 ++- > drivers/net/fm10k/fm10k_ethdev.c | 3 ++- > drivers/net/i40e/i40e_ethdev.c | 3 ++- > drivers/net/i40e/i40e_ethdev_vf.c | 3 ++- > drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++-- > drivers/net/mlx4/mlx4.c | 3 ++- > drivers/net/mlx5/mlx5.c | 3 ++- > drivers/net/mpipe/mpipe_tilegx.c | 4 ++-- > drivers/net/nfp/nfp_net.c | 3 ++- > drivers/net/null/rte_eth_null.c | 3 ++- > drivers/net/pcap/rte_eth_pcap.c | 4 +++- > drivers/net/ring/rte_eth_ring.c | 3 ++- > drivers/net/szedata2/rte_eth_szedata2.c | 3 ++- > drivers/net/vhost/rte_eth_vhost.c | 3 ++- > drivers/net/virtio/virtio_ethdev.c | 3 ++- > drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++- > drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +- > lib/librte_eal/common/include/rte_dev.h | 20 ++++++++++++++++---- > 31 files changed, 93 insertions(+), 37 deletions(-) > [...] > > -PMD_REGISTER_DRIVER(pmd_xenvirt_drv); > +PMD_REGISTER_DRIVER(pmd_xenvirt_drv, xenvirt); > diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h > index f1b5507..871089a 100644 > --- a/lib/librte_eal/common/include/rte_dev.h > +++ b/lib/librte_eal/common/include/rte_dev.h > @@ -48,7 +48,7 @@ extern "C" { > > #include > #include > - > +#include This should be done in an opposite way. The rte_pci.h should include rte_dev.h (more specific includes a generic one). I've introduced this in the following patch: [PATCH v1 01/28] eal: make enum rte_kernel_driver non-PCI specific http://dpdk.org/dev/patchwork/patch/12488/ Regards Jan > #include > > __attribute__((format(printf, 2, 0))) > @@ -178,12 +178,24 @@ int rte_eal_vdev_init(const char *name, const char *args); > */ > int rte_eal_vdev_uninit(const char *name); > > -#define PMD_REGISTER_DRIVER(d)\ > +#define DRIVER_EXPORT_NAME_ARRAY(n, idx) n##idx[] __attribute__((used)) > + > +#define DRIVER_EXPORT_NAME(d, idx) \ > +static const char DRIVER_EXPORT_NAME_ARRAY(this_pmd_name, idx) = RTE_STR(d);\ > + > +#define PMD_REGISTER_DRIVER(d, n)\ > void devinitfn_ ##d(void);\ > void __attribute__((constructor, used)) devinitfn_ ##d(void)\ > {\ > - rte_eal_driver_register(&d);\ > -} > + rte_eal_driver_register(&d);\ > +}\ > +DRIVER_EXPORT_NAME(n, __COUNTER__) > + > +#define DRIVER_REGISTER_PCI_TABLE(n, t) \ > +static const char n##_pci_tbl_export[] __attribute__((used)) = RTE_STR(t) > + > +#define DRIVER_REGISTER_PARAM_STRING(n, s) \ > +static const char n##_param_string_export[] __attribute__((used)) = s > > #ifdef __cplusplus > } -- Jan Viktorin E-mail: Viktorin@RehiveTech.com System Architect Web: www.RehiveTech.com RehiveTech Brno, Czech Republic