Netdev List
 help / color / mirror / Atom feed
* [PATCH 11/12] sock.h: Remove extern from function prototypes
From: Joe Perches @ 2013-09-22 17:32 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, linux-kernel
In-Reply-To: <b692aba58032f629907ea2d462c99b87906645ca.1379870986.git.joe@perches.com>

There are a mix of function prototypes with and without extern
in the kernel sources.  Standardize on not using extern for
function prototypes.

Function prototypes don't need to be written with extern.
extern is assumed by the compiler.  Its use is as unnecessary as
using auto to declare automatic/local variables in a block.

Signed-off-by: Joe Perches <joe@perches.com>
---
 include/net/sock.h | 223 ++++++++++++++++++++++++-----------------------------
 1 file changed, 99 insertions(+), 124 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 6ba2e7b..4625d2e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -746,7 +746,7 @@ static inline int sk_stream_wspace(const struct sock *sk)
 	return sk->sk_sndbuf - sk->sk_wmem_queued;
 }
 
-extern void sk_stream_write_space(struct sock *sk);
+void sk_stream_write_space(struct sock *sk);
 
 /* OOB backlog add */
 static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
@@ -788,7 +788,7 @@ static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *s
 	return 0;
 }
 
-extern int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb);
+int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb);
 
 static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
 {
@@ -853,15 +853,15 @@ static inline void sock_rps_reset_rxhash(struct sock *sk)
 		__rc;							\
 	})
 
-extern int sk_stream_wait_connect(struct sock *sk, long *timeo_p);
-extern int sk_stream_wait_memory(struct sock *sk, long *timeo_p);
-extern void sk_stream_wait_close(struct sock *sk, long timeo_p);
-extern int sk_stream_error(struct sock *sk, int flags, int err);
-extern void sk_stream_kill_queues(struct sock *sk);
-extern void sk_set_memalloc(struct sock *sk);
-extern void sk_clear_memalloc(struct sock *sk);
+int sk_stream_wait_connect(struct sock *sk, long *timeo_p);
+int sk_stream_wait_memory(struct sock *sk, long *timeo_p);
+void sk_stream_wait_close(struct sock *sk, long timeo_p);
+int sk_stream_error(struct sock *sk, int flags, int err);
+void sk_stream_kill_queues(struct sock *sk);
+void sk_set_memalloc(struct sock *sk);
+void sk_clear_memalloc(struct sock *sk);
 
-extern int sk_wait_data(struct sock *sk, long *timeo);
+int sk_wait_data(struct sock *sk, long *timeo);
 
 struct request_sock_ops;
 struct timewait_sock_ops;
@@ -1031,8 +1031,8 @@ struct cg_proto {
 	struct mem_cgroup	*memcg;
 };
 
-extern int proto_register(struct proto *prot, int alloc_slab);
-extern void proto_unregister(struct proto *prot);
+int proto_register(struct proto *prot, int alloc_slab);
+void proto_unregister(struct proto *prot);
 
 static inline bool memcg_proto_active(struct cg_proto *cg_proto)
 {
@@ -1287,8 +1287,8 @@ proto_memory_pressure(struct proto *prot)
 
 #ifdef CONFIG_PROC_FS
 /* Called with local bh disabled */
-extern void sock_prot_inuse_add(struct net *net, struct proto *prot, int inc);
-extern int sock_prot_inuse_get(struct net *net, struct proto *proto);
+void sock_prot_inuse_add(struct net *net, struct proto *prot, int inc);
+int sock_prot_inuse_get(struct net *net, struct proto *proto);
 #else
 static inline void sock_prot_inuse_add(struct net *net, struct proto *prot,
 		int inc)
@@ -1364,8 +1364,8 @@ static inline struct inode *SOCK_INODE(struct socket *socket)
 /*
  * Functions for memory accounting
  */
-extern int __sk_mem_schedule(struct sock *sk, int size, int kind);
-extern void __sk_mem_reclaim(struct sock *sk);
+int __sk_mem_schedule(struct sock *sk, int size, int kind);
+void __sk_mem_reclaim(struct sock *sk);
 
 #define SK_MEM_QUANTUM ((int)PAGE_SIZE)
 #define SK_MEM_QUANTUM_SHIFT ilog2(SK_MEM_QUANTUM)
@@ -1473,14 +1473,14 @@ do {									\
 	lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0);	\
 } while (0)
 
-extern void lock_sock_nested(struct sock *sk, int subclass);
+void lock_sock_nested(struct sock *sk, int subclass);
 
 static inline void lock_sock(struct sock *sk)
 {
 	lock_sock_nested(sk, 0);
 }
 
-extern void release_sock(struct sock *sk);
+void release_sock(struct sock *sk);
 
 /* BH context may only use the following locking interface. */
 #define bh_lock_sock(__sk)	spin_lock(&((__sk)->sk_lock.slock))
@@ -1489,7 +1489,7 @@ extern void release_sock(struct sock *sk);
 				SINGLE_DEPTH_NESTING)
 #define bh_unlock_sock(__sk)	spin_unlock(&((__sk)->sk_lock.slock))
 
-extern bool lock_sock_fast(struct sock *sk);
+bool lock_sock_fast(struct sock *sk);
 /**
  * unlock_sock_fast - complement of lock_sock_fast
  * @sk: socket
@@ -1507,108 +1507,84 @@ static inline void unlock_sock_fast(struct sock *sk, bool slow)
 }
 
 
-extern struct sock		*sk_alloc(struct net *net, int family,
-					  gfp_t priority,
-					  struct proto *prot);
-extern void			sk_free(struct sock *sk);
-extern void			sk_release_kernel(struct sock *sk);
-extern struct sock		*sk_clone_lock(const struct sock *sk,
-					       const gfp_t priority);
-
-extern struct sk_buff		*sock_wmalloc(struct sock *sk,
-					      unsigned long size, int force,
-					      gfp_t priority);
-extern struct sk_buff		*sock_rmalloc(struct sock *sk,
-					      unsigned long size, int force,
-					      gfp_t priority);
-extern void			sock_wfree(struct sk_buff *skb);
-extern void			skb_orphan_partial(struct sk_buff *skb);
-extern void			sock_rfree(struct sk_buff *skb);
-extern void			sock_edemux(struct sk_buff *skb);
-
-extern int			sock_setsockopt(struct socket *sock, int level,
-						int op, char __user *optval,
-						unsigned int optlen);
-
-extern int			sock_getsockopt(struct socket *sock, int level,
-						int op, char __user *optval,
-						int __user *optlen);
-extern struct sk_buff		*sock_alloc_send_skb(struct sock *sk,
-						     unsigned long size,
-						     int noblock,
-						     int *errcode);
-extern struct sk_buff		*sock_alloc_send_pskb(struct sock *sk,
-						      unsigned long header_len,
-						      unsigned long data_len,
-						      int noblock,
-						      int *errcode,
-						      int max_page_order);
-extern void *sock_kmalloc(struct sock *sk, int size,
-			  gfp_t priority);
-extern void sock_kfree_s(struct sock *sk, void *mem, int size);
-extern void sk_send_sigurg(struct sock *sk);
+struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
+		      struct proto *prot);
+void sk_free(struct sock *sk);
+void sk_release_kernel(struct sock *sk);
+struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority);
+
+struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
+			     gfp_t priority);
+struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force,
+			     gfp_t priority);
+void sock_wfree(struct sk_buff *skb);
+void skb_orphan_partial(struct sk_buff *skb);
+void sock_rfree(struct sk_buff *skb);
+void sock_edemux(struct sk_buff *skb);
+
+int sock_setsockopt(struct socket *sock, int level, int op,
+		    char __user *optval, unsigned int optlen);
+
+int sock_getsockopt(struct socket *sock, int level, int op,
+		    char __user *optval, int __user *optlen);
+struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size,
+				    int noblock, int *errcode);
+struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len,
+				     unsigned long data_len, int noblock,
+				     int *errcode, int max_page_order);
+void *sock_kmalloc(struct sock *sk, int size, gfp_t priority);
+void sock_kfree_s(struct sock *sk, void *mem, int size);
+void sk_send_sigurg(struct sock *sk);
 
 /*
  * Functions to fill in entries in struct proto_ops when a protocol
  * does not implement a particular function.
  */
-extern int                      sock_no_bind(struct socket *,
-					     struct sockaddr *, int);
-extern int                      sock_no_connect(struct socket *,
-						struct sockaddr *, int, int);
-extern int                      sock_no_socketpair(struct socket *,
-						   struct socket *);
-extern int                      sock_no_accept(struct socket *,
-					       struct socket *, int);
-extern int                      sock_no_getname(struct socket *,
-						struct sockaddr *, int *, int);
-extern unsigned int             sock_no_poll(struct file *, struct socket *,
-					     struct poll_table_struct *);
-extern int                      sock_no_ioctl(struct socket *, unsigned int,
-					      unsigned long);
-extern int			sock_no_listen(struct socket *, int);
-extern int                      sock_no_shutdown(struct socket *, int);
-extern int			sock_no_getsockopt(struct socket *, int , int,
-						   char __user *, int __user *);
-extern int			sock_no_setsockopt(struct socket *, int, int,
-						   char __user *, unsigned int);
-extern int                      sock_no_sendmsg(struct kiocb *, struct socket *,
-						struct msghdr *, size_t);
-extern int                      sock_no_recvmsg(struct kiocb *, struct socket *,
-						struct msghdr *, size_t, int);
-extern int			sock_no_mmap(struct file *file,
-					     struct socket *sock,
-					     struct vm_area_struct *vma);
-extern ssize_t			sock_no_sendpage(struct socket *sock,
-						struct page *page,
-						int offset, size_t size,
-						int flags);
+int sock_no_bind(struct socket *, struct sockaddr *, int);
+int sock_no_connect(struct socket *, struct sockaddr *, int, int);
+int sock_no_socketpair(struct socket *, struct socket *);
+int sock_no_accept(struct socket *, struct socket *, int);
+int sock_no_getname(struct socket *, struct sockaddr *, int *, int);
+unsigned int sock_no_poll(struct file *, struct socket *,
+			  struct poll_table_struct *);
+int sock_no_ioctl(struct socket *, unsigned int, unsigned long);
+int sock_no_listen(struct socket *, int);
+int sock_no_shutdown(struct socket *, int);
+int sock_no_getsockopt(struct socket *, int , int, char __user *, int __user *);
+int sock_no_setsockopt(struct socket *, int, int, char __user *, unsigned int);
+int sock_no_sendmsg(struct kiocb *, struct socket *, struct msghdr *, size_t);
+int sock_no_recvmsg(struct kiocb *, struct socket *, struct msghdr *, size_t,
+		    int);
+int sock_no_mmap(struct file *file, struct socket *sock,
+		 struct vm_area_struct *vma);
+ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset,
+			 size_t size, int flags);
 
 /*
  * Functions to fill in entries in struct proto_ops when a protocol
  * uses the inet style.
  */
-extern int sock_common_getsockopt(struct socket *sock, int level, int optname,
+int sock_common_getsockopt(struct socket *sock, int level, int optname,
 				  char __user *optval, int __user *optlen);
-extern int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock,
+int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock,
 			       struct msghdr *msg, size_t size, int flags);
-extern int sock_common_setsockopt(struct socket *sock, int level, int optname,
+int sock_common_setsockopt(struct socket *sock, int level, int optname,
 				  char __user *optval, unsigned int optlen);
-extern int compat_sock_common_getsockopt(struct socket *sock, int level,
+int compat_sock_common_getsockopt(struct socket *sock, int level,
 		int optname, char __user *optval, int __user *optlen);
-extern int compat_sock_common_setsockopt(struct socket *sock, int level,
+int compat_sock_common_setsockopt(struct socket *sock, int level,
 		int optname, char __user *optval, unsigned int optlen);
 
-extern void sk_common_release(struct sock *sk);
+void sk_common_release(struct sock *sk);
 
 /*
  *	Default socket callbacks and setup code
  */
 
 /* Initialise core socket variables */
-extern void sock_init_data(struct socket *sock, struct sock *sk);
+void sock_init_data(struct socket *sock, struct sock *sk);
 
-extern void sk_filter_release_rcu(struct rcu_head *rcu);
+void sk_filter_release_rcu(struct rcu_head *rcu);
 
 /**
  *	sk_filter_release - release a socket filter
@@ -1669,8 +1645,7 @@ static inline void sock_put(struct sock *sk)
 		sk_free(sk);
 }
 
-extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb,
-			  const int nested);
+int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested);
 
 static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)
 {
@@ -1724,8 +1699,8 @@ static inline void sock_graft(struct sock *sk, struct socket *parent)
 	write_unlock_bh(&sk->sk_callback_lock);
 }
 
-extern kuid_t sock_i_uid(struct sock *sk);
-extern unsigned long sock_i_ino(struct sock *sk);
+kuid_t sock_i_uid(struct sock *sk);
+unsigned long sock_i_ino(struct sock *sk);
 
 static inline struct dst_entry *
 __sk_dst_get(struct sock *sk)
@@ -1747,7 +1722,7 @@ sk_dst_get(struct sock *sk)
 	return dst;
 }
 
-extern void sk_reset_txq(struct sock *sk);
+void sk_reset_txq(struct sock *sk);
 
 static inline void dst_negative_advice(struct sock *sk)
 {
@@ -1800,16 +1775,16 @@ sk_dst_reset(struct sock *sk)
 	spin_unlock(&sk->sk_dst_lock);
 }
 
-extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
+struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
 
-extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
+struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
 
 static inline bool sk_can_gso(const struct sock *sk)
 {
 	return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type);
 }
 
-extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst);
+void sk_setup_caps(struct sock *sk, struct dst_entry *dst);
 
 static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags)
 {
@@ -2022,14 +1997,14 @@ static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
 	sk_mem_charge(sk, skb->truesize);
 }
 
-extern void sk_reset_timer(struct sock *sk, struct timer_list *timer,
-			   unsigned long expires);
+void sk_reset_timer(struct sock *sk, struct timer_list *timer,
+		    unsigned long expires);
 
-extern void sk_stop_timer(struct sock *sk, struct timer_list *timer);
+void sk_stop_timer(struct sock *sk, struct timer_list *timer);
 
-extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
+int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
 
-extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb);
+int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb);
 
 /*
  *	Recover an error report and clear atomically
@@ -2097,7 +2072,7 @@ static inline struct page_frag *sk_page_frag(struct sock *sk)
 	return &sk->sk_frag;
 }
 
-extern bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag);
+bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag);
 
 /*
  *	Default write policy as shown to user space via poll/select/SIGIO
@@ -2135,10 +2110,10 @@ static inline int sock_intr_errno(long timeo)
 	return timeo == MAX_SCHEDULE_TIMEOUT ? -ERESTARTSYS : -EINTR;
 }
 
-extern void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
-	struct sk_buff *skb);
-extern void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
-	struct sk_buff *skb);
+void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
+			   struct sk_buff *skb);
+void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
+			     struct sk_buff *skb);
 
 static inline void
 sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
@@ -2171,8 +2146,8 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
 		__sock_recv_wifi_status(msg, sk, skb);
 }
 
-extern void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
-				     struct sk_buff *skb);
+void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
+			      struct sk_buff *skb);
 
 static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
 					  struct sk_buff *skb)
@@ -2197,7 +2172,7 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
  *
  * Currently only depends on SOCK_TIMESTAMPING* flags.
  */
-extern void sock_tx_timestamp(struct sock *sk, __u8 *tx_flags);
+void sock_tx_timestamp(struct sock *sk, __u8 *tx_flags);
 
 /**
  * sk_eat_skb - Release a skb if it is no longer needed
@@ -2261,11 +2236,11 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb)
 	return NULL;
 }
 
-extern void sock_enable_timestamp(struct sock *sk, int flag);
-extern int sock_get_timestamp(struct sock *, struct timeval __user *);
-extern int sock_get_timestampns(struct sock *, struct timespec __user *);
-extern int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
-			      int level, int type);
+void sock_enable_timestamp(struct sock *sk, int flag);
+int sock_get_timestamp(struct sock *, struct timeval __user *);
+int sock_get_timestampns(struct sock *, struct timespec __user *);
+int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, int level,
+		       int type);
 
 /*
  *	Enable debug/info messages
-- 
1.8.1.2.459.gbcd45b4.dirty

^ permalink raw reply related

* Re: Bug - regression - Via velocity interface coming up freezes kernel
From: Julia Lawall @ 2013-09-22 17:37 UTC (permalink / raw)
  To: Dirk Kraft; +Cc: netdev
In-Reply-To: <CAFES+i+OYq_dDtEqAqkW7qYDrtdzkqc9hBGBDODQuqgvFJE7zg@mail.gmail.com>

On Sun, 22 Sep 2013, Dirk Kraft wrote:

> Hi,
>
> I observe problems with my machine freezing when bringing up the
> network interface (via velocity based). Detailed report below.
>
> First message was rejected because of html. Julia Lawall, sorry about
> sending multiple copies.
>
> [1.] One line summary of the problem:
> Via_velocity interface coming up freezes kernel - WARNING: CPU: 0 PID:
> 1529 at /build/buildd/linux-3.11.0/kernel/softirq.c:159
> local_bh_enable+0x60/0x90()
>
> [2.] Full description of the problem/report:
> Bringing up the network interface (using ifup) serviced by the
> via_velocity driver the machine freezes once an ip address is assigned
> via dhcp. No further interaction, neither via the just brought up
> interface nor the serial console, is possible. A git bisect shows that
> this behaviour was introduced with
> 2fdac010bdcf10a30711b6924612dfc40daf19b8.
> During some of the freezes a kernel warning is printed to syslog. I
> was unable to see this with 3.12.0-rc1. I was able to observe this
> with v3.11-rc6 and different ubuntu kernels. The warning looks like:
> WARNING: CPU: 0 PID: 1529 at
> /build/buildd/linux-3.11.0/kernel/softirq.c:159
> local_bh_enable+0x60/0x90(). Detailed message under point 10.
> The second network interface on the board (using the via_rhine driver)
> does not show this behaviour. The board in question is a via epia
> sn18000g.

I guess that the problem is the use of netif_receive_skb instead of
netif_rx?  I made the change because to my understanding netif_rx should
not be used in the NAPI poll function.  Perhaps that is not correct?

The uses of netif_napi_del happen in error handling code of the probe
function and in the remove function, and it doesn't seem like that code is
being executed here?

julia



> [3.] Keywords (i.e., modules, networking, kernel):
>
> [4.] Kernel version (from /proc/version):
> Linux version 3.12.0-031200rc1-generic (apw@gomeisa) (gcc version
> 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #201309161735 SMP Mon Sep 16
> 21:51:46 UTC 2013
>
> [5.] Output of Oops.. message (if applicable) with symbolic
> information resolved (see Documentation/oops-tracing.txt)
>
> [6.] A small shell script or example program which triggers the
> problem (if possible)
>
> [7.] Environment
> Description:    Ubuntu Saucy Salamander (development branch)
> Release:        13.10
>
> [7.1.] Software (add the output of the ver_linux script here)
> If some fields are empty or look unusual you may have an old version.
> Compare to the current minimal requirements in Documentation/Changes.
>
> Linux nas 3.12.0-031200rc1-generic #201309161735 SMP Mon Sep 16
> 21:51:46 UTC 2013 i686 i686 i686 GNU/Linux
>
> Gnu C                  4.8
> Gnu make               3.81
> binutils               2.23.52.20130913
> util-linux             2.20.1
> mount                  support
> module-init-tools      9
> e2fsprogs              1.42.8
> reiserfsprogs          3.6.21
> Linux C Library        2.17
> Dynamic linker (ldd)   2.17
> /usr/bin/ldd: line 41: printf: write error: Broken pipe
> /usr/bin/ldd: line 43: printf: write error: Broken pipe
> Procps                 3.3.3
> Net-tools              1.60
> Kbd                    1.15.5
> Sh-utils               8.20
> wireless-tools         30
> Modules Loaded         snd_hda_codec_via snd_hda_intel snd_hda_codec
> snd_hwdep snd_pcm snd_page_alloc snd_seq_midi snd_seq_midi_event
> snd_rawmidi snd_seq snd_seq_device snd_timer snd psmouse via_cputemp
> soundcore serio_raw i2c_viapro shpchp mac_hid hwmon_vid lp parport
> binfmt_misc raid10 raid1 raid0 multipath linear dm_crypt raid456
> async_raid6_recov async_memcpy async_pq async_xor async_tx xor
> raid6_pq padlock_sha pata_acpi padlock_aes via_rhine via_rng ahci
> via_velocity mii libahci pata_via crc_ccitt
>
> [7.2.] Processor information (from /proc/cpuinfo):
> dirk@nas:~$ cat /proc/cpuinfo
> processor       : 0
> vendor_id       : CentaurHauls
> cpu family      : 6
> model           : 13
> model name      : VIA C7 Processor 1800MHz
> stepping        : 0
> cpu MHz         : 800.000
> cache size      : 128 KB
> fdiv_bug        : no
> f00f_bug        : no
> coma_bug        : no
> fpu             : yes
> fpu_exception   : yes
> cpuid level     : 1
> wp              : yes
> flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> cmov pat clflush acpi mmx fxsr sse sse2 tm nx pni est tm2 xtpr rng
> rng_en ace ace_en ace2 ace2_en phe phe_en pmm pmm_en
> bogomips        : 1595.96
> clflush size    : 64
> cache_alignment : 64
> address sizes   : 36 bits physical, 32 bits virtual
> power management:
>
> [7.3.] Module information (from /proc/modules):
> snd_hda_codec_via 23198 1 - Live 0x00000000
> snd_hda_intel 43367 0 - Live 0x00000000
> snd_hda_codec 169632 2 snd_hda_codec_via,snd_hda_intel, Live 0x00000000
> snd_hwdep 13276 1 snd_hda_codec, Live 0x00000000
> snd_pcm 90501 2 snd_hda_intel,snd_hda_codec, Live 0x00000000
> snd_page_alloc 18398 2 snd_hda_intel,snd_pcm, Live 0x00000000
> snd_seq_midi 13132 0 - Live 0x00000000
> snd_seq_midi_event 14475 1 snd_seq_midi, Live 0x00000000
> snd_rawmidi 25198 1 snd_seq_midi, Live 0x00000000
> snd_seq 55716 2 snd_seq_midi,snd_seq_midi_event, Live 0x00000000
> snd_seq_device 14137 3 snd_seq_midi,snd_rawmidi,snd_seq, Live 0x00000000
> snd_timer 28971 2 snd_pcm,snd_seq, Live 0x00000000
> snd 61311 10 snd_hda_codec_via,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_seq_midi,snd_rawmidi,snd_seq,snd_seq_device,snd_timer,
> Live 0x00000000
> psmouse 92689 0 - Live 0x00000000
> via_cputemp 12995 0 - Live 0x00000000
> soundcore 12600 1 snd, Live 0x00000000
> serio_raw 13230 0 - Live 0x00000000
> i2c_viapro 13130 0 - Live 0x00000000
> shpchp 32265 0 - Live 0x00000000
> mac_hid 13077 0 - Live 0x00000000
> hwmon_vid 12723 1 via_cputemp, Live 0x00000000
> lp 13359 0 - Live 0x00000000
> parport 40945 1 lp, Live 0x00000000
> binfmt_misc 13172 1 - Live 0x00000000
> raid10 48030 0 - Live 0x00000000
> raid1 35268 0 - Live 0x00000000
> raid0 17594 0 - Live 0x00000000
> multipath 12977 0 - Live 0x00000000
> linear 12766 0 - Live 0x00000000
> dm_crypt 22524 0 - Live 0x00000000
> raid456 81541 1 - Live 0x00000000
> async_raid6_recov 13000 1 raid456, Live 0x00000000
> async_memcpy 12578 2 raid456,async_raid6_recov, Live 0x00000000
> async_pq 13082 2 raid456,async_raid6_recov, Live 0x00000000
> async_xor 12932 3 raid456,async_raid6_recov,async_pq, Live 0x00000000
> async_tx 13251 5
> raid456,async_raid6_recov,async_memcpy,async_pq,async_xor, Live
> 0x00000000
> xor 26221 1 async_xor, Live 0x00000000
> raid6_pq 97455 2 async_raid6_recov,async_pq, Live 0x00000000
> padlock_sha 13317 0 - Live 0x00000000
> pata_acpi 12886 0 - Live 0x00000000
> padlock_aes 12899 0 - Live 0x00000000
> via_rhine 27895 0 - Live 0x00000000
> via_rng 12588 0 - Live 0x00000000
> ahci 25703 8 - Live 0x00000000
> via_velocity 37949 0 - Live 0x00000000
> mii 13693 1 via_rhine, Live 0x00000000
> libahci 30834 1 ahci, Live 0x00000000
> pata_via 13439 3 - Live 0x00000000
> crc_ccitt 12627 1 via_velocity, Live 0x00000000
>
> [7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
> dirk@nas:~$ cat /proc/ioports
> 0000-001f : dma1
> 0020-0021 : pic1
> 0040-0043 : timer0
> 0050-0053 : timer1
> 0060-0060 : keyboard
> 0064-0064 : keyboard
> 0070-0071 : rtc0
> 0080-008f : dma page reg
> 00a0-00a1 : pic2
> 00c0-00df : dma2
> 00f0-00ff : fpu
> 0170-0177 : 0000:00:0f.1
>   0170-0177 : pata_via
> 01f0-01f7 : 0000:00:0f.1
>   01f0-01f7 : pata_via
> 02f8-02ff : serial
> 0400-041f : pnp 00:07
>   0400-0407 : vt596_smbus
> 04d0-04d1 : pnp 00:07
> 0800-0803 : ACPI PM1a_EVT_BLK
> 0804-0805 : ACPI PM1a_CNT_BLK
> 0808-080b : ACPI PM_TMR
> 0810-0815 : ACPI CPU throttle
> 0820-0823 : ACPI GPE0_BLK
> 0850-0853 : ACPI GPE1_BLK
> 0a00-0a7f : pnp 00:06
> 0cf8-0cff : PCI conf1
> 162e-162f : pnp 00:06
> 2000-2fff : PCI Bus 0000:02
> c800-c8ff : 0000:00:12.0
>   c800-c8ff : via-rhine
> cc00-cc1f : 0000:00:10.0
>   cc00-cc1f : uhci_hcd
> d000-d01f : 0000:00:10.1
>   d000-d01f : uhci_hcd
> d080-d09f : 0000:00:10.2
>   d080-d09f : uhci_hcd
> d400-d40f : 0000:00:0f.0
>   d400-d40f : ahci
> d480-d483 : 0000:00:0f.0
>   d480-d483 : ahci
> d800-d807 : 0000:00:0f.0
>   d800-d807 : ahci
> d880-d883 : 0000:00:0f.0
>   d880-d883 : ahci
> dc00-dc07 : 0000:00:0f.0
>   dc00-dc07 : ahci
> e000-efff : PCI Bus 0000:03
>   e800-e8ff : 0000:03:00.0
>     e800-e8ff : via-velocity
> fc00-fc0f : 0000:00:0f.1
>   fc00-fc0f : pata_via
>
> dirk@nas:~$ cat /proc/iomem
> 00000000-00000fff : reserved
> 00001000-0009b3ff : System RAM
> 0009b400-0009ffff : reserved
> 000a0000-000bffff : Video RAM area
> 000c0000-000cddff : Video ROM
> 000ce000-000cefff : Adapter ROM
> 000e0000-000fffff : reserved
>   000f0000-000fffff : System ROM
> 00100000-cfeaffff : System RAM
>   01000000-0168a762 : Kernel code
>   0168a763-019f077f : Kernel data
>   01ad3000-01bc6fff : Kernel bss
>   18000000-1fffffff : Crash kernel
> cfeb0000-cfebdfff : ACPI Tables
> cfebe000-cfefffff : ACPI Non-volatile Storage
> cff00000-cfffffff : RAM buffer
> d0000000-d01fffff : PCI Bus 0000:02
> d0200000-d03fffff : PCI Bus 0000:02
> d0400000-d05fffff : PCI Bus 0000:03
> d8000000-dfffffff : PCI Bus 0000:01
>   d8000000-dfffffff : 0000:01:00.0
> e0000000-efffffff : PCI MMCONFIG 0000 [bus 00-ff]
>   e0000000-efffffff : pnp 00:09
> f0000000-f7ffffff : 0000:00:00.0
> fcfff400-fcfff4ff : 0000:00:12.0
>   fcfff400-fcfff4ff : via-rhine
> fcfff800-fcfff8ff : 0000:00:10.4
>   fcfff800-fcfff8ff : ehci_hcd
> fcfffc00-fcffffff : 0000:00:0f.0
>   fcfffc00-fcffffff : ahci
> fd000000-fe9fffff : PCI Bus 0000:01
>   fd000000-fdffffff : 0000:01:00.0
>   fe9f0000-fe9fffff : 0000:01:00.0
> fea00000-feafffff : PCI Bus 0000:03
>   feaffc00-feaffcff : 0000:03:00.0
>     feaffc00-feaffcff : via-velocity
> febfc000-febfffff : 0000:80:01.0
>   febfc000-febfffff : ICH HD audio
> fec00000-fec00fff : reserved
>   fec00000-fec003ff : IOAPIC 0
> fecc0000-fecc0fff : reserved
>   fecc0000-fecc03ff : IOAPIC 1
> fed1c000-fed1ffff : pnp 00:07
> fee00000-fee00fff : Local APIC
>   fee00000-fee00fff : reserved
>     fee00000-fee00fff : pnp 00:08
> ff780000-ffffffff : reserved
>
> [7.5.] PCI information ('lspci -vvv' as root)
> dirk@nas:~$ sudo lspci -vvv
> 00:00.0 Host bridge: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Subsystem: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
>         Latency: 8
>         Region 0: Memory at f0000000 (32-bit, prefetchable) [size=128M]
>         Capabilities: [80] AGP version 3.5
>                 Status: RQ=8 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64-
> HTrans- 64bit- FW- AGP3+ Rate=x4,x8
>                 Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit-
> FW- Rate=<none>
>         Capabilities: [50] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Kernel driver in use: agpgart-via
>
> 00:00.1 Host bridge: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Subsystem: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>
> 00:00.2 Host bridge: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Subsystem: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>
> 00:00.3 Host bridge: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>
> 00:00.4 Host bridge: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Subsystem: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>
> 00:00.5 PIC: VIA Technologies, Inc. CN896/VN896/P4M900 I/O APIC
> Interrupt Controller (prog-if 20 [IO(X)-APIC])
>         Subsystem: VIA Technologies, Inc. CN896/VN896/P4M900 I/O APIC
> Interrupt Controller
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>
> 00:00.6 Host bridge: VIA Technologies, Inc. CN896/VN896/P4M900 Security Device
>         Subsystem: VIA Technologies, Inc. CN896/VN896/P4M900 Security Device
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>
> 00:00.7 Host bridge: VIA Technologies, Inc. CN896/VN896/P4M900 Host Bridge
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>
> 00:01.0 PCI bridge: VIA Technologies, Inc. VT8237/VX700 PCI Bridge
> (prog-if 00 [Normal decode])
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0, Cache Line Size: 32 bytes
>         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>         I/O behind bridge: 0000f000-00000fff
>         Memory behind bridge: fd000000-fe9fffff
>         Prefetchable memory behind bridge: d8000000-dfffffff
>         Secondary status: 66MHz+ FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- <SERR- <PERR-
>         BridgeCtl: Parity+ SERR+ NoISA- VGA+ MAbort- >Reset- FastB2B-
>                 PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>         Capabilities: [70] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>
> 00:02.0 PCI bridge: VIA Technologies, Inc. CN896/VN896/P4M900 PCI to
> PCI Bridge Controller (rev 80) (prog-if 00 [Normal decode])
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0, Cache Line Size: 32 bytes
>         Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
>         I/O behind bridge: 00002000-00002fff
>         Memory behind bridge: d0000000-d01fffff
>         Prefetchable memory behind bridge: 00000000d0200000-00000000d03fffff
>         Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- <SERR- <PERR-
>         BridgeCtl: Parity+ SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-
>                 PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>         Capabilities: [40] Express (v1) Root Port (Slot+), MSI 00
>                 DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s
> <64ns, L1 <1us
>                         ExtTag- RBE+ FLReset-
>                 DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
>                         RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
>                         MaxPayload 128 bytes, MaxReadReq 128 bytes
>                 DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
> AuxPwr+ TransPend-
>                 LnkCap: Port #0, Speed 2.5GT/s, Width x16, ASPM L0s
> L1, Latency L0 <512ns, L1 <1us
>                         ClockPM- Surprise+ LLActRep+ BwNot-
>                 LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
>                         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>                 LnkSta: Speed 2.5GT/s, Width x0, TrErr- Train-
> SlotClk+ DLActive- BWMgmt- ABWMgmt-
>                 SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd-
> HotPlug+ Surprise+
>                         Slot #0, PowerLimit 150.000W; Interlock- NoCompl-
>                 SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet+
> CmdCplt+ HPIrq+ LinkChg-
>                         Control: AttnInd Unknown, PwrInd Unknown,
> Power- Interlock-
>                 SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt-
> PresDet- Interlock-
>                         Changed: MRL- PresDet- LinkState-
>                 RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal-
> PMEIntEna+ CRSVisible-
>                 RootCap: CRSVisible-
>                 RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>         Capabilities: [68] Power Management version 2
>                 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [70] MSI: Enable- Count=1/1 Maskable- 64bit+
>                 Address: 0000000000000000  Data: 0000
>         Capabilities: [88] HyperTransport: MSI Mapping Enable- Fixed+
>         Capabilities: [98] Subsystem: VIA Technologies, Inc. Device c323
>         Capabilities: [100 v1] Advanced Error Reporting
>                 UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>                 CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
>                 CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>                 AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
>         Capabilities: [140 v1] Virtual Channel
>                 Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
>                 Arb:    Fixed- WRR32- WRR64- WRR128-
>                 Ctrl:   ArbSelect=Fixed
>                 Status: InProgress-
>                 VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
>                         Status: NegoPending- InProgress-
>                 VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable- ID=1 ArbSelect=Fixed TC/VC=00
>                         Status: NegoPending- InProgress-
>         Capabilities: [180 v1] Root Complex Link
>                 Desc:   PortNumber=01 ComponentID=01 EltType=Config
>                 Link0:  Desc:   TargetPort=00 TargetComponent=01
> AssocRCRB- LinkType=MemMapped LinkValid+
>                         Addr:   0000000000000000
>         Kernel driver in use: pcieport
>
> 00:03.0 PCI bridge: VIA Technologies, Inc. CN896/VN896/P4M900 PCI to
> PCI Bridge Controller (rev 80) (prog-if 00 [Normal decode])
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0, Cache Line Size: 32 bytes
>         Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
>         I/O behind bridge: 0000e000-0000efff
>         Memory behind bridge: fea00000-feafffff
>         Prefetchable memory behind bridge: 00000000d0400000-00000000d05fffff
>         Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- <SERR- <PERR-
>         BridgeCtl: Parity+ SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-
>                 PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>         Capabilities: [40] Express (v1) Root Port (Slot+), MSI 00
>                 DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s
> <64ns, L1 <1us
>                         ExtTag- RBE+ FLReset-
>                 DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
>                         RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
>                         MaxPayload 128 bytes, MaxReadReq 128 bytes
>                 DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
> AuxPwr+ TransPend-
>                 LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1,
> Latency L0 <512ns, L1 <1us
>                         ClockPM- Surprise+ LLActRep+ BwNot-
>                 LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
>                         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>                 LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train-
> SlotClk+ DLActive+ BWMgmt- ABWMgmt-
>                 SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd-
> HotPlug+ Surprise+
>                         Slot #0, PowerLimit 150.000W; Interlock- NoCompl-
>                 SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet+
> CmdCplt+ HPIrq+ LinkChg-
>                         Control: AttnInd Unknown, PwrInd Unknown,
> Power- Interlock-
>                 SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt-
> PresDet+ Interlock-
>                         Changed: MRL- PresDet- LinkState-
>                 RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal-
> PMEIntEna+ CRSVisible-
>                 RootCap: CRSVisible-
>                 RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>         Capabilities: [68] Power Management version 2
>                 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [70] MSI: Enable- Count=1/1 Maskable- 64bit+
>                 Address: 0000000000000000  Data: 0000
>         Capabilities: [88] HyperTransport: MSI Mapping Enable- Fixed+
>         Capabilities: [98] Subsystem: VIA Technologies, Inc. Device c323
>         Capabilities: [100 v1] Advanced Error Reporting
>                 UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>                 CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
>                 CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>                 AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
>         Capabilities: [140 v1] Virtual Channel
>                 Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
>                 Arb:    Fixed- WRR32- WRR64- WRR128-
>                 Ctrl:   ArbSelect=Fixed
>                 Status: InProgress-
>                 VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
>                         Status: NegoPending- InProgress-
>                 VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable- ID=1 ArbSelect=Fixed TC/VC=00
>                         Status: NegoPending- InProgress-
>         Capabilities: [180 v1] Root Complex Link
>                 Desc:   PortNumber=02 ComponentID=01 EltType=Config
>                 Link0:  Desc:   TargetPort=00 TargetComponent=01
> AssocRCRB- LinkType=MemMapped LinkValid+
>                         Addr:   0000000000000000
>         Kernel driver in use: pcieport
>
> 00:0f.0 SATA controller: VIA Technologies, Inc. SATA RAID Controller
> (rev 20) (prog-if 01 [AHCI 1.0])
>         Subsystem: VIA Technologies, Inc. SATA RAID Controller
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 64
>         Interrupt: pin B routed to IRQ 21
>         Region 0: I/O ports at dc00 [size=8]
>         Region 1: I/O ports at d880 [size=4]
>         Region 2: I/O ports at d800 [size=8]
>         Region 3: I/O ports at d480 [size=4]
>         Region 4: I/O ports at d400 [size=16]
>         Region 5: Memory at fcfffc00 (32-bit, non-prefetchable) [size=1K]
>         Capabilities: [c0] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot+,D3cold-)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [e0] MSI: Enable- Count=1/1 Maskable- 64bit-
>                 Address: 00000000  Data: 0000
>         Kernel driver in use: ahci
>
> 00:0f.1 IDE interface: VIA Technologies, Inc.
> VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 07)
> (prog-if 8a [Master SecP PriP])
>         Subsystem: VIA Technologies, Inc.
> VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
>         Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 32
>         Region 0: [virtual] Memory at 000001f0 (32-bit,
> non-prefetchable) [size=8]
>         Region 1: [virtual] Memory at 000003f0 (type 3,
> non-prefetchable) [size=1]
>         Region 2: [virtual] Memory at 00000170 (32-bit,
> non-prefetchable) [size=8]
>         Region 3: [virtual] Memory at 00000370 (type 3,
> non-prefetchable) [size=1]
>         Region 4: I/O ports at fc00 [size=16]
>         Capabilities: [c0] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Kernel driver in use: pata_via
>
> 00:10.0 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller (rev 91) (prog-if 00 [UHCI])
>         Subsystem: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 64, Cache Line Size: 32 bytes
>         Interrupt: pin A routed to IRQ 20
>         Region 4: I/O ports at cc00 [size=32]
>         Capabilities: [80] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Kernel driver in use: uhci_hcd
>
> 00:10.1 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller (rev 91) (prog-if 00 [UHCI])
>         Subsystem: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 64, Cache Line Size: 32 bytes
>         Interrupt: pin C routed to IRQ 22
>         Region 4: I/O ports at d000 [size=32]
>         Capabilities: [80] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Kernel driver in use: uhci_hcd
>
> 00:10.2 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller (rev 91) (prog-if 00 [UHCI])
>         Subsystem: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 64, Cache Line Size: 32 bytes
>         Interrupt: pin B routed to IRQ 21
>         Region 4: I/O ports at d080 [size=32]
>         Capabilities: [80] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Kernel driver in use: uhci_hcd
>
> 00:10.4 USB controller: VIA Technologies, Inc. USB 2.0 (rev 90)
> (prog-if 20 [EHCI])
>         Subsystem: VIA Technologies, Inc. USB 2.0 Controller
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 64, Cache Line Size: 32 bytes
>         Interrupt: pin C routed to IRQ 22
>         Region 0: Memory at fcfff800 (32-bit, non-prefetchable) [size=256]
>         Capabilities: [80] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [88] Debug port: BAR=1 offset=00a0
>         Kernel driver in use: ehci-pci
>
> 00:11.0 ISA bridge: VIA Technologies, Inc. VT8251 PCI to ISA Bridge
>         Subsystem: VIA Technologies, Inc. VT8251 PCI to ISA Bridge
>         Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Capabilities: [c0] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>
> 00:11.7 Host bridge: VIA Technologies, Inc. VT8237/8251 Ultra VLINK Controller
>         Subsystem: VIA Technologies, Inc. VT8237/8251 Ultra VLINK Controller
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
>         Latency: 128
>         Capabilities: [58] HyperTransport: Interrupt Discovery and Configuration
>
> 00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 7c)
>         Subsystem: VIA Technologies, Inc. VT6102 [Rhine II] Embeded
> Ethernet Controller on VT8235
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 64 (750ns min, 2000ns max), Cache Line Size: 32 bytes
>         Interrupt: pin A routed to IRQ 23
>         Region 0: I/O ports at c800 [size=256]
>         Region 1: Memory at fcfff400 (32-bit, non-prefetchable) [size=256]
>         Capabilities: [40] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Kernel driver in use: via-rhine
>
> 00:13.0 Host bridge: VIA Technologies, Inc. VT8251 Host Bridge
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort+ >SERR- <PERR- INTx-
>         Latency: 0
>
> 01:00.0 VGA compatible controller: VIA Technologies, Inc.
> CN896/VN896/P4M900 [Chrome 9 HC] (rev 01) (prog-if 00 [VGA
> controller])
>         Subsystem: Device 0908:1975
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium
> >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 64 (500ns min)
>         Interrupt: pin A routed to IRQ 11
>         Region 0: Memory at d8000000 (32-bit, prefetchable) [size=128M]
>         Region 1: Memory at fd000000 (32-bit, non-prefetchable) [size=16M]
>         Expansion ROM at fe9f0000 [disabled] [size=64K]
>         Capabilities: [60] Power Management version 2
>                 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [70] AGP version 3.0
>                 Status: RQ=256 Iso- ArqSz=0 Cal=7 SBA+ ITACoh- GART64-
> HTrans- 64bit- FW- AGP3+ Rate=x4,x8
>                 Command: RQ=1 ArqSz=0 Cal=0 SBA+ AGP- GART64- 64bit-
> FW- Rate=<none>
>
> 03:00.0 Ethernet controller: VIA Technologies, Inc.
> VT6120/VT6121/VT6122 Gigabit Ethernet Adapter (rev 82)
>         Subsystem: VIA Technologies, Inc. Device 0110
>         Physical Slot: 0-1
>         Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Interrupt: pin A routed to IRQ 28
>         Region 0: I/O ports at e800 [size=256]
>         Region 1: Memory at feaffc00 (64-bit, non-prefetchable) [size=256]
>         Capabilities: [50] Power Management version 3
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
>                 Status: D3 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [90] Express (v1) Endpoint, MSI 00
>                 DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s
> <64ns, L1 <1us
>                         ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
>                 DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
>                         RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>                         MaxPayload 128 bytes, MaxReadReq 512 bytes
>                 DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+
> AuxPwr+ TransPend-
>                 LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1,
> Latency L0 <1us, L1 <2us
>                         ClockPM+ Surprise- LLActRep- BwNot-
>                 LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
>                         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>                 LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train-
> SlotClk- DLActive- BWMgmt- ABWMgmt-
>         Capabilities: [c0] MSI: Enable- Count=1/1 Maskable+ 64bit+
>                 Address: 0000000000000000  Data: 0000
>                 Masking: 00000000  Pending: 00000000
>         Capabilities: [100 v1] Advanced Error Reporting
>                 UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UESvrt: DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>                 CESta:  RxErr+ BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>                 CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>                 AERCap: First Error Pointer: 14, GenCap+ CGenEn- ChkCap+ ChkEn-
>         Capabilities: [130 v1] Device Serial Number 00-40-45-ff-ff-78-90-08
>         Kernel driver in use: via-velocity
>
> 80:00.0 PCI bridge: VIA Technologies, Inc. VT8251 PCIE Root Port
> (prog-if 00 [Normal decode])
>         Control: I/O- Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>         Bus: primary=80, secondary=82, subordinate=82, sec-latency=0
>         I/O behind bridge: 0000f000-00000fff
>         Memory behind bridge: fff00000-000fffff
>         Prefetchable memory behind bridge: fff00000-000fffff
>         Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- <SERR- <PERR-
>         BridgeCtl: Parity+ SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-
>                 PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>         Capabilities: [40] Express (v1) Root Port (Slot-), MSI 00
>                 DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s
> <64ns, L1 unlimited
>                         ExtTag- RBE- FLReset-
>                 DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
>                         RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>                         MaxPayload 128 bytes, MaxReadReq 128 bytes
>                 DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
> AuxPwr+ TransPend-
>                 LnkCap: Port #1, Speed 2.5GT/s, Width x2, ASPM L0s L1,
> Latency L0 <64ns, L1 <1us
>                         ClockPM- Surprise- LLActRep- BwNot-
>                 LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
>                         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>                 LnkSta: Speed 2.5GT/s, Width x0, TrErr- Train-
> SlotClk- DLActive- BWMgmt- ABWMgmt-
>                 RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal-
> PMEIntEna- CRSVisible-
>                 RootCap: CRSVisible-
>                 RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>         Capabilities: [68] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [70] MSI: Enable- Count=1/1 Maskable+ 64bit+
>                 Address: 0000000000000000  Data: 0000
>                 Masking: 00000000  Pending: 00000000
>         Capabilities: [88] HyperTransport: MSI Mapping Enable- Fixed+
>         Capabilities: [90] Subsystem: Device 0000:0000
>         Capabilities: [100 v1] Advanced Error Reporting
>                 UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UESvrt: DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>                 CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
>                 CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
>                 AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
>         Capabilities: [140 v1] Virtual Channel
>                 Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
>                 Arb:    Fixed+ WRR32- WRR64- WRR128-
>                 Ctrl:   ArbSelect=Fixed
>                 Status: InProgress-
>                 VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
>                         Status: NegoPending- InProgress-
>                 VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable- ID=1 ArbSelect=Fixed TC/VC=00
>                         Status: NegoPending- InProgress-
>         Capabilities: [180 v1] Root Complex Link
>                 Desc:   PortNumber=01 ComponentID=01 EltType=Config
>                 Link0:  Desc:   TargetPort=00 TargetComponent=01
> AssocRCRB- LinkType=MemMapped LinkValid+
>                         Addr:   00000000fed1c000
>         Kernel driver in use: pcieport
>
> 80:00.1 PCI bridge: VIA Technologies, Inc. VT8251 PCIE Root Port
> (prog-if 00 [Normal decode])
>         Control: I/O- Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR+ FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0
>         Bus: primary=80, secondary=81, subordinate=81, sec-latency=0
>         I/O behind bridge: 0000f000-00000fff
>         Memory behind bridge: fff00000-000fffff
>         Prefetchable memory behind bridge: fff00000-000fffff
>         Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- <SERR- <PERR-
>         BridgeCtl: Parity+ SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-
>                 PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>         Capabilities: [40] Express (v1) Root Port (Slot-), MSI 00
>                 DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s
> <64ns, L1 unlimited
>                         ExtTag- RBE- FLReset-
>                 DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
>                         RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>                         MaxPayload 128 bytes, MaxReadReq 128 bytes
>                 DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
> AuxPwr+ TransPend-
>                 LnkCap: Port #2, Speed 2.5GT/s, Width x1, ASPM L0s L1,
> Latency L0 <64ns, L1 <1us
>                         ClockPM- Surprise- LLActRep- BwNot-
>                 LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
>                         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>                 LnkSta: Speed 2.5GT/s, Width x0, TrErr- Train-
> SlotClk- DLActive- BWMgmt- ABWMgmt-
>                 RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal-
> PMEIntEna- CRSVisible-
>                 RootCap: CRSVisible-
>                 RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>         Capabilities: [68] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [70] MSI: Enable- Count=1/1 Maskable+ 64bit+
>                 Address: 0000000000000000  Data: 0000
>                 Masking: 00000000  Pending: 00000000
>         Capabilities: [88] HyperTransport: MSI Mapping Enable- Fixed+
>         Capabilities: [90] Subsystem: Device 0000:0000
>         Capabilities: [100 v1] Advanced Error Reporting
>                 UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>                 UESvrt: DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt-
> UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>                 CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
>                 CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
>                 AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
>         Capabilities: [140 v1] Virtual Channel
>                 Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
>                 Arb:    Fixed+ WRR32- WRR64- WRR128-
>                 Ctrl:   ArbSelect=Fixed
>                 Status: InProgress-
>                 VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
>                         Status: NegoPending- InProgress-
>                 VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable- ID=1 ArbSelect=Fixed TC/VC=00
>                         Status: NegoPending- InProgress-
>         Capabilities: [180 v1] Root Complex Link
>                 Desc:   PortNumber=02 ComponentID=01 EltType=Config
>                 Link0:  Desc:   TargetPort=00 TargetComponent=01
> AssocRCRB- LinkType=MemMapped LinkValid+
>                         Addr:   00000000fed1c000
>         Kernel driver in use: pcieport
>
> 80:01.0 Audio device: VIA Technologies, Inc. VT8237A/VT8251 HDA Controller
>         Subsystem: VIA Technologies, Inc. VT8237A/VT8251 HDA Controller
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>         Latency: 0, Cache Line Size: 32 bytes
>         Interrupt: pin A routed to IRQ 17
>         Region 0: Memory at febfc000 (32-bit, non-prefetchable) [size=16K]
>         Capabilities: [50] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>                 Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [60] MSI: Enable- Count=1/1 Maskable- 64bit-
>                 Address: 00000000  Data: 0000
>         Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00
>                 DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s
> <64ns, L1 <1us
>                         ExtTag- RBE- FLReset-
>                 DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
>                         RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>                         MaxPayload 128 bytes, MaxReadReq 128 bytes
>                 DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq-
> AuxPwr+ TransPend+
>                 LnkCap: Port #0, Speed unknown, Width x0, ASPM
> unknown, Latency L0 <64ns, L1 <1us
>                         ClockPM- Surprise- LLActRep- BwNot-
>                 LnkCtl: ASPM Disabled; Disabled- Retrain- CommClk-
>                         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>                 LnkSta: Speed unknown, Width x0, TrErr- Train-
> SlotClk- DLActive- BWMgmt- ABWMgmt-
>         Capabilities: [100 v1] Virtual Channel
>                 Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
>                 Arb:    Fixed- WRR32- WRR64- WRR128-
>                 Ctrl:   ArbSelect=Fixed
>                 Status: InProgress-
>                 VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
>                         Status: NegoPending- InProgress-
>                 VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>                         Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>                         Ctrl:   Enable- ID=1 ArbSelect=Fixed TC/VC=00
>                         Status: NegoPending- InProgress-
>         Capabilities: [130 v1] Root Complex Link
>                 Desc:   PortNumber=03 ComponentID=01 EltType=Config
>                 Link0:  Desc:   TargetPort=00 TargetComponent=01
> AssocRCRB- LinkType=MemMapped LinkValid+
>                         Addr:   00000000fed1c000
>         Kernel driver in use: snd_hda_intel
>
> [7.6.] SCSI information (from /proc/scsi/scsi)
> dirk@nas:~$ cat /proc/scsi/scsi
> Attached devices:
> Host: scsi0 Channel: 00 Id: 00 Lun: 00
>   Vendor: ATA      Model: SAMSUNG HM160HC  Rev: LQ10
>   Type:   Direct-Access                    ANSI  SCSI revision: 05
> Host: scsi2 Channel: 00 Id: 00 Lun: 00
>   Vendor: ATA      Model: ST31500341AS     Rev: CC1H
>   Type:   Direct-Access                    ANSI  SCSI revision: 05
> Host: scsi3 Channel: 00 Id: 00 Lun: 00
>   Vendor: ATA      Model: ST31500341AS     Rev: CC1H
>   Type:   Direct-Access                    ANSI  SCSI revision: 05
> Host: scsi4 Channel: 00 Id: 00 Lun: 00
>   Vendor: ATA      Model: ST31500341AS     Rev: CC1H
>   Type:   Direct-Access                    ANSI  SCSI revision: 05
> Host: scsi5 Channel: 00 Id: 00 Lun: 00
>   Vendor: ATA      Model: ST31500341AS     Rev: CC1H
>   Type:   Direct-Access                    ANSI  SCSI revision: 05
>
> [7.7.] Other information that might be relevant to the problem (please
> look in /proc and include all information that you think to be
> relevant):
> dirk@nas:~$ ls /proc/
> 1     1223  132   1509  163   1965  2054  26    42   597   asound
> driver       key-users      mounts        stat           vmstat
> 10    1224  134   151   1656  1975  21    2609  45   65    buddyinfo
> execdomains  kmsg           mtrr          swaps          zoneinfo
> 1097  123   137   152   166   1978  2165  263   46   66    bus
> fb           kpagecount     net           sys
> 11    1242  1383  1541  1667  1981  2198  264   473  668   cgroups
> filesystems  kpageflags     pagetypeinfo  sysrq-trigger
> 1124  1243  14    1542  167   1983  22    27    5    7     cmdline
> fs           latency_stats  partitions    sysvipc
> 1130  125   1423  1550  170   1985  2217  28    504  793   consoles
> interrupts   loadavg        sched_debug   timer_list
> 1151  13    1428  159   172   1986  2285  29    534  8     cpuinfo
> iomem        locks          schedstat     timer_stats
> 1154  130   1442  1591  18    2     23    3     552  830   crypto
> ioports      mdstat         scsi          tty
> 1164  1303  1458  16    1828  20    24    30    564  842   devices
> irq          meminfo        self          uptime
> 12    131   15    160   19    2034  25    407   587  9     diskstats
> kallsyms     misc           slabinfo      version
> 122   1319  150   162   1949  2035  2572  408   588  acpi  dma
> kcore        modules        softirqs      vmallocinfo
>
> [8.]
> Downstream bug report is here:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1225571
>
> [9.]
> Bisect log:
> git bisect start
> # good: [d4e4ab86bcba5a72779c43dc1459f71fea3d89c8] Linux 3.11-rc5
> git bisect good d4e4ab86bcba5a72779c43dc1459f71fea3d89c8
> # bad: [b36f4be3de1b123d8601de062e7dbfc904f305fb] Linux 3.11-rc6
> git bisect bad b36f4be3de1b123d8601de062e7dbfc904f305fb
> # good: [1b244081af462c223cfa6a1ae881a902af64c306] Do not attempt to
> do cifs operations reading symlinks with SMB2
> git bisect good 1b244081af462c223cfa6a1ae881a902af64c306
> # good: [cde2d7a796f7e895e25b43471ed658079345636d] ext4: flush the
> extent status cache during EXT4_IOC_SWAP_BOOT
> git bisect good cde2d7a796f7e895e25b43471ed658079345636d
> # good: [c95eb3184ea1a3a2551df57190c81da695e2144b] ARM: 7809/1: perf:
> fix event validation for software group leaders
> git bisect good c95eb3184ea1a3a2551df57190c81da695e2144b
> # bad: [e180383f569e9d9247af45403d352b06444c34ca] MAINTAINERS: Change
> ownership for SGI specific modules.
> git bisect bad e180383f569e9d9247af45403d352b06444c34ca
> # good: [dfa9771a7c4784bafd0673bc7abcee3813088b77] microblaze: fix clone syscall
> git bisect good dfa9771a7c4784bafd0673bc7abcee3813088b77
> # good: [ea077b1b96e073eac5c3c5590529e964767fc5f7] m68k: Truncate base
> in do_div()
> git bisect good ea077b1b96e073eac5c3c5590529e964767fc5f7
> # bad: [89cb9ae2382b59585381c3ae619840e64df8df97] Merge tag
> 'usb-3.11-rc6' of
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
> git bisect bad 89cb9ae2382b59585381c3ae619840e64df8df97
> # good: [2b047252d087be7f2ba088b4933cd904f92e6fce] Fix TLB gather
> virtual address range invalidation corner cases
> git bisect good 2b047252d087be7f2ba088b4933cd904f92e6fce
> # bad: [ddea368c78ff9acf45261a7c82635b98e9c1fcd6] Merge
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
> git bisect bad ddea368c78ff9acf45261a7c82635b98e9c1fcd6
> # good: [9d2c9488cedb666bc8206fbdcdc1575e0fbc5929] batman-adv: fix
> potential kernel paging errors for unicast transmissions
> git bisect good 9d2c9488cedb666bc8206fbdcdc1575e0fbc5929
> # good: [50f850fdf91a9ed21bfca982932520ee21a4ccb9] Merge branch 'bnx2x'
> git bisect good 50f850fdf91a9ed21bfca982932520ee21a4ccb9
> # bad: [09a8f03197d4799bc9969b35240e5606c026ded6] Merge branch 'fixes'
> of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
> git bisect bad 09a8f03197d4799bc9969b35240e5606c026ded6
> # good: [728e2ccaa3c4d20cf4d54b73a47956bf4d334a9f] Revert "cxgb3:
> Check and handle the dma mapping errors"
> git bisect good 728e2ccaa3c4d20cf4d54b73a47956bf4d334a9f
> # bad: [2fdac010bdcf10a30711b6924612dfc40daf19b8]
> drivers/net/ethernet/via/via-velocity.c: update napi implementation
> git bisect bad 2fdac010bdcf10a30711b6924612dfc40daf19b8
>
> Because this bug is shadowed by another bug
> (https://lkml.org/lkml/2013/8/3/40) I had to apply this patch
> (http://lists.freedesktop.org/archives/dri-devel/2013-August/042668.html)
> to the versions that would not compile to do the above bisect.
>
> Output of last bisect step:
> 2fdac010bdcf10a30711b6924612dfc40daf19b8 is the first bad commit
> commit 2fdac010bdcf10a30711b6924612dfc40daf19b8
> Author: Julia Lawall <Julia.Lawall@lip6.fr>
> Date:   Wed Aug 14 16:26:53 2013 +0200
>
>     drivers/net/ethernet/via/via-velocity.c: update napi implementation
>
>     Drivers supporting NAPI should use a NAPI-specific function for receiving
>     packets.  Hence netif_rx is changed to netif_receive_skb.
>
>     Furthermore netif_napi_del should be used in the probe and remove function
>     to clean up the NAPI resource information.
>
>     Thanks to Francois Romieu, David Shwatrz and Rami Rosen for their help on
>     this patch.
>
>     Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>
> :040000 040000 d9315455cdfe498829f11b65554c1d906911f380
> f1e8f50bfc9dd5bb71574b121160bd28a5da8114 M      drivers
>
> [10.] syslog message produced for the same freeze with
> "3.11.0-7-generic #13-Ubuntu"
> Sep 15 02:25:24 nas dhclient: Internet Systems Consortium DHCP Client 4.2.4
> Sep 15 02:25:24 nas dhclient: Copyright 2004-2012 Internet Systems Consortium.
> Sep 15 02:25:24 nas dhclient: All rights reserved.
> Sep 15 02:25:24 nas dhclient: For info, please visit
> https://www.isc.org/software/dhcp/
> Sep 15 02:25:24 nas dhclient:
> Sep 15 02:25:25 nas kernel: [ 81.953639] Velocity is AUTO mode
> Sep 15 02:25:25 nas dhclient: Listening on LPF/eth0/00:40:63:f5:15:76
> Sep 15 02:25:25 nas dhclient: Sending on LPF/eth0/00:40:63:f5:15:76
> Sep 15 02:25:25 nas dhclient: Sending on Socket/fallback
> Sep 15 02:25:25 nas dhclient: DHCPDISCOVER on eth0 to 255.255.255.255
> port 67 interval 3 (xid=0x4ff0e6ad)
> Sep 15 02:25:26 nas kernel: [ 83.462216] eth0: Link auto-negotiation
> speed 100M bps full duplex
> Sep 15 02:25:28 nas dhclient: DHCPDISCOVER on eth0 to 255.255.255.255
> port 67 interval 3 (xid=0x4ff0e6ad)
> Sep 15 02:25:29 nas kernel: [ 86.675203] ------------[ cut here ]------------
> Sep 15 02:25:29 nas kernel: [ 86.675227] WARNING: CPU: 0 PID: 1529 at
> /build/buildd/linux-3.11.0/kernel/softirq.c:159
> local_bh_enable+0x60/0x90()
> Sep 15 02:25:29 nas kernel: [ 86.675231] Modules linked in:
> snd_hda_codec_via snd_hda_intel snd_hda_codec snd_hwdep(F) snd_pcm(F)
> snd_page_alloc(F) snd_seq_midi(F) snd_seq_midi_event(F) via_cputemp
> snd_rawmidi(F) snd_seq(F) snd_seq_device(F) snd_timer(F) i2c_viapro
> psmouse(F) serio_raw(F) snd(F) soundcore(F) shpchp mac_hid hwmon_vid
> lp(F) parport(F) binfmt_misc(F) raid10(F) raid1(F) raid0(F)
> multipath(F) linear(F) dm_crypt(F) via_rng raid456(F)
> async_raid6_recov(F) async_memcpy(F) async_pq(F) async_xor(F)
> async_tx(F) xor(F) raid6_pq(F) pata_acpi padlock_sha padlock_aes
> pata_via via_velocity via_rhine mii(F) ahci(F) libahci(F) crc_ccitt(F)
> Sep 15 02:25:29 nas kernel: [ 86.675315] CPU: 0 PID: 1529 Comm:
> SpiderOak Tainted: GF 3.11.0-7-generic #13-Ubuntu
> Sep 15 02:25:29 nas kernel: [ 86.675320] Hardware name: To Be Filled
> By O.E.M. To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080014
> 12/18/2007
> Sep 15 02:25:29 nas kernel: [ 86.675324] 00000000 00000000 ee803ce8
> c16313c4 00000000 ee803d18 c105268e c1805af4
> Sep 15 02:25:29 nas kernel: [ 86.675336] 00000000 000005f9 c1805dc8
> 0000009f c1056b50 c1056b50 c19566c0 efbafb80
> Sep 15 02:25:29 nas kernel: [ 86.675347] 00000000 ee803d28 c1052752
> 00000009 00000000 ee803d30 c1056b50 ee803d4c
> Sep 15 02:25:29 nas kernel: [ 86.675359] Call Trace:
> Sep 15 02:25:29 nas kernel: [ 86.675371] [<c16313c4>] dump_stack+0x41/0x52
> Sep 15 02:25:29 nas kernel: [ 86.675379] [<c105268e>]
> warn_slowpath_common+0x7e/0xa0
> Sep 15 02:25:29 nas kernel: [ 86.675387] [<c1056b50>] ?
> local_bh_enable+0x60/0x90
> Sep 15 02:25:29 nas kernel: [ 86.675394] [<c1056b50>] ?
> local_bh_enable+0x60/0x90
> Sep 15 02:25:29 nas kernel: [ 86.675401] [<c1052752>]
> warn_slowpath_null+0x22/0x30
> Sep 15 02:25:29 nas kernel: [ 86.675409] [<c1056b50>] local_bh_enable+0x60/0x90
> Sep 15 02:25:29 nas kernel: [ 86.675421] [<c155f1ea>] dst_alloc+0x12a/0x140
> Sep 15 02:25:29 nas kernel: [ 86.675431] [<c158189d>] rt_dst_alloc+0x4d/0x60
> Sep 15 02:25:29 nas kernel: [ 86.675440] [<c1583fdc>]
> ip_route_input_noref+0x2bc/0xa30
> Sep 15 02:25:29 nas kernel: [ 86.675448] [<c107c504>] ? resched_task+0x24/0x70
> Sep 15 02:25:29 nas kernel: [ 86.675456] [<c107cfd8>] ?
> ttwu_do_wakeup+0x18/0x100
> Sep 15 02:25:29 nas kernel: [ 86.675464] [<c1585b4b>] ip_rcv_finish+0xbb/0x340
> Sep 15 02:25:29 nas kernel: [ 86.675471] [<c1586414>] ip_rcv+0x254/0x3c0
> Sep 15 02:25:29 nas kernel: [ 86.675479] [<c1558217>]
> __netif_receive_skb_core+0x557/0x730
> Sep 15 02:25:29 nas kernel: [ 86.675487] [<c1558406>]
> __netif_receive_skb+0x16/0x60
> Sep 15 02:25:29 nas kernel: [ 86.675494] [<c155846f>]
> netif_receive_skb+0x1f/0x80
> Sep 15 02:25:29 nas kernel: [ 86.675516] [<f845e7ab>]
> velocity_rx_srv+0x2ab/0x410 [via_velocity]
> Sep 15 02:25:29 nas kernel: [ 86.675525] [<c13dfa19>] ?
> __mix_pool_bytes+0x39/0x80
> Sep 15 02:25:29 nas kernel: [ 86.675534] [<c1014790>] ?
> alternatives_enable_smp+0x110/0x110
> Sep 15 02:25:29 nas kernel: [ 86.675547] [<f84608ac>]
> velocity_poll+0x3c/0x90 [via_velocity]
> Sep 15 02:25:29 nas kernel: [ 86.675554] [<c1558725>] net_rx_action+0xf5/0x1f0
> Sep 15 02:25:29 nas kernel: [ 86.675562] [<c10573c1>] __do_softirq+0xc1/0x1d0
> Sep 15 02:25:29 nas kernel: [ 86.675574] [<c103cd90>] ?
> ack_apic_level+0x60/0x100
> Sep 15 02:25:29 nas kernel: [ 86.675584] [<c10d7100>] ?
> handle_irq_event_percpu+0x150/0x1a0
> Sep 15 02:25:29 nas kernel: [ 86.675591] [<c1057635>] irq_exit+0x95/0xa0
> Sep 15 02:25:29 nas kernel: [ 86.675602] [<c163f1f5>] do_IRQ+0x45/0xb0
> Sep 15 02:25:29 nas kernel: [ 86.675610] [<c163efb3>] common_interrupt+0x33/0x38
> Sep 15 02:25:29 nas kernel: [ 86.675616] ---[ end trace 00a91aa3f264230a ]---
>

^ permalink raw reply

* [PATCH net-next] xen-netback: improve ring effeciency for guest RX
From: Wei Liu @ 2013-09-22 18:03 UTC (permalink / raw)
  To: netdev
  Cc: xen-devel, Wei Liu, Xi Xiong, Matt Wilson, Annie Li, Ian Campbell,
	David Vrabel

There was a bug that netback routines netbk/xenvif_skb_count_slots and
netbk/xenvif_gop_frag_copy disagreed with each other, which caused
netback to push wrong number of responses to netfront, which caused
netfront to eventually crash. The bug was fixed in 6e43fc04a
("xen-netback: count number required slots for an skb more carefully").

Commit 6e43fc04a focused on backport-ability. The drawback with the
existing packing scheme is that the ring is not used effeciently, as
stated in 6e43fc04a.

skb->data like:
    |        1111|222222222222|3333        |

is arranged as:
    |1111        |222222222222|3333        |

If we can do this:
    |111122222222|22223333    |
That would save one ring slot, which improves ring effeciency.

This patch effectively reverts 6e43fc04a. That patch made count_slots
agree with gop_frag_copy, while this patch goes the other way around --
make gop_frag_copy agree with count_slots. The end result is that they
still agree with each other, and the ring is now arranged like:
    |111122222222|22223333    |

The patch that improves packing was first posted by Xi Xong and Matt
Wilson. I only rebase it on top of net-next and rewrite commit message,
so I retain all their SoBs. For more infomation about the original bug
please refer to email listed below and commit message of 6e43fc04a.

Original patch:
http://lists.xen.org/archives/html/xen-devel/2013-07/msg00760.html

Signed-off-by: Xi Xiong <xixiong@amazon.com>
Reviewed-by: Matt Wilson <msw@amazon.com>
[ msw: minor code cleanups, rewrote commit message, adjusted code
  to count RX slots instead of meta structures ]
Signed-off-by: Matt Wilson <msw@amazon.com>
Cc: Annie Li <annie.li@oracle.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
[ liuw: rebased on top of net-next tree, rewrote commit message, coding
  style cleanup. ]
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
---
 drivers/net/xen-netback/netback.c |  144 ++++++++++++++++---------------------
 1 file changed, 61 insertions(+), 83 deletions(-)

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index f3e591c..d0b0feb 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -47,6 +47,14 @@
 #include <asm/xen/hypercall.h>
 #include <asm/xen/page.h>
 
+/* SKB control block overlay is used to store useful information when
+ * doing guest RX.
+ */
+struct skb_cb_overlay {
+	int meta_slots_used;
+	int peek_slots_count;
+};
+
 /* Provide an option to disable split event channels at load time as
  * event channels are limited resource. Split event channels are
  * enabled by default.
@@ -212,49 +220,6 @@ static bool start_new_rx_buffer(int offset, unsigned long size, int head)
 	return false;
 }
 
-struct xenvif_count_slot_state {
-	unsigned long copy_off;
-	bool head;
-};
-
-unsigned int xenvif_count_frag_slots(struct xenvif *vif,
-				     unsigned long offset, unsigned long size,
-				     struct xenvif_count_slot_state *state)
-{
-	unsigned count = 0;
-
-	offset &= ~PAGE_MASK;
-
-	while (size > 0) {
-		unsigned long bytes;
-
-		bytes = PAGE_SIZE - offset;
-
-		if (bytes > size)
-			bytes = size;
-
-		if (start_new_rx_buffer(state->copy_off, bytes, state->head)) {
-			count++;
-			state->copy_off = 0;
-		}
-
-		if (state->copy_off + bytes > MAX_BUFFER_OFFSET)
-			bytes = MAX_BUFFER_OFFSET - state->copy_off;
-
-		state->copy_off += bytes;
-
-		offset += bytes;
-		size -= bytes;
-
-		if (offset == PAGE_SIZE)
-			offset = 0;
-
-		state->head = false;
-	}
-
-	return count;
-}
-
 /*
  * Figure out how many ring slots we're going to need to send @skb to
  * the guest. This function is essentially a dry run of
@@ -262,40 +227,53 @@ unsigned int xenvif_count_frag_slots(struct xenvif *vif,
  */
 unsigned int xenvif_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)
 {
-	struct xenvif_count_slot_state state;
 	unsigned int count;
-	unsigned char *data;
-	unsigned i;
+	int i, copy_off;
+	struct skb_cb_overlay *sco;
 
-	state.head = true;
-	state.copy_off = 0;
+	count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE);
 
-	/* Slot for the first (partial) page of data. */
-	count = 1;
+	copy_off = skb_headlen(skb) % PAGE_SIZE;
 
-	/* Need a slot for the GSO prefix for GSO extra data? */
 	if (skb_shinfo(skb)->gso_size)
 		count++;
 
-	data = skb->data;
-	while (data < skb_tail_pointer(skb)) {
-		unsigned long offset = offset_in_page(data);
-		unsigned long size = PAGE_SIZE - offset;
+	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+		unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
+		unsigned long offset = skb_shinfo(skb)->frags[i].page_offset;
+		unsigned long bytes;
 
-		if (data + size > skb_tail_pointer(skb))
-			size = skb_tail_pointer(skb) - data;
+		offset &= ~PAGE_MASK;
 
-		count += xenvif_count_frag_slots(vif, offset, size, &state);
+		while (size > 0) {
+			BUG_ON(offset >= PAGE_SIZE);
+			BUG_ON(copy_off > MAX_BUFFER_OFFSET);
 
-		data += size;
-	}
+			bytes = PAGE_SIZE - offset;
 
-	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
-		unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
-		unsigned long offset = skb_shinfo(skb)->frags[i].page_offset;
+			if (bytes > size)
+				bytes = size;
+
+			if (start_new_rx_buffer(copy_off, bytes, 0)) {
+				count++;
+				copy_off = 0;
+			}
 
-		count += xenvif_count_frag_slots(vif, offset, size, &state);
+			if (copy_off + bytes > MAX_BUFFER_OFFSET)
+				bytes = MAX_BUFFER_OFFSET - copy_off;
+
+			copy_off += bytes;
+
+			offset += bytes;
+			size -= bytes;
+
+			if (offset == PAGE_SIZE)
+				offset = 0;
+		}
 	}
+
+	sco = (struct skb_cb_overlay *)skb->cb;
+	sco->peek_slots_count = count;
 	return count;
 }
 
@@ -327,14 +305,11 @@ static struct xenvif_rx_meta *get_next_rx_buffer(struct xenvif *vif,
 	return meta;
 }
 
-/*
- * Set up the grant operations for this fragment. If it's a flipping
- * interface, we also set up the unmap request from here.
- */
+/* Set up the grant operations for this fragment. */
 static void xenvif_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 				 struct netrx_pending_operations *npo,
 				 struct page *page, unsigned long size,
-				 unsigned long offset, int *head)
+				 unsigned long offset, int head, int *first)
 {
 	struct gnttab_copy *copy_gop;
 	struct xenvif_rx_meta *meta;
@@ -358,12 +333,12 @@ static void xenvif_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 		if (bytes > size)
 			bytes = size;
 
-		if (start_new_rx_buffer(npo->copy_off, bytes, *head)) {
+		if (start_new_rx_buffer(npo->copy_off, bytes, head)) {
 			/*
 			 * Netfront requires there to be some data in the head
 			 * buffer.
 			 */
-			BUG_ON(*head);
+			BUG_ON(*first);
 
 			meta = get_next_rx_buffer(vif, npo);
 		}
@@ -397,10 +372,10 @@ static void xenvif_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,
 		}
 
 		/* Leave a gap for the GSO descriptor. */
-		if (*head && skb_shinfo(skb)->gso_size && !vif->gso_prefix)
+		if (*first && skb_shinfo(skb)->gso_size && !vif->gso_prefix)
 			vif->rx.req_cons++;
 
-		*head = 0; /* There must be something in this buffer now. */
+		*first = 0; /* There must be something in this buffer now. */
 
 	}
 }
@@ -426,7 +401,7 @@ static int xenvif_gop_skb(struct sk_buff *skb,
 	struct xen_netif_rx_request *req;
 	struct xenvif_rx_meta *meta;
 	unsigned char *data;
-	int head = 1;
+	int first = 1;
 	int old_meta_prod;
 
 	old_meta_prod = npo->meta_prod;
@@ -462,7 +437,7 @@ static int xenvif_gop_skb(struct sk_buff *skb,
 			len = skb_tail_pointer(skb) - data;
 
 		xenvif_gop_frag_copy(vif, skb, npo,
-				     virt_to_page(data), len, offset, &head);
+				     virt_to_page(data), len, offset, 1, &first);
 		data += len;
 	}
 
@@ -471,7 +446,7 @@ static int xenvif_gop_skb(struct sk_buff *skb,
 				     skb_frag_page(&skb_shinfo(skb)->frags[i]),
 				     skb_frag_size(&skb_shinfo(skb)->frags[i]),
 				     skb_shinfo(skb)->frags[i].page_offset,
-				     &head);
+				     0, &first);
 	}
 
 	return npo->meta_prod - old_meta_prod;
@@ -529,10 +504,6 @@ static void xenvif_add_frag_responses(struct xenvif *vif, int status,
 	}
 }
 
-struct skb_cb_overlay {
-	int meta_slots_used;
-};
-
 static void xenvif_kick_thread(struct xenvif *vif)
 {
 	wake_up(&vif->wq);
@@ -563,19 +534,26 @@ void xenvif_rx_action(struct xenvif *vif)
 	count = 0;
 
 	while ((skb = skb_dequeue(&vif->rx_queue)) != NULL) {
+		RING_IDX old_rx_req_cons;
+
 		vif = netdev_priv(skb->dev);
 		nr_frags = skb_shinfo(skb)->nr_frags;
 
+		old_rx_req_cons = vif->rx.req_cons;
 		sco = (struct skb_cb_overlay *)skb->cb;
 		sco->meta_slots_used = xenvif_gop_skb(skb, &npo);
 
-		count += nr_frags + 1;
+		count += vif->rx.req_cons - old_rx_req_cons;
 
 		__skb_queue_tail(&rxq, skb);
 
+		skb = skb_peek(&vif->rx_queue);
+		if (skb == NULL)
+			break;
+		sco = (struct skb_cb_overlay *)skb->cb;
+
 		/* Filled the batch queue? */
-		/* XXX FIXME: RX path dependent on MAX_SKB_FRAGS */
-		if (count + MAX_SKB_FRAGS >= XEN_NETIF_RX_RING_SIZE)
+		if (count + sco->peek_slots_count >= XEN_NETIF_RX_RING_SIZE)
 			break;
 	}
 
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 2/5] Bluetooth: Fix assignment of 0/1 to bool variables
From: Peter Senna Tschudin @ 2013-09-22 18:44 UTC (permalink / raw)
  To: marcel
  Cc: gustavo, johan.hedberg, davem, linux-bluetooth, netdev,
	linux-kernel, kernel-janitors, Peter Senna Tschudin
In-Reply-To: <1379875453-20083-1-git-send-email-peter.senna@gmail.com>

Convert 0 to false and 1 to true when assigning values to bool
variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@@
bool b;
@@
(
-b = 0
+b = false
|
-b = 1
+b = true
)

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>

---
 net/bluetooth/l2cap_core.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff -u -p a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -5797,7 +5797,7 @@ static int l2cap_rx_state_recv(struct l2
 			       struct sk_buff *skb, u8 event)
 {
 	int err = 0;
-	bool skb_in_use = 0;
+	bool skb_in_use = false;
 
 	BT_DBG("chan %p, control %p, skb %p, event %d", chan, control, skb,
 	       event);
@@ -5818,7 +5818,7 @@ static int l2cap_rx_state_recv(struct l2
 							   control->txseq);
 
 			chan->buffer_seq = chan->expected_tx_seq;
-			skb_in_use = 1;
+			skb_in_use = true;
 
 			err = l2cap_reassemble_sdu(chan, skb, control);
 			if (err)
@@ -5854,7 +5854,7 @@ static int l2cap_rx_state_recv(struct l2
 			 * current frame is stored for later use.
 			 */
 			skb_queue_tail(&chan->srej_q, skb);
-			skb_in_use = 1;
+			skb_in_use = true;
 			BT_DBG("Queued %p (queue len %d)", skb,
 			       skb_queue_len(&chan->srej_q));
 
@@ -5932,7 +5932,7 @@ static int l2cap_rx_state_srej_sent(stru
 {
 	int err = 0;
 	u16 txseq = control->txseq;
-	bool skb_in_use = 0;
+	bool skb_in_use = false;
 
 	BT_DBG("chan %p, control %p, skb %p, event %d", chan, control, skb,
 	       event);
@@ -5944,7 +5944,7 @@ static int l2cap_rx_state_srej_sent(stru
 			/* Keep frame for reassembly later */
 			l2cap_pass_to_tx(chan, control);
 			skb_queue_tail(&chan->srej_q, skb);
-			skb_in_use = 1;
+			skb_in_use = true;
 			BT_DBG("Queued %p (queue len %d)", skb,
 			       skb_queue_len(&chan->srej_q));
 
@@ -5955,7 +5955,7 @@ static int l2cap_rx_state_srej_sent(stru
 
 			l2cap_pass_to_tx(chan, control);
 			skb_queue_tail(&chan->srej_q, skb);
-			skb_in_use = 1;
+			skb_in_use = true;
 			BT_DBG("Queued %p (queue len %d)", skb,
 			       skb_queue_len(&chan->srej_q));
 
@@ -5970,7 +5970,7 @@ static int l2cap_rx_state_srej_sent(stru
 			 * the missing frames.
 			 */
 			skb_queue_tail(&chan->srej_q, skb);
-			skb_in_use = 1;
+			skb_in_use = true;
 			BT_DBG("Queued %p (queue len %d)", skb,
 			       skb_queue_len(&chan->srej_q));
 
@@ -5984,7 +5984,7 @@ static int l2cap_rx_state_srej_sent(stru
 			 * SREJ'd frames.
 			 */
 			skb_queue_tail(&chan->srej_q, skb);
-			skb_in_use = 1;
+			skb_in_use = true;
 			BT_DBG("Queued %p (queue len %d)", skb,
 			       skb_queue_len(&chan->srej_q));
 


^ permalink raw reply

* Re: [PATCH] stable_kernel_rules.txt: Exclude networking from stable rules
From: Christoph Hellwig @ 2013-09-22 18:51 UTC (permalink / raw)
  To: Joe Perches
  Cc: David Miller, stephen, netdev, Mikulas Patocka,
	Greg Kroah-Hartman, Rob Landley, linux-doc, LKML, xfs
In-Reply-To: <1379615474.22168.13.camel@joe-AO722>

This is also the preferred way to do it for XFS.  Maybe word it in a way
that we can easily add subsystems.

To me it generally seems to be the best way to do it - having random Ccs
and lots of stable trees doesn't seem like a very good way of handling
it.


^ permalink raw reply

* Re: [PATCH 2/5] Bluetooth: Fix assignment of 0/1 to bool variables
From: Marcel Holtmann @ 2013-09-22 18:58 UTC (permalink / raw)
  To: Peter Senna Tschudin
  Cc: gustavo-THi1TnShQwVAfugRpC6u6w,
	johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379875453-20083-2-git-send-email-peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi Peter,

> Convert 0 to false and 1 to true when assigning values to bool
> variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2.
> 
> The simplified semantic patch that find this problem is as
> follows (http://coccinelle.lip6.fr/):
> 
> @@
> bool b;
> @@
> (
> -b = 0
> +b = false
> |
> -b = 1
> +b = true
> )
> 
> Signed-off-by: Peter Senna Tschudin <peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> ---
> net/bluetooth/l2cap_core.c |   16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)

Acked-by: Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>

Regards

Marcel

^ permalink raw reply

* Re: [PATCH 2/8 V3] rtlwifi: rtl8192de: Fix smatch warnings in rtl8192de/hw.c
From: Sergei Shtylyov @ 2013-09-22 19:09 UTC (permalink / raw)
  To: Larry Finger
  Cc: linville-2XuSBdqkA4R54TAoqtyWWQ,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379534260-14841-3-git-send-email-Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>

Hello.

On 09/18/2013 11:57 PM, Larry Finger wrote:

> Smatch lists the following:
>    CHECK   drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> drivers/net/wireless/rtlwifi/rtl8192de/hw.c:1200 rtl92de_set_qos() info: ignoring unreachable code.
> drivers/net/wireless/rtlwifi/rtl8192de/hw.c:1200 rtl92de_set_qos() info: ignoring unreachable code.

> The dead code is deleted.

> Signed-off-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
> ---
>   drivers/net/wireless/rtlwifi/rtl8192de/hw.c |   19 -------------------
>   1 file changed, 19 deletions(-)

> Index: wireless-testing-save/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> ===================================================================
> --- wireless-testing-save.orig/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> +++ wireless-testing-save/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> @@ -1194,25 +1194,6 @@ void rtl92d_linked_set_reg(struct ieee80
>    * mac80211 will send pkt when scan */
>   void rtl92de_set_qos(struct ieee80211_hw *hw, int aci)
>   {
> -	struct rtl_priv *rtlpriv = rtl_priv(hw);
> -	rtl92d_dm_init_edca_turbo(hw);

    This call seems reachable...

> -	return;
> -	switch (aci) {
> -	case AC1_BK:
> -		rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, 0xa44f);
> -		break;
> -	case AC0_BE:
> -		break;
> -	case AC2_VI:
> -		rtl_write_dword(rtlpriv, REG_EDCA_VI_PARAM, 0x5e4322);
> -		break;
> -	case AC3_VO:
> -		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
> -		break;
> -	default:
> -		RT_ASSERT(false, "invalid aci: %d !\n", aci);
> -		break;
> -	}
>   }

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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] wireless: rtlwifi: Replace variable with a brake
From: Peter Senna Tschudin @ 2013-09-22 19:24 UTC (permalink / raw)
  To: Larry.Finger
  Cc: chaoming_li, joe, linville, linux-wireless, netdev, linux-kernel,
	kernel-janitors, Peter Senna Tschudin

This patch removes the variable continual, and change the while loop
to break when efuse_data == 0xFF.

CC: Joe Perches <joe@perches.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
Please ignore the patch:
[PATCH 12/19] wireless: Change variable type to bool

And apply this one instead.

The variable continual was declared as int, but was used as bool. I
sent previous patch changing the variable type to bool, but Joe Perches
proposed that removing the variable and adding a brake would be better.

 drivers/net/wireless/rtlwifi/efuse.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 838a1ed..d1328fc 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -1203,19 +1203,18 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate)
 
 static u16 efuse_get_current_size(struct ieee80211_hw *hw)
 {
-	int continual = true;
 	u16 efuse_addr = 0;
 	u8 hworden;
 	u8 efuse_data, word_cnts;
 
-	while (continual && efuse_one_byte_read(hw, efuse_addr, &efuse_data)
-	       && (efuse_addr < EFUSE_MAX_SIZE)) {
-		if (efuse_data != 0xFF) {
+	while (efuse_one_byte_read(hw, efuse_addr, &efuse_data) &&
+					(efuse_addr < EFUSE_MAX_SIZE)) {
+		if (efuse_data == 0xFF)
+			break;
+
 			hworden = efuse_data & 0x0F;
 			word_cnts = efuse_calculate_word_cnts(hworden);
 			efuse_addr = efuse_addr + (word_cnts * 2) + 1;
-		} else {
-			continual = false;
 		}
 	}
 
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH V2] wireless: rtlwifi: Replace variable with a brake
From: Peter Senna Tschudin @ 2013-09-22 19:50 UTC (permalink / raw)
  To: Larry.Finger
  Cc: chaoming_li, joe, linville, linux-wireless, netdev, linux-kernel,
	kernel-janitors, Peter Senna Tschudin

This patch removes the variable continual, and change the while loop
to break when efuse_data == 0xFF.

Tested by compilation only.

CC: Joe Perches <joe@perches.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
Changes from V1:
 - Fix the indetation
 - Remove remaining } from removed else

Please ignore the patch:
[PATCH 12/19] wireless: Change variable type to bool

And apply this one instead.

The variable continual was declared as int, but was used as bool. I
sent previous patch changing the variable type to bool, but Joe Perches
proposed that removing the variable and adding a brake would be better.

 drivers/net/wireless/rtlwifi/efuse.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 838a1ed..2aedd9f 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -1203,20 +1203,18 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate)
 
 static u16 efuse_get_current_size(struct ieee80211_hw *hw)
 {
-	int continual = true;
 	u16 efuse_addr = 0;
 	u8 hworden;
 	u8 efuse_data, word_cnts;
 
-	while (continual && efuse_one_byte_read(hw, efuse_addr, &efuse_data)
-	       && (efuse_addr < EFUSE_MAX_SIZE)) {
-		if (efuse_data != 0xFF) {
-			hworden = efuse_data & 0x0F;
-			word_cnts = efuse_calculate_word_cnts(hworden);
-			efuse_addr = efuse_addr + (word_cnts * 2) + 1;
-		} else {
-			continual = false;
-		}
+	while (efuse_one_byte_read(hw, efuse_addr, &efuse_data) &&
+					(efuse_addr < EFUSE_MAX_SIZE)) {
+		if (efuse_data == 0xFF)
+			break;
+
+		hworden = efuse_data & 0x0F;
+		word_cnts = efuse_calculate_word_cnts(hworden);
+		efuse_addr = efuse_addr + (word_cnts * 2) + 1;
 	}
 
 	return efuse_addr;
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH V2] wireless: rtlwifi: Replace variable with a brake
From: Sergei Shtylyov @ 2013-09-22 19:56 UTC (permalink / raw)
  To: Peter Senna Tschudin
  Cc: Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ,
	chaoming_li-kXabqFNEczNtrwSWzY7KCg, joe-6d6DIl74uiNBDgjK7y7TUQ,
	linville-2XuSBdqkA4R54TAoqtyWWQ,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379879410-22787-1-git-send-email-peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hello.

On 09/22/2013 11:50 PM, Peter Senna Tschudin wrote:

    You have a typo in the subject -- "brake" is a device to stop a vehicle. :-)

> This patch removes the variable continual, and change the while loop
> to break when efuse_data == 0xFF.

> Tested by compilation only.

> CC: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Peter Senna Tschudin <peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> Changes from V1:
>   - Fix the indetation
>   - Remove remaining } from removed else

> Please ignore the patch:
> [PATCH 12/19] wireless: Change variable type to bool

> And apply this one instead.

> The variable continual was declared as int, but was used as bool. I
> sent previous patch changing the variable type to bool, but Joe Perches
> proposed that removing the variable and adding a brake would be better.

>   drivers/net/wireless/rtlwifi/efuse.c | 18 ++++++++----------
>   1 file changed, 8 insertions(+), 10 deletions(-)

> diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
> index 838a1ed..2aedd9f 100644
> --- a/drivers/net/wireless/rtlwifi/efuse.c
> +++ b/drivers/net/wireless/rtlwifi/efuse.c
> @@ -1203,20 +1203,18 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate)
>
>   static u16 efuse_get_current_size(struct ieee80211_hw *hw)
>   {
> -	int continual = true;
>   	u16 efuse_addr = 0;
>   	u8 hworden;
>   	u8 efuse_data, word_cnts;
>
> -	while (continual && efuse_one_byte_read(hw, efuse_addr, &efuse_data)
> -	       && (efuse_addr < EFUSE_MAX_SIZE)) {
> -		if (efuse_data != 0xFF) {
> -			hworden = efuse_data & 0x0F;
> -			word_cnts = efuse_calculate_word_cnts(hworden);
> -			efuse_addr = efuse_addr + (word_cnts * 2) + 1;
> -		} else {
> -			continual = false;
> -		}
> +	while (efuse_one_byte_read(hw, efuse_addr, &efuse_data) &&
> +					(efuse_addr < EFUSE_MAX_SIZE)) {

    Start this line under efuse_one_byte_read, please. Also, parens are not 
needed.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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] declance: Remove `incompatible pointer type' warnings
From: Maciej W. Rozycki @ 2013-09-22 20:19 UTC (permalink / raw)
  To: David Miller; +Cc: Sergei Shtylyov, netdev
In-Reply-To: <20130920.144304.2081229489870626586.davem@davemloft.net>

Revert damage caused by 43d620c82985b19008d87a437b4cf83f356264f7 
[drivers/net: Remove casts of void *]:

.../declance.c: In function 'cp_to_buf':
.../declance.c:347: warning: assignment from incompatible pointer type
.../declance.c:348: warning: assignment from incompatible pointer type
.../declance.c: In function 'cp_from_buf':
.../declance.c:406: warning: assignment from incompatible pointer type
.../declance.c:407: warning: assignment from incompatible pointer type

Also add a `const' qualifier where applicable and adjust formatting.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
> Applied to net-next

 Thanks, by Sergei's request please use this version instead that has the 
reference to the original commit updated (no change to the patch itself).

  Maciej

linux-declance-cast-fix.patch
Index: linux-mips-3.12.0-rc1-20130917-4maxp/drivers/net/ethernet/amd/declance.c
===================================================================
--- linux-mips-3.12.0-rc1-20130917-4maxp.orig/drivers/net/ethernet/amd/declance.c
+++ linux-mips-3.12.0-rc1-20130917-4maxp/drivers/net/ethernet/amd/declance.c
@@ -344,8 +344,8 @@ static void cp_to_buf(const int type, vo
 		}
 
 		clen = len & 1;
-		rtp = tp;
-		rfp = fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}
@@ -372,8 +372,8 @@ static void cp_to_buf(const int type, vo
 		 * do the rest, if any.
 		 */
 		clen = len & 15;
-		rtp = (unsigned char *) tp;
-		rfp = (unsigned char *) fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}
@@ -403,8 +403,8 @@ static void cp_from_buf(const int type, 
 
 		clen = len & 1;
 
-		rtp = tp;
-		rfp = fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 
 		while (clen--) {
 			*rtp++ = *rfp++;
@@ -433,8 +433,8 @@ static void cp_from_buf(const int type, 
 		 * do the rest, if any.
 		 */
 		clen = len & 15;
-		rtp = (unsigned char *) tp;
-		rfp = (unsigned char *) fp;
+		rtp = (unsigned char *)tp;
+		rfp = (const unsigned char *)fp;
 		while (clen--) {
 			*rtp++ = *rfp++;
 		}

^ permalink raw reply

* [PATCH V3] wireless: rtlwifi: Replace variable with a break
From: Peter Senna Tschudin @ 2013-09-22 20:22 UTC (permalink / raw)
  To: Larry.Finger
  Cc: joe, sergei.shtylyov, chaoming_li, linville, linux-wireless,
	netdev, linux-kernel, kernel-janitors, Peter Senna Tschudin

This patch removes the variable continual, and change the while loop
to break when efuse_data == 0xFF.

Tested by compilation only.

CC: Joe Perches <joe@perches.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
Changes from V2:
 - Fix typo in the subject
 - Fix indentation

Changes from V1:
 - Fix the indetation
 - Remove remaining } from removed else

Please ignore the patch:
[PATCH 12/19] wireless: Change variable type to bool

And apply this one instead.

The variable continual was declared as int, but was used as bool. I
sent previous patch changing the variable type to bool, but Joe Perches
proposed that removing the variable and adding a break would be better.

 drivers/net/wireless/rtlwifi/efuse.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 838a1ed..ae13fb9 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -1203,20 +1203,18 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate)
 
 static u16 efuse_get_current_size(struct ieee80211_hw *hw)
 {
-	int continual = true;
 	u16 efuse_addr = 0;
 	u8 hworden;
 	u8 efuse_data, word_cnts;
 
-	while (continual && efuse_one_byte_read(hw, efuse_addr, &efuse_data)
-	       && (efuse_addr < EFUSE_MAX_SIZE)) {
-		if (efuse_data != 0xFF) {
-			hworden = efuse_data & 0x0F;
-			word_cnts = efuse_calculate_word_cnts(hworden);
-			efuse_addr = efuse_addr + (word_cnts * 2) + 1;
-		} else {
-			continual = false;
-		}
+	while (efuse_one_byte_read(hw, efuse_addr, &efuse_data) &&
+	       efuse_addr < EFUSE_MAX_SIZE) {
+		if (efuse_data == 0xFF)
+			break;
+
+		hworden = efuse_data & 0x0F;
+		word_cnts = efuse_calculate_word_cnts(hworden);
+		efuse_addr = efuse_addr + (word_cnts * 2) + 1;
 	}
 
 	return efuse_addr;
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH V2] wireless: rtlwifi: Replace variable with a brake
From: Peter Senna Tschudin @ 2013-09-22 20:24 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Larry.Finger, chaoming_li, Joe Perches, John Linville,
	linux-wireless, netdev, linux-kernel, kernel-janitors
In-Reply-To: <523F4B76.80507@cogentembedded.com>

On Sun, Sep 22, 2013 at 9:56 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello.
>
> On 09/22/2013 11:50 PM, Peter Senna Tschudin wrote:
>
>    You have a typo in the subject -- "brake" is a device to stop a vehicle.
> :-)
Thanks, there was other similar typo after ---

>
>
>> This patch removes the variable continual, and change the while loop
>> to break when efuse_data == 0xFF.
>
>
>> Tested by compilation only.
>
>
>> CC: Joe Perches <joe@perches.com>
>> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
>> ---
>> Changes from V1:
>>   - Fix the indetation
>>   - Remove remaining } from removed else
>
>
>> Please ignore the patch:
>> [PATCH 12/19] wireless: Change variable type to bool
>
>
>> And apply this one instead.
>
>
>> The variable continual was declared as int, but was used as bool. I
>> sent previous patch changing the variable type to bool, but Joe Perches
>> proposed that removing the variable and adding a brake would be better.
>
>
>>   drivers/net/wireless/rtlwifi/efuse.c | 18 ++++++++----------
>>   1 file changed, 8 insertions(+), 10 deletions(-)
>
>
>> diff --git a/drivers/net/wireless/rtlwifi/efuse.c
>> b/drivers/net/wireless/rtlwifi/efuse.c
>> index 838a1ed..2aedd9f 100644
>> --- a/drivers/net/wireless/rtlwifi/efuse.c
>> +++ b/drivers/net/wireless/rtlwifi/efuse.c
>> @@ -1203,20 +1203,18 @@ static void efuse_power_switch(struct ieee80211_hw
>> *hw, u8 write, u8 pwrstate)
>>
>>   static u16 efuse_get_current_size(struct ieee80211_hw *hw)
>>   {
>> -       int continual = true;
>>         u16 efuse_addr = 0;
>>         u8 hworden;
>>         u8 efuse_data, word_cnts;
>>
>> -       while (continual && efuse_one_byte_read(hw, efuse_addr,
>> &efuse_data)
>> -              && (efuse_addr < EFUSE_MAX_SIZE)) {
>> -               if (efuse_data != 0xFF) {
>> -                       hworden = efuse_data & 0x0F;
>> -                       word_cnts = efuse_calculate_word_cnts(hworden);
>> -                       efuse_addr = efuse_addr + (word_cnts * 2) + 1;
>> -               } else {
>> -                       continual = false;
>> -               }
>> +       while (efuse_one_byte_read(hw, efuse_addr, &efuse_data) &&
>> +                                       (efuse_addr < EFUSE_MAX_SIZE)) {
>
>
>    Start this line under efuse_one_byte_read, please. Also, parens are not
> needed.
Fixed on V3.

Thanks!

>
> WBR, Sergei
>



-- 
Peter

^ permalink raw reply

* Re: Bug - regression - Via velocity interface coming up freezes kernel
From: Francois Romieu @ 2013-09-22 22:11 UTC (permalink / raw)
  To: Dirk Kraft; +Cc: netdev, Julia Lawall
In-Reply-To: <CAFES+i+OYq_dDtEqAqkW7qYDrtdzkqc9hBGBDODQuqgvFJE7zg@mail.gmail.com>

Dirk Kraft <dirk.kraft@gmail.com> :
[...]
> I observe problems with my machine freezing when bringing up the
> network interface (via velocity based). Detailed report below.
> 
> First message was rejected because of html. Julia Lawall, sorry about
> sending multiple copies.
> 
> [1.] One line summary of the problem:
> Via_velocity interface coming up freezes kernel - WARNING: CPU: 0 PID:
> 1529 at /build/buildd/linux-3.11.0/kernel/softirq.c:159
> local_bh_enable+0x60/0x90()

netif_receive_skb with irq disabled ?

You can try this one as a wild guess before I have more time to analyze.

diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index d022bf9..64c42be 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -2172,16 +2172,13 @@ static int velocity_poll(struct napi_struct *napi, int budget)
 	unsigned int rx_done;
 	unsigned long flags;
 
-	spin_lock_irqsave(&vptr->lock, flags);
 	/*
 	 * Do rx and tx twice for performance (taken from the VIA
 	 * out-of-tree driver).
 	 */
-	rx_done = velocity_rx_srv(vptr, budget / 2);
-	velocity_tx_srv(vptr);
-	rx_done += velocity_rx_srv(vptr, budget - rx_done);
+	rx_done = velocity_rx_srv(vptr, budget);
+	spin_lock_irqsave(&vptr->lock, flags);
 	velocity_tx_srv(vptr);
-
 	/* If budget not fully consumed, exit the polling mode */
 	if (rx_done < budget) {
 		napi_complete(napi);

^ permalink raw reply related

* Re: [PATCH 2/5] Bluetooth: Fix assignment of 0/1 to bool variables
From: Gustavo Padovan @ 2013-09-22 22:21 UTC (permalink / raw)
  To: Peter Senna Tschudin
  Cc: marcel-kz+m5ild9QBg9hUCZPvPmw,
	johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379875453-20083-2-git-send-email-peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi Peter,

2013-09-22 Peter Senna Tschudin <peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:

> Convert 0 to false and 1 to true when assigning values to bool
> variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2.
> 
> The simplified semantic patch that find this problem is as
> follows (http://coccinelle.lip6.fr/):
> 
> @@
> bool b;
> @@
> (
> -b = 0
> +b = false
> |
> -b = 1
> +b = true
> )
> 
> Signed-off-by: Peter Senna Tschudin <peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> ---
>  net/bluetooth/l2cap_core.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

Patch has been applied to bluetooth-next. Thanks.

	Gustavo

^ permalink raw reply

* Re: [Xen-devel] [PATCH net-next] xen-netfront: convert to GRO API and advertise this feature
From: Anirban Chakraborty @ 2013-09-22 23:04 UTC (permalink / raw)
  To: Wei Liu
  Cc: Jason Wang, <netdev@vger.kernel.org>, Ian Campbell,
	<xen-devel@lists.xen.org>
In-Reply-To: <20130922120936.GA4079@zion.uk.xensource.com>


On Sep 22, 2013, at 5:09 AM, Wei Liu <wei.liu2@citrix.com> wrote:

> On Sun, Sep 22, 2013 at 02:29:15PM +0800, Jason Wang wrote:
>> On 09/22/2013 12:05 AM, Wei Liu wrote:
>>> Anirban was seeing netfront received MTU size packets, which downgraded
>>> throughput. The following patch makes netfront use GRO API which
>>> improves throughput for that case.
>>> 
>>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>>> Signed-off-by: Anirban Chakraborty <abchak@juniper.net>
>>> Cc: Ian Campbell <ian.campbell@citrix.com>
>> 
>> Maybe a dumb question: doesn't Xen depends on the driver of host card to
>> do GRO and pass it to netfront? What the case that netfront can receive
> 
> The would be the ideal situation. Netback pushes large packets to
> netfront and netfront sees large packets.
> 
>> a MTU size packet, for a card that does not support GRO in host? Doing
> 
> However Anirban saw the case when backend interface receives large
> packets but netfront sees MTU size packets, so my thought is there is
> certain configuration that leads to this issue. As we cannot tell
> users what to enable and what not to enable so I would like to solve
> this within our driver.
> 
>> GRO twice may introduce extra overheads.
>> 
> 
> AIUI if the packet that frontend sees is large already then the GRO path
> is quite short which will not introduce heavy penalty, while on the
> other hand if packet is segmented doing GRO improves throughput.
> 

Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already. 

-Anirban

^ permalink raw reply

* Re: [PATCH net-next] xen-netfront: convert to GRO API and advertise this feature
From: Anirban Chakraborty @ 2013-09-22 23:09 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Wei Liu, <netdev@vger.kernel.org>,
	<xen-devel@lists.xen.org>, Ian Campbell
In-Reply-To: <1379861723.3431.10.camel@edumazet-glaptop>


On Sep 22, 2013, at 7:55 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:

> On Sat, 2013-09-21 at 17:05 +0100, Wei Liu wrote:
>> Anirban was seeing netfront received MTU size packets, which downgraded
>> throughput. The following patch makes netfront use GRO API which
>> improves throughput for that case.
> 
>> -	netdev->hw_features	= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO;
>> +	netdev->hw_features	= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO |
>> +				  NETIF_F_GRO;
> 
> 
> This part is not needed.

Shouldn't the flag be set? In dev_gro_receive() we do check if this flag is set or not:

        if (!(skb->dev->features & NETIF_F_GRO) || netpoll_rx_on(skb))
               goto normal;

-Anirban

^ permalink raw reply

* Re: [PATCH] ipv6: udp packets following an UFO enqueued packet need also be handled by UFO
From: Hannes Frederic Sowa @ 2013-09-23  0:43 UTC (permalink / raw)
  To: netdev, yoshfuji, davem, dvyukov; +Cc: pjt, andreyknvl, kcc, therbert
In-Reply-To: <20130921042700.GB8070@order.stressinduktion.org>

On Sat, Sep 21, 2013 at 06:27:00AM +0200, Hannes Frederic Sowa wrote:
> In the following scenario the socket is corked:
> If the first UDP packet is larger then the mtu we try to append it to the
> write queue via ip6_ufo_append_data. A following packet, which is smaller
> than the mtu would be appended to the already queued up gso-skb via
> plain ip6_append_data. This causes random memory corruptions.
> 
> In ip6_ufo_append_data we also have to be careful to not queue up the
> same skb multiple times. So setup the gso frame only when no first skb
> is available.
> 
> This also fixes a shortcoming where we add the current packet's length to
> cork->length but return early because of a packet > mtu with dontfrag set
> (instead of sutracting it again).
> 
> Found with trinity.
> 
> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Further analysis showed it is very probable that this fixes the bug Dmitry
reported. So I want to give proper credits:

Reported-by: Dmitry Vyukov <dvyukov@google.com>

^ permalink raw reply

* Hallo
From: Wonga Business Loan @ 2013-09-23  0:32 UTC (permalink / raw)


goedendag
    Ik ben mevrouw Juliet kjell van Wonga Business Loan we zijn lening kredietverstrekkers en vastgoed, willen we degenen die financiële hulp nodig hebben te bereiken. Wij bieden zakelijke leningen, persoonlijke leningen, autoleningen, leningen, opleiding en medische leningen,
Wij bieden leningen aan bedrijven (klein of groot) Ook bieden wij leningen @ 3%-tarief. Onze missie is om de behoeftigen te helpen. Als belanghebbende aanvragers moeten de volgende gegevens in te dienen:
Naam van de aanvrager:
land:
Geslacht:
Bedrag dat nodig is:
doel:
duur:
Postcode:
telefoon:
Voldoen aan uw financiële behoeften is onze trots.
E-mail ons: wbl.org@manager.in.th
Lening goedkeuring manager
Mevrouw Julia kjell

^ permalink raw reply

* Re: [PATCH 01/12] ping.h: Remove extern from function prototypes
From: Ryan Mallon @ 2013-09-23  1:59 UTC (permalink / raw)
  To: Joe Perches; +Cc: netdev, David S. Miller, linux-kernel
In-Reply-To: <b692aba58032f629907ea2d462c99b87906645ca.1379870986.git.joe@perches.com>

On 23/09/13 03:32, Joe Perches wrote:
> There are a mix of function prototypes with and without extern
> in the kernel sources.  Standardize on not using extern for
> function prototypes.
> 
> Function prototypes don't need to be written with extern.
> extern is assumed by the compiler.  Its use is as unnecessary as
> using auto to declare automatic/local variables in a block.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

This seems like a lot of code churn for very little benefit. At a quick
glance:

  git grep extern include/ | wc -l
  11427

Not all of those will need to be removed, but that is still a huge
number to change, and doesn't include extern usage in C files or local
headers. You are probably never going to remove all the instances, so
what is the point of just randomly doing a handful?

~Ryan

> ---
>  include/net/ping.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/net/ping.h b/include/net/ping.h
> index 5db0224..3f67704 100644
> --- a/include/net/ping.h
> +++ b/include/net/ping.h
> @@ -103,8 +103,8 @@ void ping_seq_stop(struct seq_file *seq, void *v);
>  int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo);
>  void ping_proc_unregister(struct net *net, struct ping_seq_afinfo *afinfo);
>  
> -extern int __init ping_proc_init(void);
> -extern void ping_proc_exit(void);
> +int __init ping_proc_init(void);
> +void ping_proc_exit(void);
>  #endif
>  
>  void __init ping_init(void);
> 

^ permalink raw reply

* Re: [PATCH 01/12] ping.h: Remove extern from function prototypes
From: Joe Perches @ 2013-09-23  2:16 UTC (permalink / raw)
  To: Ryan Mallon; +Cc: netdev, David S. Miller, linux-kernel
In-Reply-To: <523FA098.9050200@gmail.com>

On Mon, 2013-09-23 at 11:59 +1000, Ryan Mallon wrote:
> This seems like a lot of code churn for very little benefit. At a quick
> glance:
> 
>   git grep extern include/ | wc -l
>   11427
> 
> Not all of those will need to be removed, but that is still a huge
> number to change, and doesn't include extern usage in C files or local
> headers. You are probably never going to remove all the instances, so
> what is the point of just randomly doing a handful?

Rather more than a handful.

The ratio of function prototypes without extern to
function prototypes with extern is currently ~2.5:1

So:

Standardization without extern
Line count reduction (~10%)
Miscellaneous neatening at the same time
Removal of all unnecessary externs from include/net

There are ~8500 instances in include/
There are ~1500 instances in include/net/

After this series, 0 in include/net/

Start somewhere, go from there...

$ git grep -E "^\s*\bextern(\s+\w+){1,4}\s*\(\s*[^\*]" include/ | wc -l
8395
$ git grep -E "^\s*\bextern(\s+\w+){1,4}\s*\(\s*[^\*]" include/net/ | wc -l
1471

^ permalink raw reply

* Re: [net-next] Fix hardcoded interrupt name lp->name to use system device value
From: Matthew Whitehead @ 2013-09-23  2:25 UTC (permalink / raw)
  To: Nate Levesque; +Cc: netdev
In-Reply-To: <1379789381-3992-1-git-send-email-thenaterhood@gmail.com>

On Sat, Sep 21, 2013 at 06:49:41PM +0000, Nate Levesque wrote:
> The lance interrupt handler was using the hard-coded name which would make it difficult to tell where the interrupt came from. Changed to use the device name that made the interrupt.
> 
> Signed-off-by: Nate Levesque <thenaterhood@gmail.com>
> ---
>  drivers/net/ethernet/amd/lance.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/amd/lance.c b/drivers/net/ethernet/amd/lance.c
> index 5c72843..256f590 100644
> --- a/drivers/net/ethernet/amd/lance.c
> +++ b/drivers/net/ethernet/amd/lance.c
> @@ -754,7 +754,7 @@ lance_open(struct net_device *dev)
>  	int i;
>  
>  	if (dev->irq == 0 ||
> -		request_irq(dev->irq, lance_interrupt, 0, lp->name, dev)) {
> +		request_irq(dev->irq, lance_interrupt, 0, dev->name, dev)) {
>  		return -EAGAIN;
>  	}
>  
> -- 
> 1.8.1.2
> 
> --
> 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

Reviewed-by: Matthew Whitehead <tedheadster@gmail.com>

^ permalink raw reply

* Re: [net-next] hp100: replace hardcoded name in /proc/interrupts with interface name
From: Matthew Whitehead @ 2013-09-23  2:26 UTC (permalink / raw)
  To: Mihir Singh; +Cc: netdev
In-Reply-To: <1379789289-10961-1-git-send-email-me@mihirsingh.com>

On Sat, Sep 21, 2013 at 06:48:09PM +0000, Mihir Singh wrote:
> The /proc/interrupts file displays hp100, which is not the accepted style. Printing eth%d is more helpful.
> 
> Signed-off-by: Mihir Singh <me@mihirsingh.com>
> ---
>  drivers/net/ethernet/hp/hp100.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
> index 91227d0..3786009 100644
> --- a/drivers/net/ethernet/hp/hp100.c
> +++ b/drivers/net/ethernet/hp/hp100.c
> @@ -1098,7 +1098,7 @@ static int hp100_open(struct net_device *dev)
>  	if (request_irq(dev->irq, hp100_interrupt,
>  			lp->bus == HP100_BUS_PCI || lp->bus ==
>  			HP100_BUS_EISA ? IRQF_SHARED : 0,
> -			"hp100", dev)) {
> +			dev->name, dev)) {
>  		printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq);
>  		return -EAGAIN;
>  	}
> -- 
> 1.8.1.2
> 
> --
> 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

Reviewed-By: Matthew Whitehead <tedheadster@gmail.com>

^ permalink raw reply

* Re: [PATCH 01/12] ping.h: Remove extern from function prototypes
From: Ryan Mallon @ 2013-09-23  2:38 UTC (permalink / raw)
  To: Joe Perches; +Cc: netdev, David S. Miller, linux-kernel
In-Reply-To: <1379902599.3575.9.camel@joe-AO722>

On 23/09/13 12:16, Joe Perches wrote:
> On Mon, 2013-09-23 at 11:59 +1000, Ryan Mallon wrote:
>> This seems like a lot of code churn for very little benefit. At a quick
>> glance:
>>
>>   git grep extern include/ | wc -l
>>   11427
>>
>> Not all of those will need to be removed, but that is still a huge
>> number to change, and doesn't include extern usage in C files or local
>> headers. You are probably never going to remove all the instances, so
>> what is the point of just randomly doing a handful?
> 
> Rather more than a handful.
> 
> The ratio of function prototypes without extern to
> function prototypes with extern is currently ~2.5:1
> 
> So:
> 
> Standardization without extern
> Line count reduction (~10%)
> Miscellaneous neatening at the same time
> Removal of all unnecessary externs from include/net
> 
> There are ~8500 instances in include/
> There are ~1500 instances in include/net/
> 
> After this series, 0 in include/net/
> 
> Start somewhere, go from there...
> 
> $ git grep -E "^\s*\bextern(\s+\w+){1,4}\s*\(\s*[^\*]" include/ | wc -l
> 8395
> $ git grep -E "^\s*\bextern(\s+\w+){1,4}\s*\(\s*[^\*]" include/net/ | wc -l
> 1471

Right, and:

  $ git grep -E "^\s*\bextern(\s+\w+){1,4}\s*\(\s*[^\*]" | wc -l
  29104

Since there are lots of local/arch headers, and there are uses of extern
function prototypes in C files.

I don't see the real benefit though. Its like trying to "clean-up" the
difference between "unsigned x" and "unsigned int x", or any number of
other minor style differences. Either version, with or without the
extern, is correct, valid C code. Plus you will get people adding new
instances of extern because they don't know any better. A checkpatch
rule might help, but we all know how often people run that...

~Ryan

^ permalink raw reply

* Re: [PATCH 01/12] ping.h: Remove extern from function prototypes
From: Joe Perches @ 2013-09-23  2:43 UTC (permalink / raw)
  To: Ryan Mallon; +Cc: netdev, David S. Miller, linux-kernel
In-Reply-To: <523FA98E.4080908@gmail.com>

On Mon, 2013-09-23 at 12:38 +1000, Ryan Mallon wrote:
> A checkpatch rule might help,

Extant.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox