[PATCH net-next v7 3/3] net: axienet: Introduce dmaengine support

Pandey, Radhey Shyam radhey.shyam.pandey at amd.com
Mon Oct 9 12:41:35 PDT 2023


> -----Original Message-----
> From: Jakub Kicinski <kuba at kernel.org>
> Sent: Saturday, October 7, 2023 3:03 AM
> To: Pandey, Radhey Shyam <radhey.shyam.pandey at amd.com>
> Cc: davem at davemloft.net; edumazet at google.com; pabeni at redhat.com;
> robh+dt at kernel.org; krzysztof.kozlowski+dt at linaro.org;
> conor+dt at kernel.org; Simek, Michal <michal.simek at amd.com>;
> linux at armlinux.org.uk; f.fainelli at gmail.com; netdev at vger.kernel.org;
> devicetree at vger.kernel.org; linux-kernel at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; git (AMD-Xilinx) <git at amd.com>
> Subject: Re: [PATCH net-next v7 3/3] net: axienet: Introduce dmaengine
> support
> 
> On Fri, 6 Oct 2023 19:04:29 +0000 Pandey, Radhey Shyam wrote:
> > > > +		netif_stop_queue(ndev);
> > > > +		if (net_ratelimit())
> > > > +			netdev_warn(ndev, "TX ring unexpectedly full\n");
> > >
> > > I don't see you stopping the queue when the ring gets full, am I not
> > > looking into the right place? Otherwise this is sort of expected to
> > > occasionally hapen
> >
> > We are calling stop_queue if TX ring is full. Is that what you meant?
> > netif_stop_queue(ndev);
> 
> But somewhere else or just here after printing the warning?

There is call to netif_stop_queue(ndev) just before this netdev_warn.
I copied below for quick reference.

+	sg_len = skb_shinfo(skb)->nr_frags + 1;
+	if (!CIRC_SPACE(lp->tx_ring_head, lp->tx_ring_tail, TX_BD_NUM_MAX)) {
+		netif_stop_queue(ndev);
+		if (net_ratelimit())
+			netdev_warn(ndev, "TX ring unexpectedly full\n");
+		return NETDEV_TX_BUSY;
+	}

However, I noticed above check doesn't account for all frags - so will 
modify the if check to see if available space is less than sg_len. If yes, then 
stop the queue and return busy , else continue with xmit.

> 
> The recommended flow is to stop the queue after enqueuing a packet
> successfully, if the remaining space is not enough to hold an skb with all frags
> populated. That avoids ever returning BUSY.



More information about the linux-arm-kernel mailing list