* Re: [PATCH] nfp: extend speed capabilities advertised
From: Alejandro Lucero @ 2016-12-20 10:29 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
In-Reply-To: <d25cdbc7-b4c5-3709-2d1f-0054f5071fa8@intel.com>
On Tue, Dec 20, 2016 at 10:25 AM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:
> On 12/19/2016 6:00 PM, Alejandro Lucero wrote:
> > I forgot one thing: to update the features file with this new one.
> >
> > I will wait for your feedback regarding the discussed problem for
> > sending another version.
>
> I think it is good to go, please send updated version.
>
>
OK
> >
>
> <...>
>
> >
> > Sorry, confused. Is it like following:
> >
> > "
> > For new FW, there is no problem, it supports the range between
> > 1G - 50G,
> > and reports correct current speed.
> >
> > With old FW, device still can be set to speed range between 1G -
> > 50G,
> > but it doesn't report current speed correct, and DPDK driver
> reports
> > back to application as device current speed is 40G, without
> really
> > knowing the current speed.
> > "
> >
> >
> > Yes, that is. Should then I do anything else or the patch is right
> > for you now?
>
> So, this patch is correct.
>
> But for the previous patch "net/nfp: report link speed using hardware
> info", it would be nice to add above information into source as comment
> and into commit log.
> If you can, would you mind sending a new version of that patch?
>
>
I'll do it.
Thanks!
> Thanks,
> ferruh
>
> >
> <...>
>
^ permalink raw reply
* Re: [PATCH] doc: correct source extract command
From: Thomas Monjalon @ 2016-12-20 10:31 UTC (permalink / raw)
To: Baruch Siach; +Cc: dev, Mcnamara, John, David Marchand
In-Reply-To: <B27915DBBA3421428155699D51E4CFE202686057@IRSMSX103.ger.corp.intel.com>
> > DPDK source archives are .tar.xz or .tar.gz, not .zip. Use .tar.xz in the
> > instructions, since that is what the main download page links to.
> >
> > Also, correct the archive file and directory name capitalization.
> >
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>
> Acked-by: John McNamara <john.mcnamara@intel.com>
Applied, thanks
^ permalink raw reply
* Re: [PATCH] doc: simplify L3fwd user guide examples
From: Mcnamara, John @ 2016-12-20 10:31 UTC (permalink / raw)
To: De Lara Guarch, Pablo; +Cc: dev@dpdk.org
In-Reply-To: <1482165252-230968-1-git-send-email-pablo.de.lara.guarch@intel.com>
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Monday, December 19, 2016 4:34 PM
> To: Mcnamara, John <john.mcnamara@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [PATCH] doc: simplify L3fwd user guide examples
>
> L3 Forwarding sample app user guides have some inconsistencies between the
> example command line and the configuration table.
> Also, they were showing too complicated configuration, using two different
> NUMA nodes for two ports, which will probably lead to performance drop due
> to use cross-socket channel.
>
> This patch simplifies the configuration of these examples, by using a
> single NUMA node and a single queue per port.
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
^ permalink raw reply
* Re: [PATCH v2] doc: fix required tools list layout
From: Mcnamara, John @ 2016-12-20 10:35 UTC (permalink / raw)
To: Thomas Monjalon, Baruch Siach; +Cc: dev@dpdk.org
In-Reply-To: <1982293.fdVZR7yPaX@xps13>
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Tuesday, December 20, 2016 10:27 AM
> To: Baruch Siach <baruch@tkos.co.il>
> Cc: dev@dpdk.org; Mcnamara, John <john.mcnamara@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] doc: fix required tools list layout
>
> > > The Python requirement should appear in the bullet list.
> > >
> > > Also, indent the x32 note, since it is related to the previous bullet.
> > >
> > > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> >
> > Acked-by: John McNamara <john.mcnamara@intel.com>
>
> Applied, thanks
Thanks.
I'll rebase my other patch that touches this file:
http://dpdk.org/dev/patchwork/patch/18152/
John
^ permalink raw reply
* Re: [PATCH v2 8/8] ethdev: Decouple interrupt handling from PCI device
From: Jan Blunck @ 2016-12-20 10:51 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: dev, David Marchand
In-Reply-To: <84460a6f-3574-8da2-3ccc-6f1e23fb50e7@nxp.com>
On Tue, Nov 22, 2016 at 1:57 PM, Shreyansh Jain <shreyansh.jain@nxp.com> wrote:
> On Monday 21 November 2016 10:25 PM, Jan Blunck wrote:
>>
>> The struct rte_intr_handle is an abstraction layer for different types of
>> interrupt mechanisms. It is embedded in the low-level device (e.g. PCI).
>> On allocation of a struct rte_eth_dev a reference to the intr_handle
>> should be stored for devices supporting interrupts.
>>
>> Signed-off-by: Jan Blunck <jblunck@infradead.org>
>> ---
>> lib/librte_ether/rte_ethdev.c | 18 ++++++++++++++++--
>> lib/librte_ether/rte_ethdev.h | 1 +
>> 2 files changed, 17 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
>> index 4288577..4ecea50 100644
>> --- a/lib/librte_ether/rte_ethdev.c
>> +++ b/lib/librte_ether/rte_ethdev.c
>> @@ -258,6 +258,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
>> rte_panic("Cannot allocate memzone for private
>> port data\n");
>> }
>> eth_dev->pci_dev = pci_dev;
>> + eth_dev->intr_handle = &pci_dev->intr_handle;
>> eth_dev->driver = eth_drv;
>> eth_dev->data->rx_mbuf_alloc_failed = 0;
>>
>> @@ -2543,7 +2544,13 @@ rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd,
>> int op, void *data)
>> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>
>> dev = &rte_eth_devices[port_id];
>> - intr_handle = &dev->pci_dev->intr_handle;
>> +
>> + if (!dev->intr_handle) {
>> + RTE_PMD_DEBUG_TRACE("RX Intr handle unset\n");
>> + return -ENOTSUP;
>> + }
>> +
>> + intr_handle = dev->intr_handle;
>> if (!intr_handle->intr_vec) {
>> RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n");
>> return -EPERM;
>> @@ -2603,7 +2610,12 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t
>> queue_id,
>> return -EINVAL;
>> }
>>
>> - intr_handle = &dev->pci_dev->intr_handle;
>> + if (!dev->intr_handle) {
>> + RTE_PMD_DEBUG_TRACE("RX Intr handle unset\n");
>> + return -ENOTSUP;
>> + }
>> +
>> + intr_handle = dev->intr_handle;
>> if (!intr_handle->intr_vec) {
>> RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n");
>> return -EPERM;
>> @@ -3205,6 +3217,8 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
>> struct rte_pci_device *pci_de
>> return;
>> }
>>
>> + eth_dev->intr_handle = &pci_dev->intr_handle;
>> +
>> eth_dev->data->dev_flags = 0;
>> if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)
>> eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
>> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
>> index 3adbb2b..f1f656a 100644
>> --- a/lib/librte_ether/rte_ethdev.h
>> +++ b/lib/librte_ether/rte_ethdev.h
>> @@ -1629,6 +1629,7 @@ struct rte_eth_dev {
>> const struct eth_driver *driver;/**< Driver for this device */
>> const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD
>> */
>> struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing
>> */
>> + struct rte_intr_handle *intr_handle; /**< Device interrupt handle
>> */
>> /** User application callbacks for NIC interrupts */
>> struct rte_eth_dev_cb_list link_intr_cbs;
>> /**
>>
>
> Is there another patch which replaces all uses of
> eth_dev->pci_dev->intr_handle with that of eth_dev->intr_handle?
>
> Now that eth_dev has a reference which is initialized as early as probe, we
> should use that rather than pci_dev->intr_handle for PCI PMDs.
>
I've added this indirection because it is required for the ethdev
function. The drivers shouldn't use the indirection through ethdev to
access the intr_handle because they do have direct access to the
device.
> OR maybe, ETH_DEV_INTR_HANDLE() like macro which you have introduced in
> i40e_ethdev.h.
>
> -
> Shreyansh
^ permalink raw reply
* Re: [PATCH v3 25/25] doc: describe testpmd flow command
From: Adrien Mazarguil @ 2016-12-20 10:51 UTC (permalink / raw)
To: Mcnamara, John; +Cc: dev@dpdk.org, Kevin Traynor
In-Reply-To: <B27915DBBA3421428155699D51E4CFE2026896B8@IRSMSX103.ger.corp.intel.com>
On Mon, Dec 19, 2016 at 08:44:07PM +0000, Mcnamara, John wrote:
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Adrien Mazarguil
> > Sent: Monday, December 19, 2016 5:49 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH v3 25/25] doc: describe testpmd flow command
> >
> > Document syntax, interaction with rte_flow and provide usage examples.
> >
> > Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> >
> > ...
> >
> > +
> > +- Check whether a flow rule can be created::
> > +
> > + flow validate {port_id}
> > + [group {group_id}] [priority {level}] [ingress] [egress]
> > + pattern {item} [/ {item} [...]] / end
> > + actions {action} [/ {action} [...]] / end
> > +
> > +- Create a flow rule::
> > +
> > + flow create {port_id}
> > + [group {group_id}] [priority {level}] [ingress] [egress]
> > + pattern {item} [/ {item} [...]] / end
> > + actions {action} [/ {action} [...]] / end
> > +
> > +- Destroy specific flow rules::
> > +
> > + flow destroy {port_id} rule {rule_id} [...]
> > +
> > +- Destroy all flow rules::
> > +
> > + flow flush {port_id}
> > +
>
> Just a note:
>
> The verbs destroy and flush don't sound right here. Create/destroy are common
> verbs pairs for objects but these actions are more like add/remove. I guess the
> names come from the underlying APIs which possibly are creating/freeing
> objects/structures but maybe they should be called add/remove as well.
>
> And flush generally applies to a pipeline or a queue. The action here is closer
> to "remove all".
>
> Probably not worth reworking at this stage if it hasn't bothered anyone else.
Well, Kevin Traynor made a similar suggestion to which I replied that the
name would be modified if enough people complained [1].
I understand your point but for some reason I keep hearing a flushing noise
every time all rules are removed at once, hence the name.
Problem is also that we now have 3 PMD series floating on the ML that depend
on the current definition. If we decided to change it, I suggest doing so in
a separate fix. A few more complaints from developers are needed before it's
too late for 17.02.
> > +underlying device in its current state but stops short of creating it.
> > +It is bound to ``rte_flow_validate()``::
> > +
> > + flow validate {port_id}
> > + [group {group_id}] [priority {level}] [ingress] [egress]
> > + pattern {item} [/ {item} [...]] / end
> > + actions {action} [/ {action} [...]] / end
> > +
>
> Here and elsewhere the indentation should be the RST standard 3 spaces,
> similar to the rest of the doc. This is only worth changing if you
> do some other revision of this doc.
>
> Otherwise very good documentation.
>
> Acked-by: John McNamara <john.mcnamara@intel.com>
Thanks, I'll make those changes if anything else warrants a v4.
[1] http://dpdk.org/ml/archives/dev/2016-December/050973.html
--
Adrien Mazarguil
6WIND
^ permalink raw reply
* Re: [PATCH] nfp: extend speed capabilities advertised
From: Alejandro Lucero @ 2016-12-20 11:02 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
In-Reply-To: <CAD+H992=T2bgGiNhC-Lcir8a8pjdwpd1icvtJVif1_oZv4Q_sw@mail.gmail.com>
On Tue, Dec 20, 2016 at 10:29 AM, Alejandro Lucero <
alejandro.lucero@netronome.com> wrote:
>
>
> On Tue, Dec 20, 2016 at 10:25 AM, Ferruh Yigit <ferruh.yigit@intel.com>
> wrote:
>
>> On 12/19/2016 6:00 PM, Alejandro Lucero wrote:
>> > I forgot one thing: to update the features file with this new one.
>> >
>> > I will wait for your feedback regarding the discussed problem for
>> > sending another version.
>>
>> I think it is good to go, please send updated version.
>>
>>
> OK
>
>
>> >
>>
>> <...>
>>
>> >
>> > Sorry, confused. Is it like following:
>> >
>> > "
>> > For new FW, there is no problem, it supports the range between
>> > 1G - 50G,
>> > and reports correct current speed.
>> >
>> > With old FW, device still can be set to speed range between 1G -
>> > 50G,
>> > but it doesn't report current speed correct, and DPDK driver
>> reports
>> > back to application as device current speed is 40G, without
>> really
>> > knowing the current speed.
>> > "
>> >
>> >
>> > Yes, that is. Should then I do anything else or the patch is right
>> > for you now?
>>
>> So, this patch is correct.
>>
>> But for the previous patch "net/nfp: report link speed using hardware
>> info", it would be nice to add above information into source as comment
>> and into commit log.
>> If you can, would you mind sending a new version of that patch?
>>
>>
>
Would it be better to report ETH_SPEED_NUM_NONE instead of
ETH_SPEED_NUM_40G for old firmware?
I will add a comment about why, but I think this is better for the user not
getting (sometimes) the right speed.
> I'll do it.
>
> Thanks!
>
>
>> Thanks,
>> ferruh
>>
>> >
>> <...>
>>
>
>
^ permalink raw reply
* [PATCH v3 0/9] Decouple ethdev from PCI device
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
This is a repost of the series I sent in November. I've addressed Shreyansh's
review comments about the PCI device users I've missed.
Jan Blunck (9):
eal: define container_of macro
ethdev: Helper to convert to struct rte_pci_device
drivers: Use ETH_DEV_PCI_DEV() helper
virtio: Don't fill dev_info->driver_name
virtio: Add vtpci_intr_handle() helper to get rte_intr_handle
virtio: Don't depend on struct rte_eth_dev's pci_dev
ethdev: Move filling of rte_eth_dev_info->pci_dev to dev_infos_get()
ethdev: Decouple interrupt handling from PCI device
ethdev: Decouple struct rte_eth_dev from struct rte_pci_device
app/test/virtual_pmd.c | 4 +-
drivers/net/bnx2x/bnx2x_ethdev.c | 13 +++---
drivers/net/bnxt/bnxt_ethdev.c | 21 ++++++----
drivers/net/bnxt/bnxt_ring.c | 11 ++---
drivers/net/bonding/rte_eth_bond_args.c | 12 +++++-
drivers/net/cxgbe/cxgbe_ethdev.c | 4 +-
drivers/net/cxgbe/cxgbe_main.c | 4 +-
drivers/net/e1000/em_ethdev.c | 21 ++++++----
drivers/net/e1000/igb_ethdev.c | 52 +++++++++++++----------
drivers/net/e1000/igb_pf.c | 3 +-
drivers/net/ena/ena_ethdev.c | 4 +-
drivers/net/enic/enic_ethdev.c | 3 +-
drivers/net/fm10k/fm10k_ethdev.c | 56 +++++++++++++------------
drivers/net/i40e/i40e_ethdev.c | 45 ++++++++++----------
drivers/net/i40e/i40e_ethdev.h | 4 ++
drivers/net/i40e/i40e_ethdev_vf.c | 39 ++++++++---------
drivers/net/ixgbe/ixgbe_ethdev.c | 67 ++++++++++++++++++------------
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +
drivers/net/mlx5/mlx5_ethdev.c | 2 +
drivers/net/nfp/nfp_net.c | 17 ++++----
drivers/net/qede/qede_ethdev.c | 18 ++++----
drivers/net/szedata2/rte_eth_szedata2.c | 28 +++++++------
drivers/net/szedata2/rte_eth_szedata2.h | 34 +++++++--------
drivers/net/thunderx/nicvf_ethdev.c | 7 +++-
drivers/net/virtio/virtio_ethdev.c | 38 ++++++++---------
drivers/net/virtio/virtio_pci.h | 6 +++
drivers/net/virtio/virtio_user_ethdev.c | 1 -
drivers/net/vmxnet3/vmxnet3_ethdev.c | 6 ++-
lib/librte_eal/common/include/rte_common.h | 20 +++++++++
lib/librte_eal/common/include/rte_pci.h | 6 +++
lib/librte_ether/rte_ethdev.c | 25 ++++++++---
lib/librte_ether/rte_ethdev.h | 9 +++-
33 files changed, 355 insertions(+), 229 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH v3 1/9] eal: define container_of macro
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen, Jan Viktorin
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
This macro is based on Jan Viktorin's original patch but also checks the
type of the passed pointer against the type of the member.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
[jblunck@infradead.org: add type checking and __extension__]
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
lib/librte_eal/common/include/rte_common.h | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index db5ac91..8dda3e2 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -331,6 +331,26 @@ rte_bsf32(uint32_t v)
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
#endif
+/**
+ * Return pointer to the wrapping struct instance.
+ *
+ * Example:
+ *
+ * struct wrapper {
+ * ...
+ * struct child c;
+ * ...
+ * };
+ *
+ * struct child *x = obtain(...);
+ * struct wrapper *w = container_of(x, struct wrapper, c);
+ */
+#ifndef container_of
+#define container_of(ptr, type, member) __extension__ ({ \
+ typeof(((type *)0)->member) *_ptr = (ptr); \
+ (type *)(((char *)_ptr) - offsetof(type, member)); })
+#endif
+
#define _RTE_STR(x) #x
/** Take a macro value and get a string version of it */
#define RTE_STR(x) _RTE_STR(x)
--
2.7.4
^ permalink raw reply related
* [PATCH v3 2/9] ethdev: Helper to convert to struct rte_pci_device
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
lib/librte_ether/rte_ethdev.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 9678179..3adbb2b 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1644,6 +1644,12 @@ struct rte_eth_dev {
uint8_t attached; /**< Flag indicating the port is attached */
} __rte_cache_aligned;
+/**
+ * @internal
+ * Helper for drivers that need to convert from rte_eth_dev to rte_pci_device.
+ */
+#define ETH_DEV_PCI_DEV(ptr) ((ptr)->pci_dev)
+
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
uint8_t nb_q_per_pool; /**< rx queue number per pool */
--
2.7.4
^ permalink raw reply related
* [PATCH v3 3/9] drivers: Use ETH_DEV_PCI_DEV() helper
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
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/bnx2x/bnx2x_ethdev.c | 12 +++---
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 +++++++++++++------------
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/nfp/nfp_net.c | 16 ++++----
drivers/net/qede/qede_ethdev.c | 17 +++++----
drivers/net/szedata2/rte_eth_szedata2.c | 27 +++++++-------
drivers/net/szedata2/rte_eth_szedata2.h | 34 ++++++++---------
drivers/net/thunderx/nicvf_ethdev.c | 5 ++-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 +-
21 files changed, 234 insertions(+), 192 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index 0eae433..c331ccd 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -124,7 +124,7 @@ bnx2x_interrupt_handler(__rte_unused struct rte_intr_handle *handle, void *param
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
bnx2x_interrupt_action(dev);
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(&(ETH_DEV_PCI_DEV(dev)->intr_handle));
}
/*
@@ -187,10 +187,10 @@ bnx2x_dev_start(struct rte_eth_dev *dev)
}
if (IS_PF(sc)) {
- rte_intr_callback_register(&(dev->pci_dev->intr_handle),
+ rte_intr_callback_register(&sc->pci_dev->intr_handle,
bnx2x_interrupt_handler, (void *)dev);
- if(rte_intr_enable(&(dev->pci_dev->intr_handle)))
+ if (rte_intr_enable(&sc->pci_dev->intr_handle))
PMD_DRV_LOG(ERR, "rte_intr_enable failed");
}
@@ -215,8 +215,8 @@ bnx2x_dev_stop(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
if (IS_PF(sc)) {
- rte_intr_disable(&(dev->pci_dev->intr_handle));
- rte_intr_callback_unregister(&(dev->pci_dev->intr_handle),
+ rte_intr_disable(&sc->pci_dev->intr_handle);
+ rte_intr_callback_unregister(&sc->pci_dev->intr_handle,
bnx2x_interrupt_handler, (void *)dev);
}
@@ -516,7 +516,7 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf)
PMD_INIT_FUNC_TRACE();
eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops : &bnx2x_eth_dev_ops;
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
rte_eth_copy_pci_info(eth_dev, pci_dev);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 035fe07..cd50f11 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -743,6 +743,7 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(eth_dev);
/* Retrieve from the default VNIC */
if (!vnic)
@@ -759,7 +760,7 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
/* EW - need to revisit here copying from u64 to u16 */
memcpy(reta_conf, vnic->rss_table, reta_size);
- if (rte_intr_allow_others(ð_dev->pci_dev->intr_handle)) {
+ if (rte_intr_allow_others(&pci_dev->intr_handle)) {
if (eth_dev->data->dev_conf.intr_conf.lsc != 0)
bnxt_dev_lsc_intr_setup(eth_dev);
}
@@ -1011,9 +1012,10 @@ static int bnxt_init_board(struct rte_eth_dev *eth_dev)
{
int rc;
struct bnxt *bp = eth_dev->data->dev_private;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(eth_dev);
/* enable device (incl. PCI PM wakeup), and bus-mastering */
- if (!eth_dev->pci_dev->mem_resource[0].addr) {
+ if (!pci_dev->mem_resource[0].addr) {
RTE_LOG(ERR, PMD,
"Cannot find PCI device base address, aborting\n");
rc = -ENODEV;
@@ -1021,9 +1023,9 @@ static int bnxt_init_board(struct rte_eth_dev *eth_dev)
}
bp->eth_dev = eth_dev;
- bp->pdev = eth_dev->pci_dev;
+ bp->pdev = pci_dev;
- bp->bar0 = (void *)eth_dev->pci_dev->mem_resource[0].addr;
+ bp->bar0 = (void *)pci_dev->mem_resource[0].addr;
if (!bp->bar0) {
RTE_LOG(ERR, PMD, "Cannot map device registers, aborting\n");
rc = -ENOMEM;
@@ -1043,6 +1045,7 @@ static int bnxt_init_board(struct rte_eth_dev *eth_dev)
static int
bnxt_dev_init(struct rte_eth_dev *eth_dev)
{
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(eth_dev);
static int version_printed;
struct bnxt *bp;
int rc;
@@ -1050,10 +1053,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
if (version_printed++ == 0)
RTE_LOG(INFO, PMD, "%s", bnxt_version);
- rte_eth_copy_pci_info(eth_dev, eth_dev->pci_dev);
+ rte_eth_copy_pci_info(eth_dev, pci_dev);
bp = eth_dev->data->dev_private;
- if (bnxt_vf_pciid(eth_dev->pci_dev->id.device_id))
+ if (bnxt_vf_pciid(pci_dev->id.device_id))
bp->flags |= BNXT_FLAG_VF;
rc = bnxt_init_board(eth_dev);
@@ -1121,8 +1124,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
RTE_LOG(INFO, PMD,
DRV_MODULE_NAME " found at mem %" PRIx64 ", node addr %pM\n",
- eth_dev->pci_dev->mem_resource[0].phys_addr,
- eth_dev->pci_dev->mem_resource[0].addr);
+ pci_dev->mem_resource[0].phys_addr,
+ pci_dev->mem_resource[0].addr);
bp->dev_stopped = 0;
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 3f81ffc..6793d75 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -209,6 +209,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
*/
int bnxt_alloc_hwrm_rings(struct bnxt *bp)
{
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(bp->eth_dev);
unsigned int i;
int rc = 0;
@@ -223,7 +224,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
if (rc)
goto err_out;
cpr->cp_doorbell =
- (char *)bp->eth_dev->pci_dev->mem_resource[2].addr;
+ (char *)pci_dev->mem_resource[2].addr;
B_CP_DIS_DB(cpr, cpr->cp_raw_cons);
bp->grp_info[0].cp_fw_ring_id = cp_ring->fw_ring_id;
}
@@ -243,7 +244,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
if (rc)
goto err_out;
cpr->cp_doorbell =
- (char *)bp->eth_dev->pci_dev->mem_resource[2].addr +
+ (char *)pci_dev->mem_resource[2].addr +
idx * 0x80;
bp->grp_info[idx].cp_fw_ring_id = cp_ring->fw_ring_id;
B_CP_DIS_DB(cpr, cpr->cp_raw_cons);
@@ -256,7 +257,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
goto err_out;
rxr->rx_prod = 0;
rxr->rx_doorbell =
- (char *)bp->eth_dev->pci_dev->mem_resource[2].addr +
+ (char *)pci_dev->mem_resource[2].addr +
idx * 0x80;
bp->grp_info[idx].rx_fw_ring_id = ring->fw_ring_id;
B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
@@ -284,7 +285,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
goto err_out;
cpr->cp_doorbell =
- (char *)bp->eth_dev->pci_dev->mem_resource[2].addr +
+ (char *)pci_dev->mem_resource[2].addr +
idx * 0x80;
bp->grp_info[idx].cp_fw_ring_id = cp_ring->fw_ring_id;
B_CP_DIS_DB(cpr, cpr->cp_raw_cons);
@@ -297,7 +298,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
goto err_out;
txr->tx_doorbell =
- (char *)bp->eth_dev->pci_dev->mem_resource[2].addr +
+ (char *)pci_dev->mem_resource[2].addr +
idx * 0x80;
}
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index b7f28eb..8bfdda8 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -1005,7 +1005,7 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
snprintf(name, sizeof(name), "cxgbeadapter%d", eth_dev->data->port_id);
adapter = rte_zmalloc(name, sizeof(*adapter), 0);
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index aee3d34..7f2f521 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -295,7 +295,7 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev)
struct e1000_vfta * shadow_vfta =
E1000_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private);
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
eth_dev->dev_ops = ð_em_ops;
eth_dev->rx_pkt_burst = (eth_rx_burst_t)ð_em_recv_pkts;
@@ -369,7 +369,7 @@ eth_em_dev_uninit(struct rte_eth_dev *eth_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return -EPERM;
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
if (adapter->stopped == 0)
eth_em_close(eth_dev);
@@ -556,7 +556,8 @@ eth_em_start(struct rte_eth_dev *dev)
E1000_DEV_PRIVATE(dev->data->dev_private);
struct e1000_hw *hw =
E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
int ret, mask;
uint32_t intr_vector = 0;
uint32_t *speeds;
@@ -738,7 +739,8 @@ eth_em_stop(struct rte_eth_dev *dev)
{
struct rte_eth_link link;
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
em_rxq_intr_disable(hw);
em_lsc_intr_disable(hw);
@@ -999,9 +1001,10 @@ static int
eth_em_rx_queue_intr_enable(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
em_rxq_intr_enable(hw);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(&pci_dev->intr_handle);
return 0;
}
@@ -1542,6 +1545,7 @@ eth_em_interrupt_action(struct rte_eth_dev *dev)
E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct e1000_interrupt *intr =
E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
uint32_t tctl, rctl;
struct rte_eth_link link;
int ret;
@@ -1550,7 +1554,7 @@ eth_em_interrupt_action(struct rte_eth_dev *dev)
return -1;
intr->flags &= ~E1000_FLAG_NEED_LINK_UPDATE;
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(&pci_dev->intr_handle);
/* set get_link_status to check register later */
hw->mac.get_link_status = 1;
@@ -1571,8 +1575,8 @@ eth_em_interrupt_action(struct rte_eth_dev *dev)
PMD_INIT_LOG(INFO, " Port %d: Link Down", dev->data->port_id);
}
PMD_INIT_LOG(DEBUG, "PCI Address: %04d:%02d:%02d:%d",
- dev->pci_dev->addr.domain, dev->pci_dev->addr.bus,
- dev->pci_dev->addr.devid, dev->pci_dev->addr.function);
+ pci_dev->addr.domain, pci_dev->addr.bus,
+ pci_dev->addr.devid, pci_dev->addr.function);
tctl = E1000_READ_REG(hw, E1000_TCTL);
rctl = E1000_READ_REG(hw, E1000_RCTL);
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 2fddf0c..b25c66e 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -672,11 +672,11 @@ igb_identify_hardware(struct rte_eth_dev *dev)
{
struct e1000_hw *hw =
E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
- hw->vendor_id = dev->pci_dev->id.vendor_id;
- hw->device_id = dev->pci_dev->id.device_id;
- hw->subsystem_vendor_id = dev->pci_dev->id.subsystem_vendor_id;
- hw->subsystem_device_id = dev->pci_dev->id.subsystem_device_id;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ hw->vendor_id = pci_dev->id.vendor_id;
+ hw->device_id = pci_dev->id.device_id;
+ hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
+ hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
e1000_set_mac_type(hw);
@@ -755,7 +755,7 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
uint32_t ctrl_ext;
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
eth_dev->dev_ops = ð_igb_ops;
eth_dev->rx_pkt_burst = ð_igb_recv_pkts;
@@ -918,7 +918,7 @@ eth_igb_dev_uninit(struct rte_eth_dev *eth_dev)
return -EPERM;
hw = E1000_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
if (adapter->stopped == 0)
eth_igb_close(eth_dev);
@@ -973,7 +973,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
return 0;
}
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
rte_eth_copy_pci_info(eth_dev, pci_dev);
@@ -1050,7 +1050,7 @@ eth_igbvf_dev_uninit(struct rte_eth_dev *eth_dev)
{
struct e1000_adapter *adapter =
E1000_DEV_PRIVATE(eth_dev->data->dev_private);
- struct rte_pci_device *pci_dev = eth_dev->pci_dev;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(eth_dev);
PMD_INIT_FUNC_TRACE();
@@ -1217,7 +1217,8 @@ eth_igb_start(struct rte_eth_dev *dev)
E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct e1000_adapter *adapter =
E1000_DEV_PRIVATE(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle =
+ Ð_DEV_PCI_DEV(dev)->intr_handle;
int ret, mask;
uint32_t intr_vector = 0;
uint32_t ctrl_ext;
@@ -1429,7 +1430,8 @@ eth_igb_stop(struct rte_eth_dev *dev)
struct e1000_flex_filter *p_flex;
struct e1000_5tuple_filter *p_5tuple, *p_5tuple_next;
struct e1000_2tuple_filter *p_2tuple, *p_2tuple_next;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle =
+ Ð_DEV_PCI_DEV(dev)->intr_handle;
igb_intr_disable(hw);
@@ -1549,7 +1551,7 @@ eth_igb_close(struct rte_eth_dev *dev)
igb_dev_free_queues(dev);
- pci_dev = dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(dev);
if (pci_dev->intr_handle.intr_vec) {
rte_free(pci_dev->intr_handle.intr_vec);
pci_dev->intr_handle.intr_vec = NULL;
@@ -2639,6 +2641,7 @@ eth_igb_interrupt_action(struct rte_eth_dev *dev)
E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct e1000_interrupt *intr =
E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
uint32_t tctl, rctl;
struct rte_eth_link link;
int ret;
@@ -2649,7 +2652,7 @@ eth_igb_interrupt_action(struct rte_eth_dev *dev)
}
igb_intr_enable(dev);
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(&pci_dev->intr_handle);
if (intr->flags & E1000_FLAG_NEED_LINK_UPDATE) {
intr->flags &= ~E1000_FLAG_NEED_LINK_UPDATE;
@@ -2677,10 +2680,10 @@ eth_igb_interrupt_action(struct rte_eth_dev *dev)
}
PMD_INIT_LOG(DEBUG, "PCI Address: %04d:%02d:%02d:%d",
- dev->pci_dev->addr.domain,
- dev->pci_dev->addr.bus,
- dev->pci_dev->addr.devid,
- dev->pci_dev->addr.function);
+ pci_dev->addr.domain,
+ pci_dev->addr.bus,
+ pci_dev->addr.devid,
+ pci_dev->addr.function);
tctl = E1000_READ_REG(hw, E1000_TCTL);
rctl = E1000_READ_REG(hw, E1000_RCTL);
if (link.link_status) {
@@ -2770,7 +2773,7 @@ eth_igbvf_interrupt_action(struct rte_eth_dev *dev)
}
igbvf_intr_enable(dev);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(Ð_DEV_PCI_DEV(dev)->intr_handle);
return 0;
}
@@ -3056,7 +3059,8 @@ igbvf_dev_start(struct rte_eth_dev *dev)
struct e1000_adapter *adapter =
E1000_DEV_PRIVATE(dev->data->dev_private);
int ret;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle =
+ Ð_DEV_PCI_DEV(dev)->intr_handle;
uint32_t intr_vector = 0;
PMD_INIT_FUNC_TRACE();
@@ -3110,7 +3114,8 @@ igbvf_dev_start(struct rte_eth_dev *dev)
static void
igbvf_dev_stop(struct rte_eth_dev *dev)
{
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle =
+ Ð_DEV_PCI_DEV(dev)->intr_handle;
PMD_INIT_FUNC_TRACE();
@@ -5102,7 +5107,7 @@ eth_igb_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
E1000_WRITE_REG(hw, E1000_EIMS, regval | mask);
E1000_WRITE_FLUSH(hw);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(Ð_DEV_PCI_DEV(dev)->intr_handle);
return 0;
}
@@ -5167,7 +5172,8 @@ eth_igb_configure_msix_intr(struct rte_eth_dev *dev)
uint32_t base = E1000_MISC_VEC_ID;
uint32_t misc_shift = 0;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle =
+ Ð_DEV_PCI_DEV(dev)->intr_handle;
/* won't configure msix register if no mapping is done
* between intr vector and event fd
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 5845bc2..6a72ee1 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -57,7 +57,8 @@
static inline uint16_t
dev_num_vf(struct rte_eth_dev *eth_dev)
{
- return eth_dev->pci_dev->max_vfs;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(eth_dev);
+ return pci_dev->max_vfs;
}
static inline
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index ab9a178..c17d969 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1278,7 +1278,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
adapter->pdev = pci_dev;
PMD_INIT_LOG(INFO, "Initializing %x:%x:%x.%d\n",
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 2b154ec..553a88e 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -621,7 +621,7 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)
eth_dev->rx_pkt_burst = &enic_recv_pkts;
eth_dev->tx_pkt_burst = &enic_xmit_pkts;
- pdev = eth_dev->pci_dev;
+ pdev = ETH_DEV_PCI_DEV(eth_dev);
rte_eth_copy_pci_info(eth_dev, pdev);
enic->pdev = pdev;
addr = &pdev->addr;
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 923690c..e1250f6 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -59,7 +59,8 @@
#define BIT_MASK_PER_UINT32 ((1 << CHARS_PER_UINT32) - 1)
/* default 1:1 map from queue ID to interrupt vector ID */
-#define Q2V(dev, queue_id) (dev->pci_dev->intr_handle.intr_vec[queue_id])
+#define D2IH(dev) (Ð_DEV_PCI_DEV(dev)->intr_handle)
+#define Q2V(dev, queue_id) (D2IH(dev)->intr_vec[queue_id])
/* First 64 Logical ports for PF/VMDQ, second 64 for Flow director */
#define MAX_LPORT_NUM 128
@@ -711,7 +712,7 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
{
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct fm10k_macvlan_filter_info *macvlan;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = D2IH(dev);
int i, ret;
struct fm10k_rx_queue *rxq;
uint64_t base_addr;
@@ -1171,7 +1172,7 @@ static void
fm10k_dev_stop(struct rte_eth_dev *dev)
{
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = D2IH(dev);
int i;
PMD_INIT_FUNC_TRACE();
@@ -1387,6 +1388,7 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info)
{
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
PMD_INIT_FUNC_TRACE();
@@ -1396,7 +1398,7 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev,
dev_info->max_tx_queues = hw->mac.max_queues;
dev_info->max_mac_addrs = FM10K_MAX_MACADDR_NUM;
dev_info->max_hash_mac_addrs = 0;
- dev_info->max_vfs = dev->pci_dev->max_vfs;
+ dev_info->max_vfs = pci_dev->max_vfs;
dev_info->vmdq_pool_base = 0;
dev_info->vmdq_queue_base = 0;
dev_info->max_vmdq_pools = ETH_32_POOLS;
@@ -2341,7 +2343,7 @@ fm10k_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
else
FM10K_WRITE_REG(hw, FM10K_VFITR(Q2V(dev, queue_id)),
FM10K_ITR_AUTOMASK | FM10K_ITR_MASK_CLEAR);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(D2IH(dev));
return 0;
}
@@ -2364,7 +2366,7 @@ static int
fm10k_dev_rxq_interrupt_setup(struct rte_eth_dev *dev)
{
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = D2IH(dev);
uint32_t intr_vector, vec;
uint16_t queue_id;
int result = 0;
@@ -2380,7 +2382,7 @@ fm10k_dev_rxq_interrupt_setup(struct rte_eth_dev *dev)
intr_vector = dev->data->nb_rx_queues;
/* disable interrupt first */
- rte_intr_disable(&dev->pci_dev->intr_handle);
+ rte_intr_disable(intr_handle);
if (hw->mac.type == fm10k_mac_pf)
fm10k_dev_disable_intr_pf(dev);
else
@@ -2415,7 +2417,7 @@ fm10k_dev_rxq_interrupt_setup(struct rte_eth_dev *dev)
fm10k_dev_enable_intr_pf(dev);
else
fm10k_dev_enable_intr_vf(dev);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(intr_handle);
hw->mac.ops.update_int_moderator(hw);
return result;
}
@@ -2581,7 +2583,7 @@ fm10k_dev_interrupt_handler_pf(
FM10K_WRITE_REG(hw, FM10K_ITR(0), FM10K_ITR_AUTOMASK |
FM10K_ITR_MASK_CLEAR);
/* Re-enable interrupt from host side */
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(D2IH(dev));
}
/**
@@ -2615,7 +2617,7 @@ fm10k_dev_interrupt_handler_vf(
FM10K_WRITE_REG(hw, FM10K_VFITR(0), FM10K_ITR_AUTOMASK |
FM10K_ITR_MASK_CLEAR);
/* Re-enable interrupt from host side */
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(D2IH(dev));
}
/* Mailbox message handler in VF */
@@ -2827,6 +2829,7 @@ static int
eth_fm10k_dev_init(struct rte_eth_dev *dev)
{
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
int diag, i;
struct fm10k_macvlan_filter_info *macvlan;
@@ -2840,18 +2843,18 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- rte_eth_copy_pci_info(dev, dev->pci_dev);
+ rte_eth_copy_pci_info(dev, pci_dev);
macvlan = FM10K_DEV_PRIVATE_TO_MACVLAN(dev->data->dev_private);
memset(macvlan, 0, sizeof(*macvlan));
/* Vendor and Device ID need to be set before init of shared code */
memset(hw, 0, sizeof(*hw));
- hw->device_id = dev->pci_dev->id.device_id;
- hw->vendor_id = dev->pci_dev->id.vendor_id;
- hw->subsystem_device_id = dev->pci_dev->id.subsystem_device_id;
- hw->subsystem_vendor_id = dev->pci_dev->id.subsystem_vendor_id;
+ hw->device_id = pci_dev->id.device_id;
+ hw->vendor_id = pci_dev->id.vendor_id;
+ hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
+ hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
hw->revision_id = 0;
- hw->hw_addr = (void *)dev->pci_dev->mem_resource[0].addr;
+ hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
if (hw->hw_addr == NULL) {
PMD_INIT_LOG(ERR, "Bad mem resource."
" Try to blacklist unused devices.");
@@ -2921,20 +2924,20 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
/*PF/VF has different interrupt handling mechanism */
if (hw->mac.type == fm10k_mac_pf) {
/* register callback func to eal lib */
- rte_intr_callback_register(&(dev->pci_dev->intr_handle),
+ rte_intr_callback_register(D2IH(dev),
fm10k_dev_interrupt_handler_pf, (void *)dev);
/* enable MISC interrupt */
fm10k_dev_enable_intr_pf(dev);
} else { /* VF */
- rte_intr_callback_register(&(dev->pci_dev->intr_handle),
+ rte_intr_callback_register(D2IH(dev),
fm10k_dev_interrupt_handler_vf, (void *)dev);
fm10k_dev_enable_intr_vf(dev);
}
/* Enable intr after callback registered */
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(D2IH(dev));
hw->mac.ops.update_int_moderator(hw);
@@ -3004,7 +3007,7 @@ static int
eth_fm10k_dev_uninit(struct rte_eth_dev *dev)
{
struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
+ struct rte_intr_handle *intr_handle = D2IH(dev);
PMD_INIT_FUNC_TRACE();
/* only uninitialize in the primary process */
@@ -3019,7 +3022,7 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev)
dev->tx_pkt_burst = NULL;
/* disable uio/vfio intr */
- rte_intr_disable(&(dev->pci_dev->intr_handle));
+ rte_intr_disable(intr_handle);
/*PF/VF has different interrupt handling mechanism */
if (hw->mac.type == fm10k_mac_pf) {
@@ -3027,13 +3030,13 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev)
fm10k_dev_disable_intr_pf(dev);
/* unregister callback func to eal lib */
- rte_intr_callback_unregister(&(dev->pci_dev->intr_handle),
+ rte_intr_callback_unregister(intr_handle,
fm10k_dev_interrupt_handler_pf, (void *)dev);
} else {
/* disable interrupt */
fm10k_dev_disable_intr_vf(dev);
- rte_intr_callback_unregister(&(dev->pci_dev->intr_handle),
+ rte_intr_callback_unregister(intr_handle,
fm10k_dev_interrupt_handler_vf, (void *)dev);
}
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 67778ba..8a63a8c 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -907,7 +907,7 @@ is_floating_veb_supported(struct rte_devargs *devargs)
static void
config_floating_veb(struct rte_eth_dev *dev)
{
- struct rte_pci_device *pci_dev = dev->pci_dev;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -952,7 +952,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)
i40e_set_tx_function(dev);
return 0;
}
- pci_dev = dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(dev);
rte_eth_copy_pci_info(dev, pci_dev);
@@ -1215,7 +1215,7 @@ eth_i40e_dev_uninit(struct rte_eth_dev *dev)
return 0;
hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- pci_dev = dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(dev);
if (hw->adapter_stopped == 0)
i40e_dev_close(dev);
@@ -1335,7 +1335,7 @@ void
i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi)
{
struct rte_eth_dev *dev = vsi->adapter->eth_dev;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
uint16_t msix_vect = vsi->msix_intr;
uint16_t i;
@@ -1448,7 +1448,7 @@ void
i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi)
{
struct rte_eth_dev *dev = vsi->adapter->eth_dev;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
uint16_t msix_vect = vsi->msix_intr;
uint16_t nb_msix = RTE_MIN(vsi->nb_msix, intr_handle->nb_efd);
@@ -1519,7 +1519,7 @@ static void
i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)
{
struct rte_eth_dev *dev = vsi->adapter->eth_dev;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
uint16_t interval = i40e_calc_itr_interval(\
RTE_LIBRTE_I40E_ITR_INTERVAL);
@@ -1550,7 +1550,7 @@ static void
i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi)
{
struct rte_eth_dev *dev = vsi->adapter->eth_dev;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
uint16_t msix_intr, i;
@@ -1675,7 +1675,7 @@ i40e_dev_start(struct rte_eth_dev *dev)
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct i40e_vsi *main_vsi = pf->main_vsi;
int ret, i;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
uint32_t intr_vector = 0;
hw->adapter_stopped = 0;
@@ -1808,7 +1808,7 @@ i40e_dev_stop(struct rte_eth_dev *dev)
struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
struct i40e_vsi *main_vsi = pf->main_vsi;
struct i40e_mirror_rule *p_mirror;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
int i;
/* Disable all queues */
@@ -1870,7 +1870,7 @@ i40e_dev_close(struct rte_eth_dev *dev)
/* Disable interrupt */
i40e_pf_disable_irq0(hw);
- rte_intr_disable(&(dev->pci_dev->intr_handle));
+ rte_intr_disable(ETH_DEV_TO_INTR_HANDLE(dev));
/* shutdown and destroy the HMC */
i40e_shutdown_lan_hmc(hw);
@@ -2588,7 +2588,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;
dev_info->max_rx_pktlen = I40E_FRAME_SIZE_MAX;
dev_info->max_mac_addrs = vsi->max_macaddrs;
- dev_info->max_vfs = dev->pci_dev->max_vfs;
+ dev_info->max_vfs = ETH_DEV_PCI_DEV(dev)->max_vfs;
dev_info->rx_offload_capa =
DEV_RX_OFFLOAD_VLAN_STRIP |
DEV_RX_OFFLOAD_QINQ_STRIP |
@@ -3488,11 +3488,12 @@ i40e_get_cap(struct i40e_hw *hw)
static int
i40e_pf_parameter_init(struct rte_eth_dev *dev)
{
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
struct i40e_hw *hw = I40E_PF_TO_HW(pf);
uint16_t qp_count = 0, vsi_count = 0;
- if (dev->pci_dev->max_vfs && !hw->func_caps.sr_iov_1_1) {
+ if (pci_dev->max_vfs && !hw->func_caps.sr_iov_1_1) {
PMD_INIT_LOG(ERR, "HW configuration doesn't support SRIOV");
return -EINVAL;
}
@@ -3533,10 +3534,10 @@ i40e_pf_parameter_init(struct rte_eth_dev *dev)
/* VF queue/VSI allocation */
pf->vf_qp_offset = pf->lan_qp_offset + pf->lan_nb_qps;
- if (hw->func_caps.sr_iov_1_1 && dev->pci_dev->max_vfs) {
+ if (hw->func_caps.sr_iov_1_1 && pci_dev->max_vfs) {
pf->flags |= I40E_FLAG_SRIOV;
pf->vf_nb_qps = RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF;
- pf->vf_num = dev->pci_dev->max_vfs;
+ pf->vf_num = pci_dev->max_vfs;
PMD_DRV_LOG(DEBUG, "%u VF VSIs, %u queues per VF VSI, "
"in total %u queues", pf->vf_num, pf->vf_nb_qps,
pf->vf_nb_qps * pf->vf_num);
@@ -5573,7 +5574,7 @@ i40e_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
done:
/* Enable interrupt */
i40e_pf_enable_irq0(hw);
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(ETH_DEV_TO_INTR_HANDLE(dev));
}
static int
@@ -8124,10 +8125,11 @@ i40e_dev_filter_ctrl(struct rte_eth_dev *dev,
static void
i40e_enable_extended_tag(struct rte_eth_dev *dev)
{
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
uint32_t buf = 0;
int ret;
- ret = rte_eal_pci_read_config(dev->pci_dev, &buf, sizeof(buf),
+ ret = rte_eal_pci_read_config(pci_dev, &buf, sizeof(buf),
PCI_DEV_CAP_REG);
if (ret < 0) {
PMD_DRV_LOG(ERR, "Failed to read PCI offset 0x%x",
@@ -8140,7 +8142,7 @@ i40e_enable_extended_tag(struct rte_eth_dev *dev)
}
buf = 0;
- ret = rte_eal_pci_read_config(dev->pci_dev, &buf, sizeof(buf),
+ ret = rte_eal_pci_read_config(pci_dev, &buf, sizeof(buf),
PCI_DEV_CTRL_REG);
if (ret < 0) {
PMD_DRV_LOG(ERR, "Failed to read PCI offset 0x%x",
@@ -8152,7 +8154,7 @@ i40e_enable_extended_tag(struct rte_eth_dev *dev)
return;
}
buf |= PCI_DEV_CTRL_EXT_TAG_MASK;
- ret = rte_eal_pci_write_config(dev->pci_dev, &buf, sizeof(buf),
+ ret = rte_eal_pci_write_config(pci_dev, &buf, sizeof(buf),
PCI_DEV_CTRL_REG);
if (ret < 0) {
PMD_DRV_LOG(ERR, "Failed to write PCI offset 0x%x",
@@ -9555,7 +9557,7 @@ i40e_dev_get_dcb_info(struct rte_eth_dev *dev,
static int
i40e_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
{
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
uint16_t interval =
i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL);
@@ -9580,7 +9582,7 @@ i40e_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
I40E_PFINT_DYN_CTLN_INTERVAL_SHIFT));
I40E_WRITE_FLUSH(hw);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(ETH_DEV_TO_INTR_HANDLE(dev));
return 0;
}
@@ -9588,7 +9590,7 @@ i40e_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
static int
i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
{
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
uint16_t msix_intr;
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))
+
static inline void
i40e_init_adminq_parameter(struct i40e_hw *hw)
{
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index aa306d6..781e658 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -718,7 +718,7 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
uint8_t cmd_buffer[sizeof(struct i40e_virtchnl_irq_map_info) + \
sizeof(struct i40e_virtchnl_vector_map)];
struct i40e_virtchnl_irq_map_info *map_info;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
uint32_t vector_id;
int i, err;
@@ -1431,7 +1431,7 @@ i40evf_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
done:
i40evf_enable_irq0(hw);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(ETH_DEV_TO_INTR_HANDLE(dev));
}
static int
@@ -1439,7 +1439,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
{
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(\
eth_dev->data->dev_private);
- struct rte_pci_device *pci_dev = eth_dev->pci_dev;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(eth_dev);
PMD_INIT_FUNC_TRACE();
@@ -1458,15 +1458,15 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
return 0;
}
- rte_eth_copy_pci_info(eth_dev, eth_dev->pci_dev);
+ rte_eth_copy_pci_info(eth_dev, pci_dev);
- hw->vendor_id = eth_dev->pci_dev->id.vendor_id;
- hw->device_id = eth_dev->pci_dev->id.device_id;
- hw->subsystem_vendor_id = eth_dev->pci_dev->id.subsystem_vendor_id;
- hw->subsystem_device_id = eth_dev->pci_dev->id.subsystem_device_id;
- hw->bus.device = eth_dev->pci_dev->addr.devid;
- hw->bus.func = eth_dev->pci_dev->addr.function;
- hw->hw_addr = (void *)eth_dev->pci_dev->mem_resource[0].addr;
+ hw->vendor_id = pci_dev->id.vendor_id;
+ hw->device_id = pci_dev->id.device_id;
+ hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
+ hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
+ hw->bus.device = pci_dev->addr.devid;
+ hw->bus.func = pci_dev->addr.function;
+ hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
hw->adapter_stopped = 0;
if(i40evf_init_vf(eth_dev) != 0) {
@@ -1853,7 +1853,7 @@ i40evf_enable_queues_intr(struct rte_eth_dev *dev)
{
struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
if (!rte_intr_allow_others(intr_handle)) {
I40E_WRITE_REG(hw,
@@ -1885,7 +1885,7 @@ i40evf_disable_queues_intr(struct rte_eth_dev *dev)
{
struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
if (!rte_intr_allow_others(intr_handle)) {
I40E_WRITE_REG(hw, I40E_VFINT_DYN_CTL01,
@@ -1911,7 +1911,7 @@ i40evf_disable_queues_intr(struct rte_eth_dev *dev)
static int
i40evf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
{
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
uint16_t interval =
i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL);
@@ -1937,7 +1937,7 @@ i40evf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
I40EVF_WRITE_FLUSH(hw);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(ETH_DEV_TO_INTR_HANDLE(dev));
return 0;
}
@@ -1945,7 +1945,7 @@ i40evf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
static int
i40evf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
{
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
uint16_t msix_intr;
@@ -2025,7 +2025,7 @@ i40evf_dev_start(struct rte_eth_dev *dev)
{
struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
uint32_t intr_vector = 0;
PMD_INIT_FUNC_TRACE();
@@ -2090,7 +2090,7 @@ i40evf_dev_start(struct rte_eth_dev *dev)
static void
i40evf_dev_stop(struct rte_eth_dev *dev)
{
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
PMD_INIT_FUNC_TRACE();
@@ -2285,7 +2285,7 @@ static void
i40evf_dev_close(struct rte_eth_dev *dev)
{
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_pci_device *pci_dev = dev->pci_dev;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
i40evf_dev_stop(dev);
hw->adapter_stopped = 1;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index edc9b22..f17da46 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -427,6 +427,9 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
(r) = (h)->bitmap[idx] >> bit & 1;\
} while (0)
+#define ETH_DEV_TO_INTR_HANDLE(ptr) \
+ (&(ETH_DEV_PCI_DEV(ptr)->intr_handle))
+
/*
* The set of PCI devices this driver supports
*/
@@ -1127,7 +1130,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
return 0;
}
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
rte_eth_copy_pci_info(eth_dev, pci_dev);
@@ -1302,7 +1305,7 @@ eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev)
return -EPERM;
hw = IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
if (hw->adapter_stopped == 0)
ixgbe_dev_close(eth_dev);
@@ -1419,7 +1422,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
return 0;
}
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
rte_eth_copy_pci_info(eth_dev, pci_dev);
@@ -1532,7 +1535,9 @@ static int
eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev)
{
struct ixgbe_hw *hw;
- struct rte_pci_device *pci_dev = eth_dev->pci_dev;
+ struct rte_pci_device *pci_dev;
+
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
PMD_INIT_FUNC_TRACE();
@@ -1960,7 +1965,8 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
}
RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
- RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = dev->pci_dev->max_vfs * nb_rx_q;
+ RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+ ETH_DEV_PCI_DEV(dev)->max_vfs * nb_rx_q;
return 0;
}
@@ -2191,7 +2197,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct ixgbe_vf_info *vfinfo =
*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
uint32_t intr_vector = 0;
int err, link_up = 0, negotiate = 0;
uint32_t speed = 0;
@@ -2291,7 +2298,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
/* Restore vf rate limit */
if (vfinfo != NULL) {
- for (vf = 0; vf < dev->pci_dev->max_vfs; vf++)
+ for (vf = 0; vf < pci_dev->max_vfs; vf++)
for (idx = 0; idx < IXGBE_MAX_QUEUE_NUM_PER_VF; idx++)
if (vfinfo[vf].tx_rate[idx] != 0)
ixgbe_set_vf_rate_limit(dev, vf,
@@ -2408,7 +2415,8 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
struct ixgbe_filter_info *filter_info =
IXGBE_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private);
struct ixgbe_5tuple_filter *p_5tuple, *p_5tuple_next;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
int vf;
PMD_INIT_FUNC_TRACE();
@@ -2424,7 +2432,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
ixgbe_stop_adapter(hw);
for (vf = 0; vfinfo != NULL &&
- vf < dev->pci_dev->max_vfs; vf++)
+ vf < pci_dev->max_vfs; vf++)
vfinfo[vf].clear_to_send = false;
if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) {
@@ -3033,6 +3041,7 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
@@ -3049,7 +3058,7 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->max_rx_pktlen = 15872; /* includes CRC, cf MAXFRS register */
dev_info->max_mac_addrs = hw->mac.num_rar_entries;
dev_info->max_hash_mac_addrs = IXGBE_VMDQ_NUM_UC_MAC;
- dev_info->max_vfs = dev->pci_dev->max_vfs;
+ dev_info->max_vfs = pci_dev->max_vfs;
if (hw->mac.type == ixgbe_mac_82598EB)
dev_info->max_vmdq_pools = ETH_16_POOLS;
else
@@ -3164,6 +3173,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
@@ -3171,7 +3181,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev,
dev_info->max_rx_pktlen = 15872; /* includes CRC, cf MAXFRS reg */
dev_info->max_mac_addrs = hw->mac.num_rar_entries;
dev_info->max_hash_mac_addrs = IXGBE_VMDQ_NUM_UC_MAC;
- dev_info->max_vfs = dev->pci_dev->max_vfs;
+ dev_info->max_vfs = pci_dev->max_vfs;
if (hw->mac.type == ixgbe_mac_82598EB)
dev_info->max_vmdq_pools = ETH_16_POOLS;
else
@@ -3434,6 +3444,7 @@ static void
ixgbe_dev_link_status_print(struct rte_eth_dev *dev)
{
struct rte_eth_link link;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
memset(&link, 0, sizeof(link));
rte_ixgbe_dev_atomic_read_link_status(dev, &link);
@@ -3448,10 +3459,10 @@ ixgbe_dev_link_status_print(struct rte_eth_dev *dev)
(int)(dev->data->port_id));
}
PMD_INIT_LOG(DEBUG, "PCI Address: " PCI_PRI_FMT,
- dev->pci_dev->addr.domain,
- dev->pci_dev->addr.bus,
- dev->pci_dev->addr.devid,
- dev->pci_dev->addr.function);
+ pci_dev->addr.domain,
+ pci_dev->addr.bus,
+ pci_dev->addr.devid,
+ pci_dev->addr.function);
}
/*
@@ -3515,7 +3526,7 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)
} else {
PMD_DRV_LOG(DEBUG, "enable intr immediately");
ixgbe_enable_intr(dev);
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(ETH_DEV_TO_INTR_HANDLE(dev));
}
@@ -3564,7 +3575,7 @@ ixgbe_dev_interrupt_delayed_handler(void *param)
PMD_DRV_LOG(DEBUG, "enable intr in delayed handler S[%08x]", eicr);
ixgbe_enable_intr(dev);
- rte_intr_enable(&(dev->pci_dev->intr_handle));
+ rte_intr_enable(ETH_DEV_TO_INTR_HANDLE(dev));
}
/**
@@ -4196,7 +4207,7 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
uint32_t intr_vector = 0;
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
int err, mask = 0;
@@ -4259,7 +4270,7 @@ static void
ixgbevf_dev_stop(struct rte_eth_dev *dev)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
PMD_INIT_FUNC_TRACE();
@@ -5070,7 +5081,7 @@ ixgbevf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
RTE_SET_USED(queue_id);
IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, mask);
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(ETH_DEV_TO_INTR_HANDLE(dev));
return 0;
}
@@ -5112,7 +5123,7 @@ ixgbe_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
mask &= (1 << (queue_id - 32));
IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask);
}
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(ETH_DEV_TO_INTR_HANDLE(dev));
return 0;
}
@@ -5216,7 +5227,7 @@ ixgbe_set_ivar_map(struct ixgbe_hw *hw, int8_t direction,
static void
ixgbevf_configure_msix(struct rte_eth_dev *dev)
{
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
uint32_t q_idx;
@@ -5249,7 +5260,7 @@ ixgbevf_configure_msix(struct rte_eth_dev *dev)
static void
ixgbe_configure_msix(struct rte_eth_dev *dev)
{
- struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
+ struct rte_intr_handle *intr_handle = ETH_DEV_TO_INTR_HANDLE(dev);
struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
uint32_t queue_id, base = IXGBE_MISC_VEC_ID;
@@ -5381,7 +5392,8 @@ static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
return -EINVAL;
if (vfinfo != NULL) {
- for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
+ for (vf_idx = 0; vf_idx < ETH_DEV_PCI_DEV(dev)->max_vfs;
+ vf_idx++) {
if (vf_idx == vf)
continue;
for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
@@ -7197,12 +7209,13 @@ ixgbe_e_tag_insertion_en_dis(struct rte_eth_dev *dev,
int ret = 0;
uint32_t vmtir, vmvir;
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
- if (l2_tunnel->vf_id >= dev->pci_dev->max_vfs) {
+ if (l2_tunnel->vf_id >= pci_dev->max_vfs) {
PMD_DRV_LOG(ERR,
"VF id %u should be less than %u",
l2_tunnel->vf_id,
- dev->pci_dev->max_vfs);
+ pci_dev->max_vfs);
return -EINVAL;
}
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 26395e4..139d816 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -61,7 +61,7 @@
static inline uint16_t
dev_num_vf(struct rte_eth_dev *eth_dev)
{
- return eth_dev->pci_dev->max_vfs;
+ return ETH_DEV_PCI_DEV(eth_dev)->max_vfs;
}
static inline
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index c6b1587..7299fad 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -718,10 +718,12 @@ static void
nfp_net_close(struct rte_eth_dev *dev)
{
struct nfp_net_hw *hw;
+ struct rte_pci_device *pci_dev;
PMD_INIT_LOG(DEBUG, "Close\n");
hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ pci_dev = ETH_DEV_PCI_DEV(dev);
/*
* We assume that the DPDK application is stopping all the
@@ -730,11 +732,11 @@ nfp_net_close(struct rte_eth_dev *dev)
nfp_net_stop(dev);
- rte_intr_disable(&dev->pci_dev->intr_handle);
+ rte_intr_disable(&pci_dev->intr_handle);
nn_cfg_writeb(hw, NFP_NET_CFG_LSC, 0xff);
/* unregister callback func from eal lib */
- rte_intr_callback_unregister(&dev->pci_dev->intr_handle,
+ rte_intr_callback_unregister(&pci_dev->intr_handle,
nfp_net_dev_interrupt_handler,
(void *)dev);
@@ -1122,6 +1124,7 @@ nfp_net_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_idx)
static void
nfp_net_dev_link_status_print(struct rte_eth_dev *dev)
{
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
struct rte_eth_link link;
memset(&link, 0, sizeof(link));
@@ -1136,8 +1139,8 @@ nfp_net_dev_link_status_print(struct rte_eth_dev *dev)
(int)(dev->data->port_id));
RTE_LOG(INFO, PMD, "PCI Address: %04d:%02d:%02d:%d\n",
- dev->pci_dev->addr.domain, dev->pci_dev->addr.bus,
- dev->pci_dev->addr.devid, dev->pci_dev->addr.function);
+ pci_dev->addr.domain, pci_dev->addr.bus,
+ pci_dev->addr.devid, pci_dev->addr.function);
}
/* Interrupt configuration and handling */
@@ -1158,7 +1161,7 @@ nfp_net_irq_unmask(struct rte_eth_dev *dev)
if (hw->ctrl & NFP_NET_CFG_CTRL_MSIXAUTO) {
/* If MSI-X auto-masking is used, clear the entry */
rte_wmb();
- rte_intr_enable(&dev->pci_dev->intr_handle);
+ rte_intr_enable(&(ETH_DEV_PCI_DEV(dev)->intr_handle));
} else {
/* Make sure all updates are written before un-masking */
rte_wmb();
@@ -2330,7 +2333,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
rte_eth_copy_pci_info(eth_dev, pci_dev);
hw->device_id = pci_dev->id.device_id;
@@ -2400,7 +2403,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
hw->cap & NFP_NET_CFG_CTRL_LSO ? "TSO " : "",
hw->cap & NFP_NET_CFG_CTRL_RSS ? "RSS " : "");
- pci_dev = eth_dev->pci_dev;
hw->ctrl = 0;
hw->stride_rx = stride;
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index d106dd0..959ff0f 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -178,11 +178,12 @@ static void
qede_interrupt_handler(__rte_unused struct rte_intr_handle *handle, void *param)
{
struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(eth_dev);
struct qede_dev *qdev = eth_dev->data->dev_private;
struct ecore_dev *edev = &qdev->edev;
qede_interrupt_action(ECORE_LEADING_HWFN(edev));
- if (rte_intr_enable(ð_dev->pci_dev->intr_handle))
+ if (rte_intr_enable(&pci_dev->intr_handle))
DP_ERR(edev, "rte_intr_enable failed\n");
}
@@ -809,6 +810,7 @@ static void qede_poll_sp_sb_cb(void *param)
static void qede_dev_close(struct rte_eth_dev *eth_dev)
{
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(eth_dev);
struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
int rc;
@@ -835,9 +837,9 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
qdev->ops->common->remove(edev);
- rte_intr_disable(ð_dev->pci_dev->intr_handle);
+ rte_intr_disable(&pci_dev->intr_handle);
- rte_intr_callback_unregister(ð_dev->pci_dev->intr_handle,
+ rte_intr_callback_unregister(&pci_dev->intr_handle,
qede_interrupt_handler, (void *)eth_dev);
if (edev->num_hwfns > 1)
@@ -1403,7 +1405,8 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
/* Extract key data structures */
adapter = eth_dev->data->dev_private;
edev = &adapter->edev;
- pci_addr = eth_dev->pci_dev->addr;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
+ pci_addr = pci_dev->addr;
PMD_INIT_FUNC_TRACE(edev);
@@ -1420,8 +1423,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
return 0;
}
- pci_dev = eth_dev->pci_dev;
-
rte_eth_copy_pci_info(eth_dev, pci_dev);
qed_ops = qed_get_eth_ops();
@@ -1442,10 +1443,10 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
qede_update_pf_params(edev);
- rte_intr_callback_register(ð_dev->pci_dev->intr_handle,
+ rte_intr_callback_register(&pci_dev->intr_handle,
qede_interrupt_handler, (void *)eth_dev);
- if (rte_intr_enable(ð_dev->pci_dev->intr_handle)) {
+ if (rte_intr_enable(&pci_dev->intr_handle)) {
DP_ERR(edev, "rte_intr_enable() failed\n");
return -ENODEV;
}
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index f3cd52d..6d80a5b 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1357,7 +1357,7 @@ get_szedata2_index(struct rte_eth_dev *dev, uint32_t *index)
uint32_t tmp_index;
FILE *fd;
char pcislot_path[PATH_MAX];
- struct rte_pci_addr pcislot_addr = dev->pci_dev->addr;
+ struct rte_pci_addr pcislot_addr = ETH_DEV_PCI_DEV(dev)->addr;
uint32_t domain;
uint32_t bus;
uint32_t devid;
@@ -1415,9 +1415,10 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev)
struct szedata *szedata_temp;
int ret;
uint32_t szedata2_index;
- struct rte_pci_addr *pci_addr = &dev->pci_dev->addr;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ struct rte_pci_addr *pci_addr = &pci_dev->addr;
struct rte_mem_resource *pci_rsc =
- &dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER];
+ &pci_dev->mem_resource[PCI_RESOURCE_NUMBER];
char rsc_filename[PATH_MAX];
void *pci_resource_ptr = NULL;
int fd;
@@ -1471,10 +1472,10 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev)
/* Set function callbacks for Ethernet API */
dev->dev_ops = &ops;
- rte_eth_copy_pci_info(dev, dev->pci_dev);
+ rte_eth_copy_pci_info(dev, pci_dev);
/* mmap pci resource0 file to rte_mem_resource structure */
- if (dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].phys_addr ==
+ if (pci_dev->mem_resource[PCI_RESOURCE_NUMBER].phys_addr ==
0) {
RTE_LOG(ERR, PMD, "Missing resource%u file\n",
PCI_RESOURCE_NUMBER);
@@ -1491,7 +1492,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev)
}
pci_resource_ptr = mmap(0,
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].len,
+ pci_dev->mem_resource[PCI_RESOURCE_NUMBER].len,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
close(fd);
if (pci_resource_ptr == NULL) {
@@ -1499,8 +1500,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev)
rsc_filename, fd);
return -EINVAL;
}
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr =
- pci_resource_ptr;
+ pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr = pci_resource_ptr;
RTE_LOG(DEBUG, PMD, "resource%u phys_addr = 0x%llx len = %llu "
"virt addr = %llx\n", PCI_RESOURCE_NUMBER,
@@ -1516,8 +1516,8 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev)
RTE_CACHE_LINE_SIZE);
if (data->mac_addrs == NULL) {
RTE_LOG(ERR, PMD, "Could not alloc space for MAC address!\n");
- munmap(dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr,
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].len);
+ munmap(pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr,
+ pci_dev->mem_resource[PCI_RESOURCE_NUMBER].len);
return -EINVAL;
}
@@ -1537,12 +1537,13 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev)
static int
rte_szedata2_eth_dev_uninit(struct rte_eth_dev *dev)
{
- struct rte_pci_addr *pci_addr = &dev->pci_dev->addr;
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ struct rte_pci_addr *pci_addr = &pci_dev->addr;
rte_free(dev->data->mac_addrs);
dev->data->mac_addrs = NULL;
- munmap(dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr,
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].len);
+ munmap(pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr,
+ pci_dev->mem_resource[PCI_RESOURCE_NUMBER].len);
RTE_LOG(INFO, PMD, "szedata2 device ("
PCI_PRI_FMT ") successfully uninitialized\n",
diff --git a/drivers/net/szedata2/rte_eth_szedata2.h b/drivers/net/szedata2/rte_eth_szedata2.h
index 522cf47..1c28c42 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.h
+++ b/drivers/net/szedata2/rte_eth_szedata2.h
@@ -120,8 +120,8 @@ static inline uint8_t
pci_resource_read8(struct rte_eth_dev *dev, uint32_t offset)
{
return *((uint8_t *)((uint8_t *)
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr +
- offset));
+ ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr +
+ offset));
}
/*
@@ -131,8 +131,8 @@ static inline uint16_t
pci_resource_read16(struct rte_eth_dev *dev, uint32_t offset)
{
return rte_le_to_cpu_16(*((uint16_t *)((uint8_t *)
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr +
- offset)));
+ ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr +
+ offset)));
}
/*
@@ -142,8 +142,8 @@ static inline uint32_t
pci_resource_read32(struct rte_eth_dev *dev, uint32_t offset)
{
return rte_le_to_cpu_32(*((uint32_t *)((uint8_t *)
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr +
- offset)));
+ ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr +
+ offset)));
}
/*
@@ -153,8 +153,8 @@ static inline uint64_t
pci_resource_read64(struct rte_eth_dev *dev, uint32_t offset)
{
return rte_le_to_cpu_64(*((uint64_t *)((uint8_t *)
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr +
- offset)));
+ ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr +
+ offset)));
}
/*
@@ -164,8 +164,8 @@ static inline void
pci_resource_write8(struct rte_eth_dev *dev, uint32_t offset, uint8_t val)
{
*((uint8_t *)((uint8_t *)
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr +
- offset)) = val;
+ ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr +
+ offset)) = val;
}
/*
@@ -175,8 +175,8 @@ static inline void
pci_resource_write16(struct rte_eth_dev *dev, uint32_t offset, uint16_t val)
{
*((uint16_t *)((uint8_t *)
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr +
- offset)) = rte_cpu_to_le_16(val);
+ ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr +
+ offset)) = rte_cpu_to_le_16(val);
}
/*
@@ -186,8 +186,8 @@ static inline void
pci_resource_write32(struct rte_eth_dev *dev, uint32_t offset, uint32_t val)
{
*((uint32_t *)((uint8_t *)
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr +
- offset)) = rte_cpu_to_le_32(val);
+ ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr +
+ offset)) = rte_cpu_to_le_32(val);
}
/*
@@ -197,13 +197,13 @@ static inline void
pci_resource_write64(struct rte_eth_dev *dev, uint32_t offset, uint64_t val)
{
*((uint64_t *)((uint8_t *)
- dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr +
- offset)) = rte_cpu_to_le_64(val);
+ ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr +
+ offset)) = rte_cpu_to_le_64(val);
}
#define SZEDATA2_PCI_RESOURCE_PTR(dev, offset, type) \
((type)((uint8_t *) \
- ((dev)->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr) \
+ (ETH_DEV_PCI_DEV(dev)->mem_resource[PCI_RESOURCE_NUMBER].addr) \
+ (offset)))
enum szedata2_link_speed {
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 466e49c..099b252 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1335,6 +1335,7 @@ static void
nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
{
struct nicvf *nic = nicvf_pmd_priv(dev);
+ struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
PMD_INIT_FUNC_TRACE();
@@ -1345,7 +1346,7 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->max_tx_queues =
(uint16_t)MAX_SND_QUEUES_PER_QS * (MAX_SQS_PER_VF + 1);
dev_info->max_mac_addrs = 1;
- dev_info->max_vfs = dev->pci_dev->max_vfs;
+ dev_info->max_vfs = pci_dev->max_vfs;
dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
dev_info->tx_offload_capa =
@@ -1975,7 +1976,7 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
}
}
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
rte_eth_copy_pci_info(eth_dev, pci_dev);
nic->device_id = pci_dev->id.device_id;
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 8bb13e5..bcb3751 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -138,7 +138,7 @@ gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,
const struct rte_memzone *mz;
snprintf(z_name, sizeof(z_name), "%s_%d_%s",
- dev->driver->pci_drv.driver.name, dev->data->port_id, post_string);
+ dev->data->drv_name, dev->data->port_id, post_string);
mz = rte_memzone_lookup(z_name);
if (!reuse) {
@@ -237,7 +237,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
eth_dev->dev_ops = &vmxnet3_eth_dev_ops;
eth_dev->rx_pkt_burst = &vmxnet3_recv_pkts;
eth_dev->tx_pkt_burst = &vmxnet3_xmit_pkts;
- pci_dev = eth_dev->pci_dev;
+ pci_dev = ETH_DEV_PCI_DEV(eth_dev);
/*
* for secondary processes, we don't initialize any further as primary
--
2.7.4
^ permalink raw reply related
* [PATCH v3 4/9] virtio: Don't fill dev_info->driver_name
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
This is overwritten in rte_eth_dev_info_get().
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Reviewed-by: David Marchand <david.marchand@6wind.com>
---
drivers/net/virtio/virtio_ethdev.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 079fd6c..741688e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1624,10 +1624,6 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
uint64_t tso_mask;
struct virtio_hw *hw = dev->data->dev_private;
- if (dev->pci_dev)
- dev_info->driver_name = dev->driver->pci_drv.driver.name;
- else
- dev_info->driver_name = "virtio_user PMD";
dev_info->max_rx_queues =
RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_RX_QUEUES);
dev_info->max_tx_queues =
--
2.7.4
^ permalink raw reply related
* [PATCH v3 5/9] virtio: Add vtpci_intr_handle() helper to get rte_intr_handle
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
This adds a helper to get the rte_intr_handle from the virtio_hw. This is
safe to do since the usage of the helper is guarded by RTE_ETH_DEV_INTR_LSC
which is only set if we found a PCI device during initialization.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
drivers/net/virtio/virtio_ethdev.c | 12 +++++++-----
drivers/net/virtio/virtio_pci.h | 6 ++++++
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 741688e..da9668e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1162,7 +1162,7 @@ virtio_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
isr = vtpci_isr(hw);
PMD_DRV_LOG(INFO, "interrupt status = %#x", isr);
- if (rte_intr_enable(&dev->pci_dev->intr_handle) < 0)
+ if (rte_intr_enable(vtpci_intr_handle(hw)) < 0)
PMD_DRV_LOG(ERR, "interrupt enable failed");
if (isr & VIRTIO_PCI_ISR_CONFIG) {
@@ -1334,7 +1334,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
/* Setup interrupt callback */
if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
- rte_intr_callback_register(&pci_dev->intr_handle,
+ rte_intr_callback_register(vtpci_intr_handle(hw),
virtio_interrupt_handler, eth_dev);
return 0;
@@ -1344,6 +1344,7 @@ static int
eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
{
struct rte_pci_device *pci_dev;
+ struct virtio_hw *hw = eth_dev->data->dev_private;
PMD_INIT_FUNC_TRACE();
@@ -1363,7 +1364,7 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
/* reset interrupt callback */
if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
- rte_intr_callback_unregister(&pci_dev->intr_handle,
+ rte_intr_callback_unregister(vtpci_intr_handle(hw),
virtio_interrupt_handler,
eth_dev);
rte_eal_pci_unmap_device(pci_dev);
@@ -1481,7 +1482,7 @@ virtio_dev_start(struct rte_eth_dev *dev)
return -ENOTSUP;
}
- if (rte_intr_enable(&dev->pci_dev->intr_handle) < 0) {
+ if (rte_intr_enable(vtpci_intr_handle(hw)) < 0) {
PMD_DRV_LOG(ERR, "interrupt enable failed");
return -EIO;
}
@@ -1573,12 +1574,13 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev)
static void
virtio_dev_stop(struct rte_eth_dev *dev)
{
+ struct virtio_hw *hw = dev->data->dev_private;
struct rte_eth_link link;
PMD_INIT_LOG(DEBUG, "stop");
if (dev->data->dev_conf.intr_conf.lsc)
- rte_intr_disable(&dev->pci_dev->intr_handle);
+ rte_intr_disable(vtpci_intr_handle(hw));
memset(&link, 0, sizeof(link));
virtio_dev_atomic_write_link_status(dev, &link);
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index de271bf..5373e39 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -317,4 +317,10 @@ uint8_t vtpci_isr(struct virtio_hw *);
uint16_t vtpci_irq_config(struct virtio_hw *, uint16_t);
+static inline struct rte_intr_handle *
+vtpci_intr_handle(struct virtio_hw *hw)
+{
+ return hw->dev ? &hw->dev->intr_handle : NULL;
+}
+
#endif /* _VIRTIO_PCI_H_ */
--
2.7.4
^ permalink raw reply related
* [PATCH v3 6/9] virtio: Don't depend on struct rte_eth_dev's pci_dev
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
We don't need to depend on rte_eth_dev->pci_dev to differentiate between
the virtio_user and the virtio_pci case. Instead we can use the private
virtio_hw struct to get that information.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
drivers/net/virtio/virtio_ethdev.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index da9668e..023101d 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -483,11 +483,11 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
hw->cvq = cvq;
}
- /* For virtio_user case (that is when dev->pci_dev is NULL), we use
+ /* For virtio_user case (that is when hw->dev is NULL), we use
* virtual address. And we need properly set _offset_, please see
* VIRTIO_MBUF_DATA_DMA_ADDR in virtqueue.h for more information.
*/
- if (dev->pci_dev)
+ if (hw->dev)
vq->offset = offsetof(struct rte_mbuf, buf_physaddr);
else {
vq->vq_ring_mem = (uintptr_t)mz->addr;
@@ -1190,7 +1190,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
struct virtio_hw *hw = eth_dev->data->dev_private;
struct virtio_net_config *config;
struct virtio_net_config local_config;
- struct rte_pci_device *pci_dev = eth_dev->pci_dev;
+ struct rte_pci_device *pci_dev = hw->dev;
int ret;
/* Reset the device although not necessary at startup */
@@ -1294,7 +1294,6 @@ int
eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
{
struct virtio_hw *hw = eth_dev->data->dev_private;
- struct rte_pci_device *pci_dev;
uint32_t dev_flags = RTE_ETH_DEV_DETACHABLE;
int ret;
@@ -1317,10 +1316,11 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
return -ENOMEM;
}
- pci_dev = eth_dev->pci_dev;
-
- if (pci_dev) {
- ret = vtpci_init(pci_dev, hw, &dev_flags);
+ /* For virtio_user case the hw->virtio_user_dev is populated by
+ * virtio_user_eth_dev_alloc() before eth_virtio_dev_init() is called.
+ */
+ if (!hw->virtio_user_dev) {
+ ret = vtpci_init(ETH_DEV_PCI_DEV(eth_dev), hw, &dev_flags);
if (ret)
return ret;
}
@@ -1343,7 +1343,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
static int
eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
{
- struct rte_pci_device *pci_dev;
struct virtio_hw *hw = eth_dev->data->dev_private;
PMD_INIT_FUNC_TRACE();
@@ -1353,7 +1352,6 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
virtio_dev_stop(eth_dev);
virtio_dev_close(eth_dev);
- pci_dev = eth_dev->pci_dev;
eth_dev->dev_ops = NULL;
eth_dev->tx_pkt_burst = NULL;
@@ -1367,7 +1365,8 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
rte_intr_callback_unregister(vtpci_intr_handle(hw),
virtio_interrupt_handler,
eth_dev);
- rte_eal_pci_unmap_device(pci_dev);
+ if (hw->dev)
+ rte_eal_pci_unmap_device(hw->dev);
PMD_INIT_LOG(DEBUG, "dev_uninit completed");
--
2.7.4
^ permalink raw reply related
* [PATCH v3 7/9] ethdev: Move filling of rte_eth_dev_info->pci_dev to dev_infos_get()
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
Only the device itself can decide its PCI or not.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
drivers/net/bnx2x/bnx2x_ethdev.c | 1 +
drivers/net/bnxt/bnxt_ethdev.c | 2 ++
drivers/net/cxgbe/cxgbe_ethdev.c | 2 ++
drivers/net/e1000/em_ethdev.c | 1 +
drivers/net/e1000/igb_ethdev.c | 2 ++
drivers/net/ena/ena_ethdev.c | 2 ++
drivers/net/enic/enic_ethdev.c | 1 +
drivers/net/fm10k/fm10k_ethdev.c | 1 +
drivers/net/i40e/i40e_ethdev.c | 1 +
drivers/net/i40e/i40e_ethdev_vf.c | 1 +
drivers/net/ixgbe/ixgbe_ethdev.c | 2 ++
drivers/net/mlx4/mlx4.c | 2 ++
drivers/net/mlx5/mlx5_ethdev.c | 2 ++
drivers/net/nfp/nfp_net.c | 1 +
drivers/net/qede/qede_ethdev.c | 1 +
drivers/net/szedata2/rte_eth_szedata2.c | 1 +
drivers/net/thunderx/nicvf_ethdev.c | 2 ++
drivers/net/virtio/virtio_ethdev.c | 1 +
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 ++
lib/librte_ether/rte_ethdev.c | 1 -
20 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index c331ccd..551dbad 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -431,6 +431,7 @@ static void
bnx2x_dev_infos_get(struct rte_eth_dev *dev, __rte_unused struct rte_eth_dev_info *dev_info)
{
struct bnx2x_softc *sc = dev->data->dev_private;
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->max_rx_queues = sc->max_rx_queues;
dev_info->max_tx_queues = sc->max_tx_queues;
dev_info->min_rx_bufsize = BNX2X_MIN_RX_BUF_SIZE;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index cd50f11..bf39fbe 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -303,6 +303,8 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
uint16_t max_vnics, i, j, vpool, vrxq;
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(eth_dev);
+
/* MAC Specifics */
dev_info->max_mac_addrs = MAX_NUM_MAC_ADDR;
dev_info->max_hash_mac_addrs = 0;
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 8bfdda8..8938b08 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -147,6 +147,8 @@ static void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,
.nb_align = 1,
};
+ device_info->pci_dev = ETH_DEV_PCI_DEV(eth_dev);
+
device_info->min_rx_bufsize = CXGBE_MIN_RX_BUFSIZE;
device_info->max_rx_pktlen = CXGBE_MAX_RX_PKTLEN;
device_info->max_rx_queues = max_queues;
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 7f2f521..3d34e5b 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1048,6 +1048,7 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->min_rx_bufsize = 256; /* See BSIZE field of RCTL register. */
dev_info->max_rx_pktlen = em_get_max_pktlen(hw);
dev_info->max_mac_addrs = hw->mac.rar_entry_count;
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index b25c66e..7d77561 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1983,6 +1983,7 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->min_rx_bufsize = 256; /* See BSIZE field of RCTL register. */
dev_info->max_rx_pktlen = 0x3FFF; /* See RLPML register. */
dev_info->max_mac_addrs = hw->mac.rar_entry_count;
@@ -2111,6 +2112,7 @@ eth_igbvf_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
{
struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->min_rx_bufsize = 256; /* See BSIZE field of RCTL register. */
dev_info->max_rx_pktlen = 0x3FFF; /* See RLPML register. */
dev_info->max_mac_addrs = hw->mac.rar_entry_count;
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index c17d969..051275e 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1436,6 +1436,8 @@ static void ena_infos_get(struct rte_eth_dev *dev,
ena_dev = &adapter->ena_dev;
ena_assert_msg(ena_dev != NULL, "Uninitialized device");
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
+
dev_info->speed_capa =
ETH_LINK_SPEED_1G |
ETH_LINK_SPEED_2_5G |
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 553a88e..bb5dfe6 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -459,6 +459,7 @@ static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev,
struct enic *enic = pmd_priv(eth_dev);
ENICPMD_FUNC_TRACE();
+ device_info->pci_dev = ETH_DEV_PCI_DEV(eth_dev);
/* Scattered Rx uses two receive queues per rx queue exposed to dpdk */
device_info->max_rx_queues = enic->conf_rq_count / 2;
device_info->max_tx_queues = enic->conf_wq_count;
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index e1250f6..5d0bce5 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1392,6 +1392,7 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev,
PMD_INIT_FUNC_TRACE();
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->min_rx_bufsize = FM10K_MIN_RX_BUF_SIZE;
dev_info->max_rx_pktlen = FM10K_MAX_PKT_SIZE;
dev_info->max_rx_queues = hw->mac.max_queues;
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 8a63a8c..29c0277 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2583,6 +2583,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct i40e_vsi *vsi = pf->main_vsi;
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->max_rx_queues = vsi->nb_qps;
dev_info->max_tx_queues = vsi->nb_qps;
dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 781e658..caef72c 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2217,6 +2217,7 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
memset(dev_info, 0, sizeof(*dev_info));
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->max_rx_queues = vf->vsi_res->num_queue_pairs;
dev_info->max_tx_queues = vf->vsi_res->num_queue_pairs;
dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index f17da46..c88b7bf 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3043,6 +3043,7 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
@@ -3175,6 +3176,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev,
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct rte_pci_device *pci_dev = ETH_DEV_PCI_DEV(dev);
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL reg */
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index da61a85..5455fea 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -4421,6 +4421,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
unsigned int max;
char ifname[IF_NAMESIZE];
+ info->pci_dev = ETH_DEV_PCI_DEV(dev);
+
if (priv == NULL)
return;
priv_lock(priv);
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index c0f73e9..489a4f6 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -562,6 +562,8 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
unsigned int max;
char ifname[IF_NAMESIZE];
+ info->pci_dev = ETH_DEV_PCI_DEV(dev);
+
priv_lock(priv);
/* FIXME: we should ask the device for these values. */
info->min_rx_bufsize = 32;
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 7299fad..c49d38a 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1008,6 +1008,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->driver_name = dev->driver->pci_drv.driver.name;
dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues;
dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues;
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 959ff0f..2c4de92 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -652,6 +652,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
PMD_INIT_FUNC_TRACE(edev);
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(eth_dev);
dev_info->min_rx_bufsize = (uint32_t)(ETHER_MIN_MTU +
QEDE_ETH_OVERHEAD);
dev_info->max_rx_pktlen = (uint32_t)ETH_TX_MAX_NON_LSO_PKT_LEN;
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 6d80a5b..6356257 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -1030,6 +1030,7 @@ eth_dev_info(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info)
{
struct pmd_internals *internals = dev->data->dev_private;
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
dev_info->if_index = 0;
dev_info->max_mac_addrs = 1;
dev_info->max_rx_pktlen = (uint32_t)-1;
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 099b252..daac853 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1339,6 +1339,8 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
PMD_INIT_FUNC_TRACE();
+ dev_info->pci_dev = pci_dev;
+
dev_info->min_rx_bufsize = ETHER_MIN_MTU;
dev_info->max_rx_pktlen = NIC_HW_MAX_FRS;
dev_info->max_rx_queues =
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 023101d..2eb6a06 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1625,6 +1625,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
uint64_t tso_mask;
struct virtio_hw *hw = dev->data->dev_private;
+ dev_info->pci_dev = hw->dev;
dev_info->max_rx_queues =
RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_RX_QUEUES);
dev_info->max_tx_queues =
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index bcb3751..f7c0382 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -709,6 +709,8 @@ static void
vmxnet3_dev_info_get(__rte_unused struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info)
{
+ dev_info->pci_dev = ETH_DEV_PCI_DEV(dev);
+
dev_info->max_rx_queues = VMXNET3_MAX_RX_QUEUES;
dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES;
dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM;
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index fde8112..4288577 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1556,7 +1556,6 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)
RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
(*dev->dev_ops->dev_infos_get)(dev, dev_info);
- dev_info->pci_dev = dev->pci_dev;
dev_info->driver_name = dev->data->drv_name;
dev_info->nb_rx_queues = dev->data->nb_rx_queues;
dev_info->nb_tx_queues = dev->data->nb_tx_queues;
--
2.7.4
^ permalink raw reply related
* [PATCH v3 8/9] ethdev: Decouple interrupt handling from PCI device
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
The struct rte_intr_handle is an abstraction layer for different types of
interrupt mechanisms. It is embedded in the low-level device (e.g. PCI).
On allocation of a struct rte_eth_dev a reference to the intr_handle
should be stored for devices supporting interrupts.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
lib/librte_ether/rte_ethdev.c | 18 ++++++++++++++++--
lib/librte_ether/rte_ethdev.h | 1 +
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 4288577..4ecea50 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -258,6 +258,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
rte_panic("Cannot allocate memzone for private port data\n");
}
eth_dev->pci_dev = pci_dev;
+ eth_dev->intr_handle = &pci_dev->intr_handle;
eth_dev->driver = eth_drv;
eth_dev->data->rx_mbuf_alloc_failed = 0;
@@ -2543,7 +2544,13 @@ rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data)
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
dev = &rte_eth_devices[port_id];
- intr_handle = &dev->pci_dev->intr_handle;
+
+ if (!dev->intr_handle) {
+ RTE_PMD_DEBUG_TRACE("RX Intr handle unset\n");
+ return -ENOTSUP;
+ }
+
+ intr_handle = dev->intr_handle;
if (!intr_handle->intr_vec) {
RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n");
return -EPERM;
@@ -2603,7 +2610,12 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id,
return -EINVAL;
}
- intr_handle = &dev->pci_dev->intr_handle;
+ if (!dev->intr_handle) {
+ RTE_PMD_DEBUG_TRACE("RX Intr handle unset\n");
+ return -ENOTSUP;
+ }
+
+ intr_handle = dev->intr_handle;
if (!intr_handle->intr_vec) {
RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n");
return -EPERM;
@@ -3205,6 +3217,8 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de
return;
}
+ eth_dev->intr_handle = &pci_dev->intr_handle;
+
eth_dev->data->dev_flags = 0;
if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)
eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 3adbb2b..f1f656a 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1629,6 +1629,7 @@ struct rte_eth_dev {
const struct eth_driver *driver;/**< Driver for this device */
const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */
+ struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
/** User application callbacks for NIC interrupts */
struct rte_eth_dev_cb_list link_intr_cbs;
/**
--
2.7.4
^ permalink raw reply related
* [PATCH v3 9/9] ethdev: Decouple struct rte_eth_dev from struct rte_pci_device
From: Jan Blunck @ 2016-12-20 11:11 UTC (permalink / raw)
To: dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-1-git-send-email-jblunck@infradead.org>
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
app/test/virtual_pmd.c | 4 ++--
drivers/net/bonding/rte_eth_bond_args.c | 12 ++++++++++--
drivers/net/cxgbe/cxgbe_main.c | 4 ++--
drivers/net/fm10k/fm10k_ethdev.c | 6 +++---
drivers/net/virtio/virtio_user_ethdev.c | 1 -
lib/librte_eal/common/include/rte_pci.h | 6 ++++++
lib/librte_ether/rte_ethdev.c | 6 +++---
lib/librte_ether/rte_ethdev.h | 4 ++--
8 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 65b44c6..bd30b14 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -625,8 +625,8 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
dev_private->dev_ops = virtual_ethdev_default_dev_ops;
eth_dev->dev_ops = &dev_private->dev_ops;
- eth_dev->pci_dev = pci_dev;
- eth_dev->pci_dev->device.driver = ð_drv->pci_drv.driver;
+ pci_dev->device.driver = ð_drv->pci_drv.driver;
+ eth_dev->device = &pci_dev->device;
eth_dev->rx_pkt_burst = virtual_ethdev_rx_burst_success;
eth_dev->tx_pkt_burst = virtual_ethdev_tx_burst_success;
diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
index 02ecde6..29436ea 100644
--- a/drivers/net/bonding/rte_eth_bond_args.c
+++ b/drivers/net/bonding/rte_eth_bond_args.c
@@ -54,15 +54,23 @@ const char *pmd_bond_init_valid_arguments[] = {
static inline int
find_port_id_by_pci_addr(const struct rte_pci_addr *pci_addr)
{
+ struct rte_pci_device *pci_dev;
struct rte_pci_addr *eth_pci_addr;
unsigned i;
for (i = 0; i < rte_eth_dev_count(); i++) {
- if (rte_eth_devices[i].pci_dev == NULL)
+ /* Currently populated by rte_eth_copy_pci_info().
+ *
+ * TODO: Once the PCI bus has arrived we should have a better
+ * way to test for being a PCI device or not.
+ */
+ if (rte_eth_devices[i].data->kdrv == RTE_KDRV_UNKNOWN ||
+ rte_eth_devices[i].data->kdrv == RTE_KDRV_NONE)
continue;
- eth_pci_addr = &(rte_eth_devices[i].pci_dev->addr);
+ pci_dev = ETH_DEV_PCI_DEV(&rte_eth_devices[i]);
+ eth_pci_addr = &pci_dev->addr;
if (pci_addr->bus == eth_pci_addr->bus &&
pci_addr->devid == eth_pci_addr->devid &&
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 922155b..ea13c7e 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -1163,14 +1163,14 @@ int cxgbe_probe(struct adapter *adapter)
pi->eth_dev->data = data;
allocate_mac:
- pi->eth_dev->pci_dev = adapter->pdev;
+ pi->eth_dev->device = &adapter->pdev->device;
pi->eth_dev->data->dev_private = pi;
pi->eth_dev->driver = adapter->eth_dev->driver;
pi->eth_dev->dev_ops = adapter->eth_dev->dev_ops;
pi->eth_dev->tx_pkt_burst = adapter->eth_dev->tx_pkt_burst;
pi->eth_dev->rx_pkt_burst = adapter->eth_dev->rx_pkt_burst;
- rte_eth_copy_pci_info(pi->eth_dev, pi->eth_dev->pci_dev);
+ rte_eth_copy_pci_info(pi->eth_dev, adapter->pdev);
TAILQ_INIT(&pi->eth_dev->link_intr_cbs);
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 5d0bce5..5718b39 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -678,7 +678,7 @@ fm10k_dev_tx_init(struct rte_eth_dev *dev)
/* Enable use of FTAG bit in TX descriptor, PFVTCTL
* register is read-only for VF.
*/
- if (fm10k_check_ftag(dev->pci_dev->device.devargs)) {
+ if (fm10k_check_ftag(dev->device->devargs)) {
if (hw->mac.type == fm10k_mac_pf) {
FM10K_WRITE_REG(hw, FM10K_PFVTCTL(i),
FM10K_PFVTCTL_FTAG_DESC_ENABLE);
@@ -2740,7 +2740,7 @@ fm10k_set_tx_function(struct rte_eth_dev *dev)
int use_sse = 1;
uint16_t tx_ftag_en = 0;
- if (fm10k_check_ftag(dev->pci_dev->device.devargs))
+ if (fm10k_check_ftag(dev->device->devargs))
tx_ftag_en = 1;
for (i = 0; i < dev->data->nb_tx_queues; i++) {
@@ -2771,7 +2771,7 @@ fm10k_set_rx_function(struct rte_eth_dev *dev)
uint16_t i, rx_using_sse;
uint16_t rx_ftag_en = 0;
- if (fm10k_check_ftag(dev->pci_dev->device.devargs))
+ if (fm10k_check_ftag(dev->device->devargs))
rx_ftag_en = 1;
/* In order to allow Vector Rx there are a few configuration
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 406beea..8cb983c 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -310,7 +310,6 @@ virtio_user_eth_dev_alloc(const char *name)
data->numa_node = SOCKET_ID_ANY;
data->kdrv = RTE_KDRV_NONE;
data->dev_flags = RTE_ETH_DEV_DETACHABLE;
- eth_dev->pci_dev = NULL;
eth_dev->driver = NULL;
return eth_dev;
}
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index 9ce8847..19deaf6 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -160,6 +160,12 @@ struct rte_pci_device {
enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
};
+/**
+ * @internal
+ * Helper macro for drivers that need to convert to struct rte_pci_device.
+ */
+#define DEV_PCI_DEV(ptr) container_of(ptr, struct rte_pci_device, device)
+
/** Any PCI device identifier (vendor, device, ...) */
#define PCI_ANY_ID (0xffff)
#define RTE_CLASS_ANY_ID (0xffffff)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 4ecea50..cc01672 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -257,7 +257,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
if (eth_dev->data->dev_private == NULL)
rte_panic("Cannot allocate memzone for private port data\n");
}
- eth_dev->pci_dev = pci_dev;
+ eth_dev->device = &pci_dev->device;
eth_dev->intr_handle = &pci_dev->intr_handle;
eth_dev->driver = eth_drv;
eth_dev->data->rx_mbuf_alloc_failed = 0;
@@ -318,7 +318,7 @@ rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
rte_free(eth_dev->data->dev_private);
- eth_dev->pci_dev = NULL;
+ eth_dev->device = NULL;
eth_dev->driver = NULL;
eth_dev->data = NULL;
@@ -2578,7 +2578,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,
const struct rte_memzone *mz;
snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
- dev->driver->pci_drv.driver.name, ring_name,
+ dev->data->drv_name, ring_name,
dev->data->port_id, queue_id);
mz = rte_memzone_lookup(z_name);
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index f1f656a..58ef798 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1628,7 +1628,7 @@ struct rte_eth_dev {
struct rte_eth_dev_data *data; /**< Pointer to device data */
const struct eth_driver *driver;/**< Driver for this device */
const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
- struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */
+ struct rte_device *device; /**< Backing device for this device */
struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
/** User application callbacks for NIC interrupts */
struct rte_eth_dev_cb_list link_intr_cbs;
@@ -1649,7 +1649,7 @@ struct rte_eth_dev {
* @internal
* Helper for drivers that need to convert from rte_eth_dev to rte_pci_device.
*/
-#define ETH_DEV_PCI_DEV(ptr) ((ptr)->pci_dev)
+#define ETH_DEV_PCI_DEV(ptr) DEV_PCI_DEV((ptr)->device)
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
--
2.7.4
^ permalink raw reply related
* Re: [PATCH v3 0/6] libeventdev API and northbound implementation
From: Bruce Richardson @ 2016-12-20 11:13 UTC (permalink / raw)
To: Jerin Jacob
Cc: dev, thomas.monjalon, hemant.agrawal, gage.eads, harry.van.haaren
In-Reply-To: <1482070895-32491-1-git-send-email-jerin.jacob@caviumnetworks.com>
On Sun, Dec 18, 2016 at 07:51:29PM +0530, Jerin Jacob wrote:
> As previously discussed in RFC v1 [1], RFC v2 [2], with changes
> described in [3] (also pasted below), here is the first non-draft series
> for this new API.
>
> [1] http://dpdk.org/ml/archives/dev/2016-August/045181.html
> [2] http://dpdk.org/ml/archives/dev/2016-October/048592.html
> [3] http://dpdk.org/ml/archives/dev/2016-October/048196.html
>
> v2..v3:
>
> 1) Changed struct rte_event layout more aligment balanced(Harry, Jerin)
> 2) Changed event_ptr type to void* from uintptr_t(Bruce)
> 3) Changed ev[] as const in rte_event_enqueue_burst to disallow
> drivers from modifying the events passed in(Bruce)
> 4) Removed queue memory allocation from common code as some drivers may not need
> it(Bruce)
> 5) Removed "struct rte_event_queue_link" and replaced with queues and priorities
> in the link and link_get API to avoid one redirection to use the API(Bruce)
>
> v1..v2:
> 1) Remove unnecessary header files from rte_eventdev.h(Thomas)
> 2) Removed PMD driver name(EVENTDEV_NAME_SKELETON_PMD) from rte_eventdev.h(Thomas)
> 3) Removed different #define for different priority schemes. Changed to
> one event device RTE_EVENT_DEV_PRIORITY_* priority (Bruce)
> 4) add const to rte_event_dev_configure(), rte_event_queue_setup(),
> rte_event_port_setup(), rte_event_port_link()(Bruce)
> 5) Fixed missing dev argument in dev->schedule() function(Bruce)
> 6) Changed \see to @see in doxgen comments(Thomas)
> 7) Added additional text in specification to clarify the queue depth(Thomas)
> 8) Changed wait to timeout across the specification(Thomas)
> 9) Added longer explanation for RTE_EVENT_OP_NEW and RTE_EVENT_OP_FORWARD(Thomas)
> 10) Fixed issue with RTE_EVENT_OP_RELEASE doxgen formatting(Thomas)
> 11) Changed to RTE_EVENT_DEV_CFG_FLAG_ from RTE_EVENT_DEV_CFG_(Thomas)
> 12) Changed to EVENT_QUEUE_CFG_FLAG_ from EVENT_QUEUE_CFG_(Thomas)
> 13) s/RTE_EVENT_TYPE_CORE/RTE_EVENT_TYPE_CPU/(Thomas, Gage)
> 14) Removed non burst API and kept only the burst API in the API specification
> (Thomas, Bruce, Harry, Jerin)
> -- Driver interface has non burst API, selection of the non burst API is based
> on num_objects == 1
> 15) sizeeof(struct rte_event) was not 16 in v1. Fixed it in v2
> -- reduced the width of event_type to 4bit to save space for future change
> -- introduced impl_opaque for implementation specific opaque data(Harry),
> Something useful for HW driver too, in the context of removal the need for sepeare
> release API.
> -- squashed other element size and provided enough space to impl_opaque(Jerin)
> -- added RTE_BUILD_BUG_ON(sizeof(struct rte_event) != 16); check
> 16) add union of uint64_t in the second element in struct rte_event to
> make sure the structure has 16byte address all arch(Thomas)
> 17) Fixed invalid check of nb_atomic_order_sequences in implementation(Gage)
> 18) s/EDEV_LOG_ERR/RTE_EDEV_LOG_ERR(Thomas)
> 19) s/rte_eventdev_pmd_/rte_event_pmd_/(Bruce)
> 20) added fine details of distributed vs centralized scheduling information
> in the specification and introduced RTE_EVENT_DEV_CAP_FLAG_DISTRIBUTED_SCHED
> flag(Gage)
> 21)s/RTE_EVENT_QUEUE_CFG_FLAG_SINGLE_CONSUMER/RTE_EVENT_QUEUE_CFG_FLAG_SINGLE_LINK (Jerin)
> to remove the confusion to between another producer and consumer in sw eventdev driver
> 22) Northbound api implementation patch spited to more logical patches(Thomas)
>
> Changes since RFC v2:
>
> - Updated the documentation to define the need for this library[Jerin]
> - Added RTE_EVENT_QUEUE_CFG_*_ONLY configuration parameters in
> struct rte_event_queue_conf to enable optimized sw implementation [Bruce]
> - Introduced RTE_EVENT_OP* ops [Bruce]
> - Added nb_event_queue_flows,nb_event_port_dequeue_depth, nb_event_port_enqueue_depth
> in rte_event_dev_configure() like ethdev and crypto library[Jerin]
> - Removed rte_event_release() and replaced with RTE_EVENT_OP_RELEASE ops to
> reduce fast path APIs and it is redundant too[Jerin]
> - In the view of better application portability, Removed pin_event
> from rte_event_enqueue as it is just hint and Intel/NXP can not support it[Jerin]
> - Added rte_event_port_links_get()[Jerin]
> - Added rte_event_dev_dump[Harry]
>
> Notes:
>
> - This patch set is check-patch clean with an exception that
> 03/06 has one WARNING:MACRO_WITH_FLOW_CONTROL
> - Looking forward to getting additional maintainers for libeventdev
>
> TODO:
> 1) Create user guide
>
> Jerin Jacob (6):
> eventdev: introduce event driven programming model
> eventdev: define southbound driver interface
> eventdev: implement the northbound APIs
> eventdev: implement PMD registration functions
> event/skeleton: add skeleton eventdev driver
> app/test: unit test case for eventdev APIs
>
Hi Jerin,
other than the couple of comments I've made in replies to the individual
patches, this looks pretty good to me. Only additional comment I have is
that some of the macro names are a little long, and maybe we can shorten
them For example, you've added "_FLAG_" into the config flag macros,
and I'm not sure that is necessary. Similarly, I think we can drop
"_DEV_" from the PRIORITY names to shorten them.
Irrespective of these naming suggestions, once the other couple of
comments are taken care of, I think this set is suitable for merging to
the next-event tree.
Series Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Regards,
/Bruce
^ permalink raw reply
* Re: [PATCH 02/13] rte_device: make driver pointer const
From: Jan Blunck @ 2016-12-20 11:14 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, Stephen Hemminger
In-Reply-To: <20161219215944.17226-3-sthemmin@microsoft.com>
On Mon, Dec 19, 2016 at 10:59 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> The info in rte_device about driver is immutable and
> shouldn't change.
> ---
> lib/librte_eal/common/include/rte_dev.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
> index 8840380d..e5471a22 100644
> --- a/lib/librte_eal/common/include/rte_dev.h
> +++ b/lib/librte_eal/common/include/rte_dev.h
> @@ -122,7 +122,7 @@ struct rte_driver;
> */
> struct rte_device {
> TAILQ_ENTRY(rte_device) next; /**< Next device */
> - struct rte_driver *driver; /**< Associated driver */
> + const struct rte_driver *driver;/**< Associated driver */
> int numa_node; /**< NUMA node connection */
> struct rte_devargs *devargs; /**< Device user arguments */
> };
> --
> 2.11.0
>
Acked-by: Jan Blunck <jblunck@infradead.org>
^ permalink raw reply
* Re: [PATCH 05/13] pmd: remove useless reset of dev_info->dev_pci
From: Jan Blunck @ 2016-12-20 11:16 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, Stephen Hemminger
In-Reply-To: <20161219215944.17226-6-sthemmin@microsoft.com>
On Mon, Dec 19, 2016 at 10:59 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> Since rte_eth_dev_info_get does memset() on dev_info before
> calling device specific code, the explicit assignment of NULL
> in all these virtual drivers has no effect.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
> app/test/virtual_pmd.c | 1 -
> drivers/net/af_packet/rte_eth_af_packet.c | 1 -
> drivers/net/bonding/rte_eth_bond_pmd.c | 1 -
> drivers/net/null/rte_eth_null.c | 1 -
> drivers/net/pcap/rte_eth_pcap.c | 1 -
> drivers/net/ring/rte_eth_ring.c | 1 -
> drivers/net/xenvirt/rte_eth_xenvirt.c | 1 -
> 7 files changed, 7 deletions(-)
>
> diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
> index 65b44c64..e0447fda 100644
> --- a/app/test/virtual_pmd.c
> +++ b/app/test/virtual_pmd.c
> @@ -117,7 +117,6 @@ virtual_ethdev_info_get(struct rte_eth_dev *dev __rte_unused,
> dev_info->max_tx_queues = (uint16_t)512;
>
> dev_info->min_rx_bufsize = 0;
> - dev_info->pci_dev = NULL;
> }
>
> static int
> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
> index ff450685..2951f86c 100644
> --- a/drivers/net/af_packet/rte_eth_af_packet.c
> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> @@ -287,7 +287,6 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> dev_info->max_rx_queues = (uint16_t)internals->nb_queues;
> dev_info->max_tx_queues = (uint16_t)internals->nb_queues;
> dev_info->min_rx_bufsize = 0;
> - dev_info->pci_dev = NULL;
> }
>
> static void
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index a80b6fa9..74af6589 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1675,7 +1675,6 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> dev_info->max_tx_queues = (uint16_t)512;
>
> dev_info->min_rx_bufsize = 0;
> - dev_info->pci_dev = NULL;
>
> dev_info->rx_offload_capa = internals->rx_offload_capa;
> dev_info->tx_offload_capa = internals->tx_offload_capa;
> diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
> index 836d982a..b4f253ad 100644
> --- a/drivers/net/null/rte_eth_null.c
> +++ b/drivers/net/null/rte_eth_null.c
> @@ -301,7 +301,6 @@ eth_dev_info(struct rte_eth_dev *dev,
> dev_info->max_rx_queues = RTE_DIM(internals->rx_null_queues);
> dev_info->max_tx_queues = RTE_DIM(internals->tx_null_queues);
> dev_info->min_rx_bufsize = 0;
> - dev_info->pci_dev = NULL;
> dev_info->reta_size = internals->reta_size;
> dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads;
> }
> diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
> index 0162f446..7253b9ad 100644
> --- a/drivers/net/pcap/rte_eth_pcap.c
> +++ b/drivers/net/pcap/rte_eth_pcap.c
> @@ -559,7 +559,6 @@ eth_dev_info(struct rte_eth_dev *dev,
> dev_info->max_rx_queues = dev->data->nb_rx_queues;
> dev_info->max_tx_queues = dev->data->nb_tx_queues;
> dev_info->min_rx_bufsize = 0;
> - dev_info->pci_dev = NULL;
> }
>
> static void
> diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
> index c1767c48..dc99a1fe 100644
> --- a/drivers/net/ring/rte_eth_ring.c
> +++ b/drivers/net/ring/rte_eth_ring.c
> @@ -179,7 +179,6 @@ eth_dev_info(struct rte_eth_dev *dev,
> dev_info->max_rx_queues = (uint16_t)internals->max_rx_queues;
> dev_info->max_tx_queues = (uint16_t)internals->max_tx_queues;
> dev_info->min_rx_bufsize = 0;
> - dev_info->pci_dev = NULL;
> }
>
> static void
> diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c
> index c08a0568..609824b6 100644
> --- a/drivers/net/xenvirt/rte_eth_xenvirt.c
> +++ b/drivers/net/xenvirt/rte_eth_xenvirt.c
> @@ -337,7 +337,6 @@ eth_dev_info(struct rte_eth_dev *dev,
> dev_info->max_rx_queues = (uint16_t)1;
> dev_info->max_tx_queues = (uint16_t)1;
> dev_info->min_rx_bufsize = 0;
> - dev_info->pci_dev = NULL;
> }
>
> static void
> --
> 2.11.0
>
Acked-by: Jan Blunck <jblunck@infradead.org>
^ permalink raw reply
* Re: [PATCH 06/13] ethdev: make dev_info generic (not just PCI)
From: Jan Blunck @ 2016-12-20 11:20 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, Stephen Hemminger
In-Reply-To: <20161219215944.17226-7-sthemmin@microsoft.com>
On Mon, Dec 19, 2016 at 10:59 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> The result from rte_eth_dev_info_get should have pointer to
> device not PCI device. This breaks ABI but is necessary.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
> app/test-pmd/config.c | 32 ++++++++++++++++++++++++++--
> app/test-pmd/testpmd.c | 11 ++++++++--
> app/test-pmd/testpmd.h | 32 ++++++++++++++++------------
> app/test/test_kni.c | 39 ++++++++++++++++++++++++++++------
> doc/guides/rel_notes/release_17_02.rst | 10 +++------
> lib/librte_ether/rte_ethdev.c | 3 ++-
> lib/librte_ether/rte_ethdev.h | 2 +-
> 7 files changed, 96 insertions(+), 33 deletions(-)
>
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 8cf537d5..1d0974ad 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -553,6 +553,16 @@ port_id_is_invalid(portid_t port_id, enum print_warning warning)
> return 1;
> }
>
> +int
> +port_is_not_pci(portid_t port_id)
> +{
> + if (ports[port_id].pci_dev)
> + return 0;
> +
> + printf("Port %u is not a PCI device\n", port_id);
> + return 1;
> +}
> +
> static int
> vlan_id_is_invalid(uint16_t vlan_id)
> {
> @@ -565,15 +575,22 @@ vlan_id_is_invalid(uint16_t vlan_id)
> static int
> port_reg_off_is_invalid(portid_t port_id, uint32_t reg_off)
> {
> + struct rte_pci_device *pci_dev = ports[port_id].pci_dev;
> uint64_t pci_len;
>
> + if (pci_dev == NULL) {
> + printf("Port %u is not a PCI device\n", port_id);
> + return 1;
> + }
> +
> if (reg_off & 0x3) {
> printf("Port register offset 0x%X not aligned on a 4-byte "
> "boundary\n",
> (unsigned)reg_off);
> return 1;
> }
> - pci_len = ports[port_id].dev_info.pci_dev->mem_resource[0].len;
> +
> + pci_len = pci_dev->mem_resource[0].len;
> if (reg_off >= pci_len) {
> printf("Port %d: register offset %u (0x%X) out of port PCI "
> "resource (length=%"PRIu64")\n",
> @@ -607,9 +624,10 @@ port_reg_bit_display(portid_t port_id, uint32_t reg_off, uint8_t bit_x)
> {
> uint32_t reg_v;
>
> -
> if (port_id_is_invalid(port_id, ENABLED_WARN))
> return;
> + if (port_is_not_pci(port_id))
> + return;
> if (port_reg_off_is_invalid(port_id, reg_off))
> return;
> if (reg_bit_pos_is_invalid(bit_x))
> @@ -629,6 +647,8 @@ port_reg_bit_field_display(portid_t port_id, uint32_t reg_off,
>
> if (port_id_is_invalid(port_id, ENABLED_WARN))
> return;
> + if (port_is_not_pci(port_id))
> + return;
> if (port_reg_off_is_invalid(port_id, reg_off))
> return;
> if (reg_bit_pos_is_invalid(bit1_pos))
> @@ -658,6 +678,8 @@ port_reg_display(portid_t port_id, uint32_t reg_off)
> return;
> if (port_reg_off_is_invalid(port_id, reg_off))
> return;
> + if (port_is_not_pci(port_id))
> + return;
> reg_v = port_id_pci_reg_read(port_id, reg_off);
> display_port_reg_value(port_id, reg_off, reg_v);
> }
> @@ -670,6 +692,8 @@ port_reg_bit_set(portid_t port_id, uint32_t reg_off, uint8_t bit_pos,
>
> if (port_id_is_invalid(port_id, ENABLED_WARN))
> return;
> + if (port_is_not_pci(port_id))
> + return;
> if (port_reg_off_is_invalid(port_id, reg_off))
> return;
> if (reg_bit_pos_is_invalid(bit_pos))
> @@ -698,6 +722,8 @@ port_reg_bit_field_set(portid_t port_id, uint32_t reg_off,
>
> if (port_id_is_invalid(port_id, ENABLED_WARN))
> return;
> + if (port_is_not_pci(port_id))
> + return;
> if (port_reg_off_is_invalid(port_id, reg_off))
> return;
> if (reg_bit_pos_is_invalid(bit1_pos))
> @@ -732,6 +758,8 @@ port_reg_set(portid_t port_id, uint32_t reg_off, uint32_t reg_v)
> {
> if (port_id_is_invalid(port_id, ENABLED_WARN))
> return;
> + if (port_is_not_pci(port_id))
> + return;
> if (port_reg_off_is_invalid(port_id, reg_off))
> return;
> port_id_pci_reg_write(port_id, reg_off, reg_v);
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index a0332c26..faf1e16d 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -492,7 +492,6 @@ static void
> init_config(void)
> {
> portid_t pid;
> - struct rte_port *port;
> struct rte_mempool *mbp;
> unsigned int nb_mbuf_per_pool;
> lcoreid_t lc_id;
> @@ -547,9 +546,17 @@ init_config(void)
> }
>
> FOREACH_PORT(pid, ports) {
> - port = &ports[pid];
> + struct rte_port *port = &ports[pid];
> + struct rte_device *dev;
> +
> rte_eth_dev_info_get(pid, &port->dev_info);
>
> + dev = port->dev_info.device;
> + if (dev->driver->type == PMD_PCI)
> + port->pci_dev = container_of(dev, struct rte_pci_device, device);
> + else
> + port->pci_dev = NULL;
> +
> if (numa_support) {
> if (port_numa[pid] != NUMA_NO_CONFIG)
> port_per_socket[port_numa[pid]]++;
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index 9c1e7039..e8aca32a 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -149,6 +149,7 @@ struct fwd_stream {
> */
> struct rte_port {
> uint8_t enabled; /**< Port enabled or not */
> + struct rte_pci_device *pci_dev;
> struct rte_eth_dev_info dev_info; /**< PCI info + driver name */
> struct rte_eth_conf dev_conf; /**< Port configuration. */
> struct ether_addr eth_addr; /**< Port ethernet address */
> @@ -442,34 +443,36 @@ mbuf_pool_find(unsigned int sock_id)
> * Read/Write operations on a PCI register of a port.
> */
> static inline uint32_t
> -port_pci_reg_read(struct rte_port *port, uint32_t reg_off)
> +pci_reg_read(struct rte_pci_device *pci_dev, uint32_t reg_off)
> {
> - void *reg_addr;
> + void *reg_addr
> + = (char *)pci_dev->mem_resource[0].addr + reg_off;
> uint32_t reg_v;
>
> - reg_addr = (void *)
> - ((char *)port->dev_info.pci_dev->mem_resource[0].addr +
> - reg_off);
> reg_v = *((volatile uint32_t *)reg_addr);
> return rte_le_to_cpu_32(reg_v);
> }
>
> -#define port_id_pci_reg_read(pt_id, reg_off) \
> - port_pci_reg_read(&ports[(pt_id)], (reg_off))
> +static inline uint32_t
> +port_id_pci_reg_read(portid_t pt_id, uint32_t reg_off)
> +{
> + return pci_reg_read(ports[pt_id].pci_dev, reg_off);
> +}
>
> static inline void
> -port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v)
> +pci_reg_write(struct rte_pci_device *pci_dev, uint32_t reg_off, uint32_t reg_v)
> {
> - void *reg_addr;
> + void *reg_addr
> + = (char *)pci_dev->mem_resource[0].addr + reg_off;
>
> - reg_addr = (void *)
> - ((char *)port->dev_info.pci_dev->mem_resource[0].addr +
> - reg_off);
> *((volatile uint32_t *)reg_addr) = rte_cpu_to_le_32(reg_v);
> }
>
> -#define port_id_pci_reg_write(pt_id, reg_off, reg_value) \
> - port_pci_reg_write(&ports[(pt_id)], (reg_off), (reg_value))
> +static inline void
> +port_id_pci_reg_write(portid_t pt_id, uint32_t reg_off, uint32_t reg_v)
> +{
> + return pci_reg_write(ports[pt_id].pci_dev, reg_off, reg_v);
> +}
>
> /* Prototypes */
> unsigned int parse_item_list(char* str, const char* item_name,
> @@ -598,6 +601,7 @@ enum print_warning {
> ENABLED_WARN = 0,
> DISABLED_WARN
> };
> +int port_is_not_pci(portid_t port_id);
> int port_id_is_invalid(portid_t port_id, enum print_warning warning);
>
> /*
> diff --git a/app/test/test_kni.c b/app/test/test_kni.c
> index 309741cb..6b2ebbed 100644
> --- a/app/test/test_kni.c
> +++ b/app/test/test_kni.c
> @@ -370,6 +370,8 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp)
> struct rte_kni_conf conf;
> struct rte_eth_dev_info info;
> struct rte_kni_ops ops;
> + struct rte_device *dev;
> + struct rte_pci_device *pci_dev;
>
> if (!mp)
> return -1;
> @@ -379,8 +381,16 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp)
> memset(&ops, 0, sizeof(ops));
>
> rte_eth_dev_info_get(port_id, &info);
> - conf.addr = info.pci_dev->addr;
> - conf.id = info.pci_dev->id;
> +
> + dev = info.device;
> + if (dev->driver->type != PMD_PCI) {
> + printf("device is not PCI\n");
> + return -1;
> + }
> +
> + pci_dev = container_of(dev, struct rte_pci_device, device);
> + conf.addr = pci_dev->addr;
> + conf.id = pci_dev->id;
> snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT);
>
> /* core id 1 configured for kernel thread */
> @@ -478,6 +488,8 @@ test_kni(void)
> struct rte_kni_conf conf;
> struct rte_eth_dev_info info;
> struct rte_kni_ops ops;
> + struct rte_device *dev;
> + struct rte_pci_device *pci_dev;
>
> /* Initialize KNI subsytem */
> rte_kni_init(KNI_TEST_MAX_PORTS);
> @@ -536,8 +548,16 @@ test_kni(void)
> memset(&conf, 0, sizeof(conf));
> memset(&ops, 0, sizeof(ops));
> rte_eth_dev_info_get(port_id, &info);
> - conf.addr = info.pci_dev->addr;
> - conf.id = info.pci_dev->id;
> +
> + dev = info.device;
> + if (dev->driver->type != PMD_PCI) {
> + printf("device is not PCI\n");
> + return -1;
> + }
> +
> + pci_dev = container_of(dev, struct rte_pci_device, device);
> + conf.addr = pci_dev->addr;
> + conf.id = pci_dev->id;
> conf.group_id = (uint16_t)port_id;
> conf.mbuf_size = MAX_PACKET_SZ;
>
> @@ -565,8 +585,15 @@ test_kni(void)
> memset(&info, 0, sizeof(info));
> memset(&ops, 0, sizeof(ops));
> rte_eth_dev_info_get(port_id, &info);
> - conf.addr = info.pci_dev->addr;
> - conf.id = info.pci_dev->id;
> + dev = info.device;
> + if (dev->driver->type != PMD_PCI) {
> + printf("device is not PCI\n");
> + return -1;
> + }
> +
> + pci_dev = container_of(dev, struct rte_pci_device, device);
> + conf.addr = pci_dev->addr;
> + conf.id = pci_dev->id;
> conf.group_id = (uint16_t)port_id;
> conf.mbuf_size = MAX_PACKET_SZ;
>
> diff --git a/doc/guides/rel_notes/release_17_02.rst b/doc/guides/rel_notes/release_17_02.rst
> index 3b650388..30b23703 100644
> --- a/doc/guides/rel_notes/release_17_02.rst
> +++ b/doc/guides/rel_notes/release_17_02.rst
> @@ -106,16 +106,12 @@ API Changes
> ABI Changes
> -----------
>
> -.. This section should contain ABI changes. Sample format:
> -
> - * Add a short 1-2 sentence description of the ABI change that was announced in
> +.. * Add a short 1-2 sentence description of the ABI change that was announced in
> the previous releases and made in this release. Use fixed width quotes for
> ``rte_function_names`` or ``rte_struct_names``. Use the past tense.
>
> - This section is a comment. do not overwrite or remove it.
> - Also, make sure to start the actual text at the margin.
> - =========================================================
> -
> +* The ``rte_eth_dev_info`` structure no longer has pointer to PCI device, but
> + instead has new_field ``device`` which is a pointer to a generic ethernet device.
>
>
> Shared Library Versions
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 1e0f2061..71a8e9b9 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -1568,7 +1568,8 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)
>
> RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
> (*dev->dev_ops->dev_infos_get)(dev, dev_info);
> - dev_info->pci_dev = dev->pci_dev;
> +
> + dev_info->device = &dev->pci_dev->device;
> dev_info->driver_name = dev->data->drv_name;
I don't think that exposing the device through dev_info makes this a
future proof. If we want to model some kind of extensions to dev_info
we should instead model this explicitly.
So from my point of view the pci_dev should get removed instead.
> dev_info->nb_rx_queues = dev->data->nb_rx_queues;
> dev_info->nb_tx_queues = dev->data->nb_tx_queues;
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 3c85e331..2b3b4014 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -879,7 +879,7 @@ struct rte_eth_conf {
> * Ethernet device information
> */
> struct rte_eth_dev_info {
> - struct rte_pci_device *pci_dev; /**< Device PCI information. */
> + struct rte_device *device; /**< Device information. */
> const char *driver_name; /**< Device Driver name. */
> unsigned int if_index; /**< Index to bound host interface, or 0 if none.
> Use if_indextoname() to translate into an interface name. */
> --
> 2.11.0
>
^ permalink raw reply
* Re: [PATCH 1/3] ethdev: New API to free consumed buffers in TX ring
From: Adrien Mazarguil @ 2016-12-20 11:27 UTC (permalink / raw)
To: Billy McFall; +Cc: thomas.monjalon, wenzhuo.lu, dev, Stephen Hemminger
In-Reply-To: <20161216124851.2640-2-bmcfall@redhat.com>
Hi Billy,
On Fri, Dec 16, 2016 at 07:48:49AM -0500, Billy McFall wrote:
> Add a new API to force free consumed buffers on TX ring. API will return
> the number of packets freed (0-n) or error code if feature not supported
> (-ENOTSUP) or input invalid (-ENODEV).
>
> Because rte_eth_tx_buffer() may be used, and mbufs may still be held
> in local buffer, the API also accepts *buffer and *sent. Before
> attempting to free, rte_eth_tx_buffer_flush() is called to make sure
> all mbufs are sent to Tx ring. rte_eth_tx_buffer_flush() is called even
> if threshold is not met.
>
> Signed-off-by: Billy McFall <bmcfall@redhat.com>
> ---
> lib/librte_ether/rte_ethdev.h | 56 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 56 insertions(+)
>
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 9678179..e3f2be4 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -1150,6 +1150,9 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
> typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
> /**< @internal Check DD bit of specific RX descriptor */
>
> +typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
> +/**< @internal Force mbufs to be from TX ring. */
> +
> typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
> uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
>
> @@ -1467,6 +1470,7 @@ struct eth_dev_ops {
> eth_rx_disable_intr_t rx_queue_intr_disable;
> eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue.*/
> eth_queue_release_t tx_queue_release;/**< Release TX queue.*/
> + eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
> eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
> eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
> flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
> @@ -2943,6 +2947,58 @@ rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id,
> }
>
> /**
> + * Request the driver to free mbufs currently cached by the driver. The
> + * driver will only free the mbuf if it is no longer in use.
> + *
> + * @param port_id
> + * The port identifier of the Ethernet device.
> + * @param queue_id
> + * The index of the transmit queue through which output packets must be
> + * sent.
> + * The value must be in the range [0, nb_tx_queue - 1] previously supplied
> + * to rte_eth_dev_configure().
> + * @param free_cnt
> + * Maximum number of packets to free. Use 0 to indicate all possible packets
> + * should be freed. Note that a packet may be using multiple mbufs.
> + * @param buffer
> + * Buffer used to collect packets to be sent. If provided, the buffer will
> + * be flushed, even if the current length is less than buffer->size. Pass NULL
> + * if buffer has already been flushed.
> + * @param sent
> + * Pointer to return number of packets sent if buffer has packets to be sent.
> + * If *buffer is supplied, *sent must also be supplied.
> + * @return
> + * Failure: < 0
> + * -ENODEV: Invalid interface
> + * -ENOTSUP: Driver does not support function
> + * Success: >= 0
> + * 0-n: Number of packets freed. More packets may still remain in ring that
> + * are in use.
> + */
> +
> +static inline int
> +rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt,
> + struct rte_eth_dev_tx_buffer *buffer, uint16_t *sent)
> +{
> + struct rte_eth_dev *dev = &rte_eth_devices[port_id];
> +
> + /* Validate Input Data. Bail if not valid or not supported. */
> + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_done_cleanup, -ENOTSUP);
> +
> + /*
> + * If transmit buffer is provided and there are still packets to be
> + * sent, then send them before attempting to free pending mbufs.
> + */
> + if (buffer && sent)
> + *sent = rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
> +
> + /* Call driver to free pending mbufs. */
> + return (*dev->dev_ops->tx_done_cleanup)(dev->data->tx_queues[queue_id],
> + free_cnt);
> +}
> +
> +/**
> * Configure a callback for buffered packets which cannot be sent
> *
> * Register a specific callback to be called when an attempt is made to send
Just a thought to follow-up on Stephen's comment to further simplify this
API, how about not adding any new eth_dev_ops but instead defining what
should happen during an empty TX burst call (tx_burst() with 0 packets).
Several PMDs already have a check for this scenario and start by cleaning up
completed packets anyway, they effectively partially implement this
definition for free already.
The main difference with this API would be that you wouldn't know how many
mbufs were freed and wouldn't collect them into an array. However most
applications have one mbuf pool and/or know where they come from, so they
can just query the pool or attempt to re-allocate from it after doing empty
bursts in case of starvation.
[1] http://dpdk.org/ml/archives/dev/2016-December/052469.html
--
Adrien Mazarguil
6WIND
^ permalink raw reply
* Re: [PATCH v3 4/9] virtio: Don't fill dev_info->driver_name
From: Ferruh Yigit @ 2016-12-20 12:17 UTC (permalink / raw)
To: Jan Blunck, dev; +Cc: shreyansh.jain, david.marchand, stephen
In-Reply-To: <1482232315-21626-5-git-send-email-jblunck@infradead.org>
On 12/20/2016 11:11 AM, Jan Blunck wrote:
> This is overwritten in rte_eth_dev_info_get().
>
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
> Reviewed-by: David Marchand <david.marchand@6wind.com>
> ---
> drivers/net/virtio/virtio_ethdev.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 079fd6c..741688e 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1624,10 +1624,6 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> uint64_t tso_mask;
> struct virtio_hw *hw = dev->data->dev_private;
>
> - if (dev->pci_dev)
> - dev_info->driver_name = dev->driver->pci_drv.driver.name;
> - else
> - dev_info->driver_name = "virtio_user PMD";
> dev_info->max_rx_queues =
> RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_RX_QUEUES);
> dev_info->max_tx_queues =
>
This has been already removed in next-net with following commit:
7c6c1857358c ("net: remove dead driver names")
^ permalink raw reply
* Re: [PATCH 1/3] ethdev: New API to free consumed buffers in TX ring
From: Ananyev, Konstantin @ 2016-12-20 12:17 UTC (permalink / raw)
To: Adrien Mazarguil, Billy McFall
Cc: thomas.monjalon@6wind.com, Lu, Wenzhuo, dev@dpdk.org,
Stephen Hemminger
In-Reply-To: <20161220112746.GT10340@6wind.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Adrien Mazarguil
> Sent: Tuesday, December 20, 2016 11:28 AM
> To: Billy McFall <bmcfall@redhat.com>
> Cc: thomas.monjalon@6wind.com; Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org; Stephen Hemminger
> <stephen@networkplumber.org>
> Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: New API to free consumed buffers in TX ring
>
> Hi Billy,
>
> On Fri, Dec 16, 2016 at 07:48:49AM -0500, Billy McFall wrote:
> > Add a new API to force free consumed buffers on TX ring. API will return
> > the number of packets freed (0-n) or error code if feature not supported
> > (-ENOTSUP) or input invalid (-ENODEV).
> >
> > Because rte_eth_tx_buffer() may be used, and mbufs may still be held
> > in local buffer, the API also accepts *buffer and *sent. Before
> > attempting to free, rte_eth_tx_buffer_flush() is called to make sure
> > all mbufs are sent to Tx ring. rte_eth_tx_buffer_flush() is called even
> > if threshold is not met.
> >
> > Signed-off-by: Billy McFall <bmcfall@redhat.com>
> > ---
> > lib/librte_ether/rte_ethdev.h | 56 +++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 56 insertions(+)
> >
> > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> > index 9678179..e3f2be4 100644
> > --- a/lib/librte_ether/rte_ethdev.h
> > +++ b/lib/librte_ether/rte_ethdev.h
> > @@ -1150,6 +1150,9 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
> > typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
> > /**< @internal Check DD bit of specific RX descriptor */
> >
> > +typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
> > +/**< @internal Force mbufs to be from TX ring. */
> > +
> > typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
> > uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
> >
> > @@ -1467,6 +1470,7 @@ struct eth_dev_ops {
> > eth_rx_disable_intr_t rx_queue_intr_disable;
> > eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue.*/
> > eth_queue_release_t tx_queue_release;/**< Release TX queue.*/
> > + eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
> > eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
> > eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
> > flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
> > @@ -2943,6 +2947,58 @@ rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id,
> > }
> >
> > /**
> > + * Request the driver to free mbufs currently cached by the driver. The
> > + * driver will only free the mbuf if it is no longer in use.
> > + *
> > + * @param port_id
> > + * The port identifier of the Ethernet device.
> > + * @param queue_id
> > + * The index of the transmit queue through which output packets must be
> > + * sent.
> > + * The value must be in the range [0, nb_tx_queue - 1] previously supplied
> > + * to rte_eth_dev_configure().
> > + * @param free_cnt
> > + * Maximum number of packets to free. Use 0 to indicate all possible packets
> > + * should be freed. Note that a packet may be using multiple mbufs.
> > + * @param buffer
> > + * Buffer used to collect packets to be sent. If provided, the buffer will
> > + * be flushed, even if the current length is less than buffer->size. Pass NULL
> > + * if buffer has already been flushed.
> > + * @param sent
> > + * Pointer to return number of packets sent if buffer has packets to be sent.
> > + * If *buffer is supplied, *sent must also be supplied.
> > + * @return
> > + * Failure: < 0
> > + * -ENODEV: Invalid interface
> > + * -ENOTSUP: Driver does not support function
> > + * Success: >= 0
> > + * 0-n: Number of packets freed. More packets may still remain in ring that
> > + * are in use.
> > + */
> > +
> > +static inline int
> > +rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt,
> > + struct rte_eth_dev_tx_buffer *buffer, uint16_t *sent)
> > +{
> > + struct rte_eth_dev *dev = &rte_eth_devices[port_id];
> > +
> > + /* Validate Input Data. Bail if not valid or not supported. */
> > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_done_cleanup, -ENOTSUP);
> > +
> > + /*
> > + * If transmit buffer is provided and there are still packets to be
> > + * sent, then send them before attempting to free pending mbufs.
> > + */
> > + if (buffer && sent)
> > + *sent = rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
> > +
> > + /* Call driver to free pending mbufs. */
> > + return (*dev->dev_ops->tx_done_cleanup)(dev->data->tx_queues[queue_id],
> > + free_cnt);
> > +}
> > +
> > +/**
> > * Configure a callback for buffered packets which cannot be sent
> > *
> > * Register a specific callback to be called when an attempt is made to send
>
> Just a thought to follow-up on Stephen's comment to further simplify this
> API, how about not adding any new eth_dev_ops but instead defining what
> should happen during an empty TX burst call (tx_burst() with 0 packets).
>
> Several PMDs already have a check for this scenario and start by cleaning up
> completed packets anyway, they effectively partially implement this
> definition for free already.
Many PMDs start by cleaning up only when number of free entries
drop below some point.
Also in that case the author would have to modify (and test) all existing TX routinies.
So I think a separate API call seems more plausible.
Though I am agree with previous comment from Stephen that last two parameters
are redundant and would just overcomplicate things.
tin
>
> The main difference with this API would be that you wouldn't know how many
> mbufs were freed and wouldn't collect them into an array. However most
> applications have one mbuf pool and/or know where they come from, so they
> can just query the pool or attempt to re-allocate from it after doing empty
> bursts in case of starvation.
>
> [1] http://dpdk.org/ml/archives/dev/2016-December/052469.html
>
> --
> Adrien Mazarguil
> 6WIND
^ permalink raw reply
* Re: [PATCH v3 02/12] eal/bus: introduce bus abstraction
From: Hemant Agrawal @ 2016-12-20 12:37 UTC (permalink / raw)
To: Shreyansh Jain, dev, david.marchand
Cc: thomas.monjalon, ferruh.yigit, jianbo.liu
In-Reply-To: <1481893853-31790-3-git-send-email-shreyansh.jain@nxp.com>
On 12/16/2016 6:40 PM, Shreyansh Jain wrote:
> This patch introduces the rte_bus abstraction for devices and drivers in
> EAL framework. The model is:
> - One or more buses are connected to a CPU (or core)
> - One or more devices are conneted to a Bus
> - Drivers are running instances which manage one or more devices
> - Bus is responsible for identifying devices (and interrupt propogation)
> - Driver is responsible for initializing the device
>
> This patch adds a 'rte_bus' class which rte_driver and rte_device refer.
> This way, each device (rte_xxx_device) would have reference to the bus
> it is based on. As well as, each driver (rte_xxx_driver) would have link
> to the bus and devices on it for servicing.
>
> __ rte_bus_list
> /
> +----------'---+
> |rte_bus |
> | driver_list------> List of rte_bus specific
> | device_list---- devices
> | | `-> List of rte_bus associated
> | | drivers
> +--|------|----+
> _________/ \_________
> +--------/----+ +-\---------------+
> |rte_device | |rte_driver |
> | rte_bus | | rte_bus |
> | rte_driver | | ... |
> | ... | +---------...-----+
> | | |||
> +---||--------+ |||
> || |||
> | \ \\\
> | \_____________ \\\
> | \ |||
> +------|---------+ +----|----------+ |||
> |rte_pci_device | |rte_xxx_device | |||
> | .... | | .... | |||
> +----------------+ +---------------+ / | \
> / | \
> _____________________/ / \
> / ___/ \
> +-------------'--+ +------------'---+ +--'------------+
> |rte_pci_driver | |rte_vdev_driver | |rte_xxx_driver |
> | .... | | .... | | .... |
> +----------------+ +----------------+ +---------------+
>
> This patch only enables the bus references on rte_driver and rte_driver.
> EAL wide global device and driver list continue to exist until an instance
> of bus is added in subsequent patches.
>
> This patch also introduces RTE_REGISTER_BUS macro on the lines of
> RTE_PMD_REGISTER_XXX. Key difference is that the constructor priority has
> been explicitly set to 101 so as to execute bus registration before PMD.
>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>
> --
> v2:
> - fix bsdapp compilation issue because of missing export symbols in map
> file
> ---
> lib/librte_eal/bsdapp/eal/Makefile | 1 +
> lib/librte_eal/bsdapp/eal/rte_eal_version.map | 15 ++
> lib/librte_eal/common/Makefile | 2 +-
> lib/librte_eal/common/eal_common_bus.c | 192 ++++++++++++++++++++++++
> lib/librte_eal/common/include/rte_bus.h | 174 +++++++++++++++++++++
> lib/librte_eal/common/include/rte_dev.h | 2 +
> lib/librte_eal/linuxapp/eal/Makefile | 1 +
> lib/librte_eal/linuxapp/eal/rte_eal_version.map | 15 ++
> 8 files changed, 401 insertions(+), 1 deletion(-)
> create mode 100644 lib/librte_eal/common/eal_common_bus.c
> create mode 100644 lib/librte_eal/common/include/rte_bus.h
>
> diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
> index a15b762..cce99f7 100644
> --- a/lib/librte_eal/bsdapp/eal/Makefile
> +++ b/lib/librte_eal/bsdapp/eal/Makefile
> @@ -78,6 +78,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_cpuflags.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_string_fns.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_hexdump.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_devargs.c
> +SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_bus.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_dev.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_options.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_thread.c
> diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> index 2f81f7c..23fc1c1 100644
> --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
> @@ -174,3 +174,18 @@ DPDK_16.11 {
> rte_eal_vdrv_unregister;
>
> } DPDK_16.07;
> +
> +DPDK_17.02 {
> + global:
> +
> + rte_bus_list;
> + rte_eal_bus_add_device;
> + rte_eal_bus_add_driver;
> + rte_eal_get_bus;
> + rte_eal_bus_dump;
> + rte_eal_bus_register;
> + rte_eal_bus_remove_device;
> + rte_eal_bus_remove_driver;
> + rte_eal_bus_unregister;
> +
> +} DPDK_16.11;
> diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
> index a92c984..0c39414 100644
> --- a/lib/librte_eal/common/Makefile
> +++ b/lib/librte_eal/common/Makefile
> @@ -38,7 +38,7 @@ INC += rte_per_lcore.h rte_random.h
> INC += rte_tailq.h rte_interrupts.h rte_alarm.h
> INC += rte_string_fns.h rte_version.h
> INC += rte_eal_memconfig.h rte_malloc_heap.h
> -INC += rte_hexdump.h rte_devargs.h rte_dev.h rte_vdev.h
> +INC += rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h rte_vdev.h
> INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h
> INC += rte_malloc.h rte_keepalive.h rte_time.h
>
> diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c
> new file mode 100644
> index 0000000..612f64e
> --- /dev/null
> +++ b/lib/librte_eal/common/eal_common_bus.c
> @@ -0,0 +1,192 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2016 NXP
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in
> + * the documentation and/or other materials provided with the
> + * distribution.
> + * * Neither the name of NXP nor the names of its
> + * contributors may be used to endorse or promote products derived
> + * from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#include <stdio.h>
> +#include <string.h>
> +#include <inttypes.h>
> +#include <sys/queue.h>
> +
> +#include <rte_bus.h>
> +#include <rte_devargs.h>
> +#include <rte_debug.h>
> +
> +#include "eal_private.h"
> +
> +struct rte_bus_list rte_bus_list =
> + TAILQ_HEAD_INITIALIZER(rte_bus_list);
> +
> +/** @internal
> + * Add a device to a bus.
> + */
> +void
> +rte_eal_bus_add_device(struct rte_bus *bus, struct rte_device *dev)
> +{
> + RTE_VERIFY(bus);
> + RTE_VERIFY(dev);
> +
> + TAILQ_INSERT_TAIL(&bus->device_list, dev, next);
> + dev->bus = bus;
> +}
> +
> +/** @internal
> + * Remove a device from its bus.
> + */
> +void
> +rte_eal_bus_remove_device(struct rte_device *dev)
> +{
> + struct rte_bus *bus;
> +
> + RTE_VERIFY(dev);
> + RTE_VERIFY(dev->bus);
> +
> + bus = dev->bus;
> + TAILQ_REMOVE(&bus->device_list, dev, next);
> + dev->bus = NULL;
> +}
> +
> +/** @internal
> + * Associate a driver with a bus.
> + */
> +void
> +rte_eal_bus_add_driver(struct rte_bus *bus, struct rte_driver *drv)
> +{
> + RTE_VERIFY(bus);
> + RTE_VERIFY(drv);
> +
> + TAILQ_INSERT_TAIL(&bus->driver_list, drv, next);
> + drv->bus = bus;
> +}
> +
> +/** @internal
> + * Disassociate a driver from bus.
> + */
> +void
> +rte_eal_bus_remove_driver(struct rte_driver *drv)
> +{
> + struct rte_bus *bus;
> +
> + RTE_VERIFY(drv);
> + RTE_VERIFY(drv->bus);
> +
> + bus = drv->bus;
> + TAILQ_REMOVE(&bus->driver_list, drv, next);
> + drv->bus = NULL;
> +}
> +
> +/**
> + * Get the bus handle using its name
> + */
> +struct rte_bus *
> +rte_eal_get_bus(const char *bus_name)
> +{
> + struct rte_bus *bus;
> +
> + RTE_VERIFY(bus_name);
> +
> + TAILQ_FOREACH(bus, &rte_bus_list, next) {
> + RTE_VERIFY(bus->name);
> +
> + if (!strcmp(bus_name, bus->name)) {
> + RTE_LOG(DEBUG, EAL, "Returning Bus object %p\n", bus);
> + return bus;
> + }
> + }
> +
> + /* Unable to find bus requested */
> + return NULL;
> +}
> +
> +/* register a bus */
> +void
> +rte_eal_bus_register(struct rte_bus *bus)
> +{
> + RTE_VERIFY(bus);
> + RTE_VERIFY(bus->name && strlen(bus->name));
> +
> + /* Initialize the driver and device list associated with the bus */
> + TAILQ_INIT(&(bus->driver_list));
> + TAILQ_INIT(&(bus->device_list));
> +
> + TAILQ_INSERT_TAIL(&rte_bus_list, bus, next);
> + RTE_LOG(INFO, EAL, "Registered [%s] bus.\n", bus->name);
> +}
> +
> +/* unregister a bus */
> +void
> +rte_eal_bus_unregister(struct rte_bus *bus)
> +{
> + /* All devices and drivers associated with the bus should have been
> + * 'device->uninit' and 'driver->remove()' already.
> + */
> + RTE_VERIFY(TAILQ_EMPTY(&(bus->driver_list)));
> + RTE_VERIFY(TAILQ_EMPTY(&(bus->device_list)));
> +
> + /* TODO: For each device, call its rte_device->driver->remove()
> + * and rte_eal_bus_remove_driver()
> + */
> +
> + TAILQ_REMOVE(&rte_bus_list, bus, next);
> + RTE_LOG(INFO, EAL, "Unregistered [%s] bus.\n", bus->name);
> +}
> +
> +/* dump one bus info */
> +static int
> +bus_dump_one(FILE *f, struct rte_bus *bus)
> +{
> + int ret;
> +
> + /* For now, dump only the bus name */
> + ret = fprintf(f, " %s\n", bus->name);
> +
> + /* Error in case of inability in writing to stream */
> + if (ret < 0)
> + return ret;
> +
> + return 0;
> +}
> +
> +void
> +rte_eal_bus_dump(FILE *f)
> +{
> + int ret;
> + struct rte_bus *bus;
> +
> + TAILQ_FOREACH(bus, &rte_bus_list, next) {
> + ret = bus_dump_one(f, bus);
> + if (ret) {
> + RTE_LOG(ERR, EAL, "Unable to write to stream (%d)\n",
> + ret);
> + break;
> + }
> + }
> +}
> diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h
> new file mode 100644
> index 0000000..f0297a9
> --- /dev/null
> +++ b/lib/librte_eal/common/include/rte_bus.h
> @@ -0,0 +1,174 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2016 NXP
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in
> + * the documentation and/or other materials provided with the
> + * distribution.
> + * * Neither the name of NXP nor the names of its
> + * contributors may be used to endorse or promote products derived
> + * from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#ifndef _RTE_BUS_H_
> +#define _RTE_BUS_H_
> +
> +/**
> + * @file
> + *
> + * RTE PMD Bus Abstraction interfaces
> + *
> + * This file exposes APIs and Interfaces for Bus Abstraction over the devices
> + * drivers in EAL.
> + */
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +#include <stdio.h>
> +#include <sys/queue.h>
> +
> +#include <rte_log.h>
> +#include <rte_dev.h>
> +
> +/** Double linked list of buses */
> +TAILQ_HEAD(rte_bus_list, rte_bus);
> +
> +/* Global Bus list */
> +extern struct rte_bus_list rte_bus_list;
> +
> +struct rte_bus {
> + TAILQ_ENTRY(rte_bus) next; /**< Next bus object in linked list */
> + struct rte_driver_list driver_list;
> + /**< List of all drivers on bus */
> + struct rte_device_list device_list;
> + /**< List of all devices on bus */
> + const char *name; /**< Name of the bus */
> +};
> +
> +/** @internal
> + * Add a device to a bus.
> + *
> + * @param bus
> + * Bus on which device is to be added
> + * @param dev
> + * Device handle
> + * @return
> + * None
> + */
> +void
> +rte_eal_bus_add_device(struct rte_bus *bus, struct rte_device *dev);
> +
> +/** @internal
> + * Remove a device from its bus.
> + *
> + * @param dev
> + * Device handle to remove
> + * @return
> + * None
> + */
> +void
> +rte_eal_bus_remove_device(struct rte_device *dev);
> +
> +/** @internal
> + * Associate a driver with a bus.
> + *
> + * @param bus
> + * Bus on which driver is to be added
> + * @param dev
> + * Driver handle
> + * @return
> + * None
> + */
> +void
> +rte_eal_bus_add_driver(struct rte_bus *bus, struct rte_driver *drv);
> +
> +/** @internal
> + * Disassociate a driver from its bus.
> + *
> + * @param dev
> + * Driver handle to remove
> + * @return
> + * None
> + */
> +void
> +rte_eal_bus_remove_driver(struct rte_driver *drv);
> +
> +/**
> + * Register a Bus handler.
> + *
> + * @param driver
> + * A pointer to a rte_bus structure describing the bus
> + * to be registered.
> + */
> +void rte_eal_bus_register(struct rte_bus *bus);
> +
> +/**
> + * Unregister a Bus handler.
> + *
> + * @param driver
> + * A pointer to a rte_bus structure describing the bus
> + * to be unregistered.
> + */
> +void rte_eal_bus_unregister(struct rte_bus *bus);
> +
> +/**
> + * Obtain handle for bus given its name.
> + *
> + * @param bus_name
> + * Name of the bus handle to search
> + * @return
> + * Pointer to Bus object if name matches any registered bus object
> + * NULL, if no matching bus found
> + */
> +struct rte_bus *rte_eal_get_bus(const char *bus_name);
> +
> +/**
> + * Dump information of all the buses registered with EAL.
> + *
> + * @param f
> + * A valid and open output stream handle
> + *
> + * @return
> + * 0 in case of success
> + * !0 in case there is error in opening the output stream
> + */
> +void rte_eal_bus_dump(FILE *f);
> +
> +/** Helper for Bus registration. The constructor has higher priority than
> + * PMD constructors
> + */
> +#define RTE_REGISTER_BUS(nm, bus) \
> +static void __attribute__((constructor(101), used)) businitfn_ ##nm(void) \
> +{\
> + (bus).name = RTE_STR(nm);\
> + rte_eal_bus_register(&bus); \
> +}
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* _RTE_BUS_H */
> diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
> index 8840380..4004f9a 100644
> --- a/lib/librte_eal/common/include/rte_dev.h
> +++ b/lib/librte_eal/common/include/rte_dev.h
> @@ -122,6 +122,7 @@ struct rte_driver;
> */
> struct rte_device {
> TAILQ_ENTRY(rte_device) next; /**< Next device */
> + struct rte_bus *bus; /**< Device connected to this bus */
> struct rte_driver *driver; /**< Associated driver */
> int numa_node; /**< NUMA node connection */
> struct rte_devargs *devargs; /**< Device user arguments */
> @@ -148,6 +149,7 @@ void rte_eal_device_remove(struct rte_device *dev);
> */
> struct rte_driver {
> TAILQ_ENTRY(rte_driver) next; /**< Next in list. */
> + struct rte_bus *bus; /**< Bus serviced by this driver */
> const char *name; /**< Driver name. */
> const char *alias; /**< Driver alias. */
> };
> diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
> index 4e206f0..aa874a5 100644
> --- a/lib/librte_eal/linuxapp/eal/Makefile
> +++ b/lib/librte_eal/linuxapp/eal/Makefile
> @@ -87,6 +87,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_cpuflags.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_string_fns.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_hexdump.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_devargs.c
> +SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_bus.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_dev.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_options.c
> SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_thread.c
> diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> index 83721ba..c873a7f 100644
> --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map
> @@ -178,3 +178,18 @@ DPDK_16.11 {
> rte_eal_vdrv_unregister;
>
> } DPDK_16.07;
> +
> +DPDK_17.02 {
> + global:
> +
> + rte_bus_list;
> + rte_eal_bus_add_device;
> + rte_eal_bus_add_driver;
> + rte_eal_get_bus;
This should be rte_eal_bus_get
Also you are missing rte_eal_bus_insert_device
> + rte_eal_bus_dump;
> + rte_eal_bus_register;
> + rte_eal_bus_remove_device;
> + rte_eal_bus_remove_driver;
> + rte_eal_bus_unregister;
> +
> +} DPDK_16.11;
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox