linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: w@1wt.eu (Willy Tarreau)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM network performance and dma_mask (was: [BUG, REGRESSION?] 3.11.6+, 3.12: GbE iface rate drops to few KB/s)
Date: Thu, 21 Nov 2013 22:51:26 +0100	[thread overview]
Message-ID: <20131121215126.GD18513@1wt.eu> (raw)
In-Reply-To: <20131121200433.4cb97d9e@skate>

Hi Thomas,

On Thu, Nov 21, 2013 at 08:04:33PM +0100, Thomas Petazzoni wrote:
> > I'm not at ease with these things so I'd like to ask your opinion here, is
> > this supposed to be an improvement or a fix ? Is this something we should
> > backport into stable versions, or is there something to fix in the armada
> > platform so that it works just as if the patch was applied ?
> 
> I guess the driver should have been setting its dma_mask to 0xffffffff,
> since the platform is capable of doing DMA on the first 32 bits of the
> physical address space, probably something like calling
> pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) or something like that.

Almost, yes. Thanks for the tip! There are so few drivers which do this
that I was convinced something was missing (nobody initializes dma_mask
on this platform), so calls to dma_set_mask() from drivers return -EIO
and are ignored.

I ended up with that in mvneta_init() at the end :

       /* setting DMA mask significantly improves transfer rates */
       pp->dev->dev.parent->coherent_dma_mask = DMA_BIT_MASK(32);
       pp->dev->dev.parent->dma_mask = &pp->dev->dev.parent->coherent_dma_mask;

This method changed in 3.12 with Russell's commit fa6a8d6 (DMA-API: provide
a helper to setup DMA masks) doing it a cleaner and safer way, using
dma_coerce_mask_and_coherent().

Then Rob's commit 0589342 (of: set dma_mask to point to coherent_dma_mask) also
merged in 3.12 pre-initialized the dma_mask to point to &coherent_dma_mask for
all devices by default.

> I know
> Russell has recently added some helpers to prevent stupid people (like
> me) from doing mistakes when setting the DMA masks. Certainly worth
> having a look.

My change now allows me to proxy HTTP traffic at 1 Gbps between the two
ports of the mirabox, while it limits to 650 Mbps without the change. But
it's not needed in mainline anymore. However it might be worth having in
older kernels (I don't know if it's suitable for stable since I don't
know if that's a bug), or at least in your own kernels if you have to
maintain and older branch for some customers.

That said, I tend to believe that applying Rob's patch will be better than
just the change above since it will cover all drivers, not only mvneta.
I'll have to test on the AX3 and the XP-GP to see the performance gain in
SMP and using the PCIe.

Best regards,
Willy

  reply	other threads:[~2013-11-21 21:51 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-10 13:53 [BUG,REGRESSION?] 3.11.6+,3.12: GbE iface rate drops to few KB/s Arnaud Ebalard
2013-11-12  6:48 ` Cong Wang
2013-11-12  7:56   ` Arnaud Ebalard
2013-11-12  8:36     ` Willy Tarreau
2013-11-12  9:14       ` Arnaud Ebalard
2013-11-12 10:01         ` Willy Tarreau
2013-11-12 15:34           ` Arnaud Ebalard
2013-11-13  7:22             ` Willy Tarreau
2013-11-17 14:19               ` Willy Tarreau
2013-11-17 17:41                 ` Eric Dumazet
2013-11-19  6:44                   ` Arnaud Ebalard
2013-11-19 13:53                     ` Eric Dumazet
2013-11-19 17:43                       ` Willy Tarreau
2013-11-19 18:31                         ` Eric Dumazet
2013-11-19 18:41                           ` Willy Tarreau
2013-11-19 23:53                             ` Arnaud Ebalard
2013-11-20  0:08                               ` Eric Dumazet
2013-11-20  0:35                                 ` Willy Tarreau
2013-11-20  0:43                                   ` Eric Dumazet
2013-11-20  0:52                                     ` Willy Tarreau
2013-11-20  8:50                               ` Thomas Petazzoni
2013-11-20 19:21                                 ` Arnaud Ebalard
2013-11-20 19:11                               ` Willy Tarreau
2013-11-20 19:26                                 ` Arnaud Ebalard
2013-11-20 21:28                                 ` Arnaud Ebalard
2013-11-20 21:54                                   ` Willy Tarreau
2013-11-21  0:44                                     ` Willy Tarreau
     [not found]                                       ` <20131121183834.GB18513@1wt.eu>
2013-11-21 19:04                                         ` ARM network performance and dma_mask (was: [BUG,REGRESSION?] 3.11.6+,3.12: GbE iface rate drops to few KB/s) Thomas Petazzoni
2013-11-21 21:51                                           ` Willy Tarreau [this message]
2013-11-21 22:01                                         ` ARM network performance and dma_mask Rob Herring
2013-11-21 22:13                                           ` Willy Tarreau
2013-11-21 21:51                                       ` [BUG,REGRESSION?] 3.11.6+,3.12: GbE iface rate drops to few KB/s Arnaud Ebalard
2013-11-21 21:52                                         ` Willy Tarreau
2013-11-21 22:00                                           ` Eric Dumazet
2013-11-21 22:55                                             ` Arnaud Ebalard
2013-11-21 23:23                                               ` Rick Jones
2013-11-20 17:12                   ` Willy Tarreau
2013-11-20 17:30                     ` Eric Dumazet
2013-11-20 17:38                       ` Willy Tarreau
2013-11-20 18:52                       ` David Miller
2013-11-20 17:34                     ` Willy Tarreau
2013-11-20 17:40                       ` Eric Dumazet
2013-11-20 18:15                         ` Willy Tarreau
2013-11-20 18:21                           ` Eric Dumazet
2013-11-20 18:29                             ` Willy Tarreau
2013-11-20 19:22                           ` Arnaud Ebalard
2013-11-18 10:09                 ` David Laight
2013-11-18 10:52                   ` Willy Tarreau
2013-11-18 10:26                 ` Thomas Petazzoni
2013-11-18 10:44                   ` Simon Guinot
2013-11-18 16:54                     ` Stephen Hemminger
2013-11-18 17:13                       ` Eric Dumazet
2013-11-18 10:51                   ` Willy Tarreau
2013-11-18 17:58                     ` Florian Fainelli

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=20131121215126.GD18513@1wt.eu \
    --to=w@1wt.eu \
    --cc=linux-arm-kernel@lists.infradead.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 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).