netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: netdev@oss.sgi.com
Subject: LLTX fix proposal
Date: Sun, 30 Jan 2005 18:18:54 -0800	[thread overview]
Message-ID: <20050130181854.7f088a95.davem@davemloft.net> (raw)


Ok, how about we do this for 2.6.11 before it goes out and
do something more sophisticated (if necessary) later.

The BUG() we're trying to catch in the ->hard_start_xmit()
routines is the illegal state:

	driver_tx_queue_empty() && !netif_queue_stopped(dev)

Therefore we could handle the race, and avoid the printk() in
the race case but not in the BUG() case above.  The test in
tg3.c is currently:

	/* This is a hard error, log it. */
	if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {
		netif_stop_queue(dev);
		spin_unlock_irqrestore(&tp->tx_lock, flags);
		printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
		       dev->name);
		return NETDEV_TX_BUSY;
	}

and I'm proposing we change it to something like:

	if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {
		/* We can race with queue processing on another
		 * cpu due to LLTX.  If the queue is not stopped,
		 * that is a hard error, log it.
		 */
		if (!netif_queue_stopped(dev)) {
			netif_stop_queue(dev);
			printk(KERN_ERR PFX "%s: BUG! Tx Ring full when "
			       "queue awake!\n",
			       dev->name);
		}
		spin_unlock_irqrestore(&tp->tx_lock, flags);
		return NETDEV_TX_BUSY;
	}

Any objections?

Again, I'm not saying %100 this is what we should do long-term.
It's meant to be correct and eliminate the bogus log messages
when the LLTX race is hit.

             reply	other threads:[~2005-01-31  2:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31  2:18 David S. Miller [this message]
2005-01-31  3:33 ` LLTX fix proposal jamal
2005-01-31  3:38   ` jamal
2005-01-31  5:09     ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050130181854.7f088a95.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).