netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Oliver Neukum <oneukum@suse.de>, Freddy Xin <freddy@asix.com.tw>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Ben Hutchings <bhutchings@solarflare.com>,
	Grant Grundler <grundler@google.com>,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 4/4] USBNET: ax88179_178a: enable tso if host supports sg dma
Date: Wed, 31 Jul 2013 21:50:54 +0800	[thread overview]
Message-ID: <CACVXFVNk+h7kBWTFT2NiGy+2F6LPatda3oL9+uuaQnT-u5J8wg@mail.gmail.com> (raw)
In-Reply-To: <20130731124707.GA30635@kroah.com>

On Wed, Jul 31, 2013 at 8:47 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Wed, Jul 31, 2013 at 06:51:49PM +0800, Ming Lei wrote:
>> This patch enables 'can_dma_sg' flag for ax88179_178a device
>> if the attached host controller supports building packet from
>> discontinuous buffers(DMA SG is possible), so both frame header
>> and skb data buffers can be passed to usb stack via urb->sg,
>> then skb data copy can be saved.
>>
>> With the patch, CPU utilization decreased much in iperf test at
>> client mode.
>
> What is "much"?

The data is platform dependent, on one dual-core ARM A15 board
at my hand, ~30~40% CPU utilization is saved with the patchset
when doing 'iperf -c' test on this board.

>
>> --- a/drivers/net/usb/ax88179_178a.c
>> +++ b/drivers/net/usb/ax88179_178a.c
>> @@ -1031,12 +1031,20 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
>>       dev->mii.phy_id = 0x03;
>>       dev->mii.supports_gmii = 1;
>>
>> +     if (dev->udev->bus->no_sg_limit)
>> +             dev->can_dma_sg = 1;
>
> I don't feel comfortable with USB drivers poking about in the USB host
> controller structures like this.  If we really do this, please provide a
> function call for it to make to determine this.

OK, that is fine.

>
> But even then, is this really something that we want/need to do at all?
> If only some xhci controller support this, we will start to see more

It should be all xhci controllers support this, per xHCI spec.

> driver-specific changes just to handle one type of host controller.  Why

We already have this kind of changes, such as usbfs and mass storage
driver, the two drivers support both sg list and non-sg list cases(depends
on HCD).

> not have the USB core handle it instead and if the host controller can
> not do sg lists like this, fall back to a slower implementation?

In the usbnet case, the driver already supports non-sg well. Actually,
all current drivers should support non-sg well because urb->sg wasn't
introduced for very long time. We can think it as a new feature or DMA
enhancement for xHCI controller.

If you mean buffer debounce for dma sg support on ehci/uhci/ohci/..,
maybe we need to discuss and evaluate further.

Thanks,
--
Ming Lei

  reply	other threads:[~2013-07-31 13:50 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 10:51 [PATCH 0/4] USB & USBNET: loose DMA SG check and support usbnet DMA SG Ming Lei
2013-07-31 10:51 ` [PATCH 1/4] USB: introduce no_sg_limit field into usb_bus Ming Lei
     [not found] ` <1375267909-30373-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-07-31 10:51   ` [PATCH 2/4] USB: XHCI: mark no_sg_limit Ming Lei
2013-07-31 16:40     ` Sarah Sharp
2013-08-01  7:30       ` Greg Kroah-Hartman
2013-08-01  8:15         ` Oliver Neukum
2013-08-01 20:47           ` Sarah Sharp
2013-07-31 15:25   ` [PATCH 0/4] USB & USBNET: loose DMA SG check and support usbnet DMA SG Eric Dumazet
2013-07-31 10:51 ` [PATCH 3/4] USBNET: support " Ming Lei
2013-07-31 10:51 ` [PATCH 4/4] USBNET: ax88179_178a: enable tso if host supports sg dma Ming Lei
2013-07-31 12:47   ` Greg Kroah-Hartman
2013-07-31 13:50     ` Ming Lei [this message]
2013-07-31 14:02       ` Oliver Neukum
     [not found]         ` <1375279366.14846.1.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
2013-07-31 15:15           ` Eric Dumazet
2013-07-31 15:25             ` Ming Lei
2013-08-01  2:04             ` Ming Lei
     [not found]   ` <1375267909-30373-5-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-08-01  3:51     ` Eric Dumazet
2013-08-01  4:41       ` Ming Lei
2013-08-01  5:04         ` Eric Dumazet
2013-08-01  8:10           ` Ming Lei
     [not found]             ` <CACVXFVMt-TgRVU+iA3NVuUzJSeXUPGvV89OnDdHaLEB1Ua6aAw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-01 13:21               ` Eric Dumazet
2013-08-01 13:49                 ` [PATCH net-next] ax88179_178a: avoid copy of tx tcp packets Eric Dumazet
2013-08-01 13:52                   ` Eric Dumazet
2013-08-04  4:56                     ` David Miller
2013-08-01 15:30   ` [PATCH 4/4] USBNET: ax88179_178a: enable tso if host supports sg dma Grant Grundler
2013-08-01 15:36     ` Eric Dumazet
2013-08-01 16:12       ` Grant Grundler
2013-07-31 11:12 ` [PATCH 0/4] USB & USBNET: loose DMA SG check and support usbnet DMA SG Oliver Neukum
2013-07-31 11:55   ` Ming Lei

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=CACVXFVNk+h7kBWTFT2NiGy+2F6LPatda3oL9+uuaQnT-u5J8wg@mail.gmail.com \
    --to=ming.lei@canonical.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=freddy@asix.com.tw \
    --cc=gregkh@linuxfoundation.org \
    --cc=grundler@google.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.de \
    /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).