DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix slave port detection
@ 2018-03-28 11:17 Matan Azrad
  2018-04-22 22:58 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Matan Azrad @ 2018-03-28 11:17 UTC (permalink / raw)
  To: Wenzhuo Lu; +Cc: dev, stable

Testpmd allows to create and control bonding devices by run time
command lines using the bonding PMD API.

Some bonding device slaves operations(close, stop, etc) should not be
used by the application and must be managed by the bonding PMD.

Thus, Testpmd manages slave flags to prevent the special operations
calls and when a slave is added to bonding device by a run time command
line, the flag is set.

There is one more way to define the slaves for a bonding device using
EAL command line and Testpmd doesn't set the slave flag in this case
what causes to the special operations to be called by Testpmd.

Add one more check to detect bonding slave device.

Fixes: 41b05095c4d1 ("app/testpmd: fix bonding start")
Fixes: 0e545d3047fe ("app/testpmd: check stopping port is not in bonding")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 app/test-pmd/testpmd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 4c0e258..73d9481 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2251,7 +2251,10 @@ uint8_t port_is_bonding_slave(portid_t slave_pid)
 	struct rte_port *port;
 
 	port = &ports[slave_pid];
-	return port->slave_flag;
+	if ((rte_eth_devices[slave_pid].data->dev_flags &
+	    RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
+		return 1;
+	return 0;
 }
 
 const uint16_t vlan_tags[] = {
-- 
1.9.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: fix slave port detection
  2018-03-28 11:17 [dpdk-dev] [PATCH] app/testpmd: fix slave port detection Matan Azrad
@ 2018-04-22 22:58 ` Thomas Monjalon
  2018-05-11 16:09   ` Iremonger, Bernard
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2018-04-22 22:58 UTC (permalink / raw)
  To: Wenzhuo Lu, declan.doherty; +Cc: stable, Matan Azrad, dev, ferruh.yigit

Wenzhuo, Declan,
Any comment or ack, please?

28/03/2018 13:17, Matan Azrad:
> Testpmd allows to create and control bonding devices by run time
> command lines using the bonding PMD API.
> 
> Some bonding device slaves operations(close, stop, etc) should not be
> used by the application and must be managed by the bonding PMD.
> 
> Thus, Testpmd manages slave flags to prevent the special operations
> calls and when a slave is added to bonding device by a run time command
> line, the flag is set.
> 
> There is one more way to define the slaves for a bonding device using
> EAL command line and Testpmd doesn't set the slave flag in this case
> what causes to the special operations to be called by Testpmd.
> 
> Add one more check to detect bonding slave device.
> 
> Fixes: 41b05095c4d1 ("app/testpmd: fix bonding start")
> Fixes: 0e545d3047fe ("app/testpmd: check stopping port is not in bonding")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> ---
>  app/test-pmd/testpmd.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 4c0e258..73d9481 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2251,7 +2251,10 @@ uint8_t port_is_bonding_slave(portid_t slave_pid)
>  	struct rte_port *port;
>  
>  	port = &ports[slave_pid];
> -	return port->slave_flag;
> +	if ((rte_eth_devices[slave_pid].data->dev_flags &
> +	    RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
> +		return 1;
> +	return 0;
>  }
>  
>  const uint16_t vlan_tags[] = {
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: fix slave port detection
  2018-04-22 22:58 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
@ 2018-05-11 16:09   ` Iremonger, Bernard
  2018-05-14  2:00     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Iremonger, Bernard @ 2018-05-11 16:09 UTC (permalink / raw)
  To: Thomas Monjalon, Lu, Wenzhuo, Doherty, Declan
  Cc: stable, Matan Azrad, dev, Yigit, Ferruh


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Sunday, April 22, 2018 11:58 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: stable@dpdk.org; Matan Azrad <matan@mellanox.com>; dev@dpdk.org;
> Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: fix slave port
> detection
> 
> Wenzhuo, Declan,
> Any comment or ack, please?
> 
> 28/03/2018 13:17, Matan Azrad:
> > Testpmd allows to create and control bonding devices by run time
> > command lines using the bonding PMD API.
> >
> > Some bonding device slaves operations(close, stop, etc) should not be
> > used by the application and must be managed by the bonding PMD.
> >
> > Thus, Testpmd manages slave flags to prevent the special operations
> > calls and when a slave is added to bonding device by a run time
> > command line, the flag is set.
> >
> > There is one more way to define the slaves for a bonding device using
> > EAL command line and Testpmd doesn't set the slave flag in this case
> > what causes to the special operations to be called by Testpmd.
> >
> > Add one more check to detect bonding slave device.
> >
> > Fixes: 41b05095c4d1 ("app/testpmd: fix bonding start")
> > Fixes: 0e545d3047fe ("app/testpmd: check stopping port is not in
> > bonding")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Matan Azrad <matan@mellanox.com>

Acked-by: Bernard Iremonger <Bernard.iremonger@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: fix slave port detection
  2018-05-11 16:09   ` Iremonger, Bernard
@ 2018-05-14  2:00     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-05-14  2:00 UTC (permalink / raw)
  To: Matan Azrad
  Cc: stable, Iremonger, Bernard, Lu, Wenzhuo, Doherty, Declan, dev,
	Yigit, Ferruh

> > > Testpmd allows to create and control bonding devices by run time
> > > command lines using the bonding PMD API.
> > >
> > > Some bonding device slaves operations(close, stop, etc) should not be
> > > used by the application and must be managed by the bonding PMD.
> > >
> > > Thus, Testpmd manages slave flags to prevent the special operations
> > > calls and when a slave is added to bonding device by a run time
> > > command line, the flag is set.
> > >
> > > There is one more way to define the slaves for a bonding device using
> > > EAL command line and Testpmd doesn't set the slave flag in this case
> > > what causes to the special operations to be called by Testpmd.
> > >
> > > Add one more check to detect bonding slave device.
> > >
> > > Fixes: 41b05095c4d1 ("app/testpmd: fix bonding start")
> > > Fixes: 0e545d3047fe ("app/testpmd: check stopping port is not in
> > > bonding")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Matan Azrad <matan@mellanox.com>
> 
> Acked-by: Bernard Iremonger <Bernard.iremonger@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-14  2:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-28 11:17 [dpdk-dev] [PATCH] app/testpmd: fix slave port detection Matan Azrad
2018-04-22 22:58 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-05-11 16:09   ` Iremonger, Bernard
2018-05-14  2:00     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).