From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Jan Blunck <jblunck@infradead.org>
Cc: <dev@dpdk.org>, <david.marchand@6wind.com>
Subject: Re: [dpdk-dev] [PATCH v2 3/8] drivers: Use ETH_DEV_PCI_DEV() helper
Date: Tue, 22 Nov 2016 16:51:52 +0530 [thread overview]
Message-ID: <efee5fcf-c987-4866-4671-479b0fc5c12a@nxp.com> (raw)
In-Reply-To: <1479747322-5774-3-git-send-email-jblunck@infradead.org>
On Monday 21 November 2016 10:25 PM, Jan Blunck wrote:
> The drivers should not directly access the rte_eth_dev->pci_dev but use
> a macro instead. This is a preparation for replacing the pci_dev with
> a struct rte_device member in the future.
>
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
> ---
> drivers/net/bnxt/bnxt_ethdev.c | 19 ++++++-----
> drivers/net/bnxt/bnxt_ring.c | 11 +++---
> drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
> drivers/net/e1000/em_ethdev.c | 20 ++++++-----
> drivers/net/e1000/igb_ethdev.c | 50 +++++++++++++++------------
> drivers/net/e1000/igb_pf.c | 3 +-
> drivers/net/ena/ena_ethdev.c | 2 +-
> drivers/net/enic/enic_ethdev.c | 2 +-
> drivers/net/fm10k/fm10k_ethdev.c | 49 ++++++++++++++-------------
I found a couple of placed in the fm10k_ethdev file where pci_dev usage
can be replaced with ETH_DEV_PCI_DEV() macro. For example,
- fm10k_dev_tx_init() +681,
- fm10k_set_tx_function +2774
Can you please check once again?
> drivers/net/i40e/i40e_ethdev.c | 44 ++++++++++++------------
> drivers/net/i40e/i40e_ethdev.h | 4 +++
> drivers/net/i40e/i40e_ethdev_vf.c | 38 ++++++++++-----------
> drivers/net/ixgbe/ixgbe_ethdev.c | 65 +++++++++++++++++++++---------------
> drivers/net/ixgbe/ixgbe_pf.c | 2 +-
> drivers/net/qede/qede_ethdev.c | 17 +++++-----
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 +--
> 16 files changed, 185 insertions(+), 147 deletions(-)
Some changes in szedata2 are also on similar lines:
- rte_szedata2_eth_dev_init +1419, +1420, ... <More>
- rte_szedata2_eth_dev_uninit
Some changes in nicvf_ethdev.c also are missing, I think:
- nicvf_eth_dev_init +1980
- nicvf_dev_info_get +1350
and nfp/nfp_net.c
- nfp_net_init(), +2333, +2403
- nfp_net_close, +718, +737
- nfp_net_dev_link_status_print
- nfp_net_irq_unmask, +1161
and bnx2x_ethdev.c
- bnx2x_common_dev_init
- and access to intr_handle which can replaced with
ETH_DEV_TO_INTR_HANDLE
Is there any specific reason these changes are not part of your patch?
[...]
> diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> index 298cef4..9d4bea7 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -671,6 +671,10 @@ i40e_get_vsi_from_adapter(struct i40e_adapter *adapter)
> #define I40E_VF_TO_HW(vf) \
> (&(((struct i40e_vf *)vf)->adapter->hw))
>
> +/* ETH_DEV_TO_INTR_HANDLE */
> +#define ETH_DEV_TO_INTR_HANDLE(ptr) \
> + (&(ETH_DEV_PCI_DEV(ptr)->intr_handle))
> +
Can this be in rte_ethdev.h just like ETH_DEV_PCI_DEV?
Or, as this is specific to rte_pci_device, probably in rte_pci.h?
Many drivers can be replaced this for accessing intr_handle.
-
Shreyansh
next prev parent reply other threads:[~2016-11-22 11:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 16:55 [dpdk-dev] [PATCH v2 1/8] eal: define container_of macro Jan Blunck
2016-11-21 16:55 ` [dpdk-dev] [PATCH v2 2/8] ethdev: Helper to convert to struct rte_pci_device Jan Blunck
2016-11-22 12:46 ` Shreyansh Jain
2016-11-21 16:55 ` [dpdk-dev] [PATCH v2 3/8] drivers: Use ETH_DEV_PCI_DEV() helper Jan Blunck
2016-11-22 11:21 ` Shreyansh Jain [this message]
2016-11-21 16:55 ` [dpdk-dev] [PATCH v2 4/8] virtio: Don't fill dev_info->driver_name Jan Blunck
2016-11-21 16:55 ` [dpdk-dev] [PATCH v2 5/8] virtio: Add vtpci_intr_handle() helper to get rte_intr_handle Jan Blunck
2016-11-21 16:55 ` [dpdk-dev] [PATCH v2 6/8] virtio: Don't depend on struct rte_eth_dev's pci_dev Jan Blunck
2016-11-21 16:55 ` [dpdk-dev] [PATCH v2 7/8] ethdev: Move filling of rte_eth_dev_info->pci_dev to dev_infos_get() Jan Blunck
2016-11-21 16:55 ` [dpdk-dev] [PATCH v2 8/8] ethdev: Decouple interrupt handling from PCI device Jan Blunck
2016-11-22 12:57 ` Shreyansh Jain
2016-12-20 10:51 ` Jan Blunck
2016-12-20 12:45 ` Shreyansh Jain
2016-11-22 10:03 ` [dpdk-dev] [PATCH v2 1/8] eal: define container_of macro Shreyansh Jain
2016-11-22 10:19 ` Thomas Monjalon
2016-11-22 11:26 ` Shreyansh Jain
2016-11-22 12:33 ` Jan Viktorin
2016-11-22 12:36 ` Shreyansh Jain
2016-12-08 7:01 ` Shreyansh Jain
2016-12-09 7:36 ` Shreyansh Jain
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=efee5fcf-c987-4866-4671-479b0fc5c12a@nxp.com \
--to=shreyansh.jain@nxp.com \
--cc=david.marchand@6wind.com \
--cc=dev@dpdk.org \
--cc=jblunck@infradead.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).