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]
Date:   Wed, 11 Aug 2021 14:09:39 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Michael Chan <michael.chan@...adcom.com>
Cc:     David Miller <davem@...emloft.net>,
        Jeffrey Huang <huangjw@...adcom.com>,
        Eddie Wai <eddie.wai@...adcom.com>,
        Prashant Sreedharan <prashant@...adcom.com>,
        Andrew Gospodarek <gospo@...adcom.com>,
        Netdev <netdev@...r.kernel.org>,
        Edwin Peer <edwin.peer@...adcom.com>
Subject: Re: [PATCH net 1/4] bnxt: don't lock the tx queue from napi poll

On Wed, 11 Aug 2021 13:42:40 -0700 Michael Chan wrote:
> > -       if (unlikely(netif_tx_queue_stopped(txq)) &&
> > -           (bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh)) {
> > -               __netif_tx_lock(txq, smp_processor_id());
> > -               if (netif_tx_queue_stopped(txq) &&
> > -                   bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh &&
> > -                   txr->dev_state != BNXT_DEV_STATE_CLOSING)
> > -                       netif_tx_wake_queue(txq);
> > -               __netif_tx_unlock(txq);
> > -       }
> > +       if (netif_tx_queue_stopped(txq) &&
> > +           bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh &&
> > +           READ_ONCE(txr->dev_state) != BNXT_DEV_STATE_CLOSING)  
> 
> This can race with bnxt_start_xmit().  bnxt_start_xmit() can also wake
> up the queue when it sees that descriptors are available.  I think
> this is the reason we added tx locking here.  The race may be ok
> because in the worst case, we will wake up the TX queue when it's not
> supposed to wakeup.  If that happens, bnxt_start_xmit() will return
> NETDEV_TX_BUSY and stop the queue again when there are not enough TX
> descriptors.

Good point, let me remove the warning from patch 3, then.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ