From: Robert Hancock <hancockrwd@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>
Subject: NETIF_F_HIGHDMA misuse in networking drivers?
Date: Sat, 20 Feb 2010 12:29:14 -0600 [thread overview]
Message-ID: <4B8029FA.2000404@gmail.com> (raw)
Was just part of a discussion in another thread talking about 64-bit DMA
support issues where NETIF_F_HIGHDMA came up. I was originally under the
impression that this flag indicated the device supported 64-bit DMA
addressing. However, from looking at the code that checks for it (and,
well, the actual comment for the flag) it really means "can access
highmem" which has nothing to do with 64-bit at all. And if there's no
highmem (like on x86_64) it has no effect at all.
From looking at some drivers, however, it seems a lot of others had
similar confusion, as they are doing things like setting NETIF_F_HIGHDMA
conditionally on whether setting 64-bit DMA mask succeeds:
drivers/net/8139cp.c:
if (pci_using_dac)
dev->features |= NETIF_F_HIGHDMA;
drivers/net/jme.c:
if (jme->dev->features & NETIF_F_HIGHDMA)
rxdesc->desc1.flags = RXFLAG_64BIT;
drivers/net/forcedeth.c:
if (dma_64bit) {
if (pci_set_dma_mask(pci_dev, DMA_BIT_MASK(39)))
dev_printk(KERN_INFO, &pci_dev->dev,
"64-bit DMA failed, using
32-bit addressing\n");
else
dev->features |= NETIF_F_HIGHDMA;
(the last one is extra funny because it keeps saying 64-bit when it's
really only 39-bit..)
The net result is that a lot of drivers aren't setting the HIGHDMA flag
where they should, and thus on architectures where highmem exists,
resulting in a bunch of unnecessary copying.
Assuming my interpretation is correct, I could try and fix up some of
this mess.. any comments?
next reply other threads:[~2010-02-20 18:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-20 18:29 Robert Hancock [this message]
2010-02-22 23:53 ` NETIF_F_HIGHDMA misuse in networking drivers? David Miller
2010-02-23 0:28 ` Robert Hancock
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=4B8029FA.2000404@gmail.com \
--to=hancockrwd@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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 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).