All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Lino Sanfilippo' <LinoSanfilippo@gmx.de>
Cc: Pavel Belous <Pavel.Belous@aquantia.com>,
	"David S . Miller" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Simon Edelhaus <Simon.Edelhaus@aquantia.com>,
	Alexey Andriyanov <Alexey.Andriyanov@aquantia.com>
Subject: RE: RE: [PATCH net-next 11/13] net: ethernet: aquantia: Refactoring buffers copying.
Date: Thu, 16 Feb 2017 16:37:41 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFE6842A@AcuExch.aculab.com> (raw)
In-Reply-To: <trinity-c726d458-78f5-41bf-8d00-ac6d55a03c35-1487260948543@3capp-gmx-bs24>

From: Lino Sanfilippo
> Sent: 16 February 2017 16:02
...
> I was referring to the copy of tx descriptors, not the frames/fragments itself.
> I wrote "tx buffers" because in this driver a descriptor is represented as
>  a struct "aq_ring_buff_s". I cannot see a reason why this descriptor copy
>  should be necessary.

Not unless the descriptor memory is on the card.

Actually it might be worse than that.
The transmit descriptor probably has an 'owner' bit.
The write of the word containing that bit must be last and
preceded by the appropriate barrier (probably dma_wmb()).
Another barrier is needed before the 'doorbell' io write that kicks
the hardware.

Using memcpy() won't have that effect at all.

If the ethernet frame is fragmented (and so uses multiple
descriptors) the owner bit of the first descriptor must be
in the last write.

	David


  reply	other threads:[~2017-02-16 16:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 20:01 [PATCH net-next 00/13] net: ethernet: aquantia: improvements and fixes Pavel Belous
2017-02-15 20:01 ` [PATCH net-next 01/13] net: ethernet: aquantia: Removed extra assignment for skb->dev Pavel Belous
2017-02-15 20:53   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 02/13] net: ethernet: aquantia: Removed busy_count field Pavel Belous
2017-02-15 20:56   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 03/13] net: ethernet: aquantia: Removed unnecessary comparsion "old_mtu == new_mtu" Pavel Belous
2017-02-15 20:56   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 04/13] net: ethernet: aquantia: Using module_pci_driver Pavel Belous
2017-02-15 20:57   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 05/13] net: ethernet: aquantia: Superfluous initialization of "err" Pavel Belous
2017-02-15 21:01   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 06/13] net: ethernet: aquantia: Fixed missing rtnl_unlock Pavel Belous
2017-02-15 21:02   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 07/13] net: ethernet: aquantia: Using NETDEV_TX_OK instead 0 Pavel Belous
2017-02-15 21:02   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 08/13] net: ethernet: aquantia: Null pointer check for aq_nic_ndev_alloc Pavel Belous
2017-02-15 21:04   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 09/13] net: ethernet: aquantia: Call netdev_register after all initialized Pavel Belous
2017-02-15 21:18   ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 10/13] net: ethernet: aquantia: Checking for success dma_map_single Pavel Belous
2017-02-15 21:23   ` Lino Sanfilippo
2017-02-15 21:40     ` Lino Sanfilippo
2017-02-15 21:47       ` Pavel Belous
2017-02-15 20:01 ` [PATCH net-next 11/13] net: ethernet: aquantia: Refactoring buffers copying Pavel Belous
2017-02-15 21:31   ` Lino Sanfilippo
2017-02-15 21:50     ` Pavel Belous
2017-02-16 13:10     ` David Laight
2017-02-16 16:02       ` Lino Sanfilippo
2017-02-16 16:37         ` David Laight [this message]
2017-02-19 10:36           ` Lino Sanfilippo
2017-02-15 20:01 ` [PATCH net-next 12/13] net: ethernet: aquantia: Fixed incorrect buff->len calculation Pavel Belous
2017-02-15 20:01 ` [PATCH net-next 13/13] net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 page Pavel Belous

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=063D6719AE5E284EB5DD2968C1650D6DCFE6842A@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=Alexey.Andriyanov@aquantia.com \
    --cc=LinoSanfilippo@gmx.de \
    --cc=Pavel.Belous@aquantia.com \
    --cc=Simon.Edelhaus@aquantia.com \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.