From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Iremonger, Bernard" <bernard.iremonger@intel.com>,
"Yigit, Ferruh" <ferruh.yigit@intel.com>,
"Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: clean up rte_eth_dev_info_get
Date: Fri, 3 Feb 2017 09:49:52 +0000 [thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772583F110909@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <8CEF83825BEC744B83065625E567D7C224D25A9D@IRSMSX108.ger.corp.intel.com>
Hi Bernard,
> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Friday, February 3, 2017 9:21 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
> dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: clean up rte_eth_dev_info_get
>
> Hi Konstantin,
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev,
> > Konstantin
> > Sent: Wednesday, February 1, 2017 6:10 PM
> > To: Yigit, Ferruh <ferruh.yigit@intel.com>; Lu, Wenzhuo
> > <wenzhuo.lu@intel.com>; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: clean up rte_eth_dev_info_get
> >
> >
> >
> > > -----Original Message-----
> > > From: Yigit, Ferruh
> > > Sent: Wednesday, February 1, 2017 5:40 PM
> > > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Lu, Wenzhuo
> > > <wenzhuo.lu@intel.com>; dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: clean up
> > > rte_eth_dev_info_get
> > >
> > > On 2/1/2017 4:24 PM, Ananyev, Konstantin wrote:
> > > > Hi Wenzhuo,
> > > >
> > > >> -----Original Message-----
> > > >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> > > >> Sent: Wednesday, January 25, 2017 2:39 AM
> > > >> To: dev@dpdk.org
> > > >> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> > > >> Subject: [dpdk-dev] [PATCH] net/ixgbe: clean up
> > > >> rte_eth_dev_info_get
> > > >>
> > > >> It'not appropriate to call rte_eth_dev_info_get in PMD, as
> > > >> rte_eth_dev_info_get need to get info from PMD.
> > > >> Remove rte_eth_dev_info_get from PMD code and get the info
> > > >> directly.
> > > >>
> > > >> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > > >> ---
> > > >> drivers/net/ixgbe/ixgbe_ethdev.c | 144
> > > >> ++++++++++++++++++---------------------
> > > >> 1 file changed, 68 insertions(+), 76 deletions(-)
> > > >>
> > > >> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > >> b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > >> index 64ce55a..f14a68b 100644
> > > >> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > >> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > >> @@ -4401,17 +4401,17 @@ static int
> > ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
> > > >> int rar_entry;
> > > >> uint8_t *new_mac = (uint8_t *)(mac_addr);
> > > >> struct rte_eth_dev *dev;
> > > >> - struct rte_eth_dev_info dev_info;
> > > >> + struct rte_pci_device *pci_dev;
> > > >>
> > > >> RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> > > >>
> > > >> dev = &rte_eth_devices[port];
> > > >> - rte_eth_dev_info_get(port, &dev_info);
> > > >> + pci_dev = IXGBE_DEV_TO_PCI(dev);
> > > >>
> > > >> - if (is_ixgbe_pmd(dev_info.driver_name) != 0)
> > > >> + if (is_ixgbe_pmd(dev->data->drv_name))
> > > >> return -ENOTSUP;
> > > >
> > > > I wonder why do we need now that it is really an ixgbe device all over the
> > place?
> > >
> > > This device specific API, so it is missing merits of abstraction
> > > layer, application can these APIs with any port_id, API should be protected
> > for it.
> >
> > Ah ok, my bad - didn't realize from the patch that it affects only device
> > specific API :) Would It be too much hassle to move these functions into a
> > separate file (rte_ixgbe_pmd.c or so)?
> > Konstantin
> >
> > >
> > > > Konstantin
> > > >
> All the device specific API functions are prefixed with rte_pmd_ixgbe
That's ok.
> so I don't think a separate file is necessary.
So far I didn't say it is necessary.
Though I think it would be good to group these functions in a separate file
to help avoid confusion (as happened to me) and keep ixgbe_ethdev.c smaller and cleaner.
Again would be easier to maintain things in future, when more folks will come up with some extensions for it.
That's why I am asking: would it be a lot of work to do?
It is probably worth doing it now, while we have this API relatively small.
Konstantin
next prev parent reply other threads:[~2017-02-03 9:49 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 2:39 Wenzhuo Lu
2017-01-25 3:16 ` Tiwei Bie
2017-01-25 5:13 ` Lu, Wenzhuo
2017-01-25 5:24 ` Tiwei Bie
2017-01-30 12:15 ` Ferruh Yigit
2017-02-03 6:50 ` Lu, Wenzhuo
2017-02-03 11:52 ` Ferruh Yigit
2017-02-01 16:24 ` Ananyev, Konstantin
2017-02-01 17:40 ` Ferruh Yigit
2017-02-01 18:10 ` Ananyev, Konstantin
2017-02-01 18:18 ` Ferruh Yigit
2017-02-03 9:21 ` Iremonger, Bernard
2017-02-03 9:49 ` Ananyev, Konstantin [this message]
2017-02-03 10:02 ` Iremonger, Bernard
2017-02-03 12:00 ` Ferruh Yigit
2017-02-06 2:09 ` [dpdk-dev] [PATCH v2] " Wenzhuo Lu
2017-02-06 2:30 ` Tiwei Bie
2017-02-06 2:41 ` Lu, Wenzhuo
2017-02-06 2:51 ` Tiwei Bie
2017-02-06 2:59 ` Lu, Wenzhuo
2017-02-06 3:08 ` Tiwei Bie
2017-02-06 3:45 ` Lu, Wenzhuo
2017-02-06 4:57 ` Tiwei Bie
2017-02-06 5:17 ` Lu, Wenzhuo
2017-02-06 5:26 ` Tiwei Bie
2017-02-07 6:33 ` [dpdk-dev] [PATCH v3] " Wenzhuo Lu
2017-02-07 14:08 ` Ferruh Yigit
2017-02-07 14:09 ` Ferruh Yigit
2017-02-08 0:54 ` Lu, Wenzhuo
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=2601191342CEEE43887BDE71AB9772583F110909@irsmsx105.ger.corp.intel.com \
--to=konstantin.ananyev@intel.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=wenzhuo.lu@intel.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 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).