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


Groups > linux.kernel > #1260018

Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

From Måns Rullgård <mans@mansr.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller
Date 2015-10-31 17:10 +0100
Message-ID <qpGT8-4Xz-15@gated-at.bofh.it> (permalink)
References <qoYyK-2ET-13@gated-at.bofh.it> <qpqlk-34u-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Francois Romieu <romieu@fr.zoreil.com> writes:

>> +static int nb8800_poll(struct napi_struct *napi, int budget)
>> +{
>> +	struct net_device *dev = napi->dev;
>> +	struct nb8800_priv *priv = netdev_priv(dev);
>> +	struct nb8800_dma_desc *rx;
>> +	int work = 0;
>> +	int last = priv->rx_eoc;
>> +	int next;
>> +
>> +	while (work < budget) {
>> +		struct rx_buf *rx_buf;
>> +		u32 report;
>> +		int len;
>> +
>> +		next = (last + 1) & (RX_DESC_COUNT - 1);
>> +
>> +		rx_buf = &priv->rx_bufs[next];
>> +		rx = &priv->rx_descs[next];
>> +		report = rx->report;
>> +
>> +		if (!report)
>> +			break;
>> +
>> +		if (IS_RX_ERROR(report)) {
>> +			nb8800_rx_error(dev, report);
>> +		} else if (likely(rx_buf->page)) {
>> +			len = RX_BYTES_TRANSFERRED(report);
>> +			nb8800_receive(dev, next, len);
>> +		}
>> +
>> +		rx->report = 0;
>> +		if (!rx_buf->page)
>> +			nb8800_alloc_rx(dev, next, true);
>
> It looks like it receives, then tries to allocate new resources. If so
> it may deplete the ring and you should instead consider allocating new
> resources first, then receive data if alloc + map suceeded.

The hardware receives a frame and stores it in the provided DMA buffer,
then raises an interrupt and moves on to the next buffer.  When a buffer
is handed over to the network stack, a new one has to take its place in
the DMA queue.  I'm not sure how you're suggesting this be done
differently.

-- 
Måns Rullgård
mans@mansr.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Mans Rullgard <mans@mansr.com> - 2015-10-29 17:50 +0100
  Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800  Ethernet controller Francois Romieu <romieu@fr.zoreil.com> - 2015-10-30 23:30 +0100
    Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Måns Rullgård <mans@mansr.com> - 2015-10-31 17:10 +0100
      Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800  Ethernet controller Francois Romieu <romieu@fr.zoreil.com> - 2015-10-31 19:10 +0100
        Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Måns Rullgård <mans@mansr.com> - 2015-10-31 19:50 +0100
  Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Måns Rullgård <mans@mansr.com> - 2015-10-31 19:50 +0100
    Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800  Ethernet controller Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-10-31 21:10 +0100
      Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Måns Rullgård <mans@mansr.com> - 2015-10-31 22:50 +0100

csiph-web