* [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Thomas Monjalon
@ 2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons Thomas Monjalon
` (4 subsequent siblings)
5 siblings, 0 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:26 UTC (permalink / raw)
To: gaetan.rivet; +Cc: dev
Add port iterators in order to allow listing easily
the ports of the same device.
The iterators can be tested by using mlx5 or testpmd.
v3: changes only in the (main) patch 2
Thomas Monjalon (4):
ethdev: simplify port state comparisons
ethdev: add siblings iterators
net/mlx5: use port sibling iterators
app/testpmd: use port sibling iterator in device cleanup
app/test-pmd/testpmd.c | 4 +-
drivers/net/mlx5/mlx5.c | 34 +++++--------
drivers/net/mlx5/mlx5_ethdev.c | 6 +--
lib/librte_ethdev/rte_ethdev.c | 25 ++++++++--
lib/librte_ethdev/rte_ethdev.h | 63 ++++++++++++++++++++++++
lib/librte_ethdev/rte_ethdev_version.map | 2 +
6 files changed, 101 insertions(+), 33 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
@ 2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
` (2 more replies)
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators Thomas Monjalon
` (3 subsequent siblings)
5 siblings, 3 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:26 UTC (permalink / raw)
To: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko; +Cc: dev
There are three states for an ethdev port.
Checking that the port is unused looks simpler than
checking it is neither attached nor removed.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
lib/librte_ethdev/rte_ethdev.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 10bdfb37e..33cffc498 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -330,8 +330,7 @@ uint16_t
rte_eth_find_next(uint16_t port_id)
{
while (port_id < RTE_MAX_ETHPORTS &&
- rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
- rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
+ rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
port_id++;
if (port_id >= RTE_MAX_ETHPORTS)
@@ -567,8 +566,7 @@ uint64_t
rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id)
{
while (port_id < RTE_MAX_ETHPORTS &&
- ((rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
- rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED) ||
+ (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED ||
rte_eth_devices[port_id].data->owner.id != owner_id))
port_id++;
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons Thomas Monjalon
@ 2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 14:58 ` Stephen Hemminger
2019-04-03 15:03 ` Slava Ovsiienko
2 siblings, 0 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:26 UTC (permalink / raw)
To: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko; +Cc: dev
There are three states for an ethdev port.
Checking that the port is unused looks simpler than
checking it is neither attached nor removed.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
lib/librte_ethdev/rte_ethdev.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 10bdfb37e..33cffc498 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -330,8 +330,7 @@ uint16_t
rte_eth_find_next(uint16_t port_id)
{
while (port_id < RTE_MAX_ETHPORTS &&
- rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
- rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
+ rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
port_id++;
if (port_id >= RTE_MAX_ETHPORTS)
@@ -567,8 +566,7 @@ uint64_t
rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id)
{
while (port_id < RTE_MAX_ETHPORTS &&
- ((rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
- rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED) ||
+ (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED ||
rte_eth_devices[port_id].data->owner.id != owner_id))
port_id++;
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
@ 2019-04-01 14:58 ` Stephen Hemminger
2019-04-01 14:58 ` Stephen Hemminger
2019-04-01 15:17 ` Thomas Monjalon
2019-04-03 15:03 ` Slava Ovsiienko
2 siblings, 2 replies; 70+ messages in thread
From: Stephen Hemminger @ 2019-04-01 14:58 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko, dev
On Mon, 1 Apr 2019 04:26:57 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 10bdfb37e..33cffc498 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -330,8 +330,7 @@ uint16_t
> rte_eth_find_next(uint16_t port_id)
> {
> while (port_id < RTE_MAX_ETHPORTS &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
> + rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
For some applications that iterate over ports this is a hot path.
What about keeping an unused port bit mask and using ffs (in the future)?
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 14:58 ` Stephen Hemminger
@ 2019-04-01 14:58 ` Stephen Hemminger
2019-04-01 15:17 ` Thomas Monjalon
1 sibling, 0 replies; 70+ messages in thread
From: Stephen Hemminger @ 2019-04-01 14:58 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko, dev
On Mon, 1 Apr 2019 04:26:57 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 10bdfb37e..33cffc498 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -330,8 +330,7 @@ uint16_t
> rte_eth_find_next(uint16_t port_id)
> {
> while (port_id < RTE_MAX_ETHPORTS &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
> + rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
For some applications that iterate over ports this is a hot path.
What about keeping an unused port bit mask and using ffs (in the future)?
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 14:58 ` Stephen Hemminger
2019-04-01 14:58 ` Stephen Hemminger
@ 2019-04-01 15:17 ` Thomas Monjalon
2019-04-01 15:17 ` Thomas Monjalon
2019-04-01 16:07 ` Stephen Hemminger
1 sibling, 2 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 15:17 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko, dev
01/04/2019 16:58, Stephen Hemminger:
> On Mon, 1 Apr 2019 04:26:57 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> > index 10bdfb37e..33cffc498 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -330,8 +330,7 @@ uint16_t
> > rte_eth_find_next(uint16_t port_id)
> > {
> > while (port_id < RTE_MAX_ETHPORTS &&
> > - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> > - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
> > + rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
>
> For some applications that iterate over ports this is a hot path.
Really?
> What about keeping an unused port bit mask and using ffs (in the future)?
I don't understand your proposal. Please could you elaborate?
Do you agree on this patch anyway?
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 15:17 ` Thomas Monjalon
@ 2019-04-01 15:17 ` Thomas Monjalon
2019-04-01 16:07 ` Stephen Hemminger
1 sibling, 0 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 15:17 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko, dev
01/04/2019 16:58, Stephen Hemminger:
> On Mon, 1 Apr 2019 04:26:57 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> > index 10bdfb37e..33cffc498 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -330,8 +330,7 @@ uint16_t
> > rte_eth_find_next(uint16_t port_id)
> > {
> > while (port_id < RTE_MAX_ETHPORTS &&
> > - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> > - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
> > + rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
>
> For some applications that iterate over ports this is a hot path.
Really?
> What about keeping an unused port bit mask and using ffs (in the future)?
I don't understand your proposal. Please could you elaborate?
Do you agree on this patch anyway?
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 15:17 ` Thomas Monjalon
2019-04-01 15:17 ` Thomas Monjalon
@ 2019-04-01 16:07 ` Stephen Hemminger
2019-04-01 16:07 ` Stephen Hemminger
1 sibling, 1 reply; 70+ messages in thread
From: Stephen Hemminger @ 2019-04-01 16:07 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko, dev
On Mon, 01 Apr 2019 17:17:35 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:
> 01/04/2019 16:58, Stephen Hemminger:
> > On Mon, 1 Apr 2019 04:26:57 +0200
> > Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> > > index 10bdfb37e..33cffc498 100644
> > > --- a/lib/librte_ethdev/rte_ethdev.c
> > > +++ b/lib/librte_ethdev/rte_ethdev.c
> > > @@ -330,8 +330,7 @@ uint16_t
> > > rte_eth_find_next(uint16_t port_id)
> > > {
> > > while (port_id < RTE_MAX_ETHPORTS &&
> > > - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> > > - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
> > > + rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
> >
> > For some applications that iterate over ports this is a hot path.
>
> Really?
>
> > What about keeping an unused port bit mask and using ffs (in the future)?
>
> I don't understand your proposal. Please could you elaborate?
>
> Do you agree on this patch anyway?
I have seen some applications spend lots of time doing:
RTE_ETH_FOREACH_DEV(portid) {
If ethdev kept a bitmask for unused ports then it could use the find
first set instruction.
Maybe the better way is to just fix the application to use its own
bitmask of ports instead.
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 16:07 ` Stephen Hemminger
@ 2019-04-01 16:07 ` Stephen Hemminger
0 siblings, 0 replies; 70+ messages in thread
From: Stephen Hemminger @ 2019-04-01 16:07 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko, dev
On Mon, 01 Apr 2019 17:17:35 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:
> 01/04/2019 16:58, Stephen Hemminger:
> > On Mon, 1 Apr 2019 04:26:57 +0200
> > Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> > > index 10bdfb37e..33cffc498 100644
> > > --- a/lib/librte_ethdev/rte_ethdev.c
> > > +++ b/lib/librte_ethdev/rte_ethdev.c
> > > @@ -330,8 +330,7 @@ uint16_t
> > > rte_eth_find_next(uint16_t port_id)
> > > {
> > > while (port_id < RTE_MAX_ETHPORTS &&
> > > - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> > > - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
> > > + rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED)
> >
> > For some applications that iterate over ports this is a hot path.
>
> Really?
>
> > What about keeping an unused port bit mask and using ffs (in the future)?
>
> I don't understand your proposal. Please could you elaborate?
>
> Do you agree on this patch anyway?
I have seen some applications spend lots of time doing:
RTE_ETH_FOREACH_DEV(portid) {
If ethdev kept a bitmask for unused ports then it could use the find
first set instruction.
Maybe the better way is to just fix the application to use its own
bitmask of ports instead.
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 14:58 ` Stephen Hemminger
@ 2019-04-03 15:03 ` Slava Ovsiienko
2019-04-03 15:03 ` Slava Ovsiienko
2 siblings, 1 reply; 70+ messages in thread
From: Slava Ovsiienko @ 2019-04-03 15:03 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Ferruh Yigit, Andrew Rybchenko; +Cc: dev
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Monday, April 1, 2019 5:27
> To: gaetan.rivet@6wind.com; Ferruh Yigit <ferruh.yigit@intel.com>; Andrew
> Rybchenko <arybchenko@solarflare.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
>
> There are three states for an ethdev port.
> Checking that the port is unused looks simpler than checking it is neither
> attached nor removed.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Viacheslav Ovsiienko <mellanox.com>
> ---
> lib/librte_ethdev/rte_ethdev.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 10bdfb37e..33cffc498 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -330,8 +330,7 @@ uint16_t
> rte_eth_find_next(uint16_t port_id)
> {
> while (port_id < RTE_MAX_ETHPORTS &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
> + rte_eth_devices[port_id].state ==
> RTE_ETH_DEV_UNUSED)
> port_id++;
>
> if (port_id >= RTE_MAX_ETHPORTS)
> @@ -567,8 +566,7 @@ uint64_t
> rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id) {
> while (port_id < RTE_MAX_ETHPORTS &&
> - ((rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED) ||
> + (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED ||
> rte_eth_devices[port_id].data->owner.id != owner_id))
> port_id++;
>
> --
> 2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
2019-04-03 15:03 ` Slava Ovsiienko
@ 2019-04-03 15:03 ` Slava Ovsiienko
0 siblings, 0 replies; 70+ messages in thread
From: Slava Ovsiienko @ 2019-04-03 15:03 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Ferruh Yigit, Andrew Rybchenko; +Cc: dev
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Monday, April 1, 2019 5:27
> To: gaetan.rivet@6wind.com; Ferruh Yigit <ferruh.yigit@intel.com>; Andrew
> Rybchenko <arybchenko@solarflare.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons
>
> There are three states for an ethdev port.
> Checking that the port is unused looks simpler than checking it is neither
> attached nor removed.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Viacheslav Ovsiienko <mellanox.com>
> ---
> lib/librte_ethdev/rte_ethdev.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 10bdfb37e..33cffc498 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -330,8 +330,7 @@ uint16_t
> rte_eth_find_next(uint16_t port_id)
> {
> while (port_id < RTE_MAX_ETHPORTS &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED)
> + rte_eth_devices[port_id].state ==
> RTE_ETH_DEV_UNUSED)
> port_id++;
>
> if (port_id >= RTE_MAX_ETHPORTS)
> @@ -567,8 +566,7 @@ uint64_t
> rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id) {
> while (port_id < RTE_MAX_ETHPORTS &&
> - ((rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
> - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED) ||
> + (rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED ||
> rte_eth_devices[port_id].data->owner.id != owner_id))
> port_id++;
>
> --
> 2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 1/4] ethdev: simplify port state comparisons Thomas Monjalon
@ 2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
` (3 more replies)
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators Thomas Monjalon
` (2 subsequent siblings)
5 siblings, 4 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:26 UTC (permalink / raw)
To: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko; +Cc: dev
If multiple ports share the same hardware device (rte_device),
they are siblings and can be found thanks to the new functions
and loop macros.
One iterator takes a port id as reference,
while the other one directly refers to the parent device.
The ownership is not checked because siblings may have
different owners.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: Reviewed-by: Andrew Rybchenko - not kept because of changes in v3
v3:
- fix logic + re-use rte_eth_find_next()
- longer parameter names
- more and better doxygen comments
---
lib/librte_ethdev/rte_ethdev.c | 19 +++++++
lib/librte_ethdev/rte_ethdev.h | 63 ++++++++++++++++++++++++
lib/librte_ethdev/rte_ethdev_version.map | 2 +
3 files changed, 84 insertions(+)
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 33cffc498..3b125a642 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -339,6 +339,25 @@ rte_eth_find_next(uint16_t port_id)
return port_id;
}
+uint16_t __rte_experimental
+rte_eth_find_next_of(uint16_t port_id, const struct rte_device *parent)
+{
+ port_id = rte_eth_find_next(port_id);
+ while (port_id < RTE_MAX_ETHPORTS &&
+ rte_eth_devices[port_id].device != parent)
+ port_id = rte_eth_find_next(port_id + 1);
+
+ return port_id;
+}
+
+uint16_t __rte_experimental
+rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id)
+{
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id, RTE_MAX_ETHPORTS);
+ return rte_eth_find_next_of(port_id,
+ rte_eth_devices[ref_port_id].device);
+}
+
static void
rte_eth_dev_shared_data_prepare(void)
{
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index b6023c050..3d5bacaee 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1387,6 +1387,69 @@ uint16_t rte_eth_find_next(uint16_t port_id);
#define RTE_ETH_FOREACH_DEV(p) \
RTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER)
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Iterates over ethdev ports of a specified device.
+ *
+ * @param port_id_start
+ * The id of the next possible valid port.
+ * @param parent
+ * The generic device behind the ports to iterate.
+ * @return
+ * Next port id of the device, possibly port_id_start,
+ * RTE_MAX_ETHPORTS if there is none.
+ */
+__rte_experimental
+uint16_t rte_eth_find_next_of(uint16_t port_id_start,
+ const struct rte_device *parent);
+
+/**
+ * Macro to iterate over all ethdev ports of a specified device.
+ *
+ * @param port_id
+ * The id of the matching port being iterated.
+ * @param parent
+ * The rte_device pointer matching the iterated ports.
+ */
+#define RTE_ETH_FOREACH_DEV_OF(port_id, parent) \
+ for (port_id = rte_eth_find_next_of(0, parent); \
+ port_id < RTE_MAX_ETHPORTS; \
+ port_id = rte_eth_find_next_of(port_id + 1, parent))
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Iterates over sibling ethdev ports (i.e. sharing the same rte_device).
+ *
+ * @param port_id_start
+ * The id of the next possible valid sibling port.
+ * @param ref_port_id
+ * The id of a reference port to compare rte_device with.
+ * @return
+ * Next sibling port id, possibly port_id_start or ref_port_id itself,
+ * RTE_MAX_ETHPORTS if there is none.
+ */
+__rte_experimental
+uint16_t rte_eth_find_next_sibling(uint16_t port_id_start,
+ uint16_t ref_port_id);
+
+/**
+ * Macro to iterate over all ethdev ports sharing the same rte_device
+ * as the specified port.
+ * Note: the specified reference port is part of the loop iterations.
+ *
+ * @param port_id
+ * The id of the matching port being iterated.
+ * @param ref_port_id
+ * The id of the port being compared.
+ */
+#define RTE_ETH_FOREACH_DEV_SIBLING(port_id, ref_port_id) \
+ for (port_id = rte_eth_find_next_sibling(0, ref_port_id); \
+ port_id < RTE_MAX_ETHPORTS; \
+ port_id = rte_eth_find_next_sibling(port_id + 1, ref_port_id))
/**
* @warning
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 92ac3de25..b37a4167d 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -245,6 +245,8 @@ EXPERIMENTAL {
rte_eth_dev_owner_set;
rte_eth_dev_owner_unset;
rte_eth_dev_rx_intr_ctl_q_get_fd;
+ rte_eth_find_next_of;
+ rte_eth_find_next_sibling;
rte_eth_switch_domain_alloc;
rte_eth_switch_domain_free;
rte_flow_conv;
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators Thomas Monjalon
@ 2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 7:23 ` Andrew Rybchenko
` (2 subsequent siblings)
3 siblings, 0 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:26 UTC (permalink / raw)
To: gaetan.rivet, Ferruh Yigit, Andrew Rybchenko; +Cc: dev
If multiple ports share the same hardware device (rte_device),
they are siblings and can be found thanks to the new functions
and loop macros.
One iterator takes a port id as reference,
while the other one directly refers to the parent device.
The ownership is not checked because siblings may have
different owners.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: Reviewed-by: Andrew Rybchenko - not kept because of changes in v3
v3:
- fix logic + re-use rte_eth_find_next()
- longer parameter names
- more and better doxygen comments
---
lib/librte_ethdev/rte_ethdev.c | 19 +++++++
lib/librte_ethdev/rte_ethdev.h | 63 ++++++++++++++++++++++++
lib/librte_ethdev/rte_ethdev_version.map | 2 +
3 files changed, 84 insertions(+)
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 33cffc498..3b125a642 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -339,6 +339,25 @@ rte_eth_find_next(uint16_t port_id)
return port_id;
}
+uint16_t __rte_experimental
+rte_eth_find_next_of(uint16_t port_id, const struct rte_device *parent)
+{
+ port_id = rte_eth_find_next(port_id);
+ while (port_id < RTE_MAX_ETHPORTS &&
+ rte_eth_devices[port_id].device != parent)
+ port_id = rte_eth_find_next(port_id + 1);
+
+ return port_id;
+}
+
+uint16_t __rte_experimental
+rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id)
+{
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id, RTE_MAX_ETHPORTS);
+ return rte_eth_find_next_of(port_id,
+ rte_eth_devices[ref_port_id].device);
+}
+
static void
rte_eth_dev_shared_data_prepare(void)
{
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index b6023c050..3d5bacaee 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1387,6 +1387,69 @@ uint16_t rte_eth_find_next(uint16_t port_id);
#define RTE_ETH_FOREACH_DEV(p) \
RTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER)
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Iterates over ethdev ports of a specified device.
+ *
+ * @param port_id_start
+ * The id of the next possible valid port.
+ * @param parent
+ * The generic device behind the ports to iterate.
+ * @return
+ * Next port id of the device, possibly port_id_start,
+ * RTE_MAX_ETHPORTS if there is none.
+ */
+__rte_experimental
+uint16_t rte_eth_find_next_of(uint16_t port_id_start,
+ const struct rte_device *parent);
+
+/**
+ * Macro to iterate over all ethdev ports of a specified device.
+ *
+ * @param port_id
+ * The id of the matching port being iterated.
+ * @param parent
+ * The rte_device pointer matching the iterated ports.
+ */
+#define RTE_ETH_FOREACH_DEV_OF(port_id, parent) \
+ for (port_id = rte_eth_find_next_of(0, parent); \
+ port_id < RTE_MAX_ETHPORTS; \
+ port_id = rte_eth_find_next_of(port_id + 1, parent))
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Iterates over sibling ethdev ports (i.e. sharing the same rte_device).
+ *
+ * @param port_id_start
+ * The id of the next possible valid sibling port.
+ * @param ref_port_id
+ * The id of a reference port to compare rte_device with.
+ * @return
+ * Next sibling port id, possibly port_id_start or ref_port_id itself,
+ * RTE_MAX_ETHPORTS if there is none.
+ */
+__rte_experimental
+uint16_t rte_eth_find_next_sibling(uint16_t port_id_start,
+ uint16_t ref_port_id);
+
+/**
+ * Macro to iterate over all ethdev ports sharing the same rte_device
+ * as the specified port.
+ * Note: the specified reference port is part of the loop iterations.
+ *
+ * @param port_id
+ * The id of the matching port being iterated.
+ * @param ref_port_id
+ * The id of the port being compared.
+ */
+#define RTE_ETH_FOREACH_DEV_SIBLING(port_id, ref_port_id) \
+ for (port_id = rte_eth_find_next_sibling(0, ref_port_id); \
+ port_id < RTE_MAX_ETHPORTS; \
+ port_id = rte_eth_find_next_sibling(port_id + 1, ref_port_id))
/**
* @warning
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 92ac3de25..b37a4167d 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -245,6 +245,8 @@ EXPERIMENTAL {
rte_eth_dev_owner_set;
rte_eth_dev_owner_unset;
rte_eth_dev_rx_intr_ctl_q_get_fd;
+ rte_eth_find_next_of;
+ rte_eth_find_next_sibling;
rte_eth_switch_domain_alloc;
rte_eth_switch_domain_free;
rte_flow_conv;
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
@ 2019-04-01 7:23 ` Andrew Rybchenko
2019-04-01 7:23 ` Andrew Rybchenko
2019-04-02 23:42 ` Ferruh Yigit
2019-04-03 15:03 ` Slava Ovsiienko
3 siblings, 1 reply; 70+ messages in thread
From: Andrew Rybchenko @ 2019-04-01 7:23 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Ferruh Yigit; +Cc: dev
On 4/1/19 5:26 AM, Thomas Monjalon wrote:
> If multiple ports share the same hardware device (rte_device),
> they are siblings and can be found thanks to the new functions
> and loop macros.
> One iterator takes a port id as reference,
> while the other one directly refers to the parent device.
>
> The ownership is not checked because siblings may have
> different owners.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-01 7:23 ` Andrew Rybchenko
@ 2019-04-01 7:23 ` Andrew Rybchenko
0 siblings, 0 replies; 70+ messages in thread
From: Andrew Rybchenko @ 2019-04-01 7:23 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Ferruh Yigit; +Cc: dev
On 4/1/19 5:26 AM, Thomas Monjalon wrote:
> If multiple ports share the same hardware device (rte_device),
> they are siblings and can be found thanks to the new functions
> and loop macros.
> One iterator takes a port id as reference,
> while the other one directly refers to the parent device.
>
> The ownership is not checked because siblings may have
> different owners.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 7:23 ` Andrew Rybchenko
@ 2019-04-02 23:42 ` Ferruh Yigit
2019-04-02 23:42 ` Ferruh Yigit
2019-04-02 23:48 ` Thomas Monjalon
2019-04-03 15:03 ` Slava Ovsiienko
3 siblings, 2 replies; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-02 23:42 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Andrew Rybchenko; +Cc: dev
On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> If multiple ports share the same hardware device (rte_device),
> they are siblings and can be found thanks to the new functions
> and loop macros.
> One iterator takes a port id as reference,
> while the other one directly refers to the parent device.
>
> The ownership is not checked because siblings may have
> different owners.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
<...>
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Iterates over ethdev ports of a specified device.
> + *
> + * @param port_id_start
> + * The id of the next possible valid port.
> + * @param parent
> + * The generic device behind the ports to iterate.
> + * @return
> + * Next port id of the device, possibly port_id_start,
> + * RTE_MAX_ETHPORTS if there is none.
> + */
> +__rte_experimental
> +uint16_t rte_eth_find_next_of(uint16_t port_id_start,
> + const struct rte_device *parent);
Minor nit, but other instances using the tag as:
uint16_t __rte_experimental
rte_eth_find_next_of(uint16_t port_id_start,
const struct rte_device *parent);
What do you think updating it for consistency? Same for two APIs.
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-02 23:42 ` Ferruh Yigit
@ 2019-04-02 23:42 ` Ferruh Yigit
2019-04-02 23:48 ` Thomas Monjalon
1 sibling, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-02 23:42 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Andrew Rybchenko; +Cc: dev
On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> If multiple ports share the same hardware device (rte_device),
> they are siblings and can be found thanks to the new functions
> and loop macros.
> One iterator takes a port id as reference,
> while the other one directly refers to the parent device.
>
> The ownership is not checked because siblings may have
> different owners.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
<...>
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Iterates over ethdev ports of a specified device.
> + *
> + * @param port_id_start
> + * The id of the next possible valid port.
> + * @param parent
> + * The generic device behind the ports to iterate.
> + * @return
> + * Next port id of the device, possibly port_id_start,
> + * RTE_MAX_ETHPORTS if there is none.
> + */
> +__rte_experimental
> +uint16_t rte_eth_find_next_of(uint16_t port_id_start,
> + const struct rte_device *parent);
Minor nit, but other instances using the tag as:
uint16_t __rte_experimental
rte_eth_find_next_of(uint16_t port_id_start,
const struct rte_device *parent);
What do you think updating it for consistency? Same for two APIs.
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-02 23:42 ` Ferruh Yigit
2019-04-02 23:42 ` Ferruh Yigit
@ 2019-04-02 23:48 ` Thomas Monjalon
2019-04-02 23:48 ` Thomas Monjalon
1 sibling, 1 reply; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-02 23:48 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: gaetan.rivet, Andrew Rybchenko, dev
03/04/2019 01:42, Ferruh Yigit:
> On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> > +__rte_experimental
> > +uint16_t rte_eth_find_next_of(uint16_t port_id_start,
> > + const struct rte_device *parent);
>
> Minor nit, but other instances using the tag as:
>
> uint16_t __rte_experimental
> rte_eth_find_next_of(uint16_t port_id_start,
> const struct rte_device *parent);
>
> What do you think updating it for consistency? Same for two APIs.
I think I did it this way to minimize the patch removing it later.
I'm OK to change it for consistency.
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-02 23:48 ` Thomas Monjalon
@ 2019-04-02 23:48 ` Thomas Monjalon
0 siblings, 0 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-02 23:48 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: gaetan.rivet, Andrew Rybchenko, dev
03/04/2019 01:42, Ferruh Yigit:
> On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> > +__rte_experimental
> > +uint16_t rte_eth_find_next_of(uint16_t port_id_start,
> > + const struct rte_device *parent);
>
> Minor nit, but other instances using the tag as:
>
> uint16_t __rte_experimental
> rte_eth_find_next_of(uint16_t port_id_start,
> const struct rte_device *parent);
>
> What do you think updating it for consistency? Same for two APIs.
I think I did it this way to minimize the patch removing it later.
I'm OK to change it for consistency.
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators Thomas Monjalon
` (2 preceding siblings ...)
2019-04-02 23:42 ` Ferruh Yigit
@ 2019-04-03 15:03 ` Slava Ovsiienko
2019-04-03 15:03 ` Slava Ovsiienko
3 siblings, 1 reply; 70+ messages in thread
From: Slava Ovsiienko @ 2019-04-03 15:03 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Ferruh Yigit, Andrew Rybchenko; +Cc: dev
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Monday, April 1, 2019 5:27
> To: gaetan.rivet@6wind.com; Ferruh Yigit <ferruh.yigit@intel.com>; Andrew
> Rybchenko <arybchenko@solarflare.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
>
> If multiple ports share the same hardware device (rte_device), they are
> siblings and can be found thanks to the new functions and loop macros.
> One iterator takes a port id as reference, while the other one directly refers
> to the parent device.
>
> The ownership is not checked because siblings may have different owners.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Viacheslav Ovsiienko <mellanox.com>
> ---
> v2: Reviewed-by: Andrew Rybchenko - not kept because of changes in v3
>
> v3:
> - fix logic + re-use rte_eth_find_next()
> - longer parameter names
> - more and better doxygen comments
> ---
> lib/librte_ethdev/rte_ethdev.c | 19 +++++++
> lib/librte_ethdev/rte_ethdev.h | 63 ++++++++++++++++++++++++
> lib/librte_ethdev/rte_ethdev_version.map | 2 +
> 3 files changed, 84 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 33cffc498..3b125a642 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -339,6 +339,25 @@ rte_eth_find_next(uint16_t port_id)
> return port_id;
> }
>
> +uint16_t __rte_experimental
> +rte_eth_find_next_of(uint16_t port_id, const struct rte_device *parent)
> +{
> + port_id = rte_eth_find_next(port_id);
> + while (port_id < RTE_MAX_ETHPORTS &&
> + rte_eth_devices[port_id].device != parent)
> + port_id = rte_eth_find_next(port_id + 1);
> +
> + return port_id;
> +}
> +
> +uint16_t __rte_experimental
> +rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id) {
> + RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id,
> RTE_MAX_ETHPORTS);
> + return rte_eth_find_next_of(port_id,
> + rte_eth_devices[ref_port_id].device);
> +}
> +
> static void
> rte_eth_dev_shared_data_prepare(void)
> {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index b6023c050..3d5bacaee 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -1387,6 +1387,69 @@ uint16_t rte_eth_find_next(uint16_t port_id);
> #define RTE_ETH_FOREACH_DEV(p) \
> RTE_ETH_FOREACH_DEV_OWNED_BY(p,
> RTE_ETH_DEV_NO_OWNER)
>
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Iterates over ethdev ports of a specified device.
> + *
> + * @param port_id_start
> + * The id of the next possible valid port.
> + * @param parent
> + * The generic device behind the ports to iterate.
> + * @return
> + * Next port id of the device, possibly port_id_start,
> + * RTE_MAX_ETHPORTS if there is none.
> + */
> +__rte_experimental
> +uint16_t rte_eth_find_next_of(uint16_t port_id_start,
> + const struct rte_device *parent);
> +
> +/**
> + * Macro to iterate over all ethdev ports of a specified device.
> + *
> + * @param port_id
> + * The id of the matching port being iterated.
> + * @param parent
> + * The rte_device pointer matching the iterated ports.
> + */
> +#define RTE_ETH_FOREACH_DEV_OF(port_id, parent) \
> + for (port_id = rte_eth_find_next_of(0, parent); \
> + port_id < RTE_MAX_ETHPORTS; \
> + port_id = rte_eth_find_next_of(port_id + 1, parent))
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Iterates over sibling ethdev ports (i.e. sharing the same rte_device).
> + *
> + * @param port_id_start
> + * The id of the next possible valid sibling port.
> + * @param ref_port_id
> + * The id of a reference port to compare rte_device with.
> + * @return
> + * Next sibling port id, possibly port_id_start or ref_port_id itself,
> + * RTE_MAX_ETHPORTS if there is none.
> + */
> +__rte_experimental
> +uint16_t rte_eth_find_next_sibling(uint16_t port_id_start,
> + uint16_t ref_port_id);
> +
> +/**
> + * Macro to iterate over all ethdev ports sharing the same rte_device
> + * as the specified port.
> + * Note: the specified reference port is part of the loop iterations.
> + *
> + * @param port_id
> + * The id of the matching port being iterated.
> + * @param ref_port_id
> + * The id of the port being compared.
> + */
> +#define RTE_ETH_FOREACH_DEV_SIBLING(port_id, ref_port_id) \
> + for (port_id = rte_eth_find_next_sibling(0, ref_port_id); \
> + port_id < RTE_MAX_ETHPORTS; \
> + port_id = rte_eth_find_next_sibling(port_id + 1, ref_port_id))
>
> /**
> * @warning
> diff --git a/lib/librte_ethdev/rte_ethdev_version.map
> b/lib/librte_ethdev/rte_ethdev_version.map
> index 92ac3de25..b37a4167d 100644
> --- a/lib/librte_ethdev/rte_ethdev_version.map
> +++ b/lib/librte_ethdev/rte_ethdev_version.map
> @@ -245,6 +245,8 @@ EXPERIMENTAL {
> rte_eth_dev_owner_set;
> rte_eth_dev_owner_unset;
> rte_eth_dev_rx_intr_ctl_q_get_fd;
> + rte_eth_find_next_of;
> + rte_eth_find_next_sibling;
> rte_eth_switch_domain_alloc;
> rte_eth_switch_domain_free;
> rte_flow_conv;
> --
> 2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
2019-04-03 15:03 ` Slava Ovsiienko
@ 2019-04-03 15:03 ` Slava Ovsiienko
0 siblings, 0 replies; 70+ messages in thread
From: Slava Ovsiienko @ 2019-04-03 15:03 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Ferruh Yigit, Andrew Rybchenko; +Cc: dev
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Monday, April 1, 2019 5:27
> To: gaetan.rivet@6wind.com; Ferruh Yigit <ferruh.yigit@intel.com>; Andrew
> Rybchenko <arybchenko@solarflare.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators
>
> If multiple ports share the same hardware device (rte_device), they are
> siblings and can be found thanks to the new functions and loop macros.
> One iterator takes a port id as reference, while the other one directly refers
> to the parent device.
>
> The ownership is not checked because siblings may have different owners.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Viacheslav Ovsiienko <mellanox.com>
> ---
> v2: Reviewed-by: Andrew Rybchenko - not kept because of changes in v3
>
> v3:
> - fix logic + re-use rte_eth_find_next()
> - longer parameter names
> - more and better doxygen comments
> ---
> lib/librte_ethdev/rte_ethdev.c | 19 +++++++
> lib/librte_ethdev/rte_ethdev.h | 63 ++++++++++++++++++++++++
> lib/librte_ethdev/rte_ethdev_version.map | 2 +
> 3 files changed, 84 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 33cffc498..3b125a642 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -339,6 +339,25 @@ rte_eth_find_next(uint16_t port_id)
> return port_id;
> }
>
> +uint16_t __rte_experimental
> +rte_eth_find_next_of(uint16_t port_id, const struct rte_device *parent)
> +{
> + port_id = rte_eth_find_next(port_id);
> + while (port_id < RTE_MAX_ETHPORTS &&
> + rte_eth_devices[port_id].device != parent)
> + port_id = rte_eth_find_next(port_id + 1);
> +
> + return port_id;
> +}
> +
> +uint16_t __rte_experimental
> +rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id) {
> + RTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id,
> RTE_MAX_ETHPORTS);
> + return rte_eth_find_next_of(port_id,
> + rte_eth_devices[ref_port_id].device);
> +}
> +
> static void
> rte_eth_dev_shared_data_prepare(void)
> {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index b6023c050..3d5bacaee 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -1387,6 +1387,69 @@ uint16_t rte_eth_find_next(uint16_t port_id);
> #define RTE_ETH_FOREACH_DEV(p) \
> RTE_ETH_FOREACH_DEV_OWNED_BY(p,
> RTE_ETH_DEV_NO_OWNER)
>
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Iterates over ethdev ports of a specified device.
> + *
> + * @param port_id_start
> + * The id of the next possible valid port.
> + * @param parent
> + * The generic device behind the ports to iterate.
> + * @return
> + * Next port id of the device, possibly port_id_start,
> + * RTE_MAX_ETHPORTS if there is none.
> + */
> +__rte_experimental
> +uint16_t rte_eth_find_next_of(uint16_t port_id_start,
> + const struct rte_device *parent);
> +
> +/**
> + * Macro to iterate over all ethdev ports of a specified device.
> + *
> + * @param port_id
> + * The id of the matching port being iterated.
> + * @param parent
> + * The rte_device pointer matching the iterated ports.
> + */
> +#define RTE_ETH_FOREACH_DEV_OF(port_id, parent) \
> + for (port_id = rte_eth_find_next_of(0, parent); \
> + port_id < RTE_MAX_ETHPORTS; \
> + port_id = rte_eth_find_next_of(port_id + 1, parent))
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Iterates over sibling ethdev ports (i.e. sharing the same rte_device).
> + *
> + * @param port_id_start
> + * The id of the next possible valid sibling port.
> + * @param ref_port_id
> + * The id of a reference port to compare rte_device with.
> + * @return
> + * Next sibling port id, possibly port_id_start or ref_port_id itself,
> + * RTE_MAX_ETHPORTS if there is none.
> + */
> +__rte_experimental
> +uint16_t rte_eth_find_next_sibling(uint16_t port_id_start,
> + uint16_t ref_port_id);
> +
> +/**
> + * Macro to iterate over all ethdev ports sharing the same rte_device
> + * as the specified port.
> + * Note: the specified reference port is part of the loop iterations.
> + *
> + * @param port_id
> + * The id of the matching port being iterated.
> + * @param ref_port_id
> + * The id of the port being compared.
> + */
> +#define RTE_ETH_FOREACH_DEV_SIBLING(port_id, ref_port_id) \
> + for (port_id = rte_eth_find_next_sibling(0, ref_port_id); \
> + port_id < RTE_MAX_ETHPORTS; \
> + port_id = rte_eth_find_next_sibling(port_id + 1, ref_port_id))
>
> /**
> * @warning
> diff --git a/lib/librte_ethdev/rte_ethdev_version.map
> b/lib/librte_ethdev/rte_ethdev_version.map
> index 92ac3de25..b37a4167d 100644
> --- a/lib/librte_ethdev/rte_ethdev_version.map
> +++ b/lib/librte_ethdev/rte_ethdev_version.map
> @@ -245,6 +245,8 @@ EXPERIMENTAL {
> rte_eth_dev_owner_set;
> rte_eth_dev_owner_unset;
> rte_eth_dev_rx_intr_ctl_q_get_fd;
> + rte_eth_find_next_of;
> + rte_eth_find_next_sibling;
> rte_eth_switch_domain_alloc;
> rte_eth_switch_domain_free;
> rte_flow_conv;
> --
> 2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Thomas Monjalon
` (2 preceding siblings ...)
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators Thomas Monjalon
@ 2019-04-01 2:26 ` Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
` (2 more replies)
2019-04-01 2:27 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup Thomas Monjalon
2019-04-03 16:42 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Ferruh Yigit
5 siblings, 3 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:26 UTC (permalink / raw)
To: gaetan.rivet, Shahaf Shuler, Yongseok Koh; +Cc: dev
Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
which skips the owned ports.
The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/net/mlx5/mlx5.c | 34 +++++++++++++---------------------
drivers/net/mlx5/mlx5_ethdev.c | 6 +-----
2 files changed, 14 insertions(+), 26 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 1d7ca615b..3287a3d78 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -493,17 +493,15 @@ mlx5_dev_close(struct rte_eth_dev *dev)
dev->data->port_id);
if (priv->domain_id != RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
unsigned int c = 0;
- unsigned int i = mlx5_dev_to_port_id(dev->device, NULL, 0);
- uint16_t port_id[i];
+ uint16_t port_id;
- i = RTE_MIN(mlx5_dev_to_port_id(dev->device, port_id, i), i);
- while (i--) {
+ RTE_ETH_FOREACH_DEV_OF(port_id, dev->device) {
struct mlx5_priv *opriv =
- rte_eth_devices[port_id[i]].data->dev_private;
+ rte_eth_devices[port_id].data->dev_private;
if (!opriv ||
opriv->domain_id != priv->domain_id ||
- &rte_eth_devices[port_id[i]] == dev)
+ &rte_eth_devices[port_id] == dev)
continue;
++c;
}
@@ -1147,22 +1145,16 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
* Look for sibling devices in order to reuse their switch domain
* if any, otherwise allocate one.
*/
- i = mlx5_dev_to_port_id(dpdk_dev, NULL, 0);
- if (i > 0) {
- uint16_t port_id[i];
+ RTE_ETH_FOREACH_DEV_OF(port_id, dpdk_dev) {
+ const struct mlx5_priv *opriv =
+ rte_eth_devices[port_id].data->dev_private;
- i = RTE_MIN(mlx5_dev_to_port_id(dpdk_dev, port_id, i), i);
- while (i--) {
- const struct mlx5_priv *opriv =
- rte_eth_devices[port_id[i]].data->dev_private;
-
- if (!opriv ||
- opriv->domain_id ==
- RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
- continue;
- priv->domain_id = opriv->domain_id;
- break;
- }
+ if (!opriv ||
+ opriv->domain_id ==
+ RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
+ continue;
+ priv->domain_id = opriv->domain_id;
+ break;
}
if (priv->domain_id == RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
err = rte_eth_switch_domain_alloc(&priv->domain_id);
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 7273bd940..e01b698fc 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1398,11 +1398,7 @@ mlx5_dev_to_port_id(const struct rte_device *dev, uint16_t *port_list,
uint16_t id;
unsigned int n = 0;
- RTE_ETH_FOREACH_DEV(id) {
- struct rte_eth_dev *ldev = &rte_eth_devices[id];
-
- if (ldev->device != dev)
- continue;
+ RTE_ETH_FOREACH_DEV_OF(id, dev) {
if (n < port_list_n)
port_list[n] = id;
n++;
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators Thomas Monjalon
@ 2019-04-01 2:26 ` Thomas Monjalon
2019-04-03 14:19 ` Ferruh Yigit
2019-04-03 15:04 ` Slava Ovsiienko
2 siblings, 0 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:26 UTC (permalink / raw)
To: gaetan.rivet, Shahaf Shuler, Yongseok Koh; +Cc: dev
Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
which skips the owned ports.
The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/net/mlx5/mlx5.c | 34 +++++++++++++---------------------
drivers/net/mlx5/mlx5_ethdev.c | 6 +-----
2 files changed, 14 insertions(+), 26 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 1d7ca615b..3287a3d78 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -493,17 +493,15 @@ mlx5_dev_close(struct rte_eth_dev *dev)
dev->data->port_id);
if (priv->domain_id != RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
unsigned int c = 0;
- unsigned int i = mlx5_dev_to_port_id(dev->device, NULL, 0);
- uint16_t port_id[i];
+ uint16_t port_id;
- i = RTE_MIN(mlx5_dev_to_port_id(dev->device, port_id, i), i);
- while (i--) {
+ RTE_ETH_FOREACH_DEV_OF(port_id, dev->device) {
struct mlx5_priv *opriv =
- rte_eth_devices[port_id[i]].data->dev_private;
+ rte_eth_devices[port_id].data->dev_private;
if (!opriv ||
opriv->domain_id != priv->domain_id ||
- &rte_eth_devices[port_id[i]] == dev)
+ &rte_eth_devices[port_id] == dev)
continue;
++c;
}
@@ -1147,22 +1145,16 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
* Look for sibling devices in order to reuse their switch domain
* if any, otherwise allocate one.
*/
- i = mlx5_dev_to_port_id(dpdk_dev, NULL, 0);
- if (i > 0) {
- uint16_t port_id[i];
+ RTE_ETH_FOREACH_DEV_OF(port_id, dpdk_dev) {
+ const struct mlx5_priv *opriv =
+ rte_eth_devices[port_id].data->dev_private;
- i = RTE_MIN(mlx5_dev_to_port_id(dpdk_dev, port_id, i), i);
- while (i--) {
- const struct mlx5_priv *opriv =
- rte_eth_devices[port_id[i]].data->dev_private;
-
- if (!opriv ||
- opriv->domain_id ==
- RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
- continue;
- priv->domain_id = opriv->domain_id;
- break;
- }
+ if (!opriv ||
+ opriv->domain_id ==
+ RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
+ continue;
+ priv->domain_id = opriv->domain_id;
+ break;
}
if (priv->domain_id == RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
err = rte_eth_switch_domain_alloc(&priv->domain_id);
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 7273bd940..e01b698fc 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1398,11 +1398,7 @@ mlx5_dev_to_port_id(const struct rte_device *dev, uint16_t *port_list,
uint16_t id;
unsigned int n = 0;
- RTE_ETH_FOREACH_DEV(id) {
- struct rte_eth_dev *ldev = &rte_eth_devices[id];
-
- if (ldev->device != dev)
- continue;
+ RTE_ETH_FOREACH_DEV_OF(id, dev) {
if (n < port_list_n)
port_list[n] = id;
n++;
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
@ 2019-04-03 14:19 ` Ferruh Yigit
2019-04-03 14:19 ` Ferruh Yigit
2019-04-03 18:07 ` Yongseok Koh
2019-04-03 15:04 ` Slava Ovsiienko
2 siblings, 2 replies; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-03 14:19 UTC (permalink / raw)
To: Shahaf Shuler, Yongseok Koh; +Cc: Thomas Monjalon, gaetan.rivet, dev
On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
> which skips the owned ports.
> The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
> and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Hi Shahaf, Yongseok,
Any comment on this patch?
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-03 14:19 ` Ferruh Yigit
@ 2019-04-03 14:19 ` Ferruh Yigit
2019-04-03 18:07 ` Yongseok Koh
1 sibling, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-03 14:19 UTC (permalink / raw)
To: Shahaf Shuler, Yongseok Koh; +Cc: Thomas Monjalon, gaetan.rivet, dev
On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
> which skips the owned ports.
> The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
> and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Hi Shahaf, Yongseok,
Any comment on this patch?
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-03 14:19 ` Ferruh Yigit
2019-04-03 14:19 ` Ferruh Yigit
@ 2019-04-03 18:07 ` Yongseok Koh
2019-04-03 18:07 ` Yongseok Koh
2019-04-04 11:33 ` Ferruh Yigit
1 sibling, 2 replies; 70+ messages in thread
From: Yongseok Koh @ 2019-04-03 18:07 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Shahaf Shuler, Thomas Monjalon, gaetan.rivet, dev
> On Apr 3, 2019, at 7:19 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
>> Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
>> which skips the owned ports.
>> The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
>> and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
>>
>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
> Hi Shahaf, Yongseok,
>
> Any comment on this patch?
Sorry for late reply.
I know it has been merged but it looks okay to me.
Thanks,
Yongseok
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-03 18:07 ` Yongseok Koh
@ 2019-04-03 18:07 ` Yongseok Koh
2019-04-04 11:33 ` Ferruh Yigit
1 sibling, 0 replies; 70+ messages in thread
From: Yongseok Koh @ 2019-04-03 18:07 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Shahaf Shuler, Thomas Monjalon, gaetan.rivet, dev
> On Apr 3, 2019, at 7:19 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
>> Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
>> which skips the owned ports.
>> The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
>> and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
>>
>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
> Hi Shahaf, Yongseok,
>
> Any comment on this patch?
Sorry for late reply.
I know it has been merged but it looks okay to me.
Thanks,
Yongseok
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-03 18:07 ` Yongseok Koh
2019-04-03 18:07 ` Yongseok Koh
@ 2019-04-04 11:33 ` Ferruh Yigit
2019-04-04 11:33 ` Ferruh Yigit
1 sibling, 1 reply; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-04 11:33 UTC (permalink / raw)
To: Yongseok Koh; +Cc: Shahaf Shuler, Thomas Monjalon, gaetan.rivet, dev
On 4/3/2019 7:07 PM, Yongseok Koh wrote:
>
>> On Apr 3, 2019, at 7:19 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
>>> Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
>>> which skips the owned ports.
>>> The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
>>> and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>
>> Hi Shahaf, Yongseok,
>>
>> Any comment on this patch?
>
> Sorry for late reply.
> I know it has been merged but it looks okay to me.
Thanks, I am appending explicit ack to the patch:
Acked-by: Yongseok Koh <yskoh@mellanox.com>
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-04 11:33 ` Ferruh Yigit
@ 2019-04-04 11:33 ` Ferruh Yigit
0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-04 11:33 UTC (permalink / raw)
To: Yongseok Koh; +Cc: Shahaf Shuler, Thomas Monjalon, gaetan.rivet, dev
On 4/3/2019 7:07 PM, Yongseok Koh wrote:
>
>> On Apr 3, 2019, at 7:19 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
>>> Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
>>> which skips the owned ports.
>>> The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
>>> and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>
>> Hi Shahaf, Yongseok,
>>
>> Any comment on this patch?
>
> Sorry for late reply.
> I know it has been merged but it looks okay to me.
Thanks, I am appending explicit ack to the patch:
Acked-by: Yongseok Koh <yskoh@mellanox.com>
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators Thomas Monjalon
2019-04-01 2:26 ` Thomas Monjalon
2019-04-03 14:19 ` Ferruh Yigit
@ 2019-04-03 15:04 ` Slava Ovsiienko
2019-04-03 15:04 ` Slava Ovsiienko
2 siblings, 1 reply; 70+ messages in thread
From: Slava Ovsiienko @ 2019-04-03 15:04 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Shahaf Shuler, Yongseok Koh; +Cc: dev
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Monday, April 1, 2019 5:27
> To: gaetan.rivet@6wind.com; Shahaf Shuler <shahafs@mellanox.com>;
> Yongseok Koh <yskoh@mellanox.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
>
> Iterating over siblings was done with RTE_ETH_FOREACH_DEV() which skips
> the owned ports.
> The new iterators RTE_ETH_FOREACH_DEV_SIBLING() and
> RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Viacheslav Ovsiienko <mellanox.com>
> ---
> drivers/net/mlx5/mlx5.c | 34 +++++++++++++---------------------
> drivers/net/mlx5/mlx5_ethdev.c | 6 +-----
> 2 files changed, 14 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index
> 1d7ca615b..3287a3d78 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -493,17 +493,15 @@ mlx5_dev_close(struct rte_eth_dev *dev)
> dev->data->port_id);
> if (priv->domain_id != RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
> {
> unsigned int c = 0;
> - unsigned int i = mlx5_dev_to_port_id(dev->device, NULL, 0);
> - uint16_t port_id[i];
> + uint16_t port_id;
>
> - i = RTE_MIN(mlx5_dev_to_port_id(dev->device, port_id, i), i);
> - while (i--) {
> + RTE_ETH_FOREACH_DEV_OF(port_id, dev->device) {
> struct mlx5_priv *opriv =
> - rte_eth_devices[port_id[i]].data-
> >dev_private;
> + rte_eth_devices[port_id].data->dev_private;
>
> if (!opriv ||
> opriv->domain_id != priv->domain_id ||
> - &rte_eth_devices[port_id[i]] == dev)
> + &rte_eth_devices[port_id] == dev)
> continue;
> ++c;
> }
> @@ -1147,22 +1145,16 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
> * Look for sibling devices in order to reuse their switch domain
> * if any, otherwise allocate one.
> */
> - i = mlx5_dev_to_port_id(dpdk_dev, NULL, 0);
> - if (i > 0) {
> - uint16_t port_id[i];
> + RTE_ETH_FOREACH_DEV_OF(port_id, dpdk_dev) {
> + const struct mlx5_priv *opriv =
> + rte_eth_devices[port_id].data->dev_private;
>
> - i = RTE_MIN(mlx5_dev_to_port_id(dpdk_dev, port_id, i), i);
> - while (i--) {
> - const struct mlx5_priv *opriv =
> - rte_eth_devices[port_id[i]].data-
> >dev_private;
> -
> - if (!opriv ||
> - opriv->domain_id ==
> - RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
> - continue;
> - priv->domain_id = opriv->domain_id;
> - break;
> - }
> + if (!opriv ||
> + opriv->domain_id ==
> + RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
> + continue;
> + priv->domain_id = opriv->domain_id;
> + break;
> }
> if (priv->domain_id ==
> RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
> err = rte_eth_switch_domain_alloc(&priv->domain_id);
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c index 7273bd940..e01b698fc 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -1398,11 +1398,7 @@ mlx5_dev_to_port_id(const struct rte_device
> *dev, uint16_t *port_list,
> uint16_t id;
> unsigned int n = 0;
>
> - RTE_ETH_FOREACH_DEV(id) {
> - struct rte_eth_dev *ldev = &rte_eth_devices[id];
> -
> - if (ldev->device != dev)
> - continue;
> + RTE_ETH_FOREACH_DEV_OF(id, dev) {
> if (n < port_list_n)
> port_list[n] = id;
> n++;
> --
> 2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
2019-04-03 15:04 ` Slava Ovsiienko
@ 2019-04-03 15:04 ` Slava Ovsiienko
0 siblings, 0 replies; 70+ messages in thread
From: Slava Ovsiienko @ 2019-04-03 15:04 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Shahaf Shuler, Yongseok Koh; +Cc: dev
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Monday, April 1, 2019 5:27
> To: gaetan.rivet@6wind.com; Shahaf Shuler <shahafs@mellanox.com>;
> Yongseok Koh <yskoh@mellanox.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators
>
> Iterating over siblings was done with RTE_ETH_FOREACH_DEV() which skips
> the owned ports.
> The new iterators RTE_ETH_FOREACH_DEV_SIBLING() and
> RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Viacheslav Ovsiienko <mellanox.com>
> ---
> drivers/net/mlx5/mlx5.c | 34 +++++++++++++---------------------
> drivers/net/mlx5/mlx5_ethdev.c | 6 +-----
> 2 files changed, 14 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index
> 1d7ca615b..3287a3d78 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -493,17 +493,15 @@ mlx5_dev_close(struct rte_eth_dev *dev)
> dev->data->port_id);
> if (priv->domain_id != RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
> {
> unsigned int c = 0;
> - unsigned int i = mlx5_dev_to_port_id(dev->device, NULL, 0);
> - uint16_t port_id[i];
> + uint16_t port_id;
>
> - i = RTE_MIN(mlx5_dev_to_port_id(dev->device, port_id, i), i);
> - while (i--) {
> + RTE_ETH_FOREACH_DEV_OF(port_id, dev->device) {
> struct mlx5_priv *opriv =
> - rte_eth_devices[port_id[i]].data-
> >dev_private;
> + rte_eth_devices[port_id].data->dev_private;
>
> if (!opriv ||
> opriv->domain_id != priv->domain_id ||
> - &rte_eth_devices[port_id[i]] == dev)
> + &rte_eth_devices[port_id] == dev)
> continue;
> ++c;
> }
> @@ -1147,22 +1145,16 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
> * Look for sibling devices in order to reuse their switch domain
> * if any, otherwise allocate one.
> */
> - i = mlx5_dev_to_port_id(dpdk_dev, NULL, 0);
> - if (i > 0) {
> - uint16_t port_id[i];
> + RTE_ETH_FOREACH_DEV_OF(port_id, dpdk_dev) {
> + const struct mlx5_priv *opriv =
> + rte_eth_devices[port_id].data->dev_private;
>
> - i = RTE_MIN(mlx5_dev_to_port_id(dpdk_dev, port_id, i), i);
> - while (i--) {
> - const struct mlx5_priv *opriv =
> - rte_eth_devices[port_id[i]].data-
> >dev_private;
> -
> - if (!opriv ||
> - opriv->domain_id ==
> - RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
> - continue;
> - priv->domain_id = opriv->domain_id;
> - break;
> - }
> + if (!opriv ||
> + opriv->domain_id ==
> + RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
> + continue;
> + priv->domain_id = opriv->domain_id;
> + break;
> }
> if (priv->domain_id ==
> RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) {
> err = rte_eth_switch_domain_alloc(&priv->domain_id);
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c index 7273bd940..e01b698fc 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -1398,11 +1398,7 @@ mlx5_dev_to_port_id(const struct rte_device
> *dev, uint16_t *port_list,
> uint16_t id;
> unsigned int n = 0;
>
> - RTE_ETH_FOREACH_DEV(id) {
> - struct rte_eth_dev *ldev = &rte_eth_devices[id];
> -
> - if (ldev->device != dev)
> - continue;
> + RTE_ETH_FOREACH_DEV_OF(id, dev) {
> if (n < port_list_n)
> port_list[n] = id;
> n++;
> --
> 2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Thomas Monjalon
` (3 preceding siblings ...)
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 3/4] net/mlx5: use port sibling iterators Thomas Monjalon
@ 2019-04-01 2:27 ` Thomas Monjalon
2019-04-01 2:27 ` Thomas Monjalon
` (2 more replies)
2019-04-03 16:42 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Ferruh Yigit
5 siblings, 3 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:27 UTC (permalink / raw)
To: gaetan.rivet, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger; +Cc: dev
When removing a rte_device on a port-based request,
all the sibling ports must be marked as closed.
The iterator loop can be simplified by using the dedicated macro.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/testpmd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 40c873b97..aeaa74c98 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2370,9 +2370,7 @@ detach_port_device(portid_t port_id)
return;
}
- for (sibling = 0; sibling < RTE_MAX_ETHPORTS; sibling++) {
- if (rte_eth_devices[sibling].device != dev)
- continue;
+ RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) {
/* reset mapping between old ports and removed device */
rte_eth_devices[sibling].device = NULL;
if (ports[sibling].port_status != RTE_PORT_CLOSED) {
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup
2019-04-01 2:27 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup Thomas Monjalon
@ 2019-04-01 2:27 ` Thomas Monjalon
2019-04-02 23:43 ` Ferruh Yigit
2019-04-03 15:04 ` Slava Ovsiienko
2 siblings, 0 replies; 70+ messages in thread
From: Thomas Monjalon @ 2019-04-01 2:27 UTC (permalink / raw)
To: gaetan.rivet, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger; +Cc: dev
When removing a rte_device on a port-based request,
all the sibling ports must be marked as closed.
The iterator loop can be simplified by using the dedicated macro.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/testpmd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 40c873b97..aeaa74c98 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2370,9 +2370,7 @@ detach_port_device(portid_t port_id)
return;
}
- for (sibling = 0; sibling < RTE_MAX_ETHPORTS; sibling++) {
- if (rte_eth_devices[sibling].device != dev)
- continue;
+ RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) {
/* reset mapping between old ports and removed device */
rte_eth_devices[sibling].device = NULL;
if (ports[sibling].port_status != RTE_PORT_CLOSED) {
--
2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup
2019-04-01 2:27 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup Thomas Monjalon
2019-04-01 2:27 ` Thomas Monjalon
@ 2019-04-02 23:43 ` Ferruh Yigit
2019-04-02 23:43 ` Ferruh Yigit
2019-04-03 15:04 ` Slava Ovsiienko
2 siblings, 1 reply; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-02 23:43 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Wenzhuo Lu, Jingjing Wu,
Bernard Iremonger
Cc: dev
On 4/1/2019 3:27 AM, Thomas Monjalon wrote:
> When removing a rte_device on a port-based request,
> all the sibling ports must be marked as closed.
> The iterator loop can be simplified by using the dedicated macro.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup
2019-04-02 23:43 ` Ferruh Yigit
@ 2019-04-02 23:43 ` Ferruh Yigit
0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-02 23:43 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Wenzhuo Lu, Jingjing Wu,
Bernard Iremonger
Cc: dev
On 4/1/2019 3:27 AM, Thomas Monjalon wrote:
> When removing a rte_device on a port-based request,
> all the sibling ports must be marked as closed.
> The iterator loop can be simplified by using the dedicated macro.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup
2019-04-01 2:27 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup Thomas Monjalon
2019-04-01 2:27 ` Thomas Monjalon
2019-04-02 23:43 ` Ferruh Yigit
@ 2019-04-03 15:04 ` Slava Ovsiienko
2019-04-03 15:04 ` Slava Ovsiienko
2 siblings, 1 reply; 70+ messages in thread
From: Slava Ovsiienko @ 2019-04-03 15:04 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Wenzhuo Lu, Jingjing Wu,
Bernard Iremonger
Cc: dev
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Monday, April 1, 2019 5:27
> To: gaetan.rivet@6wind.com; Wenzhuo Lu <wenzhuo.lu@intel.com>; Jingjing
> Wu <jingjing.wu@intel.com>; Bernard Iremonger
> <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in
> device cleanup
>
> When removing a rte_device on a port-based request, all the sibling ports
> must be marked as closed.
> The iterator loop can be simplified by using the dedicated macro.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Viacheslav Ovsiienko <mellanox.com>
> ---
> app/test-pmd/testpmd.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 40c873b97..aeaa74c98 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2370,9 +2370,7 @@ detach_port_device(portid_t port_id)
> return;
> }
>
> - for (sibling = 0; sibling < RTE_MAX_ETHPORTS; sibling++) {
> - if (rte_eth_devices[sibling].device != dev)
> - continue;
> + RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) {
> /* reset mapping between old ports and removed device */
> rte_eth_devices[sibling].device = NULL;
> if (ports[sibling].port_status != RTE_PORT_CLOSED) {
> --
> 2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup
2019-04-03 15:04 ` Slava Ovsiienko
@ 2019-04-03 15:04 ` Slava Ovsiienko
0 siblings, 0 replies; 70+ messages in thread
From: Slava Ovsiienko @ 2019-04-03 15:04 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet, Wenzhuo Lu, Jingjing Wu,
Bernard Iremonger
Cc: dev
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Monday, April 1, 2019 5:27
> To: gaetan.rivet@6wind.com; Wenzhuo Lu <wenzhuo.lu@intel.com>; Jingjing
> Wu <jingjing.wu@intel.com>; Bernard Iremonger
> <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in
> device cleanup
>
> When removing a rte_device on a port-based request, all the sibling ports
> must be marked as closed.
> The iterator loop can be simplified by using the dedicated macro.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Viacheslav Ovsiienko <mellanox.com>
> ---
> app/test-pmd/testpmd.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 40c873b97..aeaa74c98 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2370,9 +2370,7 @@ detach_port_device(portid_t port_id)
> return;
> }
>
> - for (sibling = 0; sibling < RTE_MAX_ETHPORTS; sibling++) {
> - if (rte_eth_devices[sibling].device != dev)
> - continue;
> + RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) {
> /* reset mapping between old ports and removed device */
> rte_eth_devices[sibling].device = NULL;
> if (ports[sibling].port_status != RTE_PORT_CLOSED) {
> --
> 2.21.0
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device
2019-04-01 2:26 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Thomas Monjalon
` (4 preceding siblings ...)
2019-04-01 2:27 ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: use port sibling iterator in device cleanup Thomas Monjalon
@ 2019-04-03 16:42 ` Ferruh Yigit
2019-04-03 16:42 ` Ferruh Yigit
5 siblings, 1 reply; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-03 16:42 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet; +Cc: dev
On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> Add port iterators in order to allow listing easily
> the ports of the same device.
>
> The iterators can be tested by using mlx5 or testpmd.
>
>
> v3: changes only in the (main) patch 2
>
>
> Thomas Monjalon (4):
> ethdev: simplify port state comparisons
> ethdev: add siblings iterators
> net/mlx5: use port sibling iterators
> app/testpmd: use port sibling iterator in device cleanup
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device
2019-04-03 16:42 ` [dpdk-dev] [PATCH v3 0/4] ethdev iterators for multi-ports device Ferruh Yigit
@ 2019-04-03 16:42 ` Ferruh Yigit
0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2019-04-03 16:42 UTC (permalink / raw)
To: Thomas Monjalon, gaetan.rivet; +Cc: dev
On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> Add port iterators in order to allow listing easily
> the ports of the same device.
>
> The iterators can be tested by using mlx5 or testpmd.
>
>
> v3: changes only in the (main) patch 2
>
>
> Thomas Monjalon (4):
> ethdev: simplify port state comparisons
> ethdev: add siblings iterators
> net/mlx5: use port sibling iterators
> app/testpmd: use port sibling iterator in device cleanup
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 70+ messages in thread