All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice
@ 2018-02-26 14:14 Antoine Tenart
  2018-02-26 14:14 ` [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds Antoine Tenart
  2018-02-26 14:14 ` [PATCH net-next 3/3] net: mvpp2: align the ethtool ops definition Antoine Tenart
  0 siblings, 2 replies; 6+ messages in thread
From: Antoine Tenart @ 2018-02-26 14:14 UTC (permalink / raw)
  To: davem
  Cc: Yan Markman, mw, stefanc, thomas.petazzoni, gregory.clement,
	miquel.raynal, nadavh, maxime.chevallier, netdev, linux-kernel,
	Antoine Tenart

From: Yan Markman <ymarkman@marvell.com>

Avoid repeating the check for free aggregated descriptors when it
already failed at the beginning of the function.

Signed-off-by: Yan Markman <ymarkman@marvell.com>
[Antoine: commit message]
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 5a1668cdb461..55300b1fe6c0 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5224,11 +5224,10 @@ static int mvpp2_aggr_desc_num_check(struct mvpp2 *priv,
 		u32 val = mvpp2_read(priv, MVPP2_AGGR_TXQ_STATUS_REG(cpu));
 
 		aggr_txq->count = val & MVPP2_AGGR_TXQ_PENDING_MASK;
-	}
-
-	if ((aggr_txq->count + num) > MVPP2_AGGR_TXQ_SIZE)
-		return -ENOMEM;
 
+		if ((aggr_txq->count + num) > MVPP2_AGGR_TXQ_SIZE)
+			return -ENOMEM;
+	}
 	return 0;
 }
 
-- 
2.14.3

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

* [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds
  2018-02-26 14:14 [PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice Antoine Tenart
@ 2018-02-26 14:14 ` Antoine Tenart
  2018-02-27 16:13   ` David Miller
  2018-02-26 14:14 ` [PATCH net-next 3/3] net: mvpp2: align the ethtool ops definition Antoine Tenart
  1 sibling, 1 reply; 6+ messages in thread
From: Antoine Tenart @ 2018-02-26 14:14 UTC (permalink / raw)
  To: davem
  Cc: Yan Markman, mw, stefanc, thomas.petazzoni, gregory.clement,
	miquel.raynal, nadavh, maxime.chevallier, netdev, linux-kernel

From: Yan Markman <ymarkman@marvell.com>

Adjust MVPP2_MAX_TSO_SEGS and stop_threshold/wake_threshold
for better TXQ utilization and performance.

Signed-off-by: Yan Markman <ymarkman@marvell.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 55300b1fe6c0..1a893ef70eab 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -498,7 +498,7 @@
  * skb. As we need a maxium of two descriptors per fragments (1 header, 1 data),
  * multiply this value by two to count the maximum number of skb descs needed.
  */
-#define MVPP2_MAX_TSO_SEGS		300
+#define MVPP2_MAX_TSO_SEGS		100
 #define MVPP2_MAX_SKB_DESCS		(MVPP2_MAX_TSO_SEGS * 2 + MAX_SKB_FRAGS)
 
 /* Dfault number of RXQs in use */
@@ -5810,7 +5810,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
 		txq_pcpu->tso_headers = NULL;
 
 		txq_pcpu->stop_threshold = txq->size - MVPP2_MAX_SKB_DESCS;
-		txq_pcpu->wake_threshold = txq_pcpu->stop_threshold / 2;
+		txq_pcpu->wake_threshold = txq_pcpu->stop_threshold - 100;
 
 		txq_pcpu->tso_headers =
 			dma_alloc_coherent(port->dev->dev.parent,
-- 
2.14.3

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

* [PATCH net-next 3/3] net: mvpp2: align the ethtool ops definition
  2018-02-26 14:14 [PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice Antoine Tenart
  2018-02-26 14:14 ` [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds Antoine Tenart
@ 2018-02-26 14:14 ` Antoine Tenart
  1 sibling, 0 replies; 6+ messages in thread
From: Antoine Tenart @ 2018-02-26 14:14 UTC (permalink / raw)
  To: davem
  Cc: Antoine Tenart, mw, stefanc, ymarkman, thomas.petazzoni,
	gregory.clement, miquel.raynal, nadavh, maxime.chevallier, netdev,
	linux-kernel

Cosmetic patch to align the ethtool functions to ops definitions. This
patch does not change in any way the driver's behaviour.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 1a893ef70eab..babbb1ceba2a 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -7435,18 +7435,18 @@ static const struct net_device_ops mvpp2_netdev_ops = {
 };
 
 static const struct ethtool_ops mvpp2_eth_tool_ops = {
-	.nway_reset	= phy_ethtool_nway_reset,
-	.get_link	= ethtool_op_get_link,
-	.set_coalesce	= mvpp2_ethtool_set_coalesce,
-	.get_coalesce	= mvpp2_ethtool_get_coalesce,
-	.get_drvinfo	= mvpp2_ethtool_get_drvinfo,
-	.get_ringparam	= mvpp2_ethtool_get_ringparam,
-	.set_ringparam	= mvpp2_ethtool_set_ringparam,
-	.get_strings	= mvpp2_ethtool_get_strings,
-	.get_ethtool_stats = mvpp2_ethtool_get_stats,
-	.get_sset_count	= mvpp2_ethtool_get_sset_count,
-	.get_link_ksettings = phy_ethtool_get_link_ksettings,
-	.set_link_ksettings = phy_ethtool_set_link_ksettings,
+	.nway_reset		= phy_ethtool_nway_reset,
+	.get_link		= ethtool_op_get_link,
+	.set_coalesce		= mvpp2_ethtool_set_coalesce,
+	.get_coalesce		= mvpp2_ethtool_get_coalesce,
+	.get_drvinfo		= mvpp2_ethtool_get_drvinfo,
+	.get_ringparam		= mvpp2_ethtool_get_ringparam,
+	.set_ringparam		= mvpp2_ethtool_set_ringparam,
+	.get_strings		= mvpp2_ethtool_get_strings,
+	.get_ethtool_stats	= mvpp2_ethtool_get_stats,
+	.get_sset_count		= mvpp2_ethtool_get_sset_count,
+	.get_link_ksettings	= phy_ethtool_get_link_ksettings,
+	.set_link_ksettings	= phy_ethtool_set_link_ksettings,
 };
 
 /* Used for PPv2.1, or PPv2.2 with the old Device Tree binding that
-- 
2.14.3

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

* Re: [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds
  2018-02-26 14:14 ` [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds Antoine Tenart
@ 2018-02-27 16:13   ` David Miller
  2018-02-27 17:13     ` Antoine Tenart
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2018-02-27 16:13 UTC (permalink / raw)
  To: antoine.tenart
  Cc: ymarkman, mw, stefanc, thomas.petazzoni, gregory.clement,
	miquel.raynal, nadavh, maxime.chevallier, netdev, linux-kernel

From: Antoine Tenart <antoine.tenart@bootlin.com>
Date: Mon, 26 Feb 2018 15:14:26 +0100

> From: Yan Markman <ymarkman@marvell.com>
> 
> Adjust MVPP2_MAX_TSO_SEGS and stop_threshold/wake_threshold
> for better TXQ utilization and performance.
> 
> Signed-off-by: Yan Markman <ymarkman@marvell.com>
> ---
>  drivers/net/ethernet/marvell/mvpp2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
> index 55300b1fe6c0..1a893ef70eab 100644
> --- a/drivers/net/ethernet/marvell/mvpp2.c
> +++ b/drivers/net/ethernet/marvell/mvpp2.c
> @@ -498,7 +498,7 @@
>   * skb. As we need a maxium of two descriptors per fragments (1 header, 1 data),
>   * multiply this value by two to count the maximum number of skb descs needed.
>   */
> -#define MVPP2_MAX_TSO_SEGS		300
> +#define MVPP2_MAX_TSO_SEGS		100
>  #define MVPP2_MAX_SKB_DESCS		(MVPP2_MAX_TSO_SEGS * 2 + MAX_SKB_FRAGS)
>  
>  /* Dfault number of RXQs in use */
> @@ -5810,7 +5810,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
>  		txq_pcpu->tso_headers = NULL;
>  
>  		txq_pcpu->stop_threshold = txq->size - MVPP2_MAX_SKB_DESCS;
> -		txq_pcpu->wake_threshold = txq_pcpu->stop_threshold / 2;
> +		txq_pcpu->wake_threshold = txq_pcpu->stop_threshold - 100;
>  

This number 100 is a magic constant.  If it is related to
MVPP2_MAX_TSO_SEGS, please use that define.  Otherwise
define a new one which is descriptive.

Thank you.

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

* Re: [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds
  2018-02-27 16:13   ` David Miller
@ 2018-02-27 17:13     ` Antoine Tenart
  2018-02-27 17:48       ` Yan Markman
  0 siblings, 1 reply; 6+ messages in thread
From: Antoine Tenart @ 2018-02-27 17:13 UTC (permalink / raw)
  To: David Miller
  Cc: antoine.tenart, ymarkman, mw, stefanc, thomas.petazzoni,
	gregory.clement, miquel.raynal, nadavh, maxime.chevallier, netdev,
	linux-kernel

Hi David,

On Tue, Feb 27, 2018 at 11:13:06AM -0500, David Miller wrote:
> From: Antoine Tenart <antoine.tenart@bootlin.com>
> > From: Yan Markman <ymarkman@marvell.com>
> > -#define MVPP2_MAX_TSO_SEGS		300
> > +#define MVPP2_MAX_TSO_SEGS		100
> >  #define MVPP2_MAX_SKB_DESCS		(MVPP2_MAX_TSO_SEGS * 2 + MAX_SKB_FRAGS)
> >  
> >  /* Dfault number of RXQs in use */
> > @@ -5810,7 +5810,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
> >  		txq_pcpu->tso_headers = NULL;
> >  
> >  		txq_pcpu->stop_threshold = txq->size - MVPP2_MAX_SKB_DESCS;
> > -		txq_pcpu->wake_threshold = txq_pcpu->stop_threshold / 2;
> > +		txq_pcpu->wake_threshold = txq_pcpu->stop_threshold - 100;
> >  
> 
> This number 100 is a magic constant.  If it is related to
> MVPP2_MAX_TSO_SEGS, please use that define.  Otherwise
> define a new one which is descriptive.

I agree. I'll ask Yan about it and update if possible.

Thanks!
Antoine

-- 
Antoine Ténart, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* RE: [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds
  2018-02-27 17:13     ` Antoine Tenart
@ 2018-02-27 17:48       ` Yan Markman
  0 siblings, 0 replies; 6+ messages in thread
From: Yan Markman @ 2018-02-27 17:48 UTC (permalink / raw)
  To: Antoine Tenart, David Miller
  Cc: mw@semihalf.com, Stefan Chulski,
	thomas.petazzoni@free-electrons.com,
	gregory.clement@free-electrons.com,
	miquel.raynal@free-electrons.com, Nadav Haklai,
	maxime.chevallier@bootlin.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

I will make this tomorrow.
Thanks for attention!
Best regards
Yan Markman
Tel. 05-44732819


-----Original Message-----
From: Antoine Tenart [mailto:antoine.tenart@bootlin.com] 
Sent: Tuesday, February 27, 2018 7:14 PM
To: David Miller <davem@davemloft.net>
Cc: antoine.tenart@bootlin.com; Yan Markman <ymarkman@marvell.com>; mw@semihalf.com; Stefan Chulski <stefanc@marvell.com>; thomas.petazzoni@free-electrons.com; gregory.clement@free-electrons.com; miquel.raynal@free-electrons.com; Nadav Haklai <nadavh@marvell.com>; maxime.chevallier@bootlin.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds

Hi David,

On Tue, Feb 27, 2018 at 11:13:06AM -0500, David Miller wrote:
> From: Antoine Tenart <antoine.tenart@bootlin.com>
> > From: Yan Markman <ymarkman@marvell.com>
> > -#define MVPP2_MAX_TSO_SEGS		300
> > +#define MVPP2_MAX_TSO_SEGS		100
> >  #define MVPP2_MAX_SKB_DESCS		(MVPP2_MAX_TSO_SEGS * 2 + MAX_SKB_FRAGS)
> >  
> >  /* Dfault number of RXQs in use */
> > @@ -5810,7 +5810,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
> >  		txq_pcpu->tso_headers = NULL;
> >  
> >  		txq_pcpu->stop_threshold = txq->size - MVPP2_MAX_SKB_DESCS;
> > -		txq_pcpu->wake_threshold = txq_pcpu->stop_threshold / 2;
> > +		txq_pcpu->wake_threshold = txq_pcpu->stop_threshold - 100;
> >  
> 
> This number 100 is a magic constant.  If it is related to 
> MVPP2_MAX_TSO_SEGS, please use that define.  Otherwise define a new 
> one which is descriptive.

I agree. I'll ask Yan about it and update if possible.

Thanks!
Antoine

--
Antoine Ténart, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com

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

end of thread, other threads:[~2018-02-27 17:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-26 14:14 [PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice Antoine Tenart
2018-02-26 14:14 ` [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds Antoine Tenart
2018-02-27 16:13   ` David Miller
2018-02-27 17:13     ` Antoine Tenart
2018-02-27 17:48       ` Yan Markman
2018-02-26 14:14 ` [PATCH net-next 3/3] net: mvpp2: align the ethtool ops definition Antoine Tenart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.