* Re: [PATCH 1/2] gre: fix hard header destination address checking
From: David Miller @ 2010-03-04 8:41 UTC (permalink / raw)
To: timo.teras; +Cc: netdev
In-Reply-To: <1267624874-22326-1-git-send-email-timo.teras@iki.fi>
From: Timo Teras <timo.teras@iki.fi>
Date: Wed, 3 Mar 2010 16:01:13 +0200
> ipgre_header() can be called with zero daddr when the gre device is
> configured as multipoint tunnel and still has the NOARP flag set (which is
> typically cleared by the userspace arp daemon). If the NOARP packets are
> not dropped, ipgre_tunnel_xmit() will take rt->rt_gateway (= NBMA IP) and
> use that for route look up (and may lead to bogus xfrm acquires).
>
> The multicast address check is removed as sending to multicast group should
> be ok. In fact, if gre device has a multicast address as destination
> ipgre_header is always called with multicast address.
>
> Signed-off-by: Timo Teras <timo.teras@iki.fi>
Applied.
^ permalink raw reply
* Re: [PATCH] r8169: use correct barrier between cacheable and non-cacheable memory
From: David Miller @ 2010-03-04 8:40 UTC (permalink / raw)
To: dave; +Cc: netdev, romieu, paulus, catalin.marinas
In-Reply-To: <1267669990.23829.8.camel@obelisk.thedillows.org>
From: David Dillow <dave@thedillows.org>
Date: Wed, 03 Mar 2010 21:33:10 -0500
> r8169 needs certain writes to be visible to other CPUs or the NIC before
> touching the hardware, but was using smp_wmb() which is only required to
> order cacheable memory access. Switch to wmb() which is required to
> order both cacheable and non-cacheable memory.
>
> Noticed by Catalin Marinas and Paul Mackerras.
>
> Signed-off-by: David Dillow <dave@thedillows.org>
Applied.
^ permalink raw reply
* Re: [PATCH]: tipc: Fix oops on send prior to entering networked mode (v3)
From: David Miller @ 2010-03-04 8:40 UTC (permalink / raw)
To: nhorman; +Cc: allan.stephens, netdev, jon.maloy, tipc-discussion
In-Reply-To: <20100303183123.GB7211@hmsreliant.think-freely.org>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Wed, 3 Mar 2010 13:31:23 -0500
> Ok, version 3 of the path, taking comments into account.
Applied.
^ permalink raw reply
* Re: [PATCH] IPv6: fix race between cleanup and add/delete address
From: David Miller @ 2010-03-04 8:40 UTC (permalink / raw)
To: shemminger; +Cc: yoshfuji, netdev
In-Reply-To: <20100303101959.481d76fe@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 3 Mar 2010 10:19:59 -0800
> This solves a potential race problem during the cleanup process.
> The issue is that addrconf_ifdown() needs to traverse address list,
> but then drop lock to call the notifier. The version in -next
> could get confused if add/delete happened during this window.
> Original code (2.6.32 and earlier) was okay because all addresses
> were always deleted.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH 03/12] IPv6: addrconf notify when address is unavailable
From: David Miller @ 2010-03-04 8:40 UTC (permalink / raw)
To: shemminger; +Cc: yoshfuji, netdev
In-Reply-To: <20100302234003.046022988@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 02 Mar 2010 15:32:46 -0800
> My recent change in net-next to retain permanent addresses caused regression.
> Device refcount would not go to zero when device was unregistered because
> left over anycast reference would hold ipv6 dev reference which would hold
> device references...
>
> The correct procedure is to call notify chain when address is no longer
> available for use. When interface comes back DAD timer will notify
> back that address is available.
>
>
> Also, link local addresses should be purged when interface is brought
> down. The address might be changed.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH 02/12] IPv6: addrconf timer race
From: David Miller @ 2010-03-04 8:40 UTC (permalink / raw)
To: shemminger; +Cc: yoshfuji, netdev
In-Reply-To: <20100302234002.971992509@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 02 Mar 2010 15:32:45 -0800
> The Router Solicitation timer races with device state changes
> because it doesn't lock the device. Use local variable to avoid
> one repeated dereference.
>
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH 01/12] IPv6: addrconf dad timer unnecessary bh_disable
From: David Miller @ 2010-03-04 8:39 UTC (permalink / raw)
To: shemminger; +Cc: yoshfuji, netdev
In-Reply-To: <20100302234002.893332269@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 02 Mar 2010 15:32:44 -0800
> Timer code runs in bottom half, so there is no need for
> using _bh form of locking. Also check if device is not ready
> to avoid race with address that is no longer active.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH] cxgb3: fix hot plug removal crash
From: David Miller @ 2010-03-04 8:39 UTC (permalink / raw)
To: divy; +Cc: netdev, linux-kernel, swise, wenxiong
In-Reply-To: <20100303194947.31628.5933.stgit@speedy5.asicdesigners.com>
From: Divy Le Ray <divy@chelsio.com>
Date: Wed, 03 Mar 2010 11:49:47 -0800
> From: Divy Le Ray <divy@chelsio.com>
>
> queue restart tasklets need to be stopped after napi handlers are stopped
> since the latter can restart them. So stop them after stopping napi.
>
> Signed-off-by: Divy Le Ray <divy@chelsio.com>
Applied.
^ permalink raw reply
* Re: [net-next PATCH v6 0/3] net: reserve ports for applications using fixed port numbers
From: Cong Wang @ 2010-03-04 8:31 UTC (permalink / raw)
To: David Miller
Cc: opurdila, netdev, linux-kernel, nhorman, eric.dumazet, ebiederm
In-Reply-To: <20100227.033230.196838696.davem@davemloft.net>
David Miller wrote:
> Eric B., could you look over the first two patches (which touch the
> sysctl core) and give some review and ACK/NACK?
>
ping Eric W. Biederman ... :)
^ permalink raw reply
* Re: pullreq: wireless-next-2.6 2010-03-03
From: David Miller @ 2010-03-04 6:44 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20100303212638.GI23920@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Wed, 3 Mar 2010 16:26:39 -0500
> Here is another quick batch intended for 2.6.34. Included are a
> USB ID, some small fixes, and a few (for async firmware loading and
> KEY_RFKILL) that depended on patches that weren't in the net-next-2.6
> tree until after the merge window opened.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* [PATCH 2/2] device.h drivers/base/core.c Convert dev_<level> macros to functions
From: Joe Perches @ 2010-03-04 6:27 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton, Nick Andrew
Cc: linux-kernel, Greg Kroah-Hartman, netdev
In-Reply-To: <cover.1267682641.git.joe@perches.com>
Save ~60k in a defconfig
Use %pV and struct va_format
Format arguments are verified before printk
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/base/core.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/device.h | 102 +++++++++++++++++++++++++++++----------
2 files changed, 200 insertions(+), 26 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 2820257..6551640 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1745,3 +1745,127 @@ void device_shutdown(void)
}
async_synchronize_full();
}
+
+/*
+ * Device logging functions
+ */
+
+#ifdef CONFIG_PRINTK
+
+static int __dev_printk(const char *level, const struct device *dev,
+ const char *fmt, va_list args)
+{
+ struct va_format vaf;
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+ return printk("%s%s %s: %pV",
+ level, dev_driver_string(dev), dev_name(dev), &vaf);
+}
+
+int dev_printk(const char *level, const struct device *dev,
+ const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start(args, fmt);
+ r = __dev_printk(level, dev, fmt, args);
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(dev_printk);
+
+int dev_emerg(const struct device *dev, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start(args, fmt);
+ r = __dev_printk(KERN_EMERG, dev, fmt, args);
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(dev_emerg);
+
+int dev_alert(const struct device *dev, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start(args, fmt);
+ r = __dev_printk(KERN_ALERT, dev, fmt, args);
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(dev_alert);
+
+int dev_crit(const struct device *dev, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start(args, fmt);
+ r = __dev_printk(KERN_CRIT, dev, fmt, args);
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(dev_crit);
+
+int dev_err(const struct device *dev, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start(args, fmt);
+ r = __dev_printk(KERN_ERR, dev, fmt, args);
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(dev_err);
+
+int dev_warn(const struct device *dev, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start(args, fmt);
+ r = __dev_printk(KERN_WARNING, dev, fmt, args);
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(dev_warn);
+
+int dev_notice(const struct device *dev, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start(args, fmt);
+ r = __dev_printk(KERN_NOTICE, dev, fmt, args);
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(dev_notice);
+
+int dev_info(const struct device *dev, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start(args, fmt);
+ r = __dev_printk(KERN_INFO, dev, fmt, args);
+ va_end(args);
+
+ return r;
+}
+EXPORT_SYMBOL(dev_info);
+
+#endif
diff --git a/include/linux/device.h b/include/linux/device.h
index b30527d..b4fb694 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -590,43 +590,93 @@ extern void sysdev_shutdown(void);
/* debugging and troubleshooting/diagnostic helpers. */
extern const char *dev_driver_string(const struct device *dev);
-#define dev_printk(level, dev, format, arg...) \
- printk(level "%s %s: " format , dev_driver_string(dev) , \
- dev_name(dev) , ## arg)
-
-#define dev_emerg(dev, format, arg...) \
- dev_printk(KERN_EMERG , dev , format , ## arg)
-#define dev_alert(dev, format, arg...) \
- dev_printk(KERN_ALERT , dev , format , ## arg)
-#define dev_crit(dev, format, arg...) \
- dev_printk(KERN_CRIT , dev , format , ## arg)
-#define dev_err(dev, format, arg...) \
- dev_printk(KERN_ERR , dev , format , ## arg)
-#define dev_warn(dev, format, arg...) \
- dev_printk(KERN_WARNING , dev , format , ## arg)
-#define dev_notice(dev, format, arg...) \
- dev_printk(KERN_NOTICE , dev , format , ## arg)
-#define dev_info(dev, format, arg...) \
- dev_printk(KERN_INFO , dev , format , ## arg)
+
+#ifdef CONFIG_PRINTK
+
+extern int dev_printk(const char *level, const struct device *dev,
+ const char *fmt, ...)
+ __attribute__ ((format (printf, 3, 4)));
+extern int dev_emerg(const struct device *dev, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+extern int dev_alert(const struct device *dev, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+extern int dev_crit(const struct device *dev, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+extern int dev_err(const struct device *dev, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+extern int dev_warn(const struct device *dev, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+extern int dev_notice(const struct device *dev, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+extern int dev_info(const struct device *dev, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+#else
+
+static inline int dev_printk(const char *level, const struct device *dev,
+ const char *fmt, ...)
+ __attribute__ ((format (printf, 3, 4)));
+static inline int dev_printk(const char *level, const struct device *dev,
+ const char *fmt, ...)
+ { return 0; }
+
+static inline int dev_emerg(const struct device *dev, const char *s, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static inline int dev_emerg(const struct device *dev, const char *s, ...)
+ { return 0; }
+static inline int dev_crit(const struct device *dev, const char *s, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static inline int dev_crit(const struct device *dev, const char *s, ...)
+ { return 0; }
+static inline int dev_alert(const struct device *dev, const char *s, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static inline int dev_alert(const struct device *dev, const char *s, ...)
+ { return 0; }
+static inline int dev_err(const struct device *dev, const char *s, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static inline int dev_err(const struct device *dev, const char *s, ...)
+ { return 0; }
+static inline int dev_warn(const struct device *dev, const char *s, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static inline int dev_warn(const struct device *dev, const char *s, ...)
+ { return 0; }
+static inline int dev_notice(const struct device *dev, const char *s, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static inline int dev_notice(const struct device *dev, const char *s, ...)
+ { return 0; }
+static inline int dev_info(const struct device *dev, const char *s, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static inline int dev_info(const struct device *dev, const char *s, ...)
+ { return 0; }
+
+#endif
#if defined(DEBUG)
#define dev_dbg(dev, format, arg...) \
- dev_printk(KERN_DEBUG , dev , format , ## arg)
+ dev_printk(KERN_DEBUG, dev, format, ##arg)
#elif defined(CONFIG_DYNAMIC_DEBUG)
-#define dev_dbg(dev, format, ...) do { \
+#define dev_dbg(dev, format, ...) \
+do { \
dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
- } while (0)
+} while (0)
#else
-#define dev_dbg(dev, format, arg...) \
- ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
+#define dev_dbg(dev, format, arg...) \
+({ \
+ if (0) \
+ dev_printk(KERN_DEBUG, dev, format, ##arg); \
+ 0; \
+})
#endif
#ifdef VERBOSE_DEBUG
#define dev_vdbg dev_dbg
#else
-
-#define dev_vdbg(dev, format, arg...) \
- ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
+#define dev_vdbg(dev, format, arg...) \
+({ \
+ if (0) \
+ dev_printk(KERN_DEBUG, dev, format, ##arg); \
+ 0; \
+})
#endif
/*
--
1.7.0.14.g7e948
^ permalink raw reply related
* [PATCH 1/2] vsprintf: Recursive vsnprintf: Add "%pV", struct va_format
From: Joe Perches @ 2010-03-04 6:27 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton, Nick Andrew
Cc: linux-kernel, Greg Kroah-Hartman, netdev
In-Reply-To: <cover.1267682641.git.joe@perches.com>
Add the ability to print a format and va_list from a structure pointer
Allows __dev_printk to be implemented as a single printk while
minimizing string space duplication.
%pV should not be used without some mechanism to verify the
format and argument use ala __attribute__(format (printf(...))).
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/kernel.h | 5 +++++
lib/vsprintf.c | 9 +++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7f07074..0eae8e9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -169,6 +169,11 @@ static inline void might_fault(void)
}
#endif
+struct va_format {
+ const char *fmt;
+ va_list *va;
+};
+
extern struct atomic_notifier_head panic_notifier_list;
extern long (*panic_blink)(long time);
NORET_TYPE void panic(const char * fmt, ...)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index af4aaa6..0fd7f8b 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -950,6 +950,11 @@ static char *uuid_string(char *buf, char *end, const u8 *addr,
* [0][1][2][3]-[4][5]-[6][7]-[8][9]-[10][11][12][13][14][15]
* little endian output byte order is:
* [3][2][1][0]-[5][4]-[7][6]-[8][9]-[10][11][12][13][14][15]
+ * - 'V' For a struct va_format which contains a format string * and va_list *,
+ * call vsnprintf(->format, *->va_list).
+ * Implements a "recursive vsnprintf".
+ * Do not use this feature without some mechanism to verify the
+ * correctness of the format string and va_list arguments.
*
* Note: The difference between 'S' and 'F' is that on ia64 and ppc64
* function pointers are really function descriptors, which contain a
@@ -994,6 +999,10 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
break;
case 'U':
return uuid_string(buf, end, ptr, spec, fmt);
+ case 'V':
+ return buf + vsnprintf(buf, end - buf,
+ ((struct va_format *)ptr)->fmt,
+ *(((struct va_format *)ptr)->va));
}
spec.flags |= SMALL;
if (spec.field_width == -1) {
--
1.7.0.14.g7e948
^ permalink raw reply related
* [RESEND PATCH 0/2] Make functions of dev_<level> macros, recursive vsnprintf
From: Joe Perches @ 2010-03-04 6:27 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton, Nick Andrew
Cc: linux-kernel, Greg Kroah-Hartman, netdev
(Typo'ed Linus' email address, added Greg KH and netdev)
dev_<level> macros use a lot of repetitive string space.
Eliminate the string prefixes and function arguments from all the macro uses
and consolidate them in functions.
This patchset saves about 60K.
This implementation also adds the ability to use a struct va_format to
emit a format string along with va_list arguments.
This %pV implementation should not be used without a wrapper that
does printf argument verification like the dev_<level> functions.
Inspired a bit by Nick Andrew's patches and Linus' comments in December 2008
http://lkml.org/lkml/2008/12/6/15
http://lkml.org/lkml/2008/12/6/101
Joe Perches (2):
vsprintf: Recursive vsnprintf: Add "%pV", struct va_format
device.h drivers/base/core.c Convert dev_<level> macros to functions
drivers/base/core.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/device.h | 102 +++++++++++++++++++++++++++++----------
include/linux/kernel.h | 5 ++
lib/vsprintf.c | 9 ++++
4 files changed, 214 insertions(+), 26 deletions(-)
^ permalink raw reply
* RE: [PATCH V2 2/7] tcp: use limited socket backlog
From: Eric Dumazet @ 2010-03-04 6:00 UTC (permalink / raw)
To: Zhu, Yi
Cc: netdev@vger.kernel.org, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), Patrick McHardy
In-Reply-To: <DA586906BA1FFC4384FCFD6429ECE860A45A6BAE@shzsmsx502.ccr.corp.intel.com>
Le jeudi 04 mars 2010 à 13:21 +0800, Zhu, Yi a écrit :
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > Then its a separate bug. MD5 support added so many bugs its not even
> > funny.
>
> > Existing bugs are not an excuse for adding new ones, we try the reverse.
> > No ?
>
> Can you show me where sk_drops is used by TCP and what SNMP MIB value
> should I use for backlog dropping? TCP_MIB_INERRS doesn't seem correct.
sk_drop is not yet used by TCP, because when backlog processing is
performed, TCP state machine has much finer grain capabilities to show
why a packet is dropped. In our backlog drop, we dont examine details of
packet and drop it at a lower level.
Please add a new counter, say LINUX_MIB_TCPBACKLOGDROP :
3 added lines:
- one in "include/linux/snmp.h" to define the MIB name
- one to define its string
- one to perform the increment when actual drop occurs)
A good starting point would be to study recent commit
72032fdbcde8b333e65b3430e1bcb4358e2d6716 from Jamal
(xfrm: Introduce LINUX_MIB_XFRMFWDHDRERROR)
For sk_drop, just increment it and we can get it at generic sock level.
Thanks !
^ permalink raw reply
* RE: [PATCH V2 2/7] tcp: use limited socket backlog
From: Zhu, Yi @ 2010-03-04 5:21 UTC (permalink / raw)
To: Eric Dumazet
Cc: netdev@vger.kernel.org, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), Patrick McHardy
In-Reply-To: <1267626678.2997.25.camel@edumazet-laptop>
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Then its a separate bug. MD5 support added so many bugs its not even
> funny.
> Existing bugs are not an excuse for adding new ones, we try the reverse.
> No ?
Can you show me where sk_drops is used by TCP and what SNMP MIB value
should I use for backlog dropping? TCP_MIB_INERRS doesn't seem correct.
Thanks,
-yi
^ permalink raw reply
* Re: [PATCH RFC] fix problems with NETIF_F_HIGHDMA in networking drivers v2
From: FUJITA Tomonori @ 2010-03-04 4:58 UTC (permalink / raw)
To: hancockrwd; +Cc: linux-kernel, netdev, linux-usb, davem, bzolnier
In-Reply-To: <4B8F213B.40603@gmail.com>
On Wed, 03 Mar 2010 20:55:55 -0600
Robert Hancock <hancockrwd@gmail.com> wrote:
> Many networking drivers have issues with the use of the NETIF_F_HIGHDMA flag.
> This flag actually indicates whether or not the device/driver can handle
> skbs located in high memory (as opposed to lowmem). If the flag isn't set and
> the skb is located in highmem, it needs to be copied.
> There are two problems with this flag:
>
> -Many drivers only set the flag when they detect they can use 64-bit DMA,
> since otherwise they could receive DMA addresses that they can't handle
> (which on platforms without IOMMU/SWIOTLB support is fatal). This means that if
> 64-bit support isn't available, even buffers located below 4GB will get copied
> unnecessarily.
>
> -Some drivers set the flag even though they can't actually handle 64-bit DMA,
> which would mean that on platforms without IOMMU/SWIOTLB they would get a DMA
> mapping error if the memory they received happened to be located above 4GB.
>
> In order to fix this problem, the existing NETIF_F_HIGHDMA flag is split into
> two new flags:
>
> NETIF_F_DMA_HIGH - indicates if the driver can do DMA to highmem at all
> NETIF_F_DMA_64BIT - indicates the driver can do DMA to 64-bit memory
Why can't you use dev->dma_mask here like the following?
Then you can fix drivers that use the NETIF_F_HIGHDMA flag to indicate
that they don't support 64bit DMA.
diff --git a/net/core/dev.c b/net/core/dev.c
index bcc490c..b15f94b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -129,6 +129,7 @@
#include <linux/jhash.h>
#include <linux/random.h>
#include <trace/events/napi.h>
+#include <linux/pci.h>
#include "net-sysfs.h"
@@ -1787,14 +1788,21 @@ static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
{
#ifdef CONFIG_HIGHMEM
int i;
+ if (!(dev->features & NETIF_F_HIGHDMA)) {
+ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
+ if (PageHighMem(skb_shinfo(skb)->frags[i].page))
+ return 1;
+ }
- if (dev->features & NETIF_F_HIGHDMA)
- return 0;
-
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
- if (PageHighMem(skb_shinfo(skb)->frags[i].page))
- return 1;
+ if (PCI_DMA_BUS_IS_PHYS) {
+ struct device *pdev = dev->dev.parent;
+ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+ dma_addr_t addr = page_to_phys(skb_shinfo(skb)->frags[i].page);
+ if (!pdev->dma_mask || addr + PAGE_SIZE - 1 > *pdev->dma_mask)
+ return 1;
+ }
+ }
#endif
return 0;
}
^ permalink raw reply related
* Re: [PATCH -next] bridge: depends on INET
From: Randy Dunlap @ 2010-03-04 4:00 UTC (permalink / raw)
To: Ingo Molnar
Cc: David Miller, sfr, linux-next, linux-kernel, shemminger, bridge,
netdev
In-Reply-To: <20100304031847.GA22683@elte.hu>
On 03/03/10 19:18, Ingo Molnar wrote:
>
> * David Miller <davem@davemloft.net> wrote:
>
>> From: Randy Dunlap <rdunlap@xenotime.net>
>> Date: Tue, 02 Mar 2010 09:08:23 -0800
>>
>>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>>
>>> br_multicast calls ip_send_check(), so it should depend on INET.
>>>
>>> built-in:
>>> br_multicast.c:(.text+0x88cf4): undefined reference to `ip_send_check'
>>>
>>> or modular:
>>> ERROR: "ip_send_check" [net/bridge/bridge.ko] undefined!
>>>
>>> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> Applied, but I almost lost this patch.
>>
>> You need to CC: netdev on all networking patches so that it
>> gets properly tracked in patchwork and therefore does not get
>> lost.
>
> I suspect Randy went by the MAINTAINERS entry - you might want to add netdev
> as a second 'L:' line:
>
> ETHERNET BRIDGE
> M: Stephen Hemminger <shemminger@linux-foundation.org>
> L: bridge@lists.linux-foundation.org
> W: http://www.linux-foundation.org/en/Net:Bridge
> S: Maintained
> F: include/linux/netfilter_bridge/
> F: net/bridge/
>
> To make it really clear that netdev must be Cc:-ed for those patches.
Ack that. I also expected Stephen to merge it...
--
~Randy
^ permalink raw reply
* [PATCH] socket: Merge getsockname and getpeername into a single function
From: Kenan Kalajdzic @ 2010-03-04 3:26 UTC (permalink / raw)
To: netdev; +Cc: davem
The code of getsockname is almost identical to getpeername. This patch removes
duplicate code and merges both functions into a single common function.
Signed-off-by: Kenan Kalajdzic <kenan@unix.ba>
---
net/socket.c | 50 +++++++++++++++++---------------------------------
1 files changed, 17 insertions(+), 33 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index 769c386..526e1f5 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1593,12 +1593,12 @@ out:
}
/*
- * Get the local address ('name') of a socket object. Move the obtained
- * name to user space.
+ * Common code for getsockname and getpeername system calls
+ * Get local or remote address ('name') of a socket object.
+ * Move the obtained name to user space.
*/
-
-SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
- int __user *, usockaddr_len)
+static int common_getsockpeername(int fd, struct sockaddr __user *usockaddr,
+ int __user * usockaddr_len, int remote)
{
struct socket *sock;
struct sockaddr_storage address;
@@ -1608,50 +1608,34 @@ SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
if (!sock)
goto out;
- err = security_socket_getsockname(sock);
+ if (remote)
+ err = security_socket_getpeername(sock);
+ else
+ err = security_socket_getsockname(sock);
if (err)
goto out_put;
- err = sock->ops->getname(sock, (struct sockaddr *)&address, &len, 0);
+ err = sock->ops->getname(sock, (struct sockaddr *)&address, &len, remote);
if (err)
goto out_put;
- err = move_addr_to_user((struct sockaddr *)&address, len, usockaddr, usockaddr_len);
+ err = move_addr_to_user((struct sockaddr *)&address, len, usockaddr, usockaddr_len);
out_put:
fput_light(sock->file, fput_needed);
out:
return err;
}
-/*
- * Get the remote address ('name') of a socket object. Move the obtained
- * name to user space.
- */
+SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
+ int __user *, usockaddr_len)
+{
+ return common_getsockpeername(fd, usockaddr, usockaddr_len, 0);
+}
SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
int __user *, usockaddr_len)
{
- struct socket *sock;
- struct sockaddr_storage address;
- int len, err, fput_needed;
-
- sock = sockfd_lookup_light(fd, &err, &fput_needed);
- if (sock != NULL) {
- err = security_socket_getpeername(sock);
- if (err) {
- fput_light(sock->file, fput_needed);
- return err;
- }
-
- err =
- sock->ops->getname(sock, (struct sockaddr *)&address, &len,
- 1);
- if (!err)
- err = move_addr_to_user((struct sockaddr *)&address, len, usockaddr,
- usockaddr_len);
- fput_light(sock->file, fput_needed);
- }
- return err;
+ return common_getsockpeername(fd, usockaddr, usockaddr_len, 1);
}
/*
--
1.6.4
^ permalink raw reply related
* Re: [PATCH -next] bridge: depends on INET
From: Ingo Molnar @ 2010-03-04 3:18 UTC (permalink / raw)
To: David Miller
Cc: rdunlap, sfr, linux-next, linux-kernel, shemminger, bridge,
netdev
In-Reply-To: <20100303.012359.66790294.davem@davemloft.net>
* David Miller <davem@davemloft.net> wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
> Date: Tue, 02 Mar 2010 09:08:23 -0800
>
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> >
> > br_multicast calls ip_send_check(), so it should depend on INET.
> >
> > built-in:
> > br_multicast.c:(.text+0x88cf4): undefined reference to `ip_send_check'
> >
> > or modular:
> > ERROR: "ip_send_check" [net/bridge/bridge.ko] undefined!
> >
> > Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
>
> Applied, but I almost lost this patch.
>
> You need to CC: netdev on all networking patches so that it
> gets properly tracked in patchwork and therefore does not get
> lost.
I suspect Randy went by the MAINTAINERS entry - you might want to add netdev
as a second 'L:' line:
ETHERNET BRIDGE
M: Stephen Hemminger <shemminger@linux-foundation.org>
L: bridge@lists.linux-foundation.org
W: http://www.linux-foundation.org/en/Net:Bridge
S: Maintained
F: include/linux/netfilter_bridge/
F: net/bridge/
To make it really clear that netdev must be Cc:-ed for those patches.
Thanks,
Ingo
^ permalink raw reply
* Re: [rfc/rft][patch] should use scheduler sync hint in tcp_prequeue()?
From: Ingo Molnar @ 2010-03-04 3:03 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, efault, netdev, linux-kernel
In-Reply-To: <20100303.060529.195713861.davem@davemloft.net>
* David Miller <davem@davemloft.net> wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Tue, 02 Mar 2010 12:27:53 +0100
>
> > Le mardi 02 mars 2010 ? 10:41 +0100, Mike Galbraith a ?crit :
> >> diff --git a/include/net/tcp.h b/include/net/tcp.h
> >> index 34f5cc2..ba3fc64 100644
> >> --- a/include/net/tcp.h
> >> +++ b/include/net/tcp.h
> >> @@ -939,7 +939,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
> >>
> >> tp->ucopy.memory = 0;
> >> } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) {
> >> - wake_up_interruptible_poll(sk->sk_sleep,
> >> + wake_up_interruptible_sync_poll(sk->sk_sleep,
> >> POLLIN | POLLRDNORM | POLLRDBAND);
> >> if (!inet_csk_ack_scheduled(sk))
> >> inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
> >>
> ...
> > Ingo probably can answer to this question, since he changed
> > sock_def_readable() (and others) in commit 6f3d09291b498299
> > I suspect he missed tcp_prequeue() case, maybe not...
>
> It definitely looks like an oversight to me and we should add
> be using wake_up_interruptible_sync_poll() in tcp_prequeue()
> as above.
>
> Ingo?
Yeah. I remember that patch, it was minimalistic, based on the workload i
could trigger back then.
Thanks,
Ingo
^ permalink raw reply
* [PATCH RFC] fix problems with NETIF_F_HIGHDMA in networking drivers v2
From: Robert Hancock @ 2010-03-04 2:55 UTC (permalink / raw)
To: linux-kernel, netdev, Linux-usb; +Cc: David Miller, Bartlomiej Zolnierkiewicz
Many networking drivers have issues with the use of the NETIF_F_HIGHDMA flag.
This flag actually indicates whether or not the device/driver can handle
skbs located in high memory (as opposed to lowmem). If the flag isn't set and
the skb is located in highmem, it needs to be copied.
There are two problems with this flag:
-Many drivers only set the flag when they detect they can use 64-bit DMA,
since otherwise they could receive DMA addresses that they can't handle
(which on platforms without IOMMU/SWIOTLB support is fatal). This means that if
64-bit support isn't available, even buffers located below 4GB will get copied
unnecessarily.
-Some drivers set the flag even though they can't actually handle 64-bit DMA,
which would mean that on platforms without IOMMU/SWIOTLB they would get a DMA
mapping error if the memory they received happened to be located above 4GB.
In order to fix this problem, the existing NETIF_F_HIGHDMA flag is split into
two new flags:
NETIF_F_DMA_HIGH - indicates if the driver can do DMA to highmem at all
NETIF_F_DMA_64BIT - indicates the driver can do DMA to 64-bit memory
The check for NETIF_F_DMA_HIGH in the networking core is similar to the current
one for NETIF_F_HIGHDMA. The check for NETIF_F_DMA_64BIT is similar to the
block layer code that handles bounce limit checking.
The patch updates drivers that set NETIF_F_HIGHDMA to set NETIF_F_DMA_HIGH,
and also in some cases NETIF_F_DMA_64BIT where it appears the driver can
actually handle 64-bit DMA addresses.
For the USB kaweth and usbnet drivers, this patch also uncomments and corrects
some code to set the flags based on the USB host controller's DMA mask.
These drivers should be able to access highmem unless the host controller is
non-DMA-capable, which is indicated by the DMA mask being null. If the DMA mask
is additionally 64-bit, then the NETIF_F_DMA_64BIT flag is also set.
Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
---
I suppose the API update and the driver update should likely be separate,
but this is mainly for comments on the new approach..
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 2d3dc7d..8404f7b 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -1382,7 +1382,7 @@ static void fwnet_init_dev(struct net_device *net)
net->netdev_ops = &fwnet_netdev_ops;
net->watchdog_timeo = 2 * HZ;
net->flags = IFF_BROADCAST | IFF_MULTICAST;
- net->features = NETIF_F_HIGHDMA;
+ net->features = NETIF_F_DMA_HIGH;
net->addr_len = FWNET_ALEN;
net->hard_header_len = FWNET_HLEN;
net->type = ARPHRD_IEEE1394;
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index a4e9dcb..4588f70 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -529,7 +529,7 @@ static void ether1394_init_dev(struct net_device *dev)
dev->watchdog_timeo = ETHER1394_TIMEOUT;
dev->flags = IFF_BROADCAST | IFF_MULTICAST;
- dev->features = NETIF_F_HIGHDMA;
+ dev->features = NETIF_F_DMA_HIGH;
dev->addr_len = ETH1394_ALEN;
dev->hard_header_len = ETH1394_HLEN;
dev->type = ARPHRD_IEEE1394;
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 9384f5d..7fadc25 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -1616,7 +1616,7 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
netdev->hard_header_len = ETH_HLEN;
netdev->addr_len = ETH_ALEN;
netdev->type = ARPHRD_ETHER;
- netdev->features = NETIF_F_HIGHDMA;
+ netdev->features = NETIF_F_DMA_HIGH;
netdev->netdev_ops = &nes_netdev_ops;
netdev->ethtool_ops = &nes_ethtool_ops;
netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index df3eb8c..53be462 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1058,7 +1058,7 @@ static void ipoib_setup(struct net_device *dev)
dev->type = ARPHRD_INFINIBAND;
dev->tx_queue_len = ipoib_sendq_size * 2;
dev->features = (NETIF_F_VLAN_CHALLENGED |
- NETIF_F_HIGHDMA);
+ NETIF_F_DMA_HIGH);
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
memcpy(dev->broadcast, ipv4_bcast_addr, INFINIBAND_ALEN);
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 3d4406b..d41aad4 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1967,8 +1967,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
#endif
+ dev->features |= NETIF_F_DMA_HIGH;
if (pci_using_dac)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
#if 0 /* disabled by default until verified */
dev->features |= NETIF_F_TSO;
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index b4efc91..f03d25d 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -989,7 +989,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
* through the use of skb_copy_and_csum_dev we enable these
* features
*/
- dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_DMA_HIGH;
dev->irq = pdev->irq;
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index 4ae750e..4422f8f 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -607,8 +607,9 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,
}
ap->name = dev->name;
+ dev->features |= NETIF_F_DMA_HIGH;
if (ap->pci_using_dac)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
pci_set_drvdata(pdev, dev);
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index a703ed8..1fb839d 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2335,9 +2335,10 @@ static int __devinit be_probe(struct pci_dev *pdev,
be_msix_enable(adapter);
+ netdev->features |= NETIF_F_DMA_HIGH;
status = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
if (!status) {
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
} else {
status = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (status) {
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 381887b..cd44e75 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -7935,8 +7935,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
persist_dma_mask = dma_mask = DMA_BIT_MASK(64);
/* Configure DMA attributes. */
+ dev->features |= NETIF_F_DMA_HIGH;
if (pci_set_dma_mask(pdev, dma_mask) == 0) {
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
rc = pci_set_consistent_dma_mask(pdev, persist_dma_mask);
if (rc) {
dev_err(&pdev->dev,
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ed785a3..85e9264 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -11880,8 +11880,9 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
dev->ethtool_ops = &bnx2x_ethtool_ops;
dev->features |= NETIF_F_SG;
dev->features |= NETIF_F_HW_CSUM;
+ dev->features |= NETIF_F_DMA_HIGH;
if (bp->flags & USING_DAC_FLAG)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN);
dev->features |= NETIF_F_TSO6;
#ifdef BCM_VLAN
@@ -11890,8 +11891,9 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
dev->vlan_features |= NETIF_F_SG;
dev->vlan_features |= NETIF_F_HW_CSUM;
+ dev->vlan_features |= NETIF_F_DMA_HIGH;
if (bp->flags & USING_DAC_FLAG)
- dev->vlan_features |= NETIF_F_HIGHDMA;
+ dev->vlan_features |= NETIF_F_DMA_64BIT;
dev->vlan_features |= (NETIF_F_TSO | NETIF_F_TSO_ECN);
dev->vlan_features |= NETIF_F_TSO6;
#endif
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 7cbcfb0..b96ff3a 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -5133,8 +5133,9 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
if ((cp->cas_flags & CAS_FLAG_NO_HW_CSUM) == 0)
dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
+ dev->features |= NETIF_F_DMA_HIGH;
if (pci_using_dac)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
if (register_netdev(dev)) {
dev_err(&pdev->dev, "Cannot register net device, aborting\n");
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 0f71304..9d027db 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -1106,11 +1106,11 @@ static int __devinit init_one(struct pci_dev *pdev,
netdev->mem_end = mmio_start + mmio_len - 1;
netdev->ml_priv = adapter;
netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
- netdev->features |= NETIF_F_LLTX;
+ netdev->features |= NETIF_F_LLTX | NETIF_F_DMA_HIGH;
adapter->flags |= RX_CSUM_ENABLED | TCP_CSUM_CAPABLE;
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
if (vlan_tso_capable(adapter)) {
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
adapter->flags |= VLAN_ACCEL_CAPABLE;
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 6fd968a..2133728 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -3242,9 +3242,9 @@ static int __devinit init_one(struct pci_dev *pdev,
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len - 1;
netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
- netdev->features |= NETIF_F_GRO;
+ netdev->features |= NETIF_F_GRO | NETIF_F_DMA_HIGH;
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
netdev->netdev_ops = &cxgb_netdev_ops;
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 8be6fae..6650583 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -914,8 +914,9 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
(hw->mac_type != e1000_82547))
netdev->features |= NETIF_F_TSO;
+ netdev->features |= NETIF_F_DMA_HIGH;
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
netdev->vlan_features |= NETIF_F_TSO;
netdev->vlan_features |= NETIF_F_HW_CSUM;
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 88d54d3..2b1bdea 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -5085,6 +5085,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
netdev->features |= NETIF_F_TSO;
netdev->features |= NETIF_F_TSO6;
+ netdev->features |= NETIF_F_DMA_HIGH;
netdev->vlan_features |= NETIF_F_TSO;
netdev->vlan_features |= NETIF_F_TSO6;
@@ -5092,7 +5093,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
netdev->vlan_features |= NETIF_F_SG;
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
if (e1000e_enable_mng_pass_thru(&adapter->hw))
adapter->flags |= FLAG_MNG_PT_ENABLED;
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index b004eab..fd395bc 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -3149,7 +3149,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
ehea_set_ethtool_ops(dev);
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
- | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
+ | NETIF_F_DMA_HIGH | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
| NETIF_F_LLTX;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index cf098bb..52c6807 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -2067,8 +2067,9 @@ static int __devinit enic_probe(struct pci_dev *pdev,
NETIF_F_TSO6 | NETIF_F_TSO_ECN;
if (ENIC_SETTING(enic, LRO))
netdev->features |= NETIF_F_LRO;
+ netdev->features |= NETIF_F_DMA_HIGH;
if (using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
enic->csum_rx_enabled = ENIC_SETTING(enic, RXCSUM);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index ca05e56..0d9d40b 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5670,6 +5670,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
/* copy of device id */
np->device_id = id->device;
+ dev->features |= NETIF_F_DMA_HIGH;
/* handle different descriptor versions */
if (id->driver_data & DEV_HAS_HIGH_DMA) {
/* packet format 3: supports 40-bit addressing */
@@ -5680,7 +5681,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
dev_printk(KERN_INFO, &pci_dev->dev,
"64-bit DMA failed, using 32-bit addressing\n");
else
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
if (pci_set_consistent_dma_mask(pci_dev, DMA_BIT_MASK(39))) {
dev_printk(KERN_INFO, &pci_dev->dev,
"64-bit DMA (consistent) failed, using 32-bit ring buffers\n");
@@ -6014,7 +6015,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
dev->dev_addr[5]);
dev_printk(KERN_INFO, &pci_dev->dev, "%s%s%s%s%s%s%s%s%s%sdesc-v%u\n",
- dev->features & NETIF_F_HIGHDMA ? "highdma " : "",
+ dev->features & NETIF_F_DMA_64BIT ? "highdma " : "",
dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ?
"csum " : "",
dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ?
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 6aa526e..63927c6 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -933,7 +933,8 @@ static int gfar_probe(struct of_device *ofdev,
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM) {
priv->rx_csum_enable = 1;
- dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG |
+ NETIF_F_DMA_HIGH;
} else
priv->rx_csum_enable = 0;
diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index 2b9c1cb..8679410 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -1531,7 +1531,7 @@ static int __devinit greth_of_probe(struct of_device *ofdev, const struct of_dev
GRETH_REGSAVE(regs->status, 0xFF);
if (greth->gbit_mac) {
- dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_HIGHDMA;
+ dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_DMA_HIGH;
greth_netdev_ops.ndo_start_xmit = greth_start_xmit_gbit;
greth->flags = GRETH_FLAG_RX_CSUM;
}
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 583a21c..23849ed 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1525,6 +1525,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
netdev->features |= NETIF_F_TSO;
netdev->features |= NETIF_F_TSO6;
netdev->features |= NETIF_F_GRO;
+ netdev->features |= NETIF_F_DMA_HIGH;
netdev->vlan_features |= NETIF_F_TSO;
netdev->vlan_features |= NETIF_F_TSO6;
@@ -1533,7 +1534,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
netdev->vlan_features |= NETIF_F_SG;
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
if (hw->mac.type >= e1000_82576)
netdev->features |= NETIF_F_SCTP_CSUM;
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index a77afd8..bdcb9de 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -2740,9 +2740,10 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
netdev->features |= NETIF_F_IPV6_CSUM;
netdev->features |= NETIF_F_TSO;
netdev->features |= NETIF_F_TSO6;
+ netdev->features |= NETIF_F_DMA_HIGH;
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
netdev->vlan_features |= NETIF_F_TSO;
netdev->vlan_features |= NETIF_F_TSO6;
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 70871b9..7b3dad4 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -1267,8 +1267,9 @@ static int __devinit ioc3_probe(struct pci_dev *pdev,
goto out_disable;
}
+ dev->features |= NETIF_F_DMA_HIGH;
if (pci_using_dac)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
err = pci_request_regions(pdev, "ioc3");
if (err)
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index c9fef65..6e50c2b 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -439,10 +439,10 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_HW_VLAN_TX |
NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER;
- netdev->features |= NETIF_F_TSO;
+ netdev->features |= NETIF_F_TSO | NETIF_F_DMA_HIGH;
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
/* make sure the EEPROM is good */
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 45e3532..8876b67 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -6179,6 +6179,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
netdev->features |= NETIF_F_TSO;
netdev->features |= NETIF_F_TSO6;
netdev->features |= NETIF_F_GRO;
+ netdev->features |= NETIF_F_DMA_HIGH;
if (adapter->hw.mac.type == ixgbe_mac_82599EB)
netdev->features |= NETIF_F_SCTP_CSUM;
@@ -6209,7 +6210,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
}
#endif /* IXGBE_FCOE */
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)
netdev->features |= NETIF_F_LRO;
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 235b5fd..f3986dc 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -3402,13 +3402,14 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev,
netdev->features |= NETIF_F_IPV6_CSUM;
netdev->features |= NETIF_F_TSO;
netdev->features |= NETIF_F_TSO6;
+ netdev->features |= NETIF_F_DMA_HIGH;
netdev->vlan_features |= NETIF_F_TSO;
netdev->vlan_features |= NETIF_F_TSO6;
netdev->vlan_features |= NETIF_F_IP_CSUM;
netdev->vlan_features |= NETIF_F_SG;
if (pci_using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
#endif /* MAX_SKB_FRAGS */
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 0f31497..1b0fcff 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -669,7 +669,7 @@ jme_set_clean_rxdesc(struct jme_adapter *jme, int i)
rxdesc->desc1.bufaddrl = cpu_to_le32(
(__u64)rxbi->mapping & 0xFFFFFFFFUL);
rxdesc->desc1.datalen = cpu_to_le16(rxbi->len);
- if (jme->dev->features & NETIF_F_HIGHDMA)
+ if (jme->dev->features & NETIF_F_DMA_64BIT)
rxdesc->desc1.flags = RXFLAG_64BIT;
wmb();
rxdesc->desc1.flags |= RXFLAG_OWN | RXFLAG_INT;
@@ -1743,7 +1743,7 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx)
struct jme_ring *txring = &(jme->txring[0]);
struct txdesc *txdesc = txring->desc, *ctxdesc;
struct jme_buffer_info *txbi = txring->bufinf, *ctxbi;
- u8 hidma = jme->dev->features & NETIF_F_HIGHDMA;
+ u8 hidma = jme->dev->features & NETIF_F_DMA_64BIT;
int i, nr_frags = skb_shinfo(skb)->nr_frags;
int mask = jme->tx_ring_mask;
struct skb_frag_struct *frag;
@@ -2709,9 +2709,10 @@ jme_init_one(struct pci_dev *pdev,
NETIF_F_TSO |
NETIF_F_TSO6 |
NETIF_F_HW_VLAN_TX |
- NETIF_F_HW_VLAN_RX;
+ NETIF_F_HW_VLAN_RX |
+ NETIF_F_DMA_HIGH;
if (using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
SET_NETDEV_DEV(netdev, &pdev->dev);
pci_set_drvdata(pdev, netdev);
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 72b7949..7881064 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -177,7 +177,8 @@ static void loopback_setup(struct net_device *dev)
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
| NETIF_F_TSO
| NETIF_F_NO_CSUM
- | NETIF_F_HIGHDMA
+ | NETIF_F_DMA_HIGH
+ | NETIF_F_DMA_64BIT
| NETIF_F_LLTX
| NETIF_F_NETNS_LOCAL;
dev->ethtool_ops = &loopback_ethtool_ops;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 40faa36..5e8abb0 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -378,7 +378,7 @@ static struct lock_class_key macvlan_netdev_xmit_lock_key;
static struct lock_class_key macvlan_netdev_addr_lock_key;
#define MACVLAN_FEATURES \
- (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
+ (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_DMA_HIGH | NETIF_F_FRAGLIST | \
NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_GSO_ROBUST | \
NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO)
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index c48b0f4..5288ac0 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -1041,7 +1041,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
dev->vlan_features |= NETIF_F_SG;
dev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
dev->vlan_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_HIGH;
dev->features |= NETIF_F_HW_VLAN_TX |
NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER;
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 676c513..8760667 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -3913,8 +3913,9 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->base_addr = mgp->iomem_base;
netdev->features = mgp->features;
+ netdev->features |= NETIF_F_DMA_HIGH;
if (dac_enabled)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
netdev->features |= NETIF_F_LRO;
netdev->vlan_features |= mgp->features;
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 08780ef..6847f7b 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1198,9 +1198,11 @@ netxen_setup_netdev(struct netxen_adapter *adapter,
SET_ETHTOOL_OPS(netdev, &netxen_nic_ethtool_ops);
- netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO);
+ netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
+ NETIF_F_DMA_HIGH);
netdev->features |= (NETIF_F_GRO);
- netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO);
+ netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
+ NETIF_F_DMA_HIGH);
if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
netdev->features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
@@ -1208,8 +1210,8 @@ netxen_setup_netdev(struct netxen_adapter *adapter,
}
if (adapter->pci_using_dac) {
- netdev->features |= NETIF_F_HIGHDMA;
- netdev->vlan_features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
+ netdev->vlan_features |= NETIF_F_DMA_64BIT;
}
if (adapter->capabilities & NX_FW_CAPABILITY_FVLANTX)
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 0678f31..044a3bd 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -9823,7 +9823,7 @@ static int __devinit niu_pci_init_one(struct pci_dev *pdev,
dma_mask = DMA_BIT_MASK(44);
err = pci_set_dma_mask(pdev, dma_mask);
if (!err) {
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
err = pci_set_consistent_dma_mask(pdev, dma_mask);
if (err) {
dev_err(&pdev->dev, "Unable to obtain 44 bit DMA for consistent allocations, aborting\n");
@@ -9838,7 +9838,7 @@ static int __devinit niu_pci_init_one(struct pci_dev *pdev,
}
}
- dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM);
+ dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_DMA_HIGH);
np->regs = pci_ioremap_bar(pdev, 0);
if (!np->regs) {
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 8dd509c..0b61710 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -2215,6 +2215,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
/* Yes, we support dumb IP checksum on transmit */
ndev->features |= NETIF_F_SG;
ndev->features |= NETIF_F_IP_CSUM;
+ ndev->features |= NETIF_F_DMA_HIGH;
#ifdef NS83820_VLAN_ACCEL_SUPPORT
/* We also support hardware vlan acceleration */
@@ -2224,7 +2225,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
if (using_dac) {
printk(KERN_INFO "%s: using 64 bit addressing.\n",
ndev->name);
- ndev->features |= NETIF_F_HIGHDMA;
+ ndev->features |= NETIF_F_DMA_64BIT;
}
printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: %pM io=0x%08lx irq=%d f=%s\n",
@@ -2232,7 +2233,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
(unsigned)readl(dev->base + SRR) >> 8,
(unsigned)readl(dev->base + SRR) & 0xff,
ndev->dev_addr, addr, pci_dev->irq,
- (ndev->features & NETIF_F_HIGHDMA) ? "h,sg" : "sg"
+ (ndev->features & NETIF_F_DMA_64BIT) ? "h,sg" : "sg"
);
#ifdef PHY_CODE_IS_FINISHED
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index d44d4a2..0f4ab9d 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -1758,7 +1758,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netif_napi_add(dev, &mac->napi, pasemi_mac_poll, 64);
dev->features = NETIF_F_IP_CSUM | NETIF_F_LLTX | NETIF_F_SG |
- NETIF_F_HIGHDMA | NETIF_F_GSO;
+ NETIF_F_DMA_HIGH | NETIF_F_GSO;
mac->lro_mgr.max_aggr = LRO_MAX_AGGR;
mac->lro_mgr.max_desc = MAX_LRO_DESCRIPTORS;
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 4ef0afb..80df9fe 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -3977,8 +3977,9 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
qdev->msg_enable = netif_msg_init(debug, default_msg);
+ ndev->features |= NETIF_F_DMA_HIGH;
if (pci_using_dac)
- ndev->features |= NETIF_F_HIGHDMA;
+ ndev->features |= NETIF_F_DMA_64BIT;
if (qdev->device_id == QL3032_DEVICE_ID)
ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 665e8e5..6a3fa85 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1044,12 +1044,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
netdev->features |= (NETIF_F_GRO);
netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO);
- netdev->features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
- netdev->vlan_features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
+ netdev->features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6 |
+ NETIF_F_DMA_HIGH);
+ netdev->vlan_features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6 |
+ NETIF_F_DMA_HIGH);
if (adapter->pci_using_dac) {
- netdev->features |= NETIF_F_HIGHDMA;
- netdev->vlan_features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
+ netdev->vlan_features |= NETIF_F_DMA_64BIT;
}
if (adapter->capabilities & QLCNIC_FW_CAPABILITY_FVLANTX)
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index c26ec5d..a5defb8 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4644,10 +4644,10 @@ static int __devinit qlge_probe(struct pci_dev *pdev,
| NETIF_F_TSO_ECN
| NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER);
- ndev->features |= NETIF_F_GRO;
+ ndev->features |= NETIF_F_GRO | NETIF_F_DMA_HIGH;
if (test_bit(QL_DMA64, &qdev->flags))
- ndev->features |= NETIF_F_HIGHDMA;
+ ndev->features |= NETIF_F_DMA_64BIT;
/*
* Set up net_device structure.
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index dfc3573..ddfda5e 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3047,12 +3047,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (this_use_dac < 0)
this_use_dac = tp->pcie_cap != 0;
+ dev->features |= NETIF_F_DMA_HIGH;
if ((sizeof(dma_addr_t) > 4) &&
this_use_dac &&
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
netif_info(tp, probe, dev, "using 64-bit DMA\n");
tp->cp_cmd |= PCIDAC;
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
} else {
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc < 0) {
@@ -4327,7 +4328,7 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
netif_info(tp, intr, dev, "disabling PCI DAC\n");
tp->cp_cmd &= ~PCIDAC;
RTL_W16(CPlusCmd, tp->cp_cmd);
- dev->features &= ~NETIF_F_HIGHDMA;
+ dev->features &= ~NETIF_F_DMA_64BIT;
}
rtl8169_hw_reset(ioaddr);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 43bc66a..d4b4724 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -7978,9 +7978,9 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
- dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+ dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_DMA_HIGH;
if (sp->high_dma_flag == true)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
dev->features |= NETIF_F_TSO;
dev->features |= NETIF_F_TSO6;
if ((sp->device_type & XFRAME_II_DEVICE) && (ufo)) {
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index d87c478..333b327 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -1462,7 +1462,7 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
dev->irq = pdev->irq;
/* faked with skb_copy_and_csum_dev */
- dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
+ dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_DMA_HIGH;
dev->netdev_ops = &sc92031_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 88f2fb1..6aa4387 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -2204,13 +2204,13 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
if (!net_dev)
return -ENOMEM;
net_dev->features |= (type->offload_features | NETIF_F_SG |
- NETIF_F_HIGHDMA | NETIF_F_TSO |
+ NETIF_F_DMA_HIGH | NETIF_F_TSO |
NETIF_F_GRO);
if (type->offload_features & NETIF_F_V6_CSUM)
net_dev->features |= NETIF_F_TSO6;
/* Mask for features that also apply to VLAN devices */
net_dev->vlan_features |= (NETIF_F_ALL_CSUM | NETIF_F_SG |
- NETIF_F_HIGHDMA | NETIF_F_TSO);
+ NETIF_F_DMA_HIGH | NETIF_F_TSO);
efx = netdev_priv(net_dev);
pci_set_drvdata(pci_dev, efx);
rc = efx_init_struct(efx, type, pci_dev, net_dev);
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index d0058e5..ee183f4 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -3813,8 +3813,9 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
dev->watchdog_timeo = TX_WATCHDOG;
dev->irq = hw->pdev->irq;
+ dev->features |= NETIF_F_DMA_HIGH;
if (highmem)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
skge = netdev_priv(dev);
netif_napi_add(dev, &skge->napi, skge_poll, NAPI_WEIGHT);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 653bdd7..2e2df37 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4487,9 +4487,10 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
sky2->port = port;
- dev->features |= NETIF_F_TSO | NETIF_F_IP_CSUM | NETIF_F_SG;
+ dev->features |= NETIF_F_TSO | NETIF_F_IP_CSUM | NETIF_F_SG |
+ NETIF_F_DMA_HIGH;
if (highmem)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
#ifdef SKY2_VLAN_TAG_USED
/* The workaround for FE+ status conflicts with VLAN tag detection. */
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 6dfa698..6f2a47c 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -732,8 +732,12 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
#ifdef VLAN_SUPPORT
dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
#endif /* VLAN_RX_KILL_VID */
+
+ dev->features |= NETIF_F_DMA_HIGH;
+
#ifdef ADDR_64BITS
- dev->features |= NETIF_F_HIGHDMA;
+ /* FIXME: should be setting 64-bit DMA mask here */
+ dev->features |= NETIF_F_DMA_64BIT;
#endif /* ADDR_64BITS */
/* Serial EEPROM reads are hidden by the hardware. */
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index a673361..a6a78b8 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -1529,7 +1529,7 @@ static int stmmac_probe(struct net_device *dev)
dev->netdev_ops = &stmmac_netdev_ops;
stmmac_set_ethtool_ops(dev);
- dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA);
+ dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_DMA_HIGH);
dev->watchdog_timeo = msecs_to_jiffies(watchdog);
#ifdef STMMAC_VLAN_TAG_USED
/* Both mac100 and gmac support receive VLAN tag detection */
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 4344017..bf05253 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -3196,9 +3196,10 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
gp->phy_mii.def ? gp->phy_mii.def->name : "no");
/* GEM can do it all... */
- dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_LLTX;
+ dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_LLTX |
+ NETIF_F_DMA_HIGH;
if (pci_using_dac)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
return 0;
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 0c97802..908e272 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -2024,12 +2024,12 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ndev->irq = pdev->irq;
ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO
| NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
- NETIF_F_HW_VLAN_FILTER
+ NETIF_F_HW_VLAN_FILTER | NETIF_F_DMA_HIGH
/*| NETIF_F_FRAGLIST */
;
if (pci_using_dac)
- ndev->features |= NETIF_F_HIGHDMA;
+ ndev->features |= NETIF_F_DMA_64BIT;
/************** priv ****************/
priv = nic->priv[port] = netdev_priv(ndev);
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 0fa7688..676111f 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -14552,10 +14552,11 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
persist_dma_mask = dma_mask = DMA_BIT_MASK(64);
/* Configure DMA attributes. */
+ dev->features |= NETIF_F_DMA_HIGH;
if (dma_mask > DMA_BIT_MASK(32)) {
err = pci_set_dma_mask(pdev, dma_mask);
if (!err) {
- dev->features |= NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_DMA_64BIT;
err = pci_set_consistent_dma_mask(pdev,
persist_dma_mask);
if (err < 0) {
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index 647cdd1..db8d13f 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -1628,7 +1628,7 @@ tsi108_init_one(struct platform_device *pdev)
* a new function skb_csum_dev() in net/core/skbuff.c).
*/
- dev->features = NETIF_F_HIGHDMA;
+ dev->features = NETIF_F_DMA_HIGH;
spin_lock_init(&data->txlock);
spin_lock_init(&data->misclock);
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 52671ea..ad06569 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1181,11 +1181,17 @@ err_fw:
INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl);
usb_set_intfdata(intf, kaweth);
-#if 0
-// dma_supported() is deeply broken on almost all architectures
- if (dma_supported (&intf->dev, 0xffffffffffffffffULL))
- kaweth->net->features |= NETIF_F_HIGHDMA;
-#endif
+ /* Some USB host controllers can't do DMA; they have to use PIO.
+ * They indicate this by setting their dma_mask to NULL. For
+ * such controllers we need to make sure the networking layer doesn't
+ * send us skbs in high memory.
+ */
+ if (dev->bus->controller->dma_mask) {
+ kaweth->net->features |= NETIF_F_DMA_HIGH;
+ /* OK, using DMA, can it do 64 bit? */
+ if (*dev->bus->controller->dma_mask == DMA_BIT_MASK(64))
+ kaweth->net->features |= NETIF_F_DMA_64BIT;
+ }
SET_NETDEV_DEV(netdev, &intf->dev);
if (register_netdev(netdev) != 0) {
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 17b6a62..13e4b14 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1317,12 +1317,18 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
* bind() should set rx_urb_size in that case.
*/
dev->hard_mtu = net->mtu + net->hard_header_len;
-#if 0
-// dma_supported() is deeply broken on almost all architectures
- // possible with some EHCI controllers
- if (dma_supported (&udev->dev, DMA_BIT_MASK(64)))
- net->features |= NETIF_F_HIGHDMA;
-#endif
+
+ /* Some USB host controllers can't do DMA; they have to use PIO.
+ * They indicate this by setting their dma_mask to NULL. For
+ * such controllers we need to make sure the networking layer doesn't
+ * send us skbs in high memory.
+ */
+ if (xdev->bus->controller->dma_mask) {
+ net->features |= NETIF_F_DMA_HIGH;
+ /* OK, using DMA, can it do 64 bit? */
+ if (*xdev->bus->controller->dma_mask == DMA_BIT_MASK(64))
+ net->features |= NETIF_F_DMA_64BIT;
+ }
net->netdev_ops = &usbnet_netdev_ops;
net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 25dc77c..7f22900 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -900,7 +900,7 @@ static int virtnet_probe(struct virtio_device *vdev)
/* Set up network device as normal. */
dev->netdev_ops = &virtnet_netdev;
- dev->features = NETIF_F_HIGHDMA;
+ dev->features = NETIF_F_DMA_HIGH;
SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops);
SET_NETDEV_DEV(dev, &vdev->dev);
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index cff3485..ed438af 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -2253,7 +2253,8 @@ vmxnet3_declare_features(struct vmxnet3_adapter *adapter, bool dma64)
NETIF_F_HW_VLAN_FILTER |
NETIF_F_TSO |
NETIF_F_TSO6 |
- NETIF_F_LRO;
+ NETIF_F_LRO |
+ NETIF_F_DMA_HIGH;
printk(KERN_INFO "features: sg csum vlan jf tso tsoIPv6 lro");
@@ -2262,7 +2263,7 @@ vmxnet3_declare_features(struct vmxnet3_adapter *adapter, bool dma64)
adapter->lro = true;
if (dma64) {
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->features |= NETIF_F_DMA_64BIT;
printk(" highDMA");
}
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index 46a7c9e..184886b 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -3292,8 +3292,9 @@ int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
vxge_debug_init(vxge_hw_device_trace_level_get(hldev),
"%s : checksuming enabled", __func__);
+ ndev->features |= NETIF_F_DMA_HIGH;
if (high_dma) {
- ndev->features |= NETIF_F_HIGHDMA;
+ ndev->features |= NETIF_F_DMA_64BIT;
vxge_debug_init(vxge_hw_device_trace_level_get(hldev),
"%s : using High DMA", __func__);
}
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c
index 599aa4e..c57cd66 100644
--- a/drivers/net/wimax/i2400m/netdev.c
+++ b/drivers/net/wimax/i2400m/netdev.c
@@ -633,7 +633,7 @@ void i2400m_netdev_setup(struct net_device *net_dev)
net_dev->tx_queue_len = I2400M_TX_QLEN;
net_dev->features =
NETIF_F_VLAN_CHALLENGED
- | NETIF_F_HIGHDMA;
+ | NETIF_F_DMA_HIGH;
net_dev->flags =
IFF_NOARP /* i2400m is apure IP device */
& (~IFF_BROADCAST /* i2400m is P2P */
diff --git a/drivers/uwb/i1480/i1480u-wlp/lc.c b/drivers/uwb/i1480/i1480u-wlp/lc.c
index f272dfe..052edb5 100644
--- a/drivers/uwb/i1480/i1480u-wlp/lc.c
+++ b/drivers/uwb/i1480/i1480u-wlp/lc.c
@@ -241,7 +241,7 @@ int i1480u_add(struct i1480u *i1480u, struct usb_interface *iface)
net_dev->features &= ~NETIF_F_SG;
net_dev->features &= ~NETIF_F_FRAGLIST;
/* All NETIF_F_*_CSUM disabled */
- net_dev->features |= NETIF_F_HIGHDMA;
+ net_dev->features |= NETIF_F_DMA_HIGH;
net_dev->watchdog_timeo = 5*HZ; /* FIXME: a better default? */
net_dev->netdev_ops = &i1480u_netdev_ops;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c79a88b..70200e1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -746,7 +746,7 @@ struct net_device {
#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
#define NETIF_F_IPV6_CSUM 16 /* Can checksum TCP/UDP over IPV6 */
-#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
+#define NETIF_F_DMA_HIGH 32 /* Can DMA to high memory. */
#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
@@ -764,6 +764,10 @@ struct net_device {
#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
#define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */
+#define NETIF_F_DMA_64BIT (1 << 28) /* 64-bit DMA support */
+
+ /* for backward compatibility */
+#define NETIF_F_HIGHDMA (NETIF_F_DMA_HIGH | NETIF_F_DMA_64BIT)
/* Segmentation offload features */
#define NETIF_F_GSO_SHIFT 16
@@ -789,7 +793,7 @@ struct net_device {
* for all in netdev_increment_features.
*/
#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
- NETIF_F_SG | NETIF_F_HIGHDMA | \
+ NETIF_F_SG | NETIF_F_DMA_HIGH | \
NETIF_F_FRAGLIST)
/* Interface index. Unique device identifier */
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index eb7062d..da24dd9 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -197,7 +197,7 @@ void br_dev_setup(struct net_device *dev)
dev->tx_queue_len = 0;
dev->priv_flags = IFF_EBRIDGE;
- dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
+ dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_DMA_HIGH |
NETIF_F_GSO_MASK | NETIF_F_NO_CSUM | NETIF_F_LLTX |
- NETIF_F_NETNS_LOCAL | NETIF_F_GSO;
+ NETIF_F_NETNS_LOCAL | NETIF_F_GSO | NETIF_F_DMA_64BIT;
}
diff --git a/net/core/dev.c b/net/core/dev.c
index bcc490c..4b1f50b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1785,15 +1785,24 @@ EXPORT_SYMBOL(netdev_rx_csum_fault);
static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
{
+ /* Note that these checks are skipped if CONFIG_HIGHMEM is not set.
+ In that case, the PageHighMem check is obviously not applicable,
+ and copying the skb may not result in 32-bit reachable memory
+ anyway - IOMMU has to handle bounce buffering/mapping. */
#ifdef CONFIG_HIGHMEM
int i;
- if (dev->features & NETIF_F_HIGHDMA)
- return 0;
-
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
- if (PageHighMem(skb_shinfo(skb)->frags[i].page))
+ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+ /* check for highmem page and non-highmem-capable device */
+ if (!(dev->features & NETIF_F_DMA_HIGH) &&
+ PageHighMem(skb_shinfo(skb)->frags[i].page))
return 1;
+ /* check for page >4GB and non-64bit-capable device */
+ if (!(dev->features & NETIF_F_DMA_64BIT) &&
+ page_to_pfn(skb_shinfo(skb)->frags[i].page) >
+ (0xffffffff >> PAGE_SHIFT))
+ return 1;
+ }
#endif
return 0;
^ permalink raw reply related
* Re: [PATCH 2/2] iproute2 skbedit: Add support to mark packets
From: jamal @ 2010-03-04 2:51 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Alexander Duyck
In-Reply-To: <20100303163638.09520577@nehalam>
You applied 2/2 but not 1/2.
cheers,
jamal
On Wed, 2010-03-03 at 16:36 -0800, Stephen Hemminger wrote:
> On Thu, 03 Dec 2009 08:32:48 -0500
> jamal <hadi@cyberus.ca> wrote:
>
> > I did this originally because i was getting too many support
> > questions on ipt with mark. It still makes sense since skbedit
> > seems to be the mother action of skb metadata (should probably
> > have been called skbmeta).
> >
> > cheers,
> > jamal
>
>
> Applied
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] r8169: use correct barrier between cacheable and non-cacheable memory
From: David Dillow @ 2010-03-04 2:33 UTC (permalink / raw)
To: netdev; +Cc: Francois Romieu, Paul Mackerras, Catalin Marinas
r8169 needs certain writes to be visible to other CPUs or the NIC before
touching the hardware, but was using smp_wmb() which is only required to
order cacheable memory access. Switch to wmb() which is required to
order both cacheable and non-cacheable memory.
Noticed by Catalin Marinas and Paul Mackerras.
Signed-off-by: David Dillow <dave@thedillows.org>
---
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index dfc3573..9d3ebf3 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4270,7 +4270,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
tp->cur_tx += frags + 1;
- smp_wmb();
+ wmb();
RTL_W8(TxPoll, NPQ); /* set polling bit */
@@ -4621,7 +4621,7 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
* until it does.
*/
tp->intr_mask = 0xffff;
- smp_wmb();
+ wmb();
RTL_W16(IntrMask, tp->intr_event);
}
^ permalink raw reply related
* RE: [PATCH V2 5/7] sctp: use limited socket backlog
From: Zhu, Yi @ 2010-03-04 2:00 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: netdev@vger.kernel.org, Sridhar Samudrala
In-Reply-To: <4B8E73E5.1030105@hp.com>
Vlad Yasevich <vladislav.yasevich@hp.com> wrote:
>> BTW, does the current backlog limit (sysctl_rmem_default[1] << 1) enough for sctp?
>> I noticed the sysctl_sctp_rmem[1] is set to 373500 in my box.
>>
> sctp uses the same algorithm as TCP to figure out the memory values.
> I guess the issue with using the smaller value that it would be possible to
> queue more the socket receive buffer then to the backlog. Thus backlog would
> start dropping packets even though receive buffer would still accept them.
Sysctl_tcp_rmem[1] = 87380 in my box which is much smaller than sctp. The backlog
limit is set to 258048 by default which is smaller than sysctl_sctp_rmem[1] = 373500.
I don't think backlog starts to drop packets before receive queue is correct. Fortunately
we can set the limit by individual protocols. I'll set the sk->sk_backlog.limit to
sysctl_sctp_rmem[1] in sctp_init_sock() for sctp socks in the next version.
Thanks,
-yi
^ permalink raw reply
* Re: [PATCH] iproute2: netlink support for bus-error reporting and counters
From: Stephen Hemminger @ 2010-03-04 0:47 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: Linux Netdev List, SocketCAN Core Mailing List
In-Reply-To: <4B8390D7.5010409@grandegger.com>
On Tue, 23 Feb 2010 09:24:55 +0100
Wolfgang Grandegger <wg@grandegger.com> wrote:
> This patch uses the new features of the kernel's netlink CAN interface
> making the bus-error reporting configurable and allowing to retrieve
> the CAN TX and RX bus error counters via netlink interface. Here is the
> output of my test session showing how to use them:
>
> # ip link set can0 up type can bitrate 500000 berr-reporting on
> # ip -d -s link show can0
> 2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
> link/can
> can <BERR-REPORTING> state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0
> CAN bus error counter values ^^^^^^^^^^^
> bitrate 500000 sample-point 0.875
> tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
> sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
> clock 8000000
> re-started bus-errors arbit-lost error-warn error-pass bus-off
> 0 54101 0 1 1 0
> RX: bytes packets errors dropped overrun mcast
> 432808 54101 54101 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 0 0 0 0 0 0
>
> # ifconfig can0 down
> # ip link set can0 up type can berr-reporting off
> # candump -t d any,0:0,#FFFFFFFF
> (0.000000) can0 20000004 [8] 00 08 00 00 00 00 60 00 ERRORFRAME
> (0.000474) can0 20000004 [8] 00 20 00 00 00 00 80 00 ERRORFRAME
> ^^ ^^
> \ \___ rxerr
> \_____ txerr
>
> Furthermore, the missing support for one-shot mode has been added.
>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Applied, I had already got the header file changes as part of the
net-next header file resync.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox