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] [day] [month] [year] [list]
Message-ID: <69af4321-6c4b-42a0-b183-9f73bcf479aa@gmail.com>
Date: Tue, 30 Jul 2024 21:34:03 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Justin Lai <justinlai0215@...ltek.com>, Jakub Kicinski <kuba@...nel.org>
Cc: "davem@...emloft.net" <davem@...emloft.net>,
 "edumazet@...gle.com" <edumazet@...gle.com>,
 "pabeni@...hat.com" <pabeni@...hat.com>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
 "andrew@...n.ch" <andrew@...n.ch>, "jiri@...nulli.us" <jiri@...nulli.us>,
 "horms@...nel.org" <horms@...nel.org>,
 "rkannoth@...vell.com" <rkannoth@...vell.com>,
 "jdamato@...tly.com" <jdamato@...tly.com>, Ping-Ke Shih
 <pkshih@...ltek.com>, Larry Chiu <larry.chiu@...ltek.com>
Subject: Re: [PATCH net-next v25 06/13] rtase: Implement .ndo_start_xmit
 function

On 30.07.2024 11:27, Justin Lai wrote:
>> On Mon, 29 Jul 2024 14:21:14 +0800 Justin Lai wrote:
>>> +     stop_queue = !netif_subqueue_maybe_stop(dev, ring->index,
>>> +                                             rtase_tx_avail(ring),
>>> +
>> RTASE_TX_STOP_THRS,
>>> +
>> RTASE_TX_START_THRS);
>>> +
>>> +     if (door_bell || stop_queue)
>>> +             rtase_w8(tp, RTASE_TPPOLL, BIT(ring->index));
>>> +
>>> +     return NETDEV_TX_OK;
>>> +
>>> +err_dma_1:
>>> +     ring->skbuff[entry] = NULL;
>>> +     rtase_tx_clear_range(ring, ring->cur_idx + 1, frags);
>>> +
>>> +err_dma_0:
>>> +     tp->stats.tx_dropped++;
>>> +     dev_kfree_skb_any(skb);
>>> +     return NETDEV_TX_OK;
>>> +
>>> +err_stop:
>>> +     netif_stop_queue(dev);
>>> +     tp->stats.tx_dropped++;
>>> +     return NETDEV_TX_BUSY;
>>
>> If you're dropping a packet you should somehow check that the previous xmit
>> didn't enqueue a packet to the ring and skip the doorbell because door_bell
>> was false. If that's the case you have to ring the doorbell now.
>>
I briefly checked and this may be a common issue, e.g. stmmac_xmit() behaves
the same as r8169 here.
Hitting this error path should be a rare event, so we could ring the doorbell
always, w/o any further checks?

>> Also you shouldn't increment dropped if you return TX_BUSY.
> 
I'll take care of this change for r8169.

> Thank you for your response. I will modify it.
>>
>> Please fix these issues in the driver you're copying from, too.
> 
> I will inform the person responsible for the R8169 of the issues we've
> identified and discuss what modifications need to be made.
> 
> Thanks
> Justin
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ