aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/include/asm/system.h3
-rw-r--r--arch/powerpc/include/asm/system.h3
-rw-r--r--arch/s390/appldata/appldata_net_sum.c3
-rw-r--r--arch/um/drivers/net_kern.c10
-rw-r--r--arch/x86/include/asm/system.h7
5 files changed, 11 insertions, 15 deletions
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
index 48c4f0335e3..81e1f7d5b4c 100644
--- a/arch/microblaze/include/asm/system.h
+++ b/arch/microblaze/include/asm/system.h
@@ -101,10 +101,7 @@ extern struct dentry *of_debugfs_root;
101 * MicroBlaze doesn't handle unaligned accesses in hardware. 101 * MicroBlaze doesn't handle unaligned accesses in hardware.
102 * 102 *
103 * Based on this we force the IP header alignment in network drivers. 103 * Based on this we force the IP header alignment in network drivers.
104 * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining
105 * cacheline alignment of buffers.
106 */ 104 */
107#define NET_IP_ALIGN 2 105#define NET_IP_ALIGN 2
108#define NET_SKB_PAD L1_CACHE_BYTES
109 106
110#endif /* _ASM_MICROBLAZE_SYSTEM_H */ 107#endif /* _ASM_MICROBLAZE_SYSTEM_H */
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
index a6297c67c3d..6c294acac84 100644
--- a/arch/powerpc/include/asm/system.h
+++ b/arch/powerpc/include/asm/system.h
@@ -515,11 +515,8 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
515 * powers of 2 writes until it reaches sufficient alignment). 515 * powers of 2 writes until it reaches sufficient alignment).
516 * 516 *
517 * Based on this we disable the IP header alignment in network drivers. 517 * Based on this we disable the IP header alignment in network drivers.
518 * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining
519 * cacheline alignment of buffers.
520 */ 518 */
521#define NET_IP_ALIGN 0 519#define NET_IP_ALIGN 0
522#define NET_SKB_PAD L1_CACHE_BYTES
523 520
524#define cmpxchg64(ptr, o, n) \ 521#define cmpxchg64(ptr, o, n) \
525 ({ \ 522 ({ \
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c
index 9a9586f4103..f02e89ce4df 100644
--- a/arch/s390/appldata/appldata_net_sum.c
+++ b/arch/s390/appldata/appldata_net_sum.c
@@ -85,7 +85,8 @@ static void appldata_get_net_sum_data(void *data)
85 85
86 rcu_read_lock(); 86 rcu_read_lock();
87 for_each_netdev_rcu(&init_net, dev) { 87 for_each_netdev_rcu(&init_net, dev) {
88 const struct net_device_stats *stats = dev_get_stats(dev); 88 struct rtnl_link_stats64 temp;
89 const struct net_device_stats *stats = dev_get_stats(dev, &temp);
89 90
90 rx_packets += stats->rx_packets; 91 rx_packets += stats->rx_packets;
91 tx_packets += stats->tx_packets; 92 tx_packets += stats->tx_packets;
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index f0537269423..2ab233ba32c 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -25,11 +25,6 @@
25#include "net_kern.h" 25#include "net_kern.h"
26#include "net_user.h" 26#include "net_user.h"
27 27
28static inline void set_ether_mac(struct net_device *dev, unsigned char *addr)
29{
30 memcpy(dev->dev_addr, addr, ETH_ALEN);
31}
32
33#define DRIVER_NAME "uml-netdev" 28#define DRIVER_NAME "uml-netdev"
34 29
35static DEFINE_SPINLOCK(opened_lock); 30static DEFINE_SPINLOCK(opened_lock);
@@ -266,7 +261,7 @@ static int uml_net_set_mac(struct net_device *dev, void *addr)
266 struct sockaddr *hwaddr = addr; 261 struct sockaddr *hwaddr = addr;
267 262
268 spin_lock_irq(&lp->lock); 263 spin_lock_irq(&lp->lock);
269 set_ether_mac(dev, hwaddr->sa_data); 264 eth_mac_addr(dev, hwaddr->sa_data);
270 spin_unlock_irq(&lp->lock); 265 spin_unlock_irq(&lp->lock);
271 266
272 return 0; 267 return 0;
@@ -380,7 +375,6 @@ static const struct net_device_ops uml_netdev_ops = {
380 .ndo_tx_timeout = uml_net_tx_timeout, 375 .ndo_tx_timeout = uml_net_tx_timeout,
381 .ndo_set_mac_address = uml_net_set_mac, 376 .ndo_set_mac_address = uml_net_set_mac,
382 .ndo_change_mtu = uml_net_change_mtu, 377 .ndo_change_mtu = uml_net_change_mtu,
383 .ndo_set_mac_address = eth_mac_addr,
384 .ndo_validate_addr = eth_validate_addr, 378 .ndo_validate_addr = eth_validate_addr,
385}; 379};
386 380
@@ -478,7 +472,7 @@ static void eth_configure(int n, void *init, char *mac,
478 ((*transport->user->init)(&lp->user, dev) != 0)) 472 ((*transport->user->init)(&lp->user, dev) != 0))
479 goto out_unregister; 473 goto out_unregister;
480 474
481 set_ether_mac(dev, device->mac); 475 eth_mac_addr(dev, device->mac);
482 dev->mtu = transport->user->mtu; 476 dev->mtu = transport->user->mtu;
483 dev->netdev_ops = &uml_netdev_ops; 477 dev->netdev_ops = &uml_netdev_ops;
484 dev->ethtool_ops = &uml_net_ethtool_ops; 478 dev->ethtool_ops = &uml_net_ethtool_ops;
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
index e7f4d33c55e..33ecc3ea878 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -457,4 +457,11 @@ static __always_inline void rdtsc_barrier(void)
457 alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC); 457 alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
458} 458}
459 459
460/*
461 * We handle most unaligned accesses in hardware. On the other hand
462 * unaligned DMA can be quite expensive on some Nehalem processors.
463 *
464 * Based on this we disable the IP header alignment in network drivers.
465 */
466#define NET_IP_ALIGN 0
460#endif /* _ASM_X86_SYSTEM_H */ 467#endif /* _ASM_X86_SYSTEM_H */