public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Sven Müller" <musv@gmx•de>
To: unlisted-recipients:; (no To-header on input)
Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons•com>,
	"Grégory Clement" <gregory.clement@free-electrons•com>,
	"Antoine Ténart" <antoine.tenart@free-electrons•com>,
	netdev@vger•kernel.org, "Marcin Wojtas" <mw@semihalf•com>
Subject: Re: [PATCH] net: mvneta: fix handling of the Tx descriptor counter
Date: Fri, 10 Nov 2017 11:22:37 +0100	[thread overview]
Message-ID: <20171110112237.18cb9dbc@maja.blechnet.de> (raw)
In-Reply-To: <20171031152322.3e180c30@gmx.de>


Hi Simon, 

Until now it seems to work. No issues so far.

Regards and Thanks
Sven

Am Thu, 9 Nov 2017 20:19:42 +0100
schrieb Andreas Tobler <andreas.tobler@cloudguard•ch>:

> Hi Simon,
> 
> 
> On 08.11.17 18:17, Simon Guinot wrote:  
> > Hi Sven and Andreas,
> > 
> > Please, can you try with this patch ?    
> 
> Today we, my son and I, repeated the failing scenario and we were
> able to show that our scenario behaves stable after you patch being
> applied.
> 
> Thanks for taking care of this issue. If you need further testing let
> me know.
> 
> Regards,
> Andreas
>   
> > On Wed, Nov 08, 2017 at 05:58:35PM +0100, Simon Guinot wrote:    
> >> The mvneta controller provides a 8-bit register to update the
> >> pending Tx descriptor counter. Then, a maximum of 255 Tx
> >> descriptors can be added at once. In the current code the
> >> mvneta_txq_pend_desc_add function assumes the caller takes care of
> >> this limit. But it is not the case. In some situations (xmit_more
> >> flag), more than 255 descriptors are added. When this happens, the
> >> Tx descriptor counter register is updated with a wrong value,
> >> which breaks the whole Tx queue management.
> >>
> >> This patch fixes the issue by allowing the mvneta_txq_pend_desc_add
> >> function to process more than 255 Tx descriptors.
> >>
> >> Fixes: 2a90f7e1d5d0 ("net: mvneta: add xmit_more support")
> >> Cc: stable@vger•kernel.org # 4.11+
> >> Signed-off-by: Simon Guinot <simon.guinot@sequanux•org>
> >> ---
> >>   drivers/net/ethernet/marvell/mvneta.c | 16 +++++++++-------
> >>   1 file changed, 9 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/net/ethernet/marvell/mvneta.c
> >> b/drivers/net/ethernet/marvell/mvneta.c index
> >> 64a04975bcf8..027c08ce4e5d 100644 ---
> >> a/drivers/net/ethernet/marvell/mvneta.c +++
> >> b/drivers/net/ethernet/marvell/mvneta.c @@ -816,11 +816,14 @@
> >> static void mvneta_txq_pend_desc_add(struct mvneta_port *pp, {
> >>   	u32 val;
> >>   
> >> -	/* Only 255 descriptors can be added at once ; Assume
> >> caller
> >> -	 * process TX desriptors in quanta less than 256
> >> -	 */
> >> -	val = pend_desc + txq->pending;
> >> -	mvreg_write(pp, MVNETA_TXQ_UPDATE_REG(txq->id), val);
> >> +	pend_desc += txq->pending;
> >> +
> >> +	/* Only 255 Tx descriptors can be added at once */
> >> +	while (pend_desc > 0) {
> >> +		val = min(pend_desc, 255);
> >> +		mvreg_write(pp, MVNETA_TXQ_UPDATE_REG(txq->id),
> >> val);
> >> +		pend_desc -= val;
> >> +	}
> >>   	txq->pending = 0;
> >>   }
> >>   
> >> @@ -2413,8 +2416,7 @@ static int mvneta_tx(struct sk_buff *skb,
> >> struct net_device *dev) if (txq->count >= txq->tx_stop_threshold)
> >>   			netif_tx_stop_queue(nq);
> >>   
> >> -		if (!skb->xmit_more || netif_xmit_stopped(nq) ||
> >> -		    txq->pending + frags >
> >> MVNETA_TXQ_DEC_SENT_MASK)
> >> +		if (!skb->xmit_more || netif_xmit_stopped(nq))
> >>   			mvneta_txq_pend_desc_add(pp, txq, frags);
> >>   		else
> >>   			txq->pending += frags;
> >> -- 
> >> 2.9.3    

      parent reply	other threads:[~2017-11-10 10:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171018223425.42ce7a74@gmx.de>
2017-10-18 20:55 ` Problems with mvneta Thomas Petazzoni
2017-10-19 22:25   ` Sven Müller
2017-10-20  7:09     ` Thomas Petazzoni
2017-10-23  6:29       ` Andreas Tobler
2017-10-23  9:30         ` Sven Müller
2017-10-31 14:23           ` Sven Müller
2017-10-31 14:27             ` Thomas Petazzoni
2017-10-31 17:09               ` Simon Guinot
2017-10-31 20:23                 ` Thomas Petazzoni
2017-11-01  8:10                   ` Marcin Wojtas
2017-11-08 16:58                     ` [PATCH] net: mvneta: fix handling of the Tx descriptor counter Simon Guinot
2017-11-08 17:03                       ` David Laight
2017-11-08 17:17                       ` Simon Guinot
2017-11-09 19:19                         ` Andreas Tobler
2017-11-11  9:45                       ` David Miller
2017-11-13 14:51                         ` Simon Guinot
2017-11-13 14:54                           ` David Miller
2017-11-13 15:36                             ` Simon Guinot
2017-11-20 14:58                               ` David Laight
2017-11-13 15:27                       ` [PATCH v2] " Simon Guinot
2017-11-14 12:53                         ` David Miller
2017-11-10 10:22             ` Sven Müller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171110112237.18cb9dbc@maja.blechnet.de \
    --to=musv@gmx$(echo .)de \
    --cc=antoine.tenart@free-electrons$(echo .)com \
    --cc=gregory.clement@free-electrons$(echo .)com \
    --cc=mw@semihalf$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=thomas.petazzoni@free-electrons$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox