mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, slash.tmp@free.fr
Subject: Re: [PATCH v5] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller
Date: Tue, 10 Nov 2015 18:07:59 +0000	[thread overview]
Message-ID: <yw1xmvulram8.fsf@unicorn.mansr.com> (raw)
In-Reply-To: <1447178287.17135.77.camel@edumazet-glaptop2.roam.corp.google.com> (Eric Dumazet's message of "Tue, 10 Nov 2015 09:58:07 -0800")

Eric Dumazet <eric.dumazet@gmail.com> writes:

> On Tue, 2015-11-10 at 16:14 +0000, Mans Rullgard wrote:
>> This adds a driver for the Aurora VLSI NB8800 Ethernet controller.
>> It is an almost complete rewrite of a driver originally found in
>> a Sigma Designs 2.6.22 tree.
>
> ...
>
>> +
>> +static int nb8800_xmit(struct sk_buff *skb, struct net_device *dev)
>> +{
>> +	struct nb8800_priv *priv = netdev_priv(dev);
>> +	struct nb8800_tx_desc *txd;
>> +	struct nb8800_tx_buf *txb;
>> +	struct nb8800_dma_desc *dma;
>> +	dma_addr_t dma_addr;
>> +	unsigned int dma_len;
>> +	unsigned long flags;
>> +	int align;
>> +	int next;
>> +
>> +	if (atomic_read(&priv->tx_free) <= NB8800_DESC_LOW) {
>> +		netif_stop_queue(dev);
>> +		return NETDEV_TX_BUSY;
>> +	}
>> +
>> +	align = (8 - (uintptr_t)skb->data) & 7;
>> +
>> +	dma_len = skb->len - align;
>> +	dma_addr = dma_map_single(&dev->dev, skb->data + align,
>> +				  dma_len, DMA_TO_DEVICE);
>> +
>> +	if (dma_mapping_error(&dev->dev, dma_addr)) {
>> +		netdev_err(dev, "tx dma mapping error\n");
>> +		kfree_skb(skb);
>> +		dev->stats.tx_dropped++;
>> +		return NETDEV_TX_OK;
>> +	}
>> +
>> +	if (atomic_dec_return(&priv->tx_free) <= NB8800_DESC_LOW)
>> +		netif_stop_queue(dev);
>
> You probably also want to clear skb->xmit_more or risk a stall

Very true, will fix.

-- 
Måns Rullgård
mans@mansr.com

  reply	other threads:[~2015-11-10 18:08 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 16:14 Mans Rullgard
2015-11-10 17:55 ` Eric Dumazet
2015-11-10 18:05   ` Måns Rullgård
2015-11-10 20:04     ` David Miller
2015-11-10 20:53       ` Måns Rullgård
2015-11-10 21:06         ` David Miller
2015-11-10 21:21           ` Måns Rullgård
2015-11-10 21:51             ` Eric Dumazet
2015-11-11 13:41               ` Mason
2015-11-11 13:54                 ` Måns Rullgård
2015-11-11 14:10                   ` Eric Dumazet
2015-11-11 14:06                 ` Eric Dumazet
2015-11-10 17:58 ` Eric Dumazet
2015-11-10 18:07   ` Måns Rullgård [this message]
2015-11-10 19:13 ` Mason
2015-11-10 19:25   ` Måns Rullgård
2015-11-12 13:33     ` Mason
2015-11-12 14:04       ` Måns Rullgård
2015-11-12 16:19         ` Mason
2015-11-12 16:57           ` Måns Rullgård
2015-11-12 17:20             ` Måns Rullgård
2015-11-10 22:09 ` Andy Shevchenko
2015-11-10 22:34   ` Måns Rullgård
2015-11-10 22:40     ` Andy Shevchenko
2015-11-10 23:07       ` Måns Rullgård
2015-11-11  0:36         ` Andy Shevchenko
2015-11-11  0:44           ` Måns Rullgård
2015-11-10 23:34 ` Francois Romieu
2015-11-11  0:40   ` Måns Rullgård
2015-11-11  2:11     ` David Miller
2015-11-11 12:22       ` Måns Rullgård
2015-11-11 13:04         ` Måns Rullgård
2015-11-11 13:29           ` Eric Dumazet
2015-11-11 13:48             ` Måns Rullgård
2015-11-11 14:09               ` Eric Dumazet
2015-11-11 14:15                 ` Måns Rullgård
2015-11-11 14:35                   ` Måns Rullgård
2015-11-11 14:44                     ` Eric Dumazet
2015-11-11 14:42                   ` Eric Dumazet
2015-11-11 16:24           ` David Miller
2015-11-11 18:25             ` Måns Rullgård
2015-11-11 19:02               ` David Miller
2015-11-11 19:09                 ` Måns Rullgård
2015-11-11 19:13                   ` David Miller
2015-11-11 19:17                     ` Måns Rullgård
2015-11-11 19:19                       ` David Miller
2015-11-11 19:25                         ` Måns Rullgård
2015-11-11 19:26                           ` David Miller
2015-11-11 19:35                             ` Måns Rullgård
2015-11-11 19:48                               ` David Miller
2015-11-11 20:47                                 ` Måns Rullgård
2015-11-11 16:20         ` David 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=yw1xmvulram8.fsf@unicorn.mansr.com \
    --to=mans@mansr.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=slash.tmp@free.fr \
    /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

Powered by JetHome