From: Manish Chopra <manishc@marvell.com>
To: "Gaëtan Rivet" <grive@u256.net>
Cc: "jerinjacobk@gmail.com" <jerinjacobk@gmail.com>,
Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
Igor Russkikh <irusskikh@marvell.com>,
"Rasesh Mody" <rmody@marvell.com>,
GR-Everest-DPDK-Dev <GR-Everest-DPDK-Dev@marvell.com>,
"rosen.xu@intel.com" <rosen.xu@intel.com>,
"tianfei.zhang@intel.com" <tianfei.zhang@intel.com>,
"heinrich.kuhn@netronome.com" <heinrich.kuhn@netronome.com>,
"qiming.yang@intel.com" <qiming.yang@intel.com>,
"qi.z.zhang@intel.com" <qi.z.zhang@intel.com>
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v3 1/6] drivers: add generic API to find PCI extended cap
Date: Mon, 27 Jul 2020 05:10:30 +0000 [thread overview]
Message-ID: <BY5PR18MB337933DA504B501832174001AB720@BY5PR18MB3379.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20200726224742.zyf7mn52zh3nvxpk@u256.net>
> -----Original Message-----
> From: Gaëtan Rivet <grive@u256.net>
> Sent: Monday, July 27, 2020 4:18 AM
> To: Manish Chopra <manishc@marvell.com>
> Cc: jerinjacobk@gmail.com; Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
> ferruh.yigit@intel.com; dev@dpdk.org; Igor Russkikh
> <irusskikh@marvell.com>; Rasesh Mody <rmody@marvell.com>; GR-Everest-
> DPDK-Dev <GR-Everest-DPDK-Dev@marvell.com>; rosen.xu@intel.com;
> tianfei.zhang@intel.com; heinrich.kuhn@netronome.com;
> qiming.yang@intel.com; qi.z.zhang@intel.com
> Subject: Re: [EXT] Re: [PATCH v3 1/6] drivers: add generic API to find PCI
> extended cap
>
> On 26/07/20 19:47 +0000, Manish Chopra wrote:
>
> [...]
>
> > > > diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h
> > > > index a03235da1..fec51e15a 100644
> > > > --- a/lib/librte_pci/rte_pci.h
> > > > +++ b/lib/librte_pci/rte_pci.h
> > > > @@ -22,6 +22,22 @@ extern "C" {
> > > > #include <inttypes.h>
> > > > #include <sys/types.h>
> > > >
> > > > +
> > > > +/*
> > > > + * Conventional PCI and PCI-X Mode 1 devices have 256 bytes of
> > > > + * configuration space. PCI-X Mode 2 and PCIe devices have 4096
> > > > +bytes of
> > > > + * configuration space.
> > > > + */
> > > > +#define RTE_PCI_CFG_SPACE_SIZE 256
> > > > +#define RTE_PCI_CFG_SPACE_EXP_SIZE 4096
> > > > +
> > > > +/* Extended Capabilities (PCI-X 2.0 and Express) */
> > > > +#define RTE_PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
> > > > +#define RTE_PCI_EXT_CAP_NEXT(header) ((header >> 20) &
> 0xffc)
> > > > +
> > > > +#define RTE_PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error
> Reporting
> > > */
> > > > +#define RTE_PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial
> Number */
> > > > +
> > >
> > > I understand that it is more natural to have those defines in the
> > > PCI lib, but I think there is no point in adding them in a separate
> > > lib, while the function using those is in the PCI bus.
> > >
> > > I think the defines should be put right before the
> > > rte_pci_find_next_ext_capability() prototype in
> > > drivers/bus/pci/rte_bus_pci.h.
> >
> > Hello Gaetan,
> >
> > I think these comes in the category of all RTE_PCI_* generic defines
> > (not just use in drivers/bus/pci/), Since caller of the API also need
> > to use it, For example, couple of RTE_PCI_* were added in patch #2
> > used by qede drivers specifically. rte_pci.h sounds more generic than
> rte_bus_pci.h hence I thought it is the suitable place to consolidate them in
> there.
> >
> > Thanks !!
>
> Reading the additional symbols, particularly about SRIOV capa, I think you
> are right, it's probably better to have it all within rte_pci.h.
>
> To help developers, it would be better to point in the doc that the capability
> IDs useable as parameter `cap` can be any from RTE_PCI_EXT_CAP_ID_*,
> defined within librte_pci. The dev can then grep it.
Sure, I will add the pointer to librte_pci in the comment section for
rte_pci_find_next_ext_capability()
>
> One additional thing:
>
> > > > +#define RTE_PCI_CFG_SPACE_SIZE 256
> > > > +#define RTE_PCI_CFG_SPACE_EXP_SIZE 4096
> > > > +
> > > > +/* Extended Capabilities (PCI-X 2.0 and Express) */
> > > > +#define RTE_PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
> > > > +#define RTE_PCI_EXT_CAP_NEXT(header) ((header >> 20) &
> 0xffc)
>
> I think those macros are not useful as part of the public API, they are only
> used to implement rte_pci_find_next_ext_capability(). Can you confirm? If
> this is correct, I think they should be moved to the compilation unit
> implementing rte_pci_find_next_ext_capability().
>
Hi Gaetan,
Yes Mostly, but there is a similar piece of code left in drivers/raw/ifpga [ifpga_pci_find_ext_capability()] only
which utilizes these symbols as well, which I did not want to be removed/cleaned up must as a part of this
series because that implementation is based on pread() instead of rte_pci_read_config(). I was not sure
if that driver can also directly use rte_pci_find_next_ext_capability() too, I do not have those fpga based devices
to test if at all I were to do that cleanup/removal now in that driver, so I didn't attempt to make such functional
changes in that driver now. [May be this can be cleaned up too later on with proper testing or may be a new API
based on pread() can be added further if those drivers can't use rte_pci_find_next_ext_capability() directly].
Thanks.
next prev parent reply other threads:[~2020-07-27 5:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-24 10:38 [dpdk-dev] [PATCH v3 0/6] qede: SR-IOV PF driver support Manish Chopra
2020-07-24 10:38 ` [dpdk-dev] [PATCH v3 1/6] drivers: add generic API to find PCI extended cap Manish Chopra
2020-07-25 17:32 ` Gaëtan Rivet
2020-07-26 19:47 ` [dpdk-dev] [EXT] " Manish Chopra
2020-07-26 22:47 ` Gaëtan Rivet
2020-07-27 5:10 ` Manish Chopra [this message]
2020-07-27 7:25 ` Gaëtan Rivet
2020-07-27 7:32 ` Xu, Rosen
2020-07-24 10:38 ` [dpdk-dev] [PATCH v3 2/6] net/qede: define PCI config space specific osals Manish Chopra
2020-07-24 10:38 ` [dpdk-dev] [PATCH v3 3/6] net/qede: configure VFs on hardware Manish Chopra
2020-07-24 10:38 ` [dpdk-dev] [PATCH v3 4/6] net/qede: add infrastructure support for VF load Manish Chopra
2020-07-24 10:38 ` [dpdk-dev] [PATCH v3 5/6] net/qede: initialize VF MAC and link Manish Chopra
2020-07-24 10:38 ` [dpdk-dev] [PATCH v3 6/6] net/qede: add VF FLR support Manish Chopra
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=BY5PR18MB337933DA504B501832174001AB720@BY5PR18MB3379.namprd18.prod.outlook.com \
--to=manishc@marvell.com \
--cc=GR-Everest-DPDK-Dev@marvell.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=grive@u256.net \
--cc=heinrich.kuhn@netronome.com \
--cc=irusskikh@marvell.com \
--cc=jerinj@marvell.com \
--cc=jerinjacobk@gmail.com \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=rmody@marvell.com \
--cc=rosen.xu@intel.com \
--cc=tianfei.zhang@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).