lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MN0PR12MB5953E37D081382AF52C309E2B7CEA@MN0PR12MB5953.namprd12.prod.outlook.com>
Date:   Mon, 9 Oct 2023 19:41:35 +0000
From:   "Pandey, Radhey Shyam" <radhey.shyam.pandey@....com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "conor+dt@...nel.org" <conor+dt@...nel.org>,
        "Simek, Michal" <michal.simek@....com>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "f.fainelli@...il.com" <f.fainelli@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "git (AMD-Xilinx)" <git@....com>
Subject: RE: [PATCH net-next v7 3/3] net: axienet: Introduce dmaengine support

> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Saturday, October 7, 2023 3:03 AM
> To: Pandey, Radhey Shyam <radhey.shyam.pandey@....com>
> Cc: davem@...emloft.net; edumazet@...gle.com; pabeni@...hat.com;
> robh+dt@...nel.org; krzysztof.kozlowski+dt@...aro.org;
> conor+dt@...nel.org; Simek, Michal <michal.simek@....com>;
> linux@...linux.org.uk; f.fainelli@...il.com; netdev@...r.kernel.org;
> devicetree@...r.kernel.org; linux-kernel@...r.kernel.org; linux-arm-
> kernel@...ts.infradead.org; git (AMD-Xilinx) <git@....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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ