linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Sinkovsky <msink@permonline.ru>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] Ethernet driver for the WIZnet W5300 chip
Date: Mon, 26 Mar 2012 15:05:04 +0600	[thread overview]
Message-ID: <4F703140.5030005@permonline.ru> (raw)
In-Reply-To: <1332605415.3487.14.camel@edumazet-laptop>

24.03.2012 22:10, Eric Dumazet wrote:
> As there is no tx interrupt at the end of transmit to eventually XON the
> queue, you cant XOFF it when there it no room in transmit queue.

Actually there is, but is unused in original driver, don't know why.


> Rule to use NETDEV_TX_BUSY is :
>
> Before returning NETDEV_TX_BUSY, qdisc must have been stopped by
> netif_stop_queue(ndev) (and tx completion might call netif_wake_queue()
> later)

I tried handle this situation, and it seems to work perfectly:

@@ -377,7 +377,8 @@ static int w5300_start_tx(struct sk_buff *skb, 
struct net_device *ndev)
          struct w5300_private *priv = netdev_priv(ndev);

          if (unlikely(w5300_read32(priv, W5300_S0_TX_FSR) < skb->len)) {
-                ndev->stats.tx_dropped++;
+                netif_stop_queue(ndev);
+                w5300_write(priv, W5300_S0_IMR, S0_IR_RECV | S0_IR_SENDOK);
                  return NETDEV_TX_BUSY;
          }

@@ -443,6 +444,12 @@ static irqreturn_t w5300_interrupt(int irq, void 
*ndev_instance)
                  __napi_schedule(&priv->napi);
          }

+        if (unlikely(netif_queue_stopped(ndev))) {
+                w5300_write(priv, W5300_S0_IR, S0_IR_SENDOK);
+                w5300_write(priv, W5300_S0_IMR, S0_IR_RECV);
+                netif_wake_queue(ndev);
+        }
+
          return IRQ_HANDLED;
  }

-- 
Mike


  reply	other threads:[~2012-03-26  9:05 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19  9:23 [PATCH v2] ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-03-20 18:08 ` Ben Hutchings
2012-03-21 14:49 ` Florian Fainelli
2012-03-22  6:58   ` Mike Sinkovsky
2012-03-24 11:02 ` [PATCH v3] Ethernet " Mike Sinkovsky
2012-03-24 15:53   ` Joe Perches
2012-03-24 16:10   ` Eric Dumazet
2012-03-26  9:05     ` Mike Sinkovsky [this message]
2012-03-26  9:07 ` [PATCH v4] " Mike Sinkovsky
2012-03-28  2:35   ` David Miller
2012-03-30  7:00   ` [PATCH v5 1/2] " Mike Sinkovsky
2012-03-31 21:45     ` Mark Brown
2012-03-30  7:00   ` [PATCH v5 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-03-30  9:23     ` Eric Dumazet
2012-03-31  9:40       ` Francois Romieu
2012-03-31  9:46         ` Francois Romieu
2012-03-31  9:52       ` Mike Sinkovsky
2012-03-31 10:24         ` Eric Dumazet
2012-03-31 21:23     ` Mark Brown
2012-04-02  9:40       ` Mike Sinkovsky
2012-04-02 11:21         ` Mark Brown
2012-04-03 10:58   ` [PATCH v6 0/2] Ethernet drivers for WIZnet chips Mike Sinkovsky
2012-04-03 11:39     ` Eric Dumazet
2012-04-03 12:15       ` Mike Sinkovsky
2012-04-03 12:29         ` Eric Dumazet
2012-04-04  5:58           ` Mike Sinkovsky
2012-04-04  6:17             ` Eric Dumazet
2012-04-04  7:25               ` Mike Sinkovsky
2012-04-04  7:23     ` [PATCH v7 " Mike Sinkovsky
2012-04-04 11:57       ` [PATCH v8 " Mike Sinkovsky
2012-04-05  1:15         ` David Miller
2012-04-05  5:36           ` Mike Sinkovsky
2012-04-04 11:57       ` [PATCH v8 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-04 11:57       ` [PATCH v8 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-04-04 12:08       ` [PATCH v8 0/2] Ethernet drivers for WIZnet chips Mike Sinkovsky
2012-04-05  5:33         ` [PATCH v9 " Mike Sinkovsky
2012-04-05  5:47           ` David Miller
2012-04-05  5:33         ` [PATCH v9 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-05  5:33         ` [PATCH v9 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-04-04 12:08       ` [PATCH v8 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-04 12:08       ` [PATCH v8 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-04-04  7:23     ` [PATCH v7 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-04  7:23     ` [PATCH v7 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky
2012-04-03 10:58   ` [PATCH v6 1/2] Ethernet driver for the WIZnet W5300 chip Mike Sinkovsky
2012-04-03 13:36     ` Mark Brown
2012-04-04  6:18       ` Mike Sinkovsky
2012-04-04 10:01         ` Mark Brown
2012-04-04 11:00           ` Mike Sinkovsky
2012-04-03 10:58   ` [PATCH v6 2/2] Ethernet driver for the WIZnet W5100 chip Mike Sinkovsky

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=4F703140.5030005@permonline.ru \
    --to=msink@permonline.ru \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).