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]
Message-ID: <yw1xmvulram8.fsf@unicorn.mansr.com>
Date:	Tue, 10 Nov 2015 18:07:59 +0000
From:	Måns Rullgård <mans@...sr.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	slash.tmp@...e.fr
Subject: Re: [PATCH v5] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

Eric Dumazet <eric.dumazet@...il.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@...sr.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ