Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444751

Re: [PATCH net] bnxt_en: Fix potential race condition in bnxt_tx_enable()

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net] bnxt_en: Fix potential race condition in bnxt_tx_enable()
Date 2016-07-16 08:30 +0200
Message-ID <rVrgR-ig-1@gated-at.bofh.it> (permalink)
References <rVl1M-4Mo-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 15 Jul 2016 16:42:01 -0700

> @@ -4599,7 +4599,9 @@ static void bnxt_tx_enable(struct bnxt *bp)
>  	for (i = 0; i < bp->tx_nr_rings; i++) {
>  		txr = &bp->tx_ring[i];
>  		txq = netdev_get_tx_queue(bp->dev, i);
> +		__netif_tx_lock(txq, smp_processor_id());
>  		txr->dev_state = 0;
> +		__netif_tx_unlock(txq);

You're going to have to explain how this could possibly cause a
problem, because I'm pretty sure it can't.

Either the reader sees 0, or non-zero, in this value.

And adding locking around this assignment does not change that at all.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net] bnxt_en: Fix potential race condition in bnxt_tx_enable() Florian Fainelli <f.fainelli@gmail.com> - 2016-07-16 01:50 +0200
  Re: [PATCH net] bnxt_en: Fix potential race condition in  bnxt_tx_enable() David Miller <davem@davemloft.net> - 2016-07-16 08:30 +0200
    Re: [PATCH net] bnxt_en: Fix potential race condition in bnxt_tx_enable() Michael Chan <michael.chan@broadcom.com> - 2016-07-18 13:40 +0200
  Re: [PATCH net] bnxt_en: Remove locking around txr->dev_state Michael Chan <michael.chan@broadcom.com> - 2016-07-18 22:10 +0200
  [PATCH net] bnxt_en: Remove locking around txr->dev_state Florian Fainelli <f.fainelli@gmail.com> - 2016-07-18 22:10 +0200
    Re: [PATCH net] bnxt_en: Remove locking around txr->dev_state David Miller <davem@davemloft.net> - 2016-07-20 04:30 +0200

csiph-web