* [PATCH 1/4] if_vlan: Remove VLAN_ETH_ALEN define and the 1 use of it
From: Joe Perches @ 2012-03-19 3:37 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1332128181.git.joe@perches.com>
Just use ETH_ALEN.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/if_vlan.h | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 13aff1e..33a6e19 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -18,10 +18,9 @@
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>
-#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header)
- * that VLAN requires.
+#define VLAN_HLEN 4 /* The additional bytes required by VLAN
+ * (in addition to the Ethernet header)
*/
-#define VLAN_ETH_ALEN 6 /* Octets in one ethernet addr */
#define VLAN_ETH_HLEN 18 /* Total octets in header. */
#define VLAN_ETH_ZLEN 64 /* Min. octets in frame sans FCS */
@@ -177,7 +176,7 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci)
veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
/* Move the mac addresses to the beginning of the new header. */
- memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN);
+ memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
skb->mac_header -= VLAN_HLEN;
/* first, the ethernet type */
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related
* [PATCH 0/4] driver: net: Use ETH_ALEN
From: Joe Perches @ 2012-03-19 3:37 UTC (permalink / raw)
To: linux-wireless, netdev; +Cc: linux-kernel, e1000-devel
Just some neatening
Joe Perches (4):
if_vlan: Remove VLAN_ETH_ALEN define and the 1 use of it
atlx: Use ETH_ALEN
igbvf: Use ETH_ALEN
rtlwifi: Remove unused ETH_ADDR_LEN defines
drivers/net/ethernet/atheros/atlx/atl2.c | 13 +++++--------
drivers/net/ethernet/atheros/atlx/atl2.h | 5 ++---
drivers/net/ethernet/atheros/atlx/atlx.h | 1 -
drivers/net/ethernet/intel/igbvf/defines.h | 4 ----
drivers/net/ethernet/intel/igbvf/vf.c | 7 ++-----
drivers/net/wireless/rtlwifi/rtl8192ce/reg.h | 1 -
drivers/net/wireless/rtlwifi/rtl8192de/reg.h | 1 -
include/linux/if_vlan.h | 7 +++----
8 files changed, 12 insertions(+), 27 deletions(-)
--
1.7.8.111.gad25c.dirty
^ permalink raw reply
* [v2] Re: [RFC] l2tp/ipv6: support for L2TPv2 over UDP over IPv6
From: Benjamin LaHaise @ 2012-03-19 3:28 UTC (permalink / raw)
To: James Chapman; +Cc: Eric Dumazet, netdev
In-Reply-To: <4F632FB6.9010206@katalix.com>
On Fri, Mar 16, 2012 at 12:19:02PM +0000, James Chapman wrote:
> Hi Ben,
>
> Do you have an updated patch to test?
Yes, here's an updated version. There is still work to do, as I've not
added IPv6 support to L2TPv3 pseudo-wires yet. I have managed to test
this with a couple of VMs as well as on IPv6 checksumming capable hardware,
and the checksum offloading code works for me. I'm not sure if the dst
handling is 100% correct, so close review of this area would be greatly
appreciated.
A simple test program for wiring pppd up to an L2TP socket that I've used
for testing is available at http://www.kvack.org/~bcrl/pppol2tp/l2tp_test.c
(just pass --local=<ip> --remote=<ip> /usr/sbin/pppd nodetach ... to get it
to run a connection) . I'm planning on adding support to the Babylon stack
to use the native Linux L2TP stack, but I just haven't had much time to
work on this during the last few weeks. Comments on this version?
-ben
include/linux/if_pppol2tp.h | 28 ++++++++++++++
include/linux/if_pppox.h | 12 ++++++
net/ipv6/udp.c | 31 ++++++++++++++++
net/l2tp/l2tp_core.c | 83 +++++++++++++++++++++++++++++++++++++-------
net/l2tp/l2tp_ppp.c | 44 ++++++++++++++++++++++-
5 files changed, 183 insertions(+), 15 deletions(-)
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index 23cefa1..b477541 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -19,10 +19,11 @@
#ifdef __KERNEL__
#include <linux/in.h>
+#include <linux/in6.h>
#endif
/* Structure used to connect() the socket to a particular tunnel UDP
- * socket.
+ * socket over IPv4.
*/
struct pppol2tp_addr {
__kernel_pid_t pid; /* pid that owns the fd.
@@ -35,6 +36,20 @@ struct pppol2tp_addr {
__u16 d_tunnel, d_session; /* For sending outgoing packets */
};
+/* Structure used to connect() the socket to a particular tunnel UDP
+ * socket over IPv6.
+ */
+struct pppol2tpin6_addr {
+ __kernel_pid_t pid; /* pid that owns the fd.
+ * 0 => current */
+ int fd; /* FD of UDP socket to use */
+
+ __u16 s_tunnel, s_session; /* For matching incoming packets */
+ __u16 d_tunnel, d_session; /* For sending outgoing packets */
+
+ struct sockaddr_in6 addr; /* IP address and port to send to */
+};
+
/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
* bits. So we need a different sockaddr structure.
*/
@@ -49,6 +64,17 @@ struct pppol2tpv3_addr {
__u32 d_tunnel, d_session; /* For sending outgoing packets */
};
+struct pppol2tpv3in6_addr {
+ __kernel_pid_t pid; /* pid that owns the fd.
+ * 0 => current */
+ int fd; /* FD of UDP or IP socket to use */
+
+ __u32 s_tunnel, s_session; /* For matching incoming packets */
+ __u32 d_tunnel, d_session; /* For sending outgoing packets */
+
+ struct sockaddr_in6 addr; /* IP address and port to send to */
+};
+
/* Socket options:
* DEBUG - bitmask of debug message categories
* SENDSEQ - 0 => don't send packets with sequence numbers
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index b5f927f..6720d57 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -83,6 +83,12 @@ struct sockaddr_pppol2tp {
struct pppol2tp_addr pppol2tp;
} __attribute__((packed));
+struct sockaddr_pppol2tpin6 {
+ __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
+ unsigned int sa_protocol; /* protocol identifier */
+ struct pppol2tpin6_addr pppol2tp;
+} __attribute__((packed));
+
/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
* bits. So we need a different sockaddr structure.
*/
@@ -92,6 +98,12 @@ struct sockaddr_pppol2tpv3 {
struct pppol2tpv3_addr pppol2tp;
} __attribute__((packed));
+struct sockaddr_pppol2tpv3in6 {
+ __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
+ unsigned int sa_protocol; /* protocol identifier */
+ struct pppol2tpv3in6_addr pppol2tp;
+} __attribute__((packed));
+
/*********************************************************************
*
* ioctl interface for defining forwarding of connections
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 8c25419..c0faad5 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -515,6 +515,37 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb))
goto drop;
+ if (up->encap_type) {
+ int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
+
+ /*
+ * This is an encapsulation socket so pass the skb to
+ * the socket's udp_encap_rcv() hook. Otherwise, just
+ * fall through and pass this up the UDP socket.
+ * up->encap_rcv() returns the following value:
+ * =0 if skb was successfully passed to the encap
+ * handler or was discarded by it.
+ * >0 if skb should be passed on to UDP.
+ * <0 if skb should be resubmitted as proto -N
+ */
+
+ /* if we're overly short, let UDP handle it */
+ encap_rcv = ACCESS_ONCE(up->encap_rcv);
+ if (skb->len > sizeof(struct udphdr) && encap_rcv != NULL) {
+ int ret;
+
+ ret = encap_rcv(sk, skb);
+ if (ret <= 0) {
+ UDP6_INC_STATS_BH(sock_net(sk),
+ UDP_MIB_INDATAGRAMS,
+ is_udplite);
+ return -ret;
+ }
+ }
+
+ /* FALLTHROUGH -- it's a UDP Packet */
+ }
+
/*
* UDP-Lite specific tests, ignored on UDP sockets (see net/ipv4/udp.c).
*/
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 89ff8c6..b45f5b4 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -53,6 +53,9 @@
#include <net/inet_common.h>
#include <net/xfrm.h>
#include <net/protocol.h>
+#include <net/inet6_connection_sock.h>
+#include <net/inet_ecn.h>
+#include <net/ip6_route.h>
#include <asm/byteorder.h>
#include <linux/atomic.h>
@@ -446,21 +449,43 @@ static inline int l2tp_verify_udp_checksum(struct sock *sk,
{
struct udphdr *uh = udp_hdr(skb);
u16 ulen = ntohs(uh->len);
- struct inet_sock *inet;
__wsum psum;
- if (sk->sk_no_check || skb_csum_unnecessary(skb) || !uh->check)
- return 0;
-
- inet = inet_sk(sk);
- psum = csum_tcpudp_nofold(inet->inet_saddr, inet->inet_daddr, ulen,
- IPPROTO_UDP, 0);
-
- if ((skb->ip_summed == CHECKSUM_COMPLETE) &&
- !csum_fold(csum_add(psum, skb->csum)))
+ if (sk->sk_no_check || skb_csum_unnecessary(skb))
return 0;
- skb->csum = psum;
+#if IS_ENABLED(CONFIG_IPV6)
+ if (sk->sk_family == PF_INET6) {
+ if (!uh->check) {
+ LIMIT_NETDEBUG(KERN_INFO "L2TP: IPv6: checksum is 0\n");
+ return 1;
+ }
+ if ((skb->ip_summed == CHECKSUM_COMPLETE) &&
+ !csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
+ &ipv6_hdr(skb)->daddr, ulen,
+ IPPROTO_UDP, skb->csum)) {
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+ return 0;
+ }
+ skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
+ &ipv6_hdr(skb)->daddr,
+ skb->len, IPPROTO_UDP,
+ 0));
+ } else
+#endif
+ {
+ struct inet_sock *inet;
+ if (!uh->check)
+ return 0;
+ inet = inet_sk(sk);
+ psum = csum_tcpudp_nofold(inet->inet_saddr, inet->inet_daddr,
+ ulen, IPPROTO_UDP, 0);
+
+ if ((skb->ip_summed == CHECKSUM_COMPLETE) &&
+ !csum_fold(csum_add(psum, skb->csum)))
+ return 0;
+ skb->csum = psum;
+ }
return __skb_checksum_complete(skb);
}
@@ -988,7 +1013,12 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb,
/* Queue the packet to IP for output */
skb->local_df = 1;
- error = ip_queue_xmit(skb, fl);
+#if IS_ENABLED(CONFIG_IPV6)
+ if (skb->sk->sk_family == PF_INET6)
+ error = inet6_csk_xmit(skb, NULL);
+ else
+#endif
+ error = ip_queue_xmit(skb, fl);
/* Update stats */
if (error >= 0) {
@@ -1021,6 +1051,30 @@ static inline void l2tp_skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
skb->destructor = l2tp_sock_wfree;
}
+#if IS_ENABLED(CONFIG_IPV6)
+static void l2tp_xmit_ipv6_csum(struct sock *sk, struct sk_buff *skb, int udp_len)
+{
+ struct ipv6_pinfo *np = inet6_sk(sk);
+ struct udphdr *uh = udp_hdr(skb);
+
+ if (!skb_dst(skb) || !skb_dst(skb)->dev ||
+ !(skb_dst(skb)->dev->features & NETIF_F_IPV6_CSUM)) {
+ skb->ip_summed = CHECKSUM_COMPLETE;
+ skb->csum = skb_checksum(skb, 0, udp_len, 0);
+ uh->check = csum_ipv6_magic(&np->saddr, &np->daddr, udp_len,
+ IPPROTO_UDP, skb->csum);
+ if (uh->check == 0)
+ uh->check = CSUM_MANGLED_0;
+ } else {
+ skb->ip_summed = CHECKSUM_PARTIAL;
+ skb->csum_start = skb_transport_header(skb) - skb->head;
+ skb->csum_offset = offsetof(struct udphdr, check);
+ uh->check = ~csum_ipv6_magic(&np->saddr, &np->daddr,
+ udp_len, IPPROTO_UDP, 0);
+ }
+}
+#endif
+
/* If caller requires the skb to have a ppp header, the header must be
* inserted in the skb data before calling this function.
*/
@@ -1089,6 +1143,11 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len
uh->check = 0;
/* Calculate UDP checksum if configured to do so */
+#if IS_ENABLED(CONFIG_IPV6)
+ if (sk->sk_family == PF_INET6)
+ l2tp_xmit_ipv6_csum(sk, skb, udp_len);
+ else
+#endif
if (sk->sk_no_check == UDP_CSUM_NOXMIT)
skb->ip_summed = CHECKSUM_NONE;
else if ((skb_dst(skb) && skb_dst(skb)->dev) &&
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 8a90d75..c871ced 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -915,8 +915,8 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr,
goto end_put_sess;
}
- inet = inet_sk(sk);
- if (tunnel->version == 2) {
+ inet = inet_sk(tunnel->sock);
+ if ((tunnel->version == 2) && (tunnel->sock->sk_family == AF_INET)) {
struct sockaddr_pppol2tp sp;
len = sizeof(sp);
memset(&sp, 0, len);
@@ -932,6 +932,46 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr,
sp.pppol2tp.addr.sin_port = inet->inet_dport;
sp.pppol2tp.addr.sin_addr.s_addr = inet->inet_daddr;
memcpy(uaddr, &sp, len);
+#if IS_ENABLED(CONFIG_IPV6)
+ } else if ((tunnel->version == 2) &&
+ (tunnel->sock->sk_family == AF_INET6)) {
+ struct ipv6_pinfo *np = inet6_sk(tunnel->sock);
+ struct sockaddr_pppol2tpin6 sp;
+ len = sizeof(sp);
+ memset(&sp, 0, len);
+ sp.sa_family = AF_PPPOX;
+ sp.sa_protocol = PX_PROTO_OL2TP;
+ sp.pppol2tp.fd = tunnel->fd;
+ sp.pppol2tp.pid = pls->owner;
+ sp.pppol2tp.s_tunnel = tunnel->tunnel_id;
+ sp.pppol2tp.d_tunnel = tunnel->peer_tunnel_id;
+ sp.pppol2tp.s_session = session->session_id;
+ sp.pppol2tp.d_session = session->peer_session_id;
+ sp.pppol2tp.addr.sin6_family = AF_INET6;
+ sp.pppol2tp.addr.sin6_port = inet->inet_dport;
+ memcpy(&sp.pppol2tp.addr.sin6_addr, &np->daddr,
+ sizeof(np->daddr));
+ memcpy(uaddr, &sp, len);
+ } else if ((tunnel->version == 3) &&
+ (tunnel->sock->sk_family == AF_INET6)) {
+ struct ipv6_pinfo *np = inet6_sk(tunnel->sock);
+ struct sockaddr_pppol2tpv3in6 sp;
+ len = sizeof(sp);
+ memset(&sp, 0, len);
+ sp.sa_family = AF_PPPOX;
+ sp.sa_protocol = PX_PROTO_OL2TP;
+ sp.pppol2tp.fd = tunnel->fd;
+ sp.pppol2tp.pid = pls->owner;
+ sp.pppol2tp.s_tunnel = tunnel->tunnel_id;
+ sp.pppol2tp.d_tunnel = tunnel->peer_tunnel_id;
+ sp.pppol2tp.s_session = session->session_id;
+ sp.pppol2tp.d_session = session->peer_session_id;
+ sp.pppol2tp.addr.sin6_family = AF_INET6;
+ sp.pppol2tp.addr.sin6_port = inet->inet_dport;
+ memcpy(&sp.pppol2tp.addr.sin6_addr, &np->daddr,
+ sizeof(np->daddr));
+ memcpy(uaddr, &sp, len);
+#endif
} else if (tunnel->version == 3) {
struct sockaddr_pppol2tpv3 sp;
len = sizeof(sp);
^ permalink raw reply related
* [PATCH] Fix pppol2tp getsockname()
From: Benjamin LaHaise @ 2012-03-19 3:15 UTC (permalink / raw)
To: David S. Miller; +Cc: James Chapman, netdev
While testing L2TP functionality, I came across a bug in getsockname(). The
IP address returned within the pppol2tp_addr's addr memember was not being
set to the IP address in use. This bug is caused by using inet_sk() on the
wrong socket (the L2TP socket rather than the underlying UDP socket), and was
likely introduced during the addition of L2TPv3 support.
---
net/l2tp/l2tp_ppp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 96bc7a6..9b07191 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -915,7 +915,7 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr,
goto end_put_sess;
}
- inet = inet_sk(sk);
+ inet = inet_sk(tunnel->sock);
if (tunnel->version == 2) {
struct sockaddr_pppol2tp sp;
len = sizeof(sp);
--
1.7.4.1
^ permalink raw reply related
* Re: [V4 PATCH] virtio-net: send gratuitous packet when needed
From: Rusty Russell @ 2012-03-19 2:16 UTC (permalink / raw)
To: Michael S. Tsirkin, Jason Wang; +Cc: netdev, virtualization, linux-kernel
In-Reply-To: <20120313143331.GE14931@redhat.com>
On Tue, 13 Mar 2012 16:33:31 +0200, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
> > index 970d5a2..44a38d6 100644
> > --- a/include/linux/virtio_net.h
> > +++ b/include/linux/virtio_net.h
> > @@ -49,8 +49,10 @@
> > #define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
> > #define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
> > #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
> > +#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can send gratituous packet */
> >
> > #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
> > +#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
>
> I would put this in bit 8 (0x100), this way low status byte
> is RO, high byte is RW.
The whole idea of acking by clearing the bit is unreliable, moving to a
separate byte just controls the damage.
How about you use bits 8-15 as a counter? It's still theoretically
unreliable if 256 notifications pass before the guest notices, but it's
probably better and clearer than this.
I leave the final call to MST though.
Thanks,
Rusty.
--
How could I marry someone with more hair than me? http://baldalex.org
^ permalink raw reply
* Fwd: [Bug 42957] New: Kernel trap probably by malicious packet from torrent peer
From: Stephen Hemminger @ 2012-03-19 1:44 UTC (permalink / raw)
To: netdev
In-Reply-To: <bug-42957-100@https.bugzilla.kernel.org/>
----- Forwarded Message -----
> https://bugzilla.kernel.org/show_bug.cgi?id=42957
>
> Summary: Kernel trap probably by malicious packet from
> torrent
> peer
> Product: Networking
> Version: 2.5
> Kernel Version: 3.0.23
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: IPV4
> AssignedTo: shemminger@linux-foundation.org
> ReportedBy: warpme@o2.pl
> Regression: No
>
>
> Hi,
>
> Last day I got 2 traps on otherwise (months of 24/7 uptime) stable
> server. I
> see correlation with launching torrent download (transmission
> client). Sys is
> 64-bit ArchLinux with 3.0.23 kernel. Log from trap is below. I submit
> this in
> IPv4 - but I'll appreciate if somebody will deduce from trap log
> proper
> category/kernel component involved/responsible this issue.
>
> ------------[ cut here ]------------
> Mar 17 19:32:47 [98071.093459] WARNING: at net/ipv4/tcp_input.c:2999
> tcp_ack+0x1e34/0x2080()
> Mar 17 19:32:47 [98071.093461] Hardware name: GA-880GA-UD3H
> Mar 17 19:32:47 [98071.093462] Modules linked in: md5 dvbloopback
> nfsd exportfs
> nfs nfs_acl lockd auth_rpcgss fscache sunrpc xt_multiport xt_recent
> xt_state
> xt_tcpudp dvb_pll cx22702 stb6100 stv090x cx88_dvb videobuf_dvb
> cx88_vp3054_i2c
> dvb_core iptable_mangle rc_hauppauge iptable_nat nf_nat
> nf_conntrack_ipv4
> nf_defrag_ipv4 nf_conntrack iptable_filter ip_tables x_tables
> rc_tbs_nec
> appletalk ipx p8023 psnap p8022 llc snd_hda_codec_hdmi tuner cx8802
> cx8800
> cx88xx tveeprom btcx_risc videobuf_dma_sg videobuf_core v4l2_common
> videodev
> snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_page_alloc
> snd_timer snd
> radeon soundcore drm_kms_helper ttm drm ir_lirc_codec lirc_dev
> i2c_algo_bit
> ir_sony_decoder ir_jvc_decoder ir_rc6_decoder i2c_piix4 shpchp wmi
> pci_hotplug
> i2c_core ftdi_sio usbserial edac_mce_amd v4l2_compat_ioctl32
> ir_rc5_decoder
> media ir_nec_decoder rc_core sp5100_tco edac_core processor e1000e
> button r8169
> mii pcspkr evdev k10temp loop it87 hwmon_vid ipv6 autofs4 ext3
> mbcache jbd
> sd_mod pata_jmi
> Mar 17 19:32:47 cron pata_acpi ata_generic ahci libahci libata
> scsi_mod
> ohci_hcd ehci_hcd xhci_hcd usbcore
> Mar 17 19:32:47 [98071.093507] Pid: 0, comm: kworker/0:0 Tainted: G
> W
> 3.0-ARCH #1
> Mar 17 19:32:47 [98071.093508] Call Trace:
> Mar 17 19:32:47 [98071.093509] <IRQ> [<ffffffff8105c8ff>]
> warn_slowpath_common+0x7f/0xc0
> Mar 17 19:32:47 [98071.093514] [<ffffffff8105c95a>]
> warn_slowpath_null+0x1a/0x20
> Mar 17 19:32:47 [98071.093517] [<ffffffff81380c74>]
> tcp_ack+0x1e34/0x2080
> Mar 17 19:32:47 [98071.093520] [<ffffffffa026a1b7>] ?
> ipt_do_table+0x227/0x5b0
> [ip_tables]
> Mar 17 19:32:47 [98071.093523] [<ffffffff81381d50>]
> tcp_rcv_established+0x280/0x830
> Mar 17 19:32:47 [98071.093525] [<ffffffff81388d6f>]
> tcp_v4_do_rcv+0x10f/0x310
> Mar 17 19:32:47 [98071.093544] [<ffffffff81348545>] ?
> sk_filter+0x95/0xd0
> Mar 17 19:32:47 [98071.093546] [<ffffffff8138ae14>]
> tcp_v4_rcv+0x624/0x910
> Mar 17 19:32:47 [98071.093549] [<ffffffff8136804d>]
> ip_local_deliver_finish+0xed/0x2b0
> Mar 17 19:32:47 [98071.093551] [<ffffffff813683e0>]
> ip_local_deliver+0x90/0xa0
> Mar 17 19:32:47 [98071.093553] [<ffffffff81367d21>]
> ip_rcv_finish+0x131/0x370
> Mar 17 19:32:47 [98071.093556] [<ffffffff81368615>]
> ip_rcv+0x225/0x2f0
> Mar 17 19:32:47 [98071.093559] [<ffffffff81334c1a>]
> __netif_receive_skb+0x30a/0x660
> Mar 17 19:32:47 [98071.093561] [<ffffffff8133574d>]
> netif_receive_skb+0xad/0xc0
> Mar 17 19:32:47 [98071.093564] [<ffffffff81336140>]
> napi_skb_finish+0x50/0x70
> Mar 17 19:32:47 [98071.093567] [<ffffffff81336255>]
> napi_gro_receive+0xf5/0x140
> Mar 17 19:32:47 [98071.093572] [<ffffffffa01c6dbb>]
> e1000_receive_skb+0x5b/0x70 [e1000e]
> Mar 17 19:32:47 [98071.093578] [<ffffffffa01c8702>]
> e1000_clean_rx_irq+0x2c2/0x430 [e1000e]
> Mar 17 19:32:47 [98071.093581] [<ffffffff8108404f>] ?
> hrtimer_interrupt+0x12f/0x210
> Mar 17 19:32:47 [98071.093586] [<ffffffffa01c811f>]
> e1000_clean+0xaf/0x2b0
> [e1000e]
> Mar 17 19:32:47 [98071.093589] [<ffffffff81335a29>]
> net_rx_action+0x149/0x300
> Mar 17 19:32:47 [98071.093592] [<ffffffff81063f90>]
> __do_softirq+0xb0/0x270
> Mar 17 19:32:47 [98071.093594] [<ffffffff813f875c>]
> call_softirq+0x1c/0x30
> Mar 17 19:32:47 [98071.093596] [<ffffffff8100db25>]
> do_softirq+0x65/0xa0
> Mar 17 19:32:47 [98071.093598] [<ffffffff8106449e>]
> irq_exit+0x9e/0xc0
> Mar 17 19:32:47 [98071.093600] [<ffffffff813f8fb3>] do_IRQ+0x63/0xe0
> Mar 17 19:32:47 [98071.093603] [<ffffffff813f6c93>]
> common_interrupt+0x13/0x13
> Mar 17 19:32:47 [98071.093604] <EOI> [<ffffffff81031e9b>] ?
> native_safe_halt+0xb/0x10
> Mar 17 19:32:47 [98071.093609] [<ffffffff81014173>]
> default_idle+0x53/0x2a0
> Mar 17 19:32:47 [98071.093611] [<ffffffff8101499a>]
> amd_e400_idle+0x9a/0x120
> Mar 17 19:32:47 [98071.093614] [<ffffffff8100a21a>]
> cpu_idle+0xba/0x100
> Mar 17 19:32:47 [98071.093616] [<ffffffff813e6169>]
> start_secondary+0x202/0x209
> Mar 17 19:32:47 [98071.093618] ---[ end trace 4fecd84b3e9e66ee ]---
> Mar 17 19:32:47 [98071.274828] ------------[ cut here ]------------
>
> --
> Configure bugmail:
> https://bugzilla.kernel.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug.
>
^ permalink raw reply
* iputils git tree
From: Mike Frysinger @ 2012-03-19 1:07 UTC (permalink / raw)
To: netdev, yoshfuji
[-- Attachment #1: Type: Text/Plain, Size: 320 bytes --]
the iputils homepage says to use:
git://git.linux-ipv6.org/gitroot/iputils.git
but attempting to clone from that gets me connection refused. the gitweb is
still alive though and shows recent commits:
http://www.linux-ipv6.org/gitweb/gitweb.cgi?p=gitroot/iputils.git;a=summary
so where can i clone this tree ?
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH v5] ipv6: Fix problem with expired dst cache
From: Gao feng @ 2012-03-19 0:49 UTC (permalink / raw)
To: David Miller; +Cc: netdev, eric.dumazet
In-Reply-To: <20120316.223353.988595838790067214.davem@davemloft.net>
于 2012年03月17日 13:33, David Miller 写道:
> From: Gao feng <gaofeng@cn.fujitsu.com>
> Date: Mon, 5 Mar 2012 15:16:02 +0800
>
>> If the ipv6 dst cache which copy from the dst generated by ICMPV6 RA packet.
>> this dst cache will not check expire because it has no RTF_EXPIRES flag.
>> So this dst cache will always be used until the dst gc run.
>>
>> Change the struct dst_entry,add a union contains new pointer from and expires.
>> When rt6_info.rt6i_flags has no RTF_EXPIRES flag,the dst.expires has no use.
>> we can use this field to point to where the dst cache copy from.
>> The dst.from is only used in IPV6.
>>
>> In func rt6_check_expired check if rt6_info.dst.from is expired.
>>
>> In func ip6_rt_copy only set dst.from when the ort has flag RTF_ADDRCONF
>> and RTF_DEFAULT.then hold the ort.
>>
>> In func ip6_dst_destroy release the ort.
>>
>> Add some functions to operate the RTF_EXPIRES flag and expires(from) together.
>> and change the code to use these new adding functions.
>>
>> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
>
> I see some unprotected access to dst.expires in the router discovery
> code in net/ipv6/ndisc.c, doesn't that need to be updated?
>
> There are probably some more similar cases elsewhere in the ipv6 code
> too.
>
Hi David
I only search the RTF_EXPIRES flag and forget the expires.I will do this.
BUT what confuse me is that, in func ip6_rt_copy should we do rt6_set_from in any case
or only when the ort has flag RTF_ADDRCONF and RTF_DEFAULT?
thanks.
^ permalink raw reply
* Re: [PATCH] adjust __net_exit
From: Eric W. Biederman @ 2012-03-19 0:41 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: David Miller, JBeulich, netdev, netfilter-devel, xemul
In-Reply-To: <20120317230318.GA19460@merkur.ravnborg.org>
Sam Ravnborg <sam@ravnborg.org> writes:
> On Fri, Mar 16, 2012 at 10:18:13PM -0700, David Miller wrote:
>> From: "Jan Beulich" <JBeulich@suse.com>
>> Date: Thu, 08 Mar 2012 09:37:32 +0000
>>
>> > __net_exit, judging by the majority of its uses, was intended to serve
>> > as an abstraction to allow calling such annotated functions from both
>> > __init and __exit functions. Using the (bogus and unused elsewhere)
>> > __exit_refok to implement this is inefficient - any non-modular code
>> > really can reside in __init (as non-modular __exit code is never used).
>> >
>> > Therefore, adjust __net_exit to resolve to nothing (i.e. normal .text)
>> > in modules, and __init in the core kernel.
>> >
>> > A few other adjustments are necessary/possible with this done - those
>> > were likely just oversights when added originally.
>> >
>> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> [ I have been waiting for more than a week for a netns developer
>> to review this patch, I guess I'm too optimistic these days. :-( ]
>>
>> The only reason you think __exit_refok is "bogus" is because it's
>> semantics got changed by Sam Ravnborg in commit
>> 312b1485fb509c9bc32eda28ad29537896658cb8 ("Introduce new section
>> reference annotations tags: __ref, __refdata, __refconst")
>>
>> Beforehand the __exit_refok was a real .exit section, so it got
>> completely discarded AT LINK TIME. Now it sits together with
>> __init_refok which is an unremovable kernel image section, which
>> neither gets removed at compile time nor boot time.
>
> Some misunderstanding is going on here.
>
> The *ref* annotation is used to teach modpost that this function (or data)
> may reference functions (or data) which is annotated __init*.
> And the *ref* annotation never caused the annotated code to be discarded.
>
> This was true before the above mentioned patch - and it is still true.
>
> Before the path ("Introduce new section reference ....") the __exit_refok
> annotation moved functions to the section named ".exit.text.refok"
> which was explicit part of .text (TEXT_TEXT in vmlinux).
>
> So __exit_refok does exactly what it is intended to do:
> It puts the function in a section so modpost does not warn about
> references to __init or __exit sections.
>
> As Jan points out there is only a single user left - so
> this would be a good time to kill it. It is even documented
> in init.h that this is a backward compatibility define.
Strange.
>
> The intention with Jan's patch is to move functions annotated
> __net_exit to a discardable section in the core kernel.
> Then at least __exit should be used - there is no logic
> using __init for exit code.
>
> I suggest to:
> 1) fix the patch to use __exit
> 2) fix up the bogus commit message
Those two sound reasonable to me.
The purpose of __net_exit is to mark code that can be __exit if we don't
enable network namespace support.
Looking at the original code it appears that __exit was wrong because
we had __init sections referring to the __exit code and that was
causing modpost to complain.
Now that the definition of __exit_refok has changed half a dozen times
since it was introduced I don't know what will happen.
Since this really isn't about network namespaces but what to do when
the network namespace code is disabled I'm going to bow out now.
> Then it should be OK - iff the assumption hold that the functions
> can be discarded in the core kernel.
> I have grepped a little and saw no uses where this did not hold true.
> So based on this I assume the assumption is OK.
Eric
^ permalink raw reply
* [PATCH wireless-next 3/3] ath6kl: Add __printf verification to ath6kl_printk
From: Joe Perches @ 2012-03-19 0:30 UTC (permalink / raw)
To: Kalle Valo; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1332116921.git.joe@perches.com>
Make sure printf formats and arguments match.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/ath/ath6kl/common.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/common.h b/drivers/net/wireless/ath/ath6kl/common.h
index a60e78c..71f5450 100644
--- a/drivers/net/wireless/ath/ath6kl/common.h
+++ b/drivers/net/wireless/ath/ath6kl/common.h
@@ -22,7 +22,8 @@
#define ATH6KL_MAX_IE 256
-extern int ath6kl_printk(const char *level, const char *fmt, ...);
+extern __printf(2, 3)
+int ath6kl_printk(const char *level, const char *fmt, ...);
/*
* Reflects the version of binary interface exposed by ATH6KL target
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related
* [PATCH wireless-next 2/3] ath5k: Introduce _ath5k_printk to reduce code/text
From: Joe Perches @ 2012-03-19 0:30 UTC (permalink / raw)
To: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, Bob Copeland
Cc: John W. Linville, linux-wireless, ath5k-devel, netdev,
linux-kernel
In-Reply-To: <cover.1332116921.git.joe@perches.com>
Macros can be converted to functions to reduce overall object size.
Convert the ATH5K_PRINTK macro to use _ath5k_printk.
Allyesconfig size is reduced ~10%
$ size drivers/net/wireless/ath/ath5k/built-in.o*
text data bss dec hex filename
211557 2032 40672 254261 3e135 drivers/net/wireless/ath/ath5k/built-in.o.new
235412 2032 47296 284740 45844 drivers/net/wireless/ath/ath5k/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/ath/ath5k/ath5k.h | 9 +++++----
drivers/net/wireless/ath/ath5k/base.c | 20 ++++++++++++++++++++
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 954c373..55ef93d 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -79,11 +79,12 @@
#define ATH5K_PRINTF(fmt, ...) \
pr_warn("%s: " fmt, __func__, ##__VA_ARGS__)
+void __printf(3, 4)
+_ath5k_printk(const struct ath5k_hw *ah, const char *level,
+ const char *fmt, ...);
+
#define ATH5K_PRINTK(_sc, _level, _fmt, ...) \
- printk(_level pr_fmt("%s%s" _fmt), \
- ((_sc) && (_sc)->hw) ? wiphy_name((_sc)->hw->wiphy) : "", \
- ((_sc) && (_sc)->hw) ? ": " : "", \
- ##__VA_ARGS__)
+ _ath5k_printk(_sc, _level, _fmt, ##__VA_ARGS__)
#define ATH5K_PRINTK_LIMIT(_sc, _level, _fmt, ...) \
do { \
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a9c0503..3007bba 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -3040,3 +3040,23 @@ ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable)
ath5k_hw_set_rx_filter(ah, rfilt);
ah->filter_flags = rfilt;
}
+
+void _ath5k_printk(const struct ath5k_hw *ah, const char *level,
+ const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ if (ah && ah->hw)
+ printk("%s" pr_fmt("%s: %pV"),
+ level, wiphy_name(ah->hw->wiphy), &vaf);
+ else
+ printk("%s" pr_fmt("%pV"), level, &vaf);
+
+ va_end(args);
+}
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related
* [PATCH wireless-next 1/3] ath: Add and use pr_fmt, convert printks to pr_<level>
From: Joe Perches @ 2012-03-19 0:30 UTC (permalink / raw)
To: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, Bob Copeland,
Kalle Valo, Jouni Malinen, Vasanthakumar Thiagarajan,
Senthil Balasubramanian
Cc: John W. Linville, linux-wireless, ath5k-devel, netdev,
linux-kernel, ath9k-devel
In-Reply-To: <cover.1332116921.git.joe@perches.com>
Use a more current logging style.
Make sure all output is prefixed appropriately.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/ath/ath5k/ani.c | 44 +++++++++++--------------
drivers/net/wireless/ath/ath5k/ath5k.h | 32 +++++++++--------
drivers/net/wireless/ath/ath5k/attach.c | 2 +
drivers/net/wireless/ath/ath5k/base.c | 2 +
drivers/net/wireless/ath/ath5k/debug.c | 17 ++++++----
drivers/net/wireless/ath/ath5k/desc.c | 2 +
drivers/net/wireless/ath/ath5k/dma.c | 2 +
drivers/net/wireless/ath/ath5k/eeprom.c | 2 +
drivers/net/wireless/ath/ath5k/initvals.c | 5 ++-
drivers/net/wireless/ath/ath5k/led.c | 2 +
drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +
drivers/net/wireless/ath/ath5k/pci.c | 4 ++-
drivers/net/wireless/ath/ath5k/phy.c | 2 +
drivers/net/wireless/ath/ath5k/qcu.c | 2 +
drivers/net/wireless/ath/ath5k/reset.c | 2 +
drivers/net/wireless/ath/ath5k/sysfs.c | 2 +
drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 +
drivers/net/wireless/ath/ath6kl/init.c | 2 +
drivers/net/wireless/ath/ath6kl/main.c | 2 +
drivers/net/wireless/ath/ath6kl/txrx.c | 2 +
drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 ++--
drivers/net/wireless/ath/ath9k/htc_hst.c | 7 ++--
drivers/net/wireless/ath/ath9k/init.c | 13 +++----
drivers/net/wireless/ath/ath9k/pci.c | 9 +++--
drivers/net/wireless/ath/main.c | 4 ++-
drivers/net/wireless/ath/regd.c | 4 ++-
26 files changed, 107 insertions(+), 70 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/ani.c b/drivers/net/wireless/ath/ath5k/ani.c
index bf67416..6841f5c 100644
--- a/drivers/net/wireless/ath/ath5k/ani.c
+++ b/drivers/net/wireless/ath/ath5k/ani.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "ath5k.h"
#include "reg.h"
#include "debug.h"
@@ -728,33 +730,25 @@ void
ath5k_ani_print_counters(struct ath5k_hw *ah)
{
/* clears too */
- printk(KERN_NOTICE "ACK fail\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_ACK_FAIL));
- printk(KERN_NOTICE "RTS fail\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_RTS_FAIL));
- printk(KERN_NOTICE "RTS success\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_RTS_OK));
- printk(KERN_NOTICE "FCS error\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_FCS_FAIL));
+ pr_notice("ACK fail\t%d\n", ath5k_hw_reg_read(ah, AR5K_ACK_FAIL));
+ pr_notice("RTS fail\t%d\n", ath5k_hw_reg_read(ah, AR5K_RTS_FAIL));
+ pr_notice("RTS success\t%d\n", ath5k_hw_reg_read(ah, AR5K_RTS_OK));
+ pr_notice("FCS error\t%d\n", ath5k_hw_reg_read(ah, AR5K_FCS_FAIL));
/* no clear */
- printk(KERN_NOTICE "tx\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_PROFCNT_TX));
- printk(KERN_NOTICE "rx\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_PROFCNT_RX));
- printk(KERN_NOTICE "busy\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_PROFCNT_RXCLR));
- printk(KERN_NOTICE "cycles\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_PROFCNT_CYCLE));
-
- printk(KERN_NOTICE "AR5K_PHYERR_CNT1\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_PHYERR_CNT1));
- printk(KERN_NOTICE "AR5K_PHYERR_CNT2\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_PHYERR_CNT2));
- printk(KERN_NOTICE "AR5K_OFDM_FIL_CNT\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_OFDM_FIL_CNT));
- printk(KERN_NOTICE "AR5K_CCK_FIL_CNT\t%d\n",
- ath5k_hw_reg_read(ah, AR5K_CCK_FIL_CNT));
+ pr_notice("tx\t%d\n", ath5k_hw_reg_read(ah, AR5K_PROFCNT_TX));
+ pr_notice("rx\t%d\n", ath5k_hw_reg_read(ah, AR5K_PROFCNT_RX));
+ pr_notice("busy\t%d\n", ath5k_hw_reg_read(ah, AR5K_PROFCNT_RXCLR));
+ pr_notice("cycles\t%d\n", ath5k_hw_reg_read(ah, AR5K_PROFCNT_CYCLE));
+
+ pr_notice("AR5K_PHYERR_CNT1\t%d\n",
+ ath5k_hw_reg_read(ah, AR5K_PHYERR_CNT1));
+ pr_notice("AR5K_PHYERR_CNT2\t%d\n",
+ ath5k_hw_reg_read(ah, AR5K_PHYERR_CNT2));
+ pr_notice("AR5K_OFDM_FIL_CNT\t%d\n",
+ ath5k_hw_reg_read(ah, AR5K_OFDM_FIL_CNT));
+ pr_notice("AR5K_CCK_FIL_CNT\t%d\n",
+ ath5k_hw_reg_read(ah, AR5K_CCK_FIL_CNT));
}
#endif
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 8d434b8..954c373 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -76,26 +76,28 @@
GENERIC DRIVER DEFINITIONS
\****************************/
-#define ATH5K_PRINTF(fmt, ...) \
- printk(KERN_WARNING "%s: " fmt, __func__, ##__VA_ARGS__)
-
-#define ATH5K_PRINTK(_sc, _level, _fmt, ...) \
- printk(_level "ath5k %s: " _fmt, \
- ((_sc) && (_sc)->hw) ? wiphy_name((_sc)->hw->wiphy) : "", \
- ##__VA_ARGS__)
-
-#define ATH5K_PRINTK_LIMIT(_sc, _level, _fmt, ...) do { \
- if (net_ratelimit()) \
- ATH5K_PRINTK(_sc, _level, _fmt, ##__VA_ARGS__); \
- } while (0)
+#define ATH5K_PRINTF(fmt, ...) \
+ pr_warn("%s: " fmt, __func__, ##__VA_ARGS__)
+
+#define ATH5K_PRINTK(_sc, _level, _fmt, ...) \
+ printk(_level pr_fmt("%s%s" _fmt), \
+ ((_sc) && (_sc)->hw) ? wiphy_name((_sc)->hw->wiphy) : "", \
+ ((_sc) && (_sc)->hw) ? ": " : "", \
+ ##__VA_ARGS__)
+
+#define ATH5K_PRINTK_LIMIT(_sc, _level, _fmt, ...) \
+do { \
+ if (net_ratelimit()) \
+ ATH5K_PRINTK(_sc, _level, _fmt, ##__VA_ARGS__); \
+} while (0)
-#define ATH5K_INFO(_sc, _fmt, ...) \
+#define ATH5K_INFO(_sc, _fmt, ...) \
ATH5K_PRINTK(_sc, KERN_INFO, _fmt, ##__VA_ARGS__)
-#define ATH5K_WARN(_sc, _fmt, ...) \
+#define ATH5K_WARN(_sc, _fmt, ...) \
ATH5K_PRINTK_LIMIT(_sc, KERN_WARNING, _fmt, ##__VA_ARGS__)
-#define ATH5K_ERR(_sc, _fmt, ...) \
+#define ATH5K_ERR(_sc, _fmt, ...) \
ATH5K_PRINTK_LIMIT(_sc, KERN_ERR, _fmt, ##__VA_ARGS__)
/*
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
index d7114c7..7106547 100644
--- a/drivers/net/wireless/ath/ath5k/attach.c
+++ b/drivers/net/wireless/ath/ath5k/attach.c
@@ -20,6 +20,8 @@
* Attach/Detach Functions and helpers *
\*************************************/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/pci.h>
#include <linux/slab.h>
#include "ath5k.h"
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 0e643b0..a9c0503 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -40,6 +40,8 @@
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 8c5ce8b..9be8857 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -57,6 +57,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGES.
*/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/export.h>
#include <linux/moduleparam.h>
@@ -254,10 +257,10 @@ static ssize_t write_file_beacon(struct file *file,
if (strncmp(buf, "disable", 7) == 0) {
AR5K_REG_DISABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE);
- printk(KERN_INFO "debugfs disable beacons\n");
+ pr_info("debugfs disable beacons\n");
} else if (strncmp(buf, "enable", 6) == 0) {
AR5K_REG_ENABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE);
- printk(KERN_INFO "debugfs enable beacons\n");
+ pr_info("debugfs enable beacons\n");
}
return count;
}
@@ -457,19 +460,19 @@ static ssize_t write_file_antenna(struct file *file,
if (strncmp(buf, "diversity", 9) == 0) {
ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
- printk(KERN_INFO "ath5k debug: enable diversity\n");
+ pr_info("debug: enable diversity\n");
} else if (strncmp(buf, "fixed-a", 7) == 0) {
ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_A);
- printk(KERN_INFO "ath5k debugfs: fixed antenna A\n");
+ pr_info("debug: fixed antenna A\n");
} else if (strncmp(buf, "fixed-b", 7) == 0) {
ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_B);
- printk(KERN_INFO "ath5k debug: fixed antenna B\n");
+ pr_info("debug: fixed antenna B\n");
} else if (strncmp(buf, "clear", 5) == 0) {
for (i = 0; i < ARRAY_SIZE(ah->stats.antenna_rx); i++) {
ah->stats.antenna_rx[i] = 0;
ah->stats.antenna_tx[i] = 0;
}
- printk(KERN_INFO "ath5k debug: cleared antenna stats\n");
+ pr_info("debug: cleared antenna stats\n");
}
return count;
}
@@ -639,7 +642,7 @@ static ssize_t write_file_frameerrors(struct file *file,
st->txerr_fifo = 0;
st->txerr_filt = 0;
st->tx_all_count = 0;
- printk(KERN_INFO "ath5k debug: cleared frameerrors stats\n");
+ pr_info("debug: cleared frameerrors stats\n");
}
return count;
}
diff --git a/drivers/net/wireless/ath/ath5k/desc.c b/drivers/net/wireless/ath/ath5k/desc.c
index f8bfa3a..77a6077 100644
--- a/drivers/net/wireless/ath/ath5k/desc.c
+++ b/drivers/net/wireless/ath/ath5k/desc.c
@@ -21,6 +21,8 @@
Hardware Descriptor Functions
\******************************/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "ath5k.h"
#include "reg.h"
#include "debug.h"
diff --git a/drivers/net/wireless/ath/ath5k/dma.c b/drivers/net/wireless/ath/ath5k/dma.c
index 5cc9aa8..ce86f15 100644
--- a/drivers/net/wireless/ath/ath5k/dma.c
+++ b/drivers/net/wireless/ath/ath5k/dma.c
@@ -29,6 +29,8 @@
* status registers (ISR).
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "ath5k.h"
#include "reg.h"
#include "debug.h"
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
index cd708c1..4026c90 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -21,6 +21,8 @@
* EEPROM access functions and helpers *
\*************************************/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/slab.h>
#include "ath5k.h"
diff --git a/drivers/net/wireless/ath/ath5k/initvals.c b/drivers/net/wireless/ath/ath5k/initvals.c
index a1ea78e..ee1c2fa 100644
--- a/drivers/net/wireless/ath/ath5k/initvals.c
+++ b/drivers/net/wireless/ath/ath5k/initvals.c
@@ -19,6 +19,8 @@
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "ath5k.h"
#include "reg.h"
#include "debug.h"
@@ -1574,8 +1576,7 @@ ath5k_hw_write_initvals(struct ath5k_hw *ah, u8 mode, bool skip_pcu)
/* AR5K_MODE_11B */
if (mode > 2) {
- ATH5K_ERR(ah,
- "unsupported channel mode: %d\n", mode);
+ ATH5K_ERR(ah, "unsupported channel mode: %d\n", mode);
return -EINVAL;
}
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c
index c1151c7..b9f708a 100644
--- a/drivers/net/wireless/ath/ath5k/led.c
+++ b/drivers/net/wireless/ath/ath5k/led.c
@@ -39,6 +39,8 @@
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/pci.h>
#include "ath5k.h"
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 5c53299..22b80af 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -41,6 +41,8 @@
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <net/mac80211.h>
#include <asm/unaligned.h>
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index 849fa06..53424e8 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/nl80211.h>
#include <linux/pci.h>
#include <linux/pci-aspm.h>
@@ -347,7 +349,7 @@ init_ath5k_pci(void)
ret = pci_register_driver(&ath5k_pci_driver);
if (ret) {
- printk(KERN_ERR "ath5k_pci: can't register pci driver\n");
+ pr_err("pci: can't register pci driver\n");
return ret;
}
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 3a28454..8b71a2d 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -22,6 +22,8 @@
* PHY related functions *
\***********************/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/delay.h>
#include <linux/slab.h>
#include <asm/unaligned.h>
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c
index 30b50f9..a6de200 100644
--- a/drivers/net/wireless/ath/ath5k/qcu.c
+++ b/drivers/net/wireless/ath/ath5k/qcu.c
@@ -20,6 +20,8 @@
Queue Control Unit, DCF Control Unit Functions
\********************************************/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "ath5k.h"
#include "reg.h"
#include "debug.h"
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
index 200f165..0c2dd47 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -23,6 +23,8 @@
Reset function and helpers
\****************************/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <asm/unaligned.h>
#include <linux/pci.h> /* To determine if a card is pci-e */
diff --git a/drivers/net/wireless/ath/ath5k/sysfs.c b/drivers/net/wireless/ath/ath5k/sysfs.c
index 9364da7..04cf0ca 100644
--- a/drivers/net/wireless/ath/ath5k/sysfs.c
+++ b/drivers/net/wireless/ath/ath5k/sysfs.c
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/device.h>
#include <linux/pci.h>
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 00d3895..bdcc68f 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -15,6 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/moduleparam.h>
#include <linux/inetdevice.h>
#include <linux/export.h>
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 03cae14..eb7cc2f 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -16,6 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/moduleparam.h>
#include <linux/errno.h>
#include <linux/export.h>
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 229e192..07071fc 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -15,6 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "core.h"
#include "hif-ops.h"
#include "cfg80211.h"
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index f85353f..521f0be 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -15,6 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "core.h"
#include "debug.h"
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index de5ee15..a2e939a 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "htc.h"
MODULE_AUTHOR("Atheros Communications");
@@ -966,9 +968,7 @@ int ath9k_htc_resume(struct htc_target *htc_handle)
static int __init ath9k_htc_init(void)
{
if (ath9k_hif_usb_init() < 0) {
- printk(KERN_ERR
- "ath9k_htc: No USB devices found,"
- " driver not installed.\n");
+ pr_err("No USB devices found, driver not installed\n");
return -ENODEV;
}
@@ -979,6 +979,6 @@ module_init(ath9k_htc_init);
static void __exit ath9k_htc_exit(void)
{
ath9k_hif_usb_exit();
- printk(KERN_INFO "ath9k_htc: Driver unloaded\n");
+ pr_info("Driver unloaded\n");
}
module_exit(ath9k_htc_exit);
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 1b90ed8..8a8a88a 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "htc.h"
static int htc_issue_send(struct htc_target *target, struct sk_buff* skb,
@@ -432,8 +434,7 @@ struct htc_target *ath9k_htc_hw_alloc(void *hif_handle,
target = kzalloc(sizeof(struct htc_target), GFP_KERNEL);
if (!target) {
- printk(KERN_ERR "Unable to allocate memory for"
- "target device\n");
+ pr_err("Unable to allocate memory for target device\n");
return NULL;
}
@@ -464,7 +465,7 @@ int ath9k_htc_hw_init(struct htc_target *target,
char *product, u32 drv_info)
{
if (ath9k_htc_probe_device(target, dev, devid, product, drv_info)) {
- printk(KERN_ERR "Failed to initialize the device\n");
+ pr_err("Failed to initialize the device\n");
return -ENODEV;
}
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 60159f4..ce8b523 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/ath9k_platform.h>
@@ -866,17 +868,14 @@ static int __init ath9k_init(void)
/* Register rate control algorithm */
error = ath_rate_control_register();
if (error != 0) {
- printk(KERN_ERR
- "ath9k: Unable to register rate control "
- "algorithm: %d\n",
- error);
+ pr_err("Unable to register rate control algorithm: %d\n",
+ error);
goto err_out;
}
error = ath_pci_init();
if (error < 0) {
- printk(KERN_ERR
- "ath9k: No PCI devices found, driver not installed.\n");
+ pr_err("No PCI devices found, driver not installed\n");
error = -ENODEV;
goto err_rate_unregister;
}
@@ -905,6 +904,6 @@ static void __exit ath9k_exit(void)
ath_ahb_exit();
ath_pci_exit();
ath_rate_control_unregister();
- printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
+ pr_info("%s: Driver unloaded\n", dev_info);
}
module_exit(ath9k_exit);
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 77dc327..a856b51 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/nl80211.h>
#include <linux/pci.h>
#include <linux/pci-aspm.h>
@@ -171,14 +173,13 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (ret) {
- printk(KERN_ERR "ath9k: 32-bit DMA not available\n");
+ pr_err("32-bit DMA not available\n");
goto err_dma;
}
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (ret) {
- printk(KERN_ERR "ath9k: 32-bit DMA consistent "
- "DMA enable failed\n");
+ pr_err("32-bit DMA consistent DMA enable failed\n");
goto err_dma;
}
@@ -224,7 +225,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
mem = pci_iomap(pdev, 0, 0);
if (!mem) {
- printk(KERN_ERR "PCI memory map error\n") ;
+ pr_err("PCI memory map error\n") ;
ret = -EIO;
goto err_iomap;
}
diff --git a/drivers/net/wireless/ath/main.c b/drivers/net/wireless/ath/main.c
index ea2c737..8e99540 100644
--- a/drivers/net/wireless/ath/main.c
+++ b/drivers/net/wireless/ath/main.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
@@ -49,7 +51,7 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
if (off != 0)
skb_reserve(skb, common->cachelsz - off);
} else {
- printk(KERN_ERR "skbuff alloc of size %u failed\n", len);
+ pr_err("skbuff alloc of size %u failed\n", len);
return NULL;
}
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 10dea37..d816980 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/export.h>
#include <net/cfg80211.h>
@@ -562,7 +564,7 @@ static int __ath_regd_init(struct ath_regulatory *reg)
printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
if (!ath_regd_is_eeprom_valid(reg)) {
- printk(KERN_ERR "ath: Invalid EEPROM contents\n");
+ pr_err("Invalid EEPROM contents\n");
return -EINVAL;
}
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related
* [PATCH wireless-next 0/3] ath: printk cleanups and code reduction
From: Joe Perches @ 2012-03-19 0:30 UTC (permalink / raw)
To: linux-wireless, ath5k-devel, ath9k-devel; +Cc: netdev, linux-kernel
Joe Perches (3):
ath: Add and use pr_fmt, convert printks to pr_<level>
ath5k: Introduce _ath5k_printk to reduce code/text
ath6kl: Add __printf verification to ath6kl_printk
drivers/net/wireless/ath/ath5k/ani.c | 44 +++++++++++--------------
drivers/net/wireless/ath/ath5k/ath5k.h | 29 +++++++++-------
drivers/net/wireless/ath/ath5k/attach.c | 2 +
drivers/net/wireless/ath/ath5k/base.c | 22 ++++++++++++
drivers/net/wireless/ath/ath5k/debug.c | 17 ++++++----
drivers/net/wireless/ath/ath5k/desc.c | 2 +
drivers/net/wireless/ath/ath5k/dma.c | 2 +
drivers/net/wireless/ath/ath5k/eeprom.c | 2 +
drivers/net/wireless/ath/ath5k/initvals.c | 5 ++-
drivers/net/wireless/ath/ath5k/led.c | 2 +
drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +
drivers/net/wireless/ath/ath5k/pci.c | 4 ++-
drivers/net/wireless/ath/ath5k/phy.c | 2 +
drivers/net/wireless/ath/ath5k/qcu.c | 2 +
drivers/net/wireless/ath/ath5k/reset.c | 2 +
drivers/net/wireless/ath/ath5k/sysfs.c | 2 +
drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 +
drivers/net/wireless/ath/ath6kl/common.h | 3 +-
drivers/net/wireless/ath/ath6kl/init.c | 2 +
drivers/net/wireless/ath/ath6kl/main.c | 2 +
drivers/net/wireless/ath/ath6kl/txrx.c | 2 +
drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 ++--
drivers/net/wireless/ath/ath9k/htc_hst.c | 7 ++--
drivers/net/wireless/ath/ath9k/init.c | 13 +++----
drivers/net/wireless/ath/ath9k/pci.c | 9 +++--
drivers/net/wireless/ath/main.c | 4 ++-
drivers/net/wireless/ath/regd.c | 4 ++-
27 files changed, 128 insertions(+), 69 deletions(-)
--
1.7.8.111.gad25c.dirty
^ permalink raw reply
* Re: netfilter: Hung task
From: Pablo Neira Ayuso @ 2012-03-19 0:28 UTC (permalink / raw)
To: Sasha Levin
Cc: kaber, davem, Dave Jones, netfilter-devel,
linux-kernel@vger.kernel.org List, netdev, Christoph Lameter
In-Reply-To: <CA+1xoqcQYqCgQb=1M5PVkm=6SBhV2oJxJ2CtBp=gAvZM36Kc2Q@mail.gmail.com>
On Sun, Mar 18, 2012 at 10:52:55PM +0200, Sasha Levin wrote:
> On Sun, Mar 18, 2012 at 4:19 PM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Sun, Mar 18, 2012 at 12:55:13PM +0200, Sasha Levin wrote:
> >> Hi all,
> >>
> >> I got the following spew after fuzzing using trinity on a KVM tools
> >> guest, using the latest linux-next.
> >>
> >> It reminds me a lot of https://lkml.org/lkml/2012/3/14/375 and
> >> https://lkml.org/lkml/2012/1/14/45
> >
> > You mention neither Linux kernel version nor the way you trigger this.
> >
> > With that little information it's really hard to really know.
>
> Hum? I've mentioned it happened with "the latest linux-next" (which is
> currently two days old), and using the trinity fuzzer - which means
> that I don't have a specific method to reproduce the problem.
Sorry, I should not read my email diagonally, really.
Looking at the trace, I'd point to some problem in the slub memory
allocator. Please, correct me if I'm wrong.
Christoph?
^ permalink raw reply
* Re: [PATCH net-next 4/4] gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
From: Eric Dumazet @ 2012-03-18 23:53 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: davem, therbert, netdev, linuxppc-dev
In-Reply-To: <CAP=VYLpzpbLVAJ6=L1jdoZWcyAWPPKGMFTKBVU=7=HR+qTxwwA@mail.gmail.com>
Le dimanche 18 mars 2012 à 19:24 -0400, Paul Gortmaker a écrit :
> On Sun, Mar 18, 2012 at 5:55 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > On Sun, 2012-03-18 at 17:39 -0400, Paul Gortmaker wrote:
> >> The __netif_subqueue_stopped() just does the following:
> >>
> >> struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
> >> return netif_tx_queue_stopped(txq);
> >>
> >> and since we already have the txq in scope, we can just call that
> >> directly in this case.
> >>
> >> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> >> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> >> ---
> >> drivers/net/ethernet/freescale/gianfar.c | 2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
> >> index 6e66cc3..d9428f0 100644
> >> --- a/drivers/net/ethernet/freescale/gianfar.c
> >> +++ b/drivers/net/ethernet/freescale/gianfar.c
> >> @@ -2565,7 +2565,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
> >> }
> >>
> >> /* If we freed a buffer, we can restart transmission, if necessary */
> >> - if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
> >> + if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree)
> >> netif_wake_subqueue(dev, tqi);
> >>
> >> /* Update dirty indicators */
> >
> > Please change netif_wake_subqueue() as well ;)
>
> I looked at this earlier when I added patch #4 but I was concerned about
> the different semantics.
>
> The netif_wake_subqueue() just returns on a netpoll_trap but the other
> netif_tx_wake_queue() actually calls netif_tx_start_queue() for the same
> netpoll_trap instance. Maybe that is OK, but I didn't want to be changing
> the behaviour of subtleties in stuff where I am clearly still learning.
>
I see... commit 7b3d3e4fc68 added a small difference here...
^ permalink raw reply
* Re: [PATCH net-next 4/4] gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
From: Paul Gortmaker @ 2012-03-18 23:24 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, therbert, netdev, linuxppc-dev
In-Reply-To: <1332107741.9397.27.camel@edumazet-glaptop>
On Sun, Mar 18, 2012 at 5:55 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Sun, 2012-03-18 at 17:39 -0400, Paul Gortmaker wrote:
>> The __netif_subqueue_stopped() just does the following:
>>
>> struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
>> return netif_tx_queue_stopped(txq);
>>
>> and since we already have the txq in scope, we can just call that
>> directly in this case.
>>
>> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> ---
>> drivers/net/ethernet/freescale/gianfar.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
>> index 6e66cc3..d9428f0 100644
>> --- a/drivers/net/ethernet/freescale/gianfar.c
>> +++ b/drivers/net/ethernet/freescale/gianfar.c
>> @@ -2565,7 +2565,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
>> }
>>
>> /* If we freed a buffer, we can restart transmission, if necessary */
>> - if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
>> + if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree)
>> netif_wake_subqueue(dev, tqi);
>>
>> /* Update dirty indicators */
>
> Please change netif_wake_subqueue() as well ;)
I looked at this earlier when I added patch #4 but I was concerned about
the different semantics.
The netif_wake_subqueue() just returns on a netpoll_trap but the other
netif_tx_wake_queue() actually calls netif_tx_start_queue() for the same
netpoll_trap instance. Maybe that is OK, but I didn't want to be changing
the behaviour of subtleties in stuff where I am clearly still learning.
Thanks,
Paul.
>
> --
> 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
* Exploding businesses?
From: John Lavenia @ 2012-03-18 18:42 UTC (permalink / raw)
To: netdev
Hi {!firstname_fix},
In the F.R.E.E video series I sent
out yesterday, I've laid out for you
a plan for you to personally benefit
(HUGELY) using online video.
http://www.boldstatementmarketing.com/profitwithvideo/?setuser=1199
I've literally revealed the step-by-step
plan people are using to dominate the
web and attract floods of paying customers.
If you are currently a business owner,
you can use these strategies and tools to
literally swipe customers away from the
competition and create a huge increase
in your customer base and pro.fits.
I'm watching realtors, brokers,
finance professionals (it's tax season -
just in time!), network marketers and
more follow the plan I've laid out for
you to attract more of the customers
they want and their businesses are
exploding.
Making more with what you do simply
boils down to getting your message across
and getting in front of people.
See exactly how to do it
http://www.boldstatementmarketing.com/profitwithvideo/?setuser=1199
But, if you're someone who isn't a
business owner, you can pro.fit from
these same strategies starting immediately.
The bottom line is that you can make a difference
(a HUGE difference) in your own bottom line this year
as well as that of others...
Just Watch:
http://www.boldstatementmarketing.com/profitwithvideo/?setuser=1199
To your success,
John Lavenia
PS: I've included $1,000 in f.r.e.e gifts for you
including our team making your first video for
you...I apologize in advance but I'm going to
have to shut the f.r.e.e. bonusus down sooner
than expected, maybe in the next day or two because
of how much response we've gotten.
There's only so many f.r.e.e. videos my team is
able to make.
Don't miss out.
http://www.boldstatementmarketing.com/profitwithvideo/?setuser=1199
^ permalink raw reply
* Re: [PATCH net-next 4/4] gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
From: Eric Dumazet @ 2012-03-18 21:55 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: davem, therbert, netdev, linuxppc-dev
In-Reply-To: <1332106761-18293-5-git-send-email-paul.gortmaker@windriver.com>
On Sun, 2012-03-18 at 17:39 -0400, Paul Gortmaker wrote:
> The __netif_subqueue_stopped() just does the following:
>
> struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
> return netif_tx_queue_stopped(txq);
>
> and since we already have the txq in scope, we can just call that
> directly in this case.
>
> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> drivers/net/ethernet/freescale/gianfar.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
> index 6e66cc3..d9428f0 100644
> --- a/drivers/net/ethernet/freescale/gianfar.c
> +++ b/drivers/net/ethernet/freescale/gianfar.c
> @@ -2565,7 +2565,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
> }
>
> /* If we freed a buffer, we can restart transmission, if necessary */
> - if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
> + if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree)
> netif_wake_subqueue(dev, tqi);
>
> /* Update dirty indicators */
Please change netif_wake_subqueue() as well ;)
^ permalink raw reply
* [PATCH net-next 3/4] gianfar: delete orphaned version strings and dead macros
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332106761-18293-1-git-send-email-paul.gortmaker@windriver.com>
There were two version strings, and neither one was being used.
Also in the same proximity were some unused #define that were
left over from the past. Delete them all.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar.c | 3 ---
drivers/net/ethernet/freescale/gianfar.h | 3 ---
2 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index a4c934b..6e66cc3 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -104,10 +104,7 @@
#include "fsl_pq_mdio.h"
#define TX_TIMEOUT (1*HZ)
-#undef BRIEF_GFAR_ERRORS
-#undef VERBOSE_GFAR_ERRORS
-const char gfar_driver_name[] = "Gianfar Ethernet";
const char gfar_driver_version[] = "1.3";
static int gfar_enet_open(struct net_device *dev);
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 4fe0f34..fc2488a 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -78,11 +78,8 @@ struct ethtool_rx_list {
#define INCREMENTAL_BUFFER_SIZE 512
#define PHY_INIT_TIMEOUT 100000
-#define GFAR_PHY_CHANGE_TIME 2
-#define DEVICE_NAME "%s: Gianfar Ethernet Controller Version 1.2, "
#define DRV_NAME "gfar-enet"
-extern const char gfar_driver_name[];
extern const char gfar_driver_version[];
/* MAXIMUM NUMBER OF QUEUES SUPPORTED */
--
1.7.9.1
^ permalink raw reply related
* [PATCH net-next 4/4] gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332106761-18293-1-git-send-email-paul.gortmaker@windriver.com>
The __netif_subqueue_stopped() just does the following:
struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
return netif_tx_queue_stopped(txq);
and since we already have the txq in scope, we can just call that
directly in this case.
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 6e66cc3..d9428f0 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2565,7 +2565,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
}
/* If we freed a buffer, we can restart transmission, if necessary */
- if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
+ if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree)
netif_wake_subqueue(dev, tqi);
/* Update dirty indicators */
--
1.7.9.1
^ permalink raw reply related
* [PATCH net-next 1/4] gianfar: Add support for byte queue limits.
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332106761-18293-1-git-send-email-paul.gortmaker@windriver.com>
Add support for byte queue limits (BQL), based on the similar
modifications made to intel/igb/igb_main.c from Eric Dumazet
in commit bdbc063129e811264cd6c311d8c2d9b95de01231
"igb: Add support for byte queue limits."
A local variable for tx_queue->qindex was introduced in
gfar_clean_tx_ring, since it is now used often enough to warrant it,
and it cleans up the readability somewhat as well.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index adb0ae4..a4c934b 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -1755,9 +1755,12 @@ static void free_skb_resources(struct gfar_private *priv)
/* Go through all the buffer descriptors and free their data buffers */
for (i = 0; i < priv->num_tx_queues; i++) {
+ struct netdev_queue *txq;
tx_queue = priv->tx_queue[i];
+ txq = netdev_get_tx_queue(tx_queue->dev, tx_queue->qindex);
if(tx_queue->tx_skbuff)
free_skb_tx_queue(tx_queue);
+ netdev_tx_reset_queue(txq);
}
for (i = 0; i < priv->num_rx_queues; i++) {
@@ -2217,6 +2220,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
lstatus |= BD_LFLAG(TXBD_CRC | TXBD_READY) | skb_headlen(skb);
}
+ netdev_tx_sent_queue(txq, skb->len);
+
/*
* We can work in parallel with gfar_clean_tx_ring(), except
* when modifying num_txbdfree. Note that we didn't grab the lock
@@ -2460,6 +2465,7 @@ static void gfar_align_skb(struct sk_buff *skb)
static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
{
struct net_device *dev = tx_queue->dev;
+ struct netdev_queue *txq;
struct gfar_private *priv = netdev_priv(dev);
struct gfar_priv_rx_q *rx_queue = NULL;
struct txbd8 *bdp, *next = NULL;
@@ -2471,10 +2477,13 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
int frags = 0, nr_txbds = 0;
int i;
int howmany = 0;
+ int tqi = tx_queue->qindex;
+ unsigned int bytes_sent = 0;
u32 lstatus;
size_t buflen;
- rx_queue = priv->rx_queue[tx_queue->qindex];
+ rx_queue = priv->rx_queue[tqi];
+ txq = netdev_get_tx_queue(dev, tqi);
bdp = tx_queue->dirty_tx;
skb_dirtytx = tx_queue->skb_dirtytx;
@@ -2533,6 +2542,8 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
bdp = next_txbd(bdp, base, tx_ring_size);
}
+ bytes_sent += skb->len;
+
/*
* If there's room in the queue (limit it to rx_buffer_size)
* we add this skb back into the pool, if it's the right size
@@ -2557,13 +2568,15 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
}
/* If we freed a buffer, we can restart transmission, if necessary */
- if (__netif_subqueue_stopped(dev, tx_queue->qindex) && tx_queue->num_txbdfree)
- netif_wake_subqueue(dev, tx_queue->qindex);
+ if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
+ netif_wake_subqueue(dev, tqi);
/* Update dirty indicators */
tx_queue->skb_dirtytx = skb_dirtytx;
tx_queue->dirty_tx = bdp;
+ netdev_tx_completed_queue(txq, howmany, bytes_sent);
+
return howmany;
}
--
1.7.9.1
^ permalink raw reply related
* [PATCH v2 net-next 0/4] Gianfar byte queue limits
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332089787-24086-1-git-send-email-paul.gortmaker@windriver.com>
Identical to v1 but with the additional patch suggested by Eric.
Compile tested. The v1 text follows below the pull request.
Sorry for the near back-to-back sends; I would have liked to have
got this out earlier in the week and not so close to net-next
closing, but that just didn't happen...
Thanks,
Paul
---
The following changes since commit cdf485be3a63d1f34293740fb726088c6840ceea:
ixgbe: dcb: use DCB config values for FCoE traffic class on open (2012-03-14 00:49:10 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git gianfar-bql
for you to fetch changes up to 5407b14c6792d6ff122ecb1a2a6acffad60ef389:
gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped (2012-03-18 17:11:22 -0400)
----------------------------------------------------------------
Paul Gortmaker (4):
gianfar: Add support for byte queue limits.
gianfar: constify giant block of status descriptor strings
gianfar: delete orphaned version strings and dead macros
gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
drivers/net/ethernet/freescale/gianfar.c | 22 ++++++++++++++++------
drivers/net/ethernet/freescale/gianfar.h | 3 ---
drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 +-
3 files changed, 17 insertions(+), 10 deletions(-)
> The BQL support here is unchanged from what I posted earlier as an
> RFC[1] -- with the exception of the fact that I'm now happier with
> the runtime testing vs. the simple "hey it boots" that I'd done
> for the RFC. Plus I added a couple trivial cleanup patches.
>
> For testing, I made a couple spiders homeless by reviving an ancient
> 10baseT hub. I connected an sbc8349 into that, and connected the
> yellowing hub into a GigE 16port, which was also connected to the
> recipient x86 box.
>
> Gianfar saw the interface as follows:
>
> fsl-gianfar e0024000.ethernet: eth0: mac: 00:a0:1e:a0:26:5a
> fsl-gianfar e0024000.ethernet: eth0: Running with NAPI enabled
> fsl-gianfar e0024000.ethernet: eth0: RX BD ring size for Q[0]: 256
> fsl-gianfar e0024000.ethernet: eth0: TX BD ring size for Q[0]: 256
> PHY: mdio@e0024520:19 - Link is Up - 10/Half
>
> With the sbc8349 being diskless, I simply used an scp of /proc/kcore
> to the connected x86 box as a rudimentary Tx heavy workload.
>
> BQL data was collected by changing into the dir:
>
> /sys/devices/e0000000.soc8349/e0024000.ethernet/net/eth0/queues/tx-0/byte_queue_limits
>
> and running the following:
>
> for i in * ; do echo -n $i": " ; cat $i ; done
>
> Running with the defaults, data like below was typical:
>
> hold_time: 1000
> inflight: 4542
> limit: 3456
> limit_max: 1879048192
> limit_min: 0
>
> hold_time: 1000
> inflight: 4542
> limit: 3378
> limit_max: 1879048192
> limit_min: 0
>
> i.e. 2 or 3 MTU sized packets in flight and the limit value lying
> somewhere between those two values.
>
> The interesting thing is that the interactive speed reported by scp
> seemed somewhat erratic, ranging from ~450 to ~700kB/s. (This was
> the only traffic on the old junk - perhaps expected oscillations such
> as those seen in isolated ARED tests?) Average speed for 100M was:
>
> 104857600 bytes (105 MB) copied, 172.616 s, 607 kB/s
>
> Anyway, back to BQL testing; setting the values as follows:
>
> hold_time: 1000
> inflight: 1514
> limit: 1400
> limit_max: 1400
> limit_min: 1000
>
> had the effect of serializing the interface to a single packet, and
> the crusty old hub seemed much happier with this arrangement, keeping
> a constant speed and achieving the following on a 100MB Tx block:
>
> 104857600 bytes (105 MB) copied, 112.52 s, 932 kB/s
>
> It might be interesting to know more about why the defaults suffer
> the slowdown, but the hub could possibly be ancient spec violating
> trash. Definitely something that nobody would ever use for anything
> today. (aside from contrived tests like this)
>
> But it did give me an example of where I could see the effects of
> changing the BQL settings, and I'm reasonably confident they are
> working as expected.
>
> Paul.
> ---
>
> [1] http://lists.openwall.net/netdev/2012/01/06/64
>
> Paul Gortmaker (3):
> gianfar: Add support for byte queue limits.
> gianfar: constify giant block of status descriptor strings
> gianfar: delete orphaned version strings and dead macros
>
> drivers/net/ethernet/freescale/gianfar.c | 22 ++++++++++++++++------
> drivers/net/ethernet/freescale/gianfar.h | 3 ---
> drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 +-
> 3 files changed, 17 insertions(+), 10 deletions(-)
>
--
1.7.9.1
^ permalink raw reply
* [PATCH net-next 2/4] gianfar: constify giant block of status descriptor strings
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332106761-18293-1-git-send-email-paul.gortmaker@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 5a78d55..8d74efd 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -58,7 +58,7 @@ static void gfar_gringparam(struct net_device *dev, struct ethtool_ringparam *rv
static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rvals);
static void gfar_gdrvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo);
-static char stat_gstrings[][ETH_GSTRING_LEN] = {
+static const char stat_gstrings[][ETH_GSTRING_LEN] = {
"rx-dropped-by-kernel",
"rx-large-frame-errors",
"rx-short-frame-errors",
--
1.7.9.1
^ permalink raw reply related
* Re: Kernel Panic with bonding + IPoIB on 3.2.9
From: Joseph Glanville @ 2012-03-18 21:20 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <CAOzFzEi=UOnwiV+qVks7+RnYU3PFbaQ+3OaEE3YFG2HHuD5ydQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 19 March 2012 07:21, Joseph Glanville
<joseph.glanville-2MxvZkOi9dvvnOemgxGiVw@public.gmane.org> wrote:
> On 19 March 2012 06:41, Joseph Glanville
> <joseph.glanville-2MxvZkOi9dvvnOemgxGiVw@public.gmane.org> wrote:
>> Hi guys,
>>
>> I am getting an annoying kernel panic on 3.2.9 that seems to be
>> related to bonding (as I can't reproduce the crash without it)
>> I believe it might be related to LRO/GRO but there isnt a param to
>> disable it anymore that I could see in /ulp/ipoib/
>> Let me know if there is anything further I can do to help debug.
>>
>> Useful information:
>>
>> Hardware:
>> Dell C2100 - Intel Xeon dual socket with 144GB RAM
>> Mellanox Connect-X DDR using in kernel mlx4 driver
>> Machine is also a Xen dom0
>>
>> ibstatCA 'mlx4_0'
>> CA type: MT26418
>> Number of ports: 2
>> Firmware version: 2.9.1000
>> Hardware version: a0
>> Node GUID: 0x0002c9030008d7be
>> System image GUID: 0x0002c9030008d7c1
>> Port 1:
>> State: Active
>> Physical state: LinkUp
>> Rate: 20
>> Base lid: 6
>> LMC: 0
>> SM lid: 1
>> Capability mask: 0x02590868
>> Port GUID: 0x0002c9030008d7bf
>> Link layer: InfiniBand
>> Port 2:
>> State: Active
>> Physical state: LinkUp
>> Rate: 20
>> Base lid: 9
>> LMC: 0
>> SM lid: 1
>> Capability mask: 0x02590868
>> Port GUID: 0x0002c9030008d7c0
>> Link layer: InfiniBand
>>
>>
>> ip link show
>> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
>> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>> 2: ib0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 65220 qdisc
>> pfifo_fast master bond0 state UP qlen 256
>> link/infiniband
>> 80:00:00:48:fe:80:00:00:00:00:00:00:00:02:c9:03:00:08:d7:bf brd
>> 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
>> 3: ib1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 65220 qdisc
>> pfifo_fast master bond0 state UP qlen 256
>> link/infiniband
>> 80:00:00:49:fe:80:00:00:00:00:00:00:00:02:c9:03:00:08:d7:c0 brd
>> 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
>> 4: gre0: <NOARP> mtu 1476 qdisc noop state DOWN
>> link/gre 0.0.0.0 brd 0.0.0.0
>> 5: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
>> link/sit 0.0.0.0 brd 0.0.0.0
>> 6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 65220 qdisc
>> noqueue state UP
>> link/infiniband
>> 80:00:00:48:fe:80:00:00:00:00:00:00:00:02:c9:03:00:08:d7:bf brd
>> 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:f
>>
>> The KP itself:
>> [ 422.046837] ------------[ cut here ]------------
>> [ 422.047024] kernel BUG at net/core/dev.c:1896!
>> [ 422.047126] invalid opcode: 0000 [#1] SMP
>> [ 422.047289] CPU 1
>> [ 422.047328] Modules linked in: ib_srpt(O) scst_vdisk(O) scst(O)
>> bonding raid1 raid0 md_mod dm_multipath
>> [ 422.047869]
>> [ 422.047962] Pid: 3352, comm: sshd Tainted: G O
>> 3.2.1-orion #4 Dell PowerEdge C2100 /0P19C9
>> [ 422.048237] RIP: e030:[<ffffffff81559b92>] [<ffffffff81559b92>]
>> skb_checksum_help+0x142/0x150
>> [ 422.048450] RSP: e02b:ffff88006cb11758 EFLAGS: 00010282
>> [ 422.048556] RAX: 0000000000000108 RBX: ffff880072f7f4e8 RCX: 0000000060004420
>> [ 422.048668] RDX: 0000000000000108 RSI: 0000000000000000 RDI: ffff880072f7f4e8
>> [ 422.048780] RBP: ffff88006cb11778 R08: ffff88000e53529c R09: 0000000000000104
>> [ 422.048892] R10: ffffffff8151a7d0 R11: 0000000000000000 R12: 00000000ffff0018
>> [ 422.049005] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
>> [ 422.049119] FS: 00007fea22aa8700(0000) GS:ffff8800bf435000(0000)
>> knlGS:0000000000000000
>> [ 422.049288] CS: e033 DS: 0000 ES: 0000 CR0: 000000008005003b
>> [ 422.049395] CR2: 00007fff14d07ed8 CR3: 00000000085dc000 CR4: 0000000000002660
>> [ 422.049506] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>> [ 422.049618] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
>> [ 422.049742] Process sshd (pid: 3352, threadinfo ffff88006cb10000,
>> task ffff88000cea4920)
>> [ 422.049909] Stack:
>> [ 422.050002] ffff880072f7f4e8 ffff88000ce64000 0000000000000000
>> 0000000000000000
>> [ 422.050290] ffff88006cb117e8 ffffffff8155f15e ffff88006cb11858
>> ffffffff8187ba80
>> [ 422.050580] ffff88000ce5bc80 0000000000000000 0000000000000006
>> 0000000000000000
>> [ 422.050869] Call Trace:
>> [ 422.050967] [<ffffffff8155f15e>] dev_hard_start_xmit+0x36e/0x6c0
>> [ 422.051084] [<ffffffff8157a19b>] sch_direct_xmit+0xdb/0x1e0
>> [ 422.051191] [<ffffffff8155f638>] dev_queue_xmit+0x188/0x620
>> [ 422.051301] [<ffffffffa003b297>] bond_dev_queue_xmit+0x27/0x70 [bonding]
>> [ 422.051413] [<ffffffffa003b5e4>] bond_start_xmit+0x304/0x4e0 [bonding]
>> [ 422.051524] [<ffffffff8155f099>] dev_hard_start_xmit+0x2a9/0x6c0
>> [ 422.051633] [<ffffffff8155f895>] dev_queue_xmit+0x3e5/0x620
>> [ 422.051742] [<ffffffff81567cbd>] neigh_connected_output+0xbd/0xf0
>> [ 422.051853] [<ffffffff815a7120>] ? ip_fragment+0x850/0x850
>> [ 422.051960] [<ffffffff815a72ae>] ip_finish_output+0x18e/0x300
>> [ 422.052068] [<ffffffff815a7dd8>] ip_output+0x98/0xa0
>> [ 422.052172] [<ffffffff815a74be>] ? __ip_local_out+0x9e/0xa0
>> [ 422.052279] [<ffffffff815a74e4>] ip_local_out+0x24/0x30
>> [ 422.052385] [<ffffffff815a764a>] ip_queue_xmit+0x15a/0x400
>> [ 422.052510] [<ffffffff815bdade>] tcp_transmit_skb+0x3de/0x8f0
>> [ 422.052617] [<ffffffff815be702>] tcp_write_xmit+0x1d2/0x9c0
>> [ 422.052725] [<ffffffff81129057>] ? ksize+0x17/0xc0
>> [ 422.052829] [<ffffffff815bef41>] __tcp_push_pending_frames+0x21/0x90
>> [ 422.052939] [<ffffffff815b09ae>] tcp_sendmsg+0x75e/0xd80
>> [ 422.053047] [<ffffffff815d4c0f>] inet_sendmsg+0x5f/0xb0
>> [ 422.053155] [<ffffffff81009f3f>] ? xen_restore_fl_direct_reloc+0x4/0x4
>> [ 422.053267] [<ffffffff8126734e>] ? selinux_socket_sendmsg+0x1e/0x20
>> [ 422.053377] [<ffffffff8154732a>] sock_aio_write+0x15a/0x170
>> [ 422.053486] [<ffffffff812652d1>] ? inode_has_perm.clone.15+0x21/0x30
>> [ 422.053597] [<ffffffff8113133a>] do_sync_write+0xda/0x120
>> [ 422.053704] [<ffffffff81268003>] ? selinux_file_permission+0xb3/0x140
>> [ 422.053821] [<ffffffff812e8efa>] ? put_ldisc+0x5a/0xc0
>> [ 422.053937] [<ffffffff81262237>] ? security_file_permission+0x27/0xb0
>> [ 422.054048] [<ffffffff81131ca9>] vfs_write+0x169/0x180
>> [ 422.054153] [<ffffffff81131f1c>] sys_write+0x4c/0x90
>> [ 422.054260] [<ffffffff816891d2>] system_call_fastpath+0x16/0x1b
>> [ 422.054367] Code: 65 86 ff ff 85 c0 0f 84 75 ff ff ff eb a6 41 29
>> d4 48 8b 83 d8 00 00 00 0f b7 53 72 45 8d 64 04 02 41 39 d4 77 cd e9
>> 5d ff ff ff <0f> 0b 0f 0b 66 2e 0f 1f 84 00 00 00 00 00 55 b8 ea ff ff
>> ff 48
>> [ 422.056691] RIP [<ffffffff81559b92>] skb_checksum_help+0x142/0x150
>> [ 422.056831] RSP <ffff88006cb11758>
>> [ 422.056930] ---[ end trace 751906f8ee2b0c91 ]---
>> [ 422.057032] Kernel panic - not syncing: Fatal exception in interrupt
>> [ 422.057141] Pid: 3352, comm: sshd Tainted: G D O 3.2.1-orion #4
>> [ 422.057250] Call Trace:
>> [ 422.057348] [<ffffffff8167e944>] panic+0x8c/0x1a0
>> [ 422.057451] [<ffffffff816825fa>] oops_end+0xea/0xf0
>> [ 422.057557] [<ffffffff81016636>] die+0x56/0x90
>> [ 422.057660] [<ffffffff81681f64>] do_trap+0xc4/0x170
>> [ 422.057764] [<ffffffff81013e50>] do_invalid_op+0x90/0xb0
>> [ 422.057870] [<ffffffff81559b92>] ? skb_checksum_help+0x142/0x150
>> [ 422.057989] [<ffffffff8168b1ab>] invalid_op+0x1b/0x20
>> [ 422.058101] [<ffffffff8151a7d0>] ? ipoib_setup+0x330/0x330
>> [ 422.058207] [<ffffffff81559b92>] ? skb_checksum_help+0x142/0x150
>> [ 422.058316] [<ffffffff8155f15e>] dev_hard_start_xmit+0x36e/0x6c0
>> [ 422.058425] [<ffffffff8157a19b>] sch_direct_xmit+0xdb/0x1e0
>> [ 422.058533] [<ffffffff8155f638>] dev_queue_xmit+0x188/0x620
>> [ 422.058641] [<ffffffffa003b297>] bond_dev_queue_xmit+0x27/0x70 [bonding]
>> [ 422.058753] [<ffffffffa003b5e4>] bond_start_xmit+0x304/0x4e0 [bonding]
>> [ 422.058864] [<ffffffff8155f099>] dev_hard_start_xmit+0x2a9/0x6c0
>> [ 422.058973] [<ffffffff8155f895>] dev_queue_xmit+0x3e5/0x620
>> [ 422.059080] [<ffffffff81567cbd>] neigh_connected_output+0xbd/0xf0
>> [ 422.059190] [<ffffffff815a7120>] ? ip_fragment+0x850/0x850
>> [ 422.059296] [<ffffffff815a72ae>] ip_finish_output+0x18e/0x300
>> [ 422.059412] [<ffffffff815a7dd8>] ip_output+0x98/0xa0
>> [ 422.059517] [<ffffffff815a74be>] ? __ip_local_out+0x9e/0xa0
>> [ 422.059624] [<ffffffff815a74e4>] ip_local_out+0x24/0x30
>> [ 422.059730] [<ffffffff815a764a>] ip_queue_xmit+0x15a/0x400
>> [ 422.059836] [<ffffffff815bdade>] tcp_transmit_skb+0x3de/0x8f0
>> [ 422.059944] [<ffffffff815be702>] tcp_write_xmit+0x1d2/0x9c0
>>
>> --
>> Founder | Director | VP Research
>> Orion Virtualisation Solutions | www.orionvm.com.au | Phone: 1300 56
>> 99 52 | Mobile: 0428 754 846
>
> CC'ing netdev as that is probably the most appropriate now that I
> think about it.
>
> --
> Founder | Director | VP Research
> Orion Virtualisation Solutions | www.orionvm.com.au | Phone: 1300 56
> 99 52 | Mobile: 0428 754 846
I have narrowed it down to mtu, MTU up to 50k seems to work just fine,
but max MTU of 65520 basically instantly KPs the machine.
Time to dig into bonding.c I guess, if any of the bonding devs could
shed any light on this that would be awesome.
Joseph.
--
Founder | Director | VP Research
Orion Virtualisation Solutions | www.orionvm.com.au | Phone: 1300 56
99 52 | Mobile: 0428 754 846
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH v2 net-next 2/2] tcp: reduce out_of_order memory use
From: Eric Dumazet @ 2012-03-18 21:07 UTC (permalink / raw)
To: Neal Cardwell
Cc: David Miller, netdev, Tom Herbert, Ilpo Järvinen,
H.K. Jerry Chu, Yuchung Cheng
In-Reply-To: <CADVnQy=_Adr9xTd=7aUFT6m38YQ8V-V7KQc9c6L4nej-dfvekQ@mail.gmail.com>
With increasing receive window sizes, but speed of light not improved
that much, out of order queue can contain a huge number of skbs, waiting
to be moved to receive_queue when missing packets can fill the holes.
Some devices happen to use fat skbs (truesize of 4096 + sizeof(struct
sk_buff)) to store regular (MTU <= 1500) frames. This makes highly
probable sk_rmem_alloc hits sk_rcvbuf limit, which can be 4Mbytes in
many cases.
When limit is hit, tcp stack calls tcp_collapse_ofo_queue(), a true
latency killer and cpu cache blower.
Doing the coalescing attempt each time we add a frame in ofo queue
permits to keep memory use tight and in many cases avoid the
tcp_collapse() thing later.
Tested on various wireless setups (b43, ath9k, ...) known to use big skb
truesize, this patch removed the "packets collapsed in receive queue due
to low socket buffer" I had before.
This also reduced average memory used by tcp sockets.
With help from Neal Cardwell.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: H.K. Jerry Chu <hkchu@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
V2: rebase after tcp_data_queue_ofo() introduction.
include/linux/snmp.h | 1 +
net/ipv4/proc.c | 1 +
net/ipv4/tcp_input.c | 19 ++++++++++++++++++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 8ee8af4..2e68f5b 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -233,6 +233,7 @@ enum
LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */
+ LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */
__LINUX_MIB_MAX
};
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 02d6107..8af0d44 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -257,6 +257,7 @@ static const struct snmp_mib snmp4_net_list[] = {
SNMP_MIB_ITEM("TCPReqQFullDoCookies", LINUX_MIB_TCPREQQFULLDOCOOKIES),
SNMP_MIB_ITEM("TCPReqQFullDrop", LINUX_MIB_TCPREQQFULLDROP),
SNMP_MIB_ITEM("TCPRetransFail", LINUX_MIB_TCPRETRANSFAIL),
+ SNMP_MIB_ITEM("TCPRcvCoalesce", LINUX_MIB_TCPRCVCOALESCE),
SNMP_MIB_SENTINEL
};
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index fa7de12..e886e2f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4484,7 +4484,24 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
end_seq = TCP_SKB_CB(skb)->end_seq;
if (seq == TCP_SKB_CB(skb1)->end_seq) {
- __skb_queue_after(&tp->out_of_order_queue, skb1, skb);
+ /* Packets in ofo can stay in queue a long time.
+ * Better try to coalesce them right now
+ * to avoid future tcp_collapse_ofo_queue(),
+ * probably the most expensive function in tcp stack.
+ */
+ if (skb->len <= skb_tailroom(skb1) && !tcp_hdr(skb)->fin) {
+ NET_INC_STATS_BH(sock_net(sk),
+ LINUX_MIB_TCPRCVCOALESCE);
+ BUG_ON(skb_copy_bits(skb, 0,
+ skb_put(skb1, skb->len),
+ skb->len));
+ TCP_SKB_CB(skb1)->end_seq = end_seq;
+ TCP_SKB_CB(skb1)->ack_seq = TCP_SKB_CB(skb)->ack_seq;
+ __kfree_skb(skb);
+ skb = NULL;
+ } else {
+ __skb_queue_after(&tp->out_of_order_queue, skb1, skb);
+ }
if (!tp->rx_opt.num_sacks ||
tp->selective_acks[0].end_seq != seq)
^ permalink raw reply related
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