From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] net: mvneta: fix handling of the Tx descriptor counter Date: Sat, 11 Nov 2017 18:45:04 +0900 (KST) Message-ID: <20171111.184504.2151388779461931723.davem@davemloft.net> References: <20171108165835.13453-1-simon.guinot@sequanux.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: thomas.petazzoni@free-electrons.com, netdev@vger.kernel.org, musv@gmx.de, andreas.tobler@cloudguard.ch, gregory.clement@free-electrons.com, antoine.tenart@free-electrons.com, mw@semihalf.com, stable@vger.kernel.org To: simon.guinot@sequanux.org Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:45830 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750896AbdKKJpJ (ORCPT ); Sat, 11 Nov 2017 04:45:09 -0500 In-Reply-To: <20171108165835.13453-1-simon.guinot@sequanux.org> Sender: netdev-owner@vger.kernel.org List-ID: From: Simon Guinot Date: Wed, 8 Nov 2017 17:58:35 +0100 > @@ -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; As David Laight said, you should not allow unlimited amounts of ->xmit_more frames to be queued without a TX doorbell update. Therefore, please keep some kind of limit here otherwise latency will spike in some circumstances.