Netdev List
 help / color / mirror / Atom feed
* rps: Fix build with CONFIG_SYSFS enabled
From: Tom Herbert @ 2010-03-22 20:57 UTC (permalink / raw)
  To: davem; +Cc: netdev

Fix build with CONFIG_SYSFS not enabled.


Signed-off-by: Tom Herbert <therbert@google.com>
---
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 7a46343..f6b6bfe 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -739,7 +739,9 @@ void netdev_unregister_kobject(struct net_device * net)
 	if (!net_eq(dev_net(net), &init_net))
 		return;
 
+#ifdef CONFIG_SYSFS
 	rx_queue_remove_kobjects(net);
+#endif
 
 	device_del(dev);
 }
@@ -780,11 +782,13 @@ int netdev_register_kobject(struct net_device *net)
 	if (error)
 		return error;
 
+#ifdef CONFIG_SYSFS
 	error = rx_queue_register_kobjects(net);
 	if (error) {
 		device_del(dev);
 		return error;
 	}
+#endif
 
 	return error;
 }


^ permalink raw reply related

* Re: [Uclinux-dist-devel] [PATCH] can: bfin_can: switch to common Blackfin can header
From: Mike Frysinger @ 2010-03-22 21:09 UTC (permalink / raw)
  To: David Miller
  Cc: socketcan-core, netdev, uclinux-dist-devel, oliver.hartkopp,
	urs.thuermann
In-Reply-To: <20100322.101720.133896229.davem@davemloft.net>

On Mon, Mar 22, 2010 at 13:17, David Miller wrote:
> From: Mike Frysinger <vapier.adi@gmail.com>
>> On Sun, Mar 21, 2010 at 23:58, David Miller wrote:
>>> From: Mike Frysinger <vapier.adi@gmail.com>
>>> When I say "resubmit" I've deleted your patch from my inbox
>>> and marked it "changed requested" or similar in patchwork
>>> so it doesn't show up in the todo list any more.
>>
>> i missed the relevance of your original "resubmit" because no other
>> maintainer ive worked with so far has exhibited this behavior, and
>> there wasnt any indication as to why a resubmission was necessary
>> considering no changes were made
>
> So when I ask you to resubmit something you just assume that
> I have no reason whatsoever for doing so?

like i said, the word "resubmit" did not equate exactly with "resend
the exact same patch".  your e-mail came across (wrt how most every
one else ive worked with) as "poke me again when it's ready in
mainline".  once Linus merged things, i gave you a poke.

> Do you still feel this way after people other than me also asked you
> to do the same exact thing for me?  Do you think they are making
> arbitrary requests as well?

the only other person to say anything did not say "you now need to
resend your patch".  it was "please wait until Linus has pulled things
and then Dave has pulled things".  which was not relevant at the point
it was sent.

> This is the fatal flaw in your logic and behavior.

take a chill pill man
-mike

^ permalink raw reply

* RE: Gianfar: RX Recycle skb->len error
From: Ben Menchaca (ben@bigfootnetworks.com) @ 2010-03-22 21:10 UTC (permalink / raw)
  To: avorontsov@ru.mvista.com, David Miller
  Cc: netdev@vger.kernel.org, Sandeep.Kumar@freescale.com
In-Reply-To: <20100322172446.GA32758@oksana.dev.rtsoft.ru>

> Yes, skb_unreserve() (or skb_reset_reserved() for naming consistency?)
> would be great.

Just a couple of notes:
	It's yucky, but skb_reserve(skb, -alignamount) works, if you know the alignamount (which I discuss a bit below).  If that's not intended, then should len be unsigned int?  skb_put, skb_push, and skb_pull all seem to be unsigned int.

	It seems in both these cases for gianfar, the amount of the alignment is not immediately available to the code the recognizes that the skb_reset_reserved() is required.  A bit larger rework appears to be needed.  

I took a shot at using a new heuristic for the rx_ring to prevent having to skb_reset_reserved() at all.  The idea is to guarantee that the elements in ring are reserve()-ed, and that if we encounter an error condition that yields the two-skb case, free the new skb, since it has not yet been reserve()-ed.  Looking forward to hearing from FS on the "right" way, though.

Ben Menchaca
Bigfoot Networks

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index b671555..82f8486 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -109,6 +109,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static void gfar_reset_task(struct work_struct *work);
 static void gfar_timeout(struct net_device *dev);
 static int gfar_close(struct net_device *dev);
+static void gfar_skb_reserve_aligned(struct sk_buff *skb);
 struct sk_buff *gfar_new_skb(struct net_device *dev);
 static void gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp,
 		struct sk_buff *skb);
@@ -214,6 +215,7 @@ static int gfar_init_bds(struct net_device *ndev)
 							ndev->name);
 					goto err_rxalloc_fail;
 				}
+				gfar_skb_reserve_aligned(ndev);
 				rx_queue->rx_skbuff[j] = skb;
 
 				gfar_new_rxbdp(rx_queue, rxbdp, skb);
@@ -2372,6 +2374,20 @@ static void gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp,
 }
 
 
+static void gfar_skb_reserve_aligned(struct sk_buff *skb)
+{
+	unsigned int alignamount;
+
+        alignamount = RXBUF_ALIGNMENT -
+                (((unsigned long) skb->data) & (RXBUF_ALIGNMENT - 1));
+
+        /* We need the data buffer to be aligned properly.  We will reserve
+         * as many bytes as needed to align the data properly
+         */
+        skb_reserve(skb, alignamount);
+}
+
+
 struct sk_buff * gfar_new_skb(struct net_device *dev)
 {
 	unsigned int alignamount;
@@ -2383,17 +2399,6 @@ struct sk_buff * gfar_new_skb(struct net_device *dev)
 		skb = netdev_alloc_skb(dev,
 				priv->rx_buffer_size + RXBUF_ALIGNMENT);
 
-	if (!skb)
-		return NULL;
-
-	alignamount = RXBUF_ALIGNMENT -
-		(((unsigned long) skb->data) & (RXBUF_ALIGNMENT - 1));
-
-	/* We need the data buffer to be aligned properly.  We will reserve
-	 * as many bytes as needed to align the data properly
-	 */
-	skb_reserve(skb, alignamount);
-
 	return skb;
 }
 
@@ -2532,21 +2537,17 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
 			if (unlikely(!newskb))
 				newskb = skb;
 			else if (skb) {
-				/*
-				 * We need to reset ->data to what it
-				 * was before gfar_new_skb() re-aligned
-				 * it to an RXBUF_ALIGNMENT boundary
-				 * before we put the skb back on the
-				 * recycle list.
-				 */
-				skb->data = skb->head + NET_SKB_PAD;
-				__skb_queue_head(&priv->rx_recycle, skb);
+				__skb_queue_head(&priv->rx_recycle, newskb);
+				newskb = skb;
+			} else {
+				gfar_skb_reserve_aligned(newskb);
 			}
 		} else {
 			/* Increment the number of packets */
 			rx_queue->stats.rx_packets++;
 			howmany++;
 
+			gfar_skb_reserve_aligned(newskb);
 			if (likely(skb)) {
 				pkt_len = bdp->length - ETH_FCS_LEN;
 				/* Remove the FCS from the packet length */



^ permalink raw reply related

* Re: 2.6.34-rc2: Reported regressions from 2.6.33
From: Rafael J. Wysocki @ 2010-03-22 21:20 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Alex Villacis Lasso, Linux Kernel Mailing List, Maciej Rutecki,
	Andrew Morton, Kernel Testers List, Network Development,
	Linux ACPI, Linux PM List, Linux SCSI List, Linux Wireless List,
	DRI
In-Reply-To: <alpine.LFD.2.00.1003221012270.18017@i5.linux-foundation.org>

On Monday 22 March 2010, Linus Torvalds wrote:
> 
> On Sun, 21 Mar 2010, Rafael J. Wysocki wrote:
> > 
> > Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=15495
> > Subject		: Flood of SELinux denials on polkitd
> > Submitter	: Alex Villacis Lasso <avillaci@ceibo.fiec.espol.edu.ec>
> > Date		: 2010-03-09 16:47 (13 days old)
> 
> Fixed by commit 3836a03d978e68b0ae00d3589089343c998cd4ff ("anon_inodes: 
> mark the anon inode private"), I'm pretty sure.

Thanks, closed.

Rafael

^ permalink raw reply

* Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module
From: Wolfgang Grandegger @ 2010-03-22 21:24 UTC (permalink / raw)
  To: Ira W. Snyder
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, sameo-VuQAYsv1563Yd54FQh9/CA
In-Reply-To: <20100322205101.GC19327-lulEs6mt1IksTUYHLfqkUA@public.gmane.org>

Ira W. Snyder wrote:
> On Mon, Mar 22, 2010 at 09:28:25PM +0100, Wolfgang Grandegger wrote:
> 
> [ big snip ]
> 
>> You could even add the tx/rx values for each error message (for both,
>> state changes and bus-errors).
>>
> 
> Ok, with that change, I get the following:
> 
> berr-reporting on:
> 
>   can0  20000088  [8] 00 00 80 19 00 00 08 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 10 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 18 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 20 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 28 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 30 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 38 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 40 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 48 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 50 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 58 00   ERRORFRAME
>   can0  20000004  [8] 00 08 00 00 00 00 60 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 60 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 68 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 70 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 78 00   ERRORFRAME
>   can0  20000004  [8] 00 20 00 00 00 00 80 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 80 00   ERRORFRAME
>   can0  20000088  [8] 00 00 80 19 00 00 80 00   ERRORFRAME
> 
> And now lots more of this last frame repeated, until the controller
> decides to stop. Seems fine. It has always done this.
> 
> berr-reporting off:
> 
>   can1  20000004  [8] 00 08 00 00 00 00 60 00   ERRORFRAME
>   can1  20000004  [8] 00 20 00 00 00 00 80 00   ERRORFRAME
> 
> 
> Same as before. Excellent.

Yes, below is some more theory from the AT91 CAN manual, in case you are
interested in technical details.

Wolfgang.

-----------------------------------------------------------------------
o REC: Receive Error Counter
  When a receiver detects an error, REC will be increased by one, except
  when the detected error is a BIT ERROR while sending an ACTIVE ERROR
  FLAG or an OVERLOAD FLAG. When a receiver detects a dominant bit as
  the first bit after sending an ERROR FLAG, REC is increased by 8.
  When a receiver detects a BIT ERROR while sending an ACTIVE ERROR
  FLAG, REC is increased by 8. Any node tolerates up to 7 consecutive
  dominant bits after sending an ACTIVE ERROR FLAG, PASSIVE ERROR FLAG
  or OVERLOAD FLAG. After detecting the 14th consecutive dominant bit
  (in case of an ACTIVE ERROR FLAG or an OVER-LOAD FLAG) or after
  detecting the 8th consecutive dominant bit following a PASSIVE ERROR
  FLAG, and after each sequence of additional eight consecutive dominant
  bits, each receiver increases its REC by 8. After successful reception
  of a message, REC is decreased by 1 if it was between 1 and 127. If
  REC was 0, it stays 0, and if it was greater than 127, then it is set
  to a value between 119 and 127.

o TEC: Transmit Error Counter
  When a transmitter sends an ERROR FLAG, TEC is increased by 8 except
  when:
  - the transmitter is error passive and detects an ACKNOWLEDGMENT ERROR
    because of not detecting a dominant ACK and does not detect a
    dominant bit while sending its PASSIVE ERROR FLAG.
  - the transmitter sends an ERROR FLAG because a STUFF ERROR occurred
    during arbitration and should have been recessive and has been sent
    as recessive but monitored as dominant.
  When a transmitter detects a BIT ERROR while sending an ACTIVE ERROR
  FLAG or an OVERLOAD FLAG, the TEC will be increased by 8.
  Any node tolerates up to 7 consecutive dominant bits after sending an
  ACTIVE ERROR FLAG, PASSIVE ERROR FLAG or OVERLOAD FLAG. After
  detecting the 14th consecutive dominant bit (in case of an ACTIVE
  ERROR FLAG or an OVERLOAD FLAG) or after detecting the 8th consecutive
  dominant bit following a PASSIVE ERROR FLAG, and after each
  sequence of additional eight consecutive dominant bits every
  transmitter increases its TEC by 8. After a successful transmission
  the TEC is decreased by 1 unless it was already 0.

^ permalink raw reply

* Re: [Bugme-new] [Bug 15571] New: TCP madness - some packets are shunned.
From: Andrew Morton @ 2010-03-22 21:37 UTC (permalink / raw)
  To: netdev; +Cc: bugzilla-daemon, bugme-daemon, jasen
In-Reply-To: <bug-15571-10286@http.bugzilla.kernel.org/>


(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Thu, 18 Mar 2010 02:46:29 GMT
bugzilla-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=15571
> 
>                URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=53646
>                     2
>            Summary: TCP madness - some packets are shunned.
>            Product: Networking
>            Version: 2.5
>     Kernel Version: 2.6.30
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>         AssignedTo: acme@ghostprotocols.net
>         ReportedBy: jasen@treshna.com
>         Regression: No
> 
> 
> The host http://www.cv-it.com is virtually unreachable with kernel 2.6.26 
> (and later) slow with kernel 2.6.18 and just fine with windows XP.
> 
> I used telnet to port 80 for testing.
> 
> it seems to be a TCP issue, as the having the XP machine behind a linux based
> iptables firewall pc causes no problems, but telnet from the firewall pc itself
> to port 80 on www.cv-it.com does not work



^ permalink raw reply

* Re: rps: Fix build with CONFIG_SYSFS enabled
From: Randy Dunlap @ 2010-03-22 21:48 UTC (permalink / raw)
  To: Tom Herbert; +Cc: davem, netdev
In-Reply-To: <alpine.DEB.1.00.1003221355380.25849@pokey.mtv.corp.google.com>

On 03/22/10 13:57, Tom Herbert wrote:
> Fix build with CONFIG_SYSFS not enabled.
> 
> 
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
> index 7a46343..f6b6bfe 100644
> --- a/net/core/net-sysfs.c
> +++ b/net/core/net-sysfs.c
> @@ -739,7 +739,9 @@ void netdev_unregister_kobject(struct net_device * net)
>  	if (!net_eq(dev_net(net), &init_net))
>  		return;
>  
> +#ifdef CONFIG_SYSFS
>  	rx_queue_remove_kobjects(net);
> +#endif
>  
>  	device_del(dev);
>  }
> @@ -780,11 +782,13 @@ int netdev_register_kobject(struct net_device *net)
>  	if (error)
>  		return error;
>  
> +#ifdef CONFIG_SYSFS
>  	error = rx_queue_register_kobjects(net);
>  	if (error) {
>  		device_del(dev);
>  		return error;
>  	}
> +#endif
>  
>  	return error;
>  }
> 
> --

Dave, this patch and Eric's patch both build OK.  Your choice...

-- 
~Randy

^ permalink raw reply

* Re: [Patch] netconsole: do not depend on experimental
From: Matt Mackall @ 2010-03-22 22:17 UTC (permalink / raw)
  To: Neil Horman; +Cc: Amerigo Wang, linux-kernel, netdev, David Miller
In-Reply-To: <20100322125919.GB4288@hmsreliant.think-freely.org>

On Mon, 2010-03-22 at 08:59 -0400, Neil Horman wrote:
> On Mon, Mar 22, 2010 at 05:59:23AM -0400, Amerigo Wang wrote:
> > 
> > Nowadays, most distributions enable netconsole by default,
> > including RHEL, Fedora, Debian, Arch, Opensuse. And
> > we don't have any bug reports about it. So I think there
> > is no need to mark it as experimental any more.
> > 
> > Cc: David S. Miller <davem@davemloft.net>
> > Signed-off-by: WANG Cong <amwang@redhat.com>
> > 
> > ---
> > diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> > index 0ba5b8e..e3d6c52 100644
> > --- a/drivers/net/Kconfig
> > +++ b/drivers/net/Kconfig
> > @@ -3252,15 +3252,14 @@ config NET_FC
> >  	  "SCSI generic support".
> >  
> >  config NETCONSOLE
> > -	tristate "Network console logging support (EXPERIMENTAL)"
> > -	depends on EXPERIMENTAL
> > +	tristate "Network console logging support"
> >  	---help---
> >  	If you want to log kernel messages over the network, enable this.
> >  	See <file:Documentation/networking/netconsole.txt> for details.
> >  
> >  config NETCONSOLE_DYNAMIC
> > -	bool "Dynamic reconfiguration of logging targets (EXPERIMENTAL)"
> > -	depends on NETCONSOLE && SYSFS && EXPERIMENTAL
> > +	bool "Dynamic reconfiguration of logging targets"
> > +	depends on NETCONSOLE && SYSFS
> >  	select CONFIGFS_FS
> >  	help
> >  	  This option enables the ability to dynamically reconfigure target
> > --
> 
> Seems reasonable.  Netconsole seems pretty mature.
> 
> Acked-by: Neil Horman <nhorman@tuxdriver.com>

Yeah, I'd forgotten that flag was even there.

Acked-by: Matt Mackall <mpm@selenic.com>

-- 
http://selenic.com : development and support for Mercurial and Linux



^ permalink raw reply

* Re: [Patch v2] netpoll: warn when there are spaces in parameters
From: Matt Mackall @ 2010-03-22 22:22 UTC (permalink / raw)
  To: Amerigo Wang; +Cc: linux-kernel, netdev, elendil, David Miller
In-Reply-To: <20100322090341.5289.10770.sendpatchset@localhost.localdomain>

On Mon, 2010-03-22 at 04:59 -0400, Amerigo Wang wrote:
> +			printk(KERN_INFO "%s: warning: whitespace"
> +					"is not allowed\n", np->name);

Is it a warning or is it info? If it's a warning, then we probably need
to add "netpoll" or whatever to the message so that people who've got a
warning-level threshold will know what it's about.

-- 
http://selenic.com : development and support for Mercurial and Linux



^ permalink raw reply

* Re: [RFC Patch 1/3] netpoll: add generic support for bridge and bonding devices
From: Matt Mackall @ 2010-03-22 22:31 UTC (permalink / raw)
  To: Amerigo Wang
  Cc: linux-kernel, netdev, bridge, Andy Gospodarek, Neil Horman,
	Stephen Hemminger, bonding-devel, Jay Vosburgh, David Miller,
	Jeff Moyer
In-Reply-To: <20100322082059.4967.63492.sendpatchset@localhost.localdomain>

On Mon, 2010-03-22 at 04:17 -0400, Amerigo Wang wrote:
> This whole patchset is for adding netpoll support to bridge and bonding
> devices. I already tested it for bridge, bonding, bridge over bonding,
> and bonding over bridge. It looks fine now.

Ages ago, Jeff Moyer took a run at this, added him to the cc: on the off
chance he still cares.

> Please comment.
> 
> 
> To make bridge and bonding support netpoll, we need to adjust
> some netpoll generic code. This patch does the following things:
> 
> 1) introduce two new priv_flags for struct net_device:
>    IFF_IN_NETPOLL which identifies we are processing a netpoll;
>    IFF_DISABLE_NETPOLL is used to disable netpoll support for a device
>    at run-time;

This one is a little worrisome. I've tried to keep the netpoll code
restricted to as tight an area as possible. Adding new flags like these
that random drivers might try to fiddle with seems like a good way for a
driver writer to get in trouble. Also flag space is filling up.

> 2) introduce three new methods for netdev_ops:
>    ->ndo_netpoll_setup() is used to setup netpoll for a device;
>    ->ndo_netpoll_xmit() is used to transmit netpoll requests;
>    ->ndo_netpoll_cleanup() is used to clean up netpoll when a device is
>      removed.

Seems like a lot of interface for something to be used by only a couple
core drivers. Hopefully Dave has an opinion here.

> 3) introduce netpoll_poll_dev() which takes a struct net_device * parameter;
> 
> 4) export netpoll_send_skb() and netpoll_poll_dev() which will be used later;
> 
> 5) hide a pointer to struct netpoll in struct netpoll_info, ditto.
> 
> Cc: David Miller <davem@davemloft.net>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Signed-off-by: WANG Cong <amwang@redhat.com>
> 
> ---
> Index: linux-2.6/include/linux/if.h
> ===================================================================
> --- linux-2.6.orig/include/linux/if.h
> +++ linux-2.6/include/linux/if.h
> @@ -71,6 +71,8 @@
>  					 * release skb->dst
>  					 */
>  #define IFF_DONT_BRIDGE 0x800		/* disallow bridging this ether dev */
> +#define IFF_IN_NETPOLL	0x1000		/* whether we are processing netpoll */
> +#define IFF_DISABLE_NETPOLL	0x2000	/* disable netpoll at run-time */
>  
>  #define IF_GET_IFACE	0x0001		/* for querying only */
>  #define IF_GET_PROTO	0x0002
> Index: linux-2.6/include/linux/netdevice.h
> ===================================================================
> --- linux-2.6.orig/include/linux/netdevice.h
> +++ linux-2.6/include/linux/netdevice.h
> @@ -530,6 +530,8 @@ struct netdev_queue {
>  	unsigned long		tx_dropped;
>  } ____cacheline_aligned_in_smp;
>  
> +struct netpoll;
> +struct netpoll_info;
>  
>  /*
>   * This structure defines the management hooks for network devices.
> @@ -667,6 +669,12 @@ struct net_device_ops {
>  						        unsigned short vid);
>  #ifdef CONFIG_NET_POLL_CONTROLLER
>  	void                    (*ndo_poll_controller)(struct net_device *dev);
> +	void			(*ndo_netpoll_setup)(struct net_device *dev,
> +						     struct netpoll_info *npinfo);
> +	int			(*ndo_netpoll_xmit)(struct netpoll *np,
> +						    struct sk_buff *skb,
> +						    struct net_device *dev);
> +	void			(*ndo_netpoll_cleanup)(struct net_device *dev);
>  #endif
>  	int			(*ndo_set_vf_mac)(struct net_device *dev,
>  						  int queue, u8 *mac);
> Index: linux-2.6/include/linux/netpoll.h
> ===================================================================
> --- linux-2.6.orig/include/linux/netpoll.h
> +++ linux-2.6/include/linux/netpoll.h
> @@ -36,8 +36,11 @@ struct netpoll_info {
>  	struct sk_buff_head txq;
>  
>  	struct delayed_work tx_work;
> +
> +	struct netpoll *netpoll;
>  };
>  
> +void netpoll_poll_dev(struct net_device *dev);
>  void netpoll_poll(struct netpoll *np);
>  void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
>  void netpoll_print_options(struct netpoll *np);
> @@ -47,6 +50,7 @@ int netpoll_trap(void);
>  void netpoll_set_trap(int trap);
>  void netpoll_cleanup(struct netpoll *np);
>  int __netpoll_rx(struct sk_buff *skb);
> +void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
>  
> 
>  #ifdef CONFIG_NETPOLL
> Index: linux-2.6/net/core/netpoll.c
> ===================================================================
> --- linux-2.6.orig/net/core/netpoll.c
> +++ linux-2.6/net/core/netpoll.c
> @@ -178,9 +178,8 @@ static void service_arp_queue(struct net
>  	}
>  }
>  
> -void netpoll_poll(struct netpoll *np)
> +void netpoll_poll_dev(struct net_device *dev)
>  {
> -	struct net_device *dev = np->dev;
>  	const struct net_device_ops *ops;
>  
>  	if (!dev || !netif_running(dev))
> @@ -200,6 +199,13 @@ void netpoll_poll(struct netpoll *np)
>  	zap_completion_queue();
>  }
>  
> +void netpoll_poll(struct netpoll *np)
> +{
> +	if (!np->dev)
> +		return;
> +	netpoll_poll_dev(np->dev);
> +}
> +
>  static void refill_skbs(void)
>  {
>  	struct sk_buff *skb;
> @@ -281,7 +287,7 @@ static int netpoll_owner_active(struct n
>  	return 0;
>  }
>  
> -static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
> +void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
>  {
>  	int status = NETDEV_TX_BUSY;
>  	unsigned long tries;
> @@ -307,7 +313,10 @@ static void netpoll_send_skb(struct netp
>  		     tries > 0; --tries) {
>  			if (__netif_tx_trylock(txq)) {
>  				if (!netif_tx_queue_stopped(txq)) {
> -					status = ops->ndo_start_xmit(skb, dev);
> +					if (ops->ndo_netpoll_xmit)
> +						status = ops->ndo_netpoll_xmit(np, skb, dev);
> +					else
> +						status = ops->ndo_start_xmit(skb, dev);
>  					if (status == NETDEV_TX_OK)
>  						txq_trans_update(txq);
>  				}
> @@ -752,7 +761,10 @@ int netpoll_setup(struct netpoll *np)
>  		atomic_inc(&npinfo->refcnt);
>  	}
>  
> -	if (!ndev->netdev_ops->ndo_poll_controller) {
> +	npinfo->netpoll = np;
> +
> +	if (ndev->priv_flags & IFF_DISABLE_NETPOLL
> +			|| !ndev->netdev_ops->ndo_poll_controller) {
>  		printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n",
>  		       np->name, np->dev_name);
>  		err = -ENOTSUPP;
> @@ -830,6 +842,9 @@ int netpoll_setup(struct netpoll *np)
>  	/* last thing to do is link it to the net device structure */
>  	ndev->npinfo = npinfo;
>  
> +	if (ndev->netdev_ops->ndo_netpoll_setup)
> +		ndev->netdev_ops->ndo_netpoll_setup(ndev, npinfo);
> +
>  	/* avoid racing with NAPI reading npinfo */
>  	synchronize_rcu();
>  
> @@ -904,6 +919,7 @@ void netpoll_set_trap(int trap)
>  		atomic_dec(&trapped);
>  }
>  
> +EXPORT_SYMBOL(netpoll_send_skb);
>  EXPORT_SYMBOL(netpoll_set_trap);
>  EXPORT_SYMBOL(netpoll_trap);
>  EXPORT_SYMBOL(netpoll_print_options);
> @@ -911,4 +927,5 @@ EXPORT_SYMBOL(netpoll_parse_options);
>  EXPORT_SYMBOL(netpoll_setup);
>  EXPORT_SYMBOL(netpoll_cleanup);
>  EXPORT_SYMBOL(netpoll_send_udp);
> +EXPORT_SYMBOL(netpoll_poll_dev);
>  EXPORT_SYMBOL(netpoll_poll);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
http://selenic.com : development and support for Mercurial and Linux

^ permalink raw reply

* Re: [RFC Patch 2/3] bridge: make bridge support netpoll
From: Matt Mackall @ 2010-03-22 22:35 UTC (permalink / raw)
  To: Amerigo Wang
  Cc: linux-kernel, netdev, bridge, Andy Gospodarek, Neil Horman,
	Stephen Hemminger, bonding-devel, Jay Vosburgh, David Miller
In-Reply-To: <20100322082112.4967.5504.sendpatchset@localhost.localdomain>

On Mon, 2010-03-22 at 04:17 -0400, Amerigo Wang wrote:
> Based on the previous patch, make bridge support netpoll by:
> 
> 1) implement the 4 methods to support netpoll for bridge;
> 
> 2) modify netpoll during forwarding packets in bridge;
> 
> 3) disable netpoll support of bridge when a netpoll-unabled device
>    is added to bridge;

Not sure if this is the right thing to do. Shouldn't we simply enable
polling on all devices that support it and warn about the others (aka
best effort)?

-- 
http://selenic.com : development and support for Mercurial and Linux

^ permalink raw reply

* Re: [RFC Patch 3/3] bonding: make bonding support netpoll
From: Matt Mackall @ 2010-03-22 22:38 UTC (permalink / raw)
  To: Amerigo Wang
  Cc: linux-kernel, netdev, bridge, Andy Gospodarek, Neil Horman,
	Stephen Hemminger, bonding-devel, Jay Vosburgh, David Miller
In-Reply-To: <20100322082123.4967.77433.sendpatchset@localhost.localdomain>

On Mon, 2010-03-22 at 04:17 -0400, Amerigo Wang wrote:
> Based on Andy's work, but I modify a lot.
> 
> Similar to the patch for bridge, this patch does:
> 
> 1) implement the 4 methods to support netpoll for bonding;
> 
> 2) modify netpoll during forwarding packets in bonding;
> 
> 3) disable netpoll support of bridge when a netpoll-unabled device
>    is added to bonding;
> 
> 4) enable netpoll support when all underlying devices support netpoll.

Again, not sure if this is the right policy. Seems to me that on a
bonding device we should simply pick an interface to send netpoll
messages on, without reference to balancing, etc. Thus, if any of the
bonded devices supports polling, it should work.

Hopefully someone more familiar with the goals and philosophy of the
bonding code can comment further.

-- 
http://selenic.com : development and support for Mercurial and Linux

^ permalink raw reply

* [PATCH] kaweth: New USB ID 07c9:b010 Allied Telesyn AT-USB10
From: Andreas Hartmann @ 2010-03-22 23:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, netdev, linux-kernel, Andrew Morton

New USB ID 07c9:b010 Allied Telesyn AT-USB10
Signed-off-by: Andreas Hartmann <andi@ahash.de>
---
This USB Ethernet adapter has the KL5KUSB101B chip and is so far unknown to the
kaweth driver. The device was found working with the patch applied.
--- linux-2.6.34-rc2/drivers/net/usb/kaweth.c.orig      2010-03-20 02:17:57.000000000 +0100
+++ linux-2.6.34-rc2/drivers/net/usb/kaweth.c   2010-03-22 23:30:31.000000000 +0100
@@ -145,6 +145,7 @@ static struct usb_device_id usb_klsi_tab
        { USB_DEVICE(0x0707, 0x0100) }, /* SMC 2202USB */
        { USB_DEVICE(0x07aa, 0x0001) }, /* Correga K.K. */
        { USB_DEVICE(0x07b8, 0x4000) }, /* D-Link DU-E10 */
+       { USB_DEVICE(0x07c9, 0xb010) }, /* Allied Telesyn AT-USB10 */
        { USB_DEVICE(0x0846, 0x1001) }, /* NetGear EA-101 */
        { USB_DEVICE(0x0846, 0x1002) }, /* NetGear EA-101 */
        { USB_DEVICE(0x085a, 0x0008) }, /* PortGear Ethernet Adapter */

^ permalink raw reply

* Re: [Bug 15582] New: BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
From: Andrew Morton @ 2010-03-22 23:14 UTC (permalink / raw)
  To: Patrick McHardy, Jeff Kirsher, Jesse Brandeburg, Bruce Allan,
	Alex Duyck <alexa
  Cc: bugzilla-daemon, netdev, stivi
In-Reply-To: <bug-15582-27@http.bugzilla.kernel.org/>


(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Fri, 19 Mar 2010 12:01:10 GMT
bugzilla-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=15582
> 
>            Summary: BUG: unable to handle kernel NULL pointer dereference
>                     at 0000000000000028

A bug in igb or the vlan code, I guess.

>            Product: Memory Management
>            Version: 2.5
>     Kernel Version: 2.6.33.1
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>         AssignedTo: akpm@linux-foundation.org
>         ReportedBy: stivi@kity.pl
>         Regression: No
> 
> 
> Distribution:Debian Lenny
> 
> Hardware Environment:
> INTEL Server Board S5520HC
> Intel(R) Xeon(R) CPU X5560  @ 2.80GHz
> 2x RAID bus controller 3ware Inc 9690SA-8I
> 
> Software Environment: squid (multi instances)
> 
> Problem Description:
> 
> The following error occurs whenever i halt the machine:
> [  439.629361] BUG: unable to handle kernel NULL pointer dereference at
> 0000000000000028
> [  439.723410] IP: [<ffffffff812462aa>] vlan_gro_common+0xd7/0x190
> [  439.794374] PGD 0
> [  439.818655] Oops: 0000 [#1] SMP
> [  439.857638] last sysfs file:
> /sys/devices/pci0000:00/0000:00:09.0/0000:05:00.0/host1/target1:0:0/1:0:0:0/block/sdc/queue/nr_requests
> [  440.000143] CPU 7
> [  440.024385] Pid: 0, comm: swapper Not tainted 2.6.33.1-univ #1
> S5520HC/S5520HC
> [  440.110817] RIP: 0010:[<ffffffff812462aa>]  [<ffffffff812462aa>]
> vlan_gro_common+0xd7/0x190
> [  440.210919] RSP: 0018:ffff8800283c3d10  EFLAGS: 00010203
> [  440.274472] RAX: 0000000000000001 RBX: ffff88066d5fd818 RCX:
> ffff8806683aa680
> [  440.359798] RDX: 00000000000003e7 RSI: 0000000000000000 RDI:
> ffff88066d2b2000
> [  440.445124] RBP: 00000000000003e7 R08: ffff88066c5ea000 R09:
> ffff8806683aa680
> [  440.530488] R10: 00000000000003e7 R11: 000000000000040b R12:
> 0000000000000000
> [  440.615816] R13: ffff88066d5fd818 R14: 000000000000003e R15:
> 000000000000040c
> [  440.701169] FS:  0000000000000000(0000) GS:ffff8800283c0000(0000)
> knlGS:0000000000000000
> [  440.797986] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [  440.866705] CR2: 0000000000000028 CR3: 0000000001361000 CR4:
> 00000000000006e0
> [  440.952036] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [  441.037364] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
> 0000000000000400
> [  441.122690] Process swapper (pid: 0, threadinfo ffff88066fa82000, task
> ffff88066fa7acd0)
> [  441.219462] Stack:
> [  441.243535]  ffff8806683aa680 ffffffff812466c7 0000000000000246
> ffff8806683aa680
> [  441.330462] <0> 000000000000003e ffff88066d5fd680 0000000000000008
> ffffffffa00b1871
> [  441.422868] <0> 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [  441.517692] Call Trace:
> [  441.546959]  <IRQ>
> [  441.572233]  [<ffffffff812466c7>] ? vlan_gro_receive+0x6e/0x83
> [  441.641993]  [<ffffffffa00b1871>] ? igb_poll+0x741/0xe80 [igb]
> [  441.711790]  [<ffffffff811e07ee>] ? net_rx_action+0xa8/0x1a1
> [  441.779478]  [<ffffffff81039ffe>] ? __do_softirq+0xd7/0x195
> [  441.846122]  [<ffffffff8100370c>] ? call_softirq+0x1c/0x28
> [  441.911727]  [<ffffffff81005325>] ? do_softirq+0x31/0x63
> [  441.975300]  [<ffffffff81039df4>] ? irq_exit+0x36/0x78
> [  442.036746]  [<ffffffff81004a26>] ? do_IRQ+0xa7/0xbd
> [  442.096119]  [<ffffffff81258ed3>] ? ret_from_intr+0x0/0xa
> [  442.160685]  <EOI>
> [  442.185957]  [<ffffffff811cad43>] ? poll_idle+0x1b/0x55
> [  442.248444]  [<ffffffff811cad32>] ? poll_idle+0xa/0x55
> [  442.309890]  [<ffffffff811cb06a>] ? cpuidle_idle_call+0x8e/0xe8
> [  442.380683]  [<ffffffff81001cd4>] ? cpu_idle+0x53/0x8b
> [  442.442133] Code: 41 81 79 7e 88 09 0f 85 d1 00 00 00 44 89 d2 44 89 d0 66
> 81 e2 ff 0f 80 cc 10 66 41 89 81 b8 00 00 00 89 d0 66 c1 e8 09 0f b7 c0 <48> 8b
> 4c c6 20 31 c0 48 85 c9 74 0c 48 89 d0 25 ff$
> [  442.678920] RIP  [<ffffffff812462aa>] vlan_gro_common+0xd7/0x190
> [  442.750922]  RSP <ffff8800283c3d10>
> [  442.792645] CR2: 0000000000000028
> [  442.832293] ---[ end trace 9245d00ed2188cae ]---
> [  442.887516] Kernel panic - not syncing: Fatal exception in interrupt
> [  442.963506] Pid: 0, comm: swapper Tainted: G      D    2.6.33.1-univ #1
> [  443.042610] Call Trace:
> [  443.071875]  <IRQ>  [<ffffffff812568b7>] ? panic+0x86/0x145
> [  443.138593]  [<ffffffff81039e06>] ? irq_exit+0x48/0x78
> [  443.200050]  [<ffffffff81258ed3>] ? ret_from_intr+0x0/0xa
> [  443.264661]  [<ffffffff8103554c>] ? kmsg_dump+0x99/0x124
> [  443.328202]  [<ffffffff81006416>] ? oops_end+0x9f/0xac
> [  443.389656]  [<ffffffff8101e9af>] ? no_context+0x1f2/0x201
> [  443.455263]  [<ffffffffa014cd20>] ? bond_dev_queue_xmit+0x14c/0x169
> [bonding]
> [  443.540611]  [<ffffffff8101eb65>] ? __bad_area_nosemaphore+0x1a7/0x1cb
> [  443.618679]  [<ffffffff811e0d8f>] ? dev_hard_start_xmit+0x221/0x2dd
> [  443.693630]  [<ffffffff811e134d>] ? dev_queue_xmit+0x401/0x433
> [  443.763397]  [<ffffffff812590df>] ? page_fault+0x1f/0x30
> [  443.826927]  [<ffffffff812462aa>] ? vlan_gro_common+0xd7/0x190
> [  443.896686]  [<ffffffff812466c7>] ? vlan_gro_receive+0x6e/0x83
> [  443.966485]  [<ffffffffa00b1871>] ? igb_poll+0x741/0xe80 [igb]
> [  444.036246]  [<ffffffff811e07ee>] ? net_rx_action+0xa8/0x1a1
> [  444.103927]  [<ffffffff81039ffe>] ? __do_softirq+0xd7/0x195
> [  444.170569]  [<ffffffff8100370c>] ? call_softirq+0x1c/0x28
> [  444.236176]  [<ffffffff81005325>] ? do_softirq+0x31/0x63
> [  444.299704]  [<ffffffff81039df4>] ? irq_exit+0x36/0x78
> [  444.361157]  [<ffffffff81004a26>] ? do_IRQ+0xa7/0xbd
> [  444.420533]  [<ffffffff81258ed3>] ? ret_from_intr+0x0/0xa
> [  444.485101]  <EOI>  [<ffffffff811cad43>] ? poll_idle+0x1b/0x55
> [  444.555036]  [<ffffffff811cad32>] ? poll_idle+0xa/0x55
> [  444.616486]  [<ffffffff811cb06a>] ? cpuidle_idle_call+0x8e/0xe8
> [  444.687283]  [<ffffffff81001cd4>] ? cpu_idle+0x53/0x8b
> 
> Steps to reproduce: Whenever i halt the machine.
> 
> 
> Igb driver is replaced by:
> http://downloadcenter.intel.com/detail_desc.aspx?agr=Y&DwnldID=13663
> 
> This is the same machine from bugs:
> https://bugzilla.kernel.org/show_bug.cgi?id=15148,
> https://bugzilla.kernel.org/show_bug.cgi?id=15581.
> 


^ permalink raw reply

* Re: [Uclinux-dist-devel] [PATCH] can: bfin_can: switch to common Blackfin can header
From: David Miller @ 2010-03-22 23:36 UTC (permalink / raw)
  To: vapier.adi
  Cc: socketcan-core, netdev, uclinux-dist-devel, oliver.hartkopp,
	urs.thuermann
In-Reply-To: <8bd0f97a1003221409w24437f85ke27f4338e82ba44e@mail.gmail.com>

From: Mike Frysinger <vapier.adi@gmail.com>
Date: Mon, 22 Mar 2010 17:09:55 -0400

> On Mon, Mar 22, 2010 at 13:17, David Miller wrote:
>> From: Mike Frysinger <vapier.adi@gmail.com>
>> Do you still feel this way after people other than me also asked you
>> to do the same exact thing for me?  Do you think they are making
>> arbitrary requests as well?
> 
> the only other person to say anything did not say "you now need to
> resend your patch".  it was "please wait until Linus has pulled things
> and then Dave has pulled things".  which was not relevant at the point
> it was sent.

Wolfgang told you to "just resubmit the patch", just like I asked you
to, when you said "the code is there just apply the old one."

^ permalink raw reply

* Re: [RFC Patch 3/3] bonding: make bonding support netpoll
From: Jay Vosburgh @ 2010-03-22 23:36 UTC (permalink / raw)
  To: Matt Mackall
  Cc: Amerigo Wang, linux-kernel, netdev, bridge, Andy Gospodarek,
	Neil Horman, Stephen Hemminger, bonding-devel, David Miller
In-Reply-To: <1269297485.3552.26.camel@calx>

Matt Mackall <mpm@selenic.com> wrote:

>On Mon, 2010-03-22 at 04:17 -0400, Amerigo Wang wrote:
>> Based on Andy's work, but I modify a lot.
>> 
>> Similar to the patch for bridge, this patch does:
>> 
>> 1) implement the 4 methods to support netpoll for bonding;
>> 
>> 2) modify netpoll during forwarding packets in bonding;
>> 
>> 3) disable netpoll support of bridge when a netpoll-unabled device
>>    is added to bonding;
>> 
>> 4) enable netpoll support when all underlying devices support netpoll.
>
>Again, not sure if this is the right policy. Seems to me that on a
>bonding device we should simply pick an interface to send netpoll
>messages on, without reference to balancing, etc. Thus, if any of the
>bonded devices supports polling, it should work.

	For some of the modes, the above is pretty straighforward.
Others, 802.3ad and balance-alb, are a bit more complicated.

	The risk is that the network peers and switches may see the same
MAC address on multiple ports, or different MAC addresses for the same
IP address.

	To implement the above suggestion, I think a "current netpoll
slave" would have to be tracked, and kept up to date (as slaves become
active or inactive, etc).  Reusing the existing "current active slave"
won't work for the case that the active slave is not netpoll-capable,
but a different slave is; also, not all modes use the current active
slave.

	In 802.3ad, the "current netpoll slave" selector will have to
poke into the aggregator status to choose the netpoll slave.  It's not a
simple matter of picking one and then sticking with it forever; if the
aggregator containing the netpoll slave is deactivated, then peers may
not receive the traffic, etc.

	In the active-backup mode, only the active slave can send or
receive, so if it's not netpoll capable, but a backup slave is, you're
still out of luck (unless netpoll awareness is added to the "best slave"
selection logic, and even then it'd have to be a secondary criteria).
Or, the inactive slave can be transmitted on, but if the same MAC comes
out of the active and a backup slave, it can confuse switches.

	In one mode (balance-alb), slaves keep their own MAC addresses,
and are matched with peers.  Bypassing the balance algorithm could again
confuse peers or switches, who could see two MAC addresses for the same
IP address, if netpoll traffic goes out a different slave than the
balance algorithm picks for the same destination.

	I think, then, the question becomes: is this extra complexity
worth it to cover the cases of netpoll over bonding wherein one or more
slaves don't support netpoll?  

	How many network drivers don't support netpoll nowadays?

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

^ permalink raw reply

* Re: Unable to create more than 1 guest virtio-net device using vhost-net backend
From: Sridhar Samudrala @ 2010-03-22 23:41 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Avi Kivity, netdev, kvm@vger.kernel.org, gleb, David Stevens
In-Reply-To: <20100322181623.GA20188@redhat.com>

On Mon, 2010-03-22 at 20:16 +0200, Michael S. Tsirkin wrote:
> On Sun, Mar 21, 2010 at 01:58:29PM +0200, Avi Kivity wrote:
> > On 03/21/2010 01:34 PM, Michael S. Tsirkin wrote:
> >> On Sun, Mar 21, 2010 at 12:29:31PM +0200, Avi Kivity wrote:
> >>    
> >>> On 03/21/2010 12:15 PM, Michael S. Tsirkin wrote:
> >>>      
> >>>>>> Nothing easy that I can see. Each device needs 2 of these.  Avi, Gleb,
> >>>>>> any objections to increasing the limit to say 16?  That would give us
> >>>>>> 5 more devices to the limit of 6 per guest.
> >>>>>>
> >>>>>>
> >>>>>>            
> >>>>> Increase it to 200, then.
> >>>>>
> >>>>>          
> >>>> OK. I think we'll also need a smarter allocator
> >>>> than bus->dev_count++ than we now have. Right?
> >>>>
> >>>>        
> >>> No, why?
> >>>      
> >> We'll run into problems if devices are created/removed in random order,
> >> won't we?
> >>    
> >
> > unregister_dev() takes care of it.
> >
> >>> Eventually we'll want faster scanning than the linear search we employ
> >>> now, though.
> >>>      
> >> Yes I suspect with 200 entries we will :). Let's just make it 16 for
> >> now?
> >>    
> >
> > Let's make it 200 and fix the performance problems later.  Making it 16  
> > is just asking for trouble.
> 
> I did this and performance with vhost seems to become much more noisy,
> and drop by about 10% on average, even though in practice only
> a single device is created. Still trying to figure it out ...
> Any idea?

I am not sure if this 10% variation is due to the increase of NR_IO_BUS_DEVS.
In our testing, we do see variations of 10% or higher between multiple netperf 
instances with the same setup/configuration when using virtio/vhost.

Thanks
Sridhar


^ permalink raw reply

* 2.6.34-rc1 regression: rmmod hangs on modules which interfaces have ipv6 address
From: Tantilov, Emil S @ 2010-03-23  0:02 UTC (permalink / raw)
  To: netdev@vger.kernel.org; +Cc: David Miller

Steps to reproduce:
1. Load driver
2. Bring interfaces up with IPv6 address 
3. rmmod the driver

rmmod fails with "waiting for device to become free. Usage count=1"

Bisecting turned up this patch:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=3e81c6da39a265e11ef48f52bd15bf7ca0068c75

Although I can't confirm this since without it I am not able to assign IPv6 addresses. So it could be caused by whatever this commit is trying to fix.

Thanks,
Emil

^ permalink raw reply

* [net-next-2.6 PATCH] igb: add IntMode module parameter
From: Jeff Kirsher @ 2010-03-23  0:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Nicholas Nunley, Jeff Kirsher

From: Nick Nunley <nicholasx.d.nunley@intel.com>

This patch adds the IntMode module parameter to igb. This
allows user selection of interrupt mode (MSI-X, MSI, legacy)
on driver load.

Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/Makefile    |    3 +
 drivers/net/igb/igb.h       |    7 ++
 drivers/net/igb/igb_main.c  |  125 ++++++++++++++++++++++++----------------
 drivers/net/igb/igb_param.c |  133 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 215 insertions(+), 53 deletions(-)
 create mode 100644 drivers/net/igb/igb_param.c

diff --git a/drivers/net/igb/Makefile b/drivers/net/igb/Makefile
index 8372cb9..049255e 100644
--- a/drivers/net/igb/Makefile
+++ b/drivers/net/igb/Makefile
@@ -33,5 +33,6 @@
 obj-$(CONFIG_IGB) += igb.o
 
 igb-objs := igb_main.o igb_ethtool.o e1000_82575.o \
-	    e1000_mac.o e1000_nvm.o e1000_phy.o e1000_mbx.o
+	    e1000_mac.o e1000_nvm.o e1000_phy.o e1000_mbx.o \
+	    igb_param.o
 
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index a177570..78a9c28 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -43,6 +43,11 @@ struct igb_adapter;
 /* ((1000000000ns / (6000ints/s * 1024ns)) << 2 = 648 */
 #define IGB_START_ITR 648
 
+/* Interrupt modes, as used by the IntMode paramter */
+#define IGB_INT_MODE_LEGACY                0
+#define IGB_INT_MODE_MSI                   1
+#define IGB_INT_MODE_MSIX                  2
+
 /* TX/RX descriptor defines */
 #define IGB_DEFAULT_TXD                  256
 #define IGB_MIN_TXD                       80
@@ -314,6 +319,7 @@ struct igb_adapter {
 	u16 rx_ring_count;
 	unsigned int vfs_allocated_count;
 	struct vf_data_storage *vf_data;
+	int int_mode;
 	u32 rss_queues;
 };
 
@@ -358,6 +364,7 @@ extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
 extern void igb_update_stats(struct igb_adapter *);
 extern bool igb_has_link(struct igb_adapter *adapter);
 extern void igb_set_ethtool_ops(struct net_device *);
+extern void igb_check_options(struct igb_adapter *);
 extern void igb_power_up_link(struct igb_adapter *);
 
 static inline s32 igb_reset_phy(struct e1000_hw *hw)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 45a0e4f..83431e9 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -679,6 +679,7 @@ static void igb_clear_interrupt_scheme(struct igb_adapter *adapter)
  **/
 static void igb_set_interrupt_capability(struct igb_adapter *adapter)
 {
+	struct pci_dev *pdev = adapter->pdev;
 	int err;
 	int numvecs, i;
 
@@ -686,60 +687,74 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
 	adapter->num_rx_queues = adapter->rss_queues;
 	adapter->num_tx_queues = adapter->rss_queues;
 
-	/* start with one vector for every rx queue */
-	numvecs = adapter->num_rx_queues;
-
-	/* if tx handler is separate add 1 for every tx queue */
-	if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS))
-		numvecs += adapter->num_tx_queues;
-
-	/* store the number of vectors reserved for queues */
-	adapter->num_q_vectors = numvecs;
-
-	/* add 1 vector for link status interrupts */
-	numvecs++;
-	adapter->msix_entries = kcalloc(numvecs, sizeof(struct msix_entry),
-					GFP_KERNEL);
-	if (!adapter->msix_entries)
-		goto msi_only;
-
-	for (i = 0; i < numvecs; i++)
-		adapter->msix_entries[i].entry = i;
-
-	err = pci_enable_msix(adapter->pdev,
-			      adapter->msix_entries,
-			      numvecs);
-	if (err == 0)
-		goto out;
-
-	igb_reset_interrupt_capability(adapter);
-
-	/* If we can't do MSI-X, try MSI */
-msi_only:
+	switch (adapter->int_mode) {
+	case IGB_INT_MODE_MSIX:
+		/* start with one vector for every rx queue */
+		numvecs = adapter->num_rx_queues;
+
+		/* if tx handler is seperate add 1 for every tx queue */
+		if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS))
+			numvecs += adapter->num_tx_queues;
+
+		/* store the number of vectors reserved for queues */
+		adapter->num_q_vectors = numvecs;
+
+		/* add 1 vecotr for link status interrupts */
+		numvecs++;
+		adapter->msix_entries = kcalloc(numvecs,
+		                                sizeof(struct msix_entry),
+		                                GFP_KERNEL);
+		if (adapter->msix_entries) {
+			for (i = 0; i < numvecs; i++)
+				adapter->msix_entries[i].entry = i;
+
+			err = pci_enable_msix(pdev,
+			                      adapter->msix_entries, numvecs);
+			if (err == 0)
+				break;
+		}
+		/* MSI-X failed, so fall through and try MSI */
+		dev_warn(&pdev->dev, "Failed to initialize MSI-X interrupts. "
+		         "Falling back to MSI interrupts.\n");
+		igb_reset_interrupt_capability(adapter);
+	case IGB_INT_MODE_MSI:
+		if (!pci_enable_msi(pdev))
+			adapter->flags |= IGB_FLAG_HAS_MSI;
+		else
+			dev_warn(&pdev->dev, "Failed to initialize MSI "
+			         "interrupts.  Falling back to legacy "
+			         "interrupts.\n");
+		/* Fall through */
+	case IGB_INT_MODE_LEGACY:
 #ifdef CONFIG_PCI_IOV
-	/* disable SR-IOV for non MSI-X configurations */
-	if (adapter->vf_data) {
-		struct e1000_hw *hw = &adapter->hw;
-		/* disable iov and allow time for transactions to clear */
-		pci_disable_sriov(adapter->pdev);
-		msleep(500);
-
-		kfree(adapter->vf_data);
-		adapter->vf_data = NULL;
-		wr32(E1000_IOVCTL, E1000_IOVCTL_REUSE_VFQ);
-		msleep(100);
-		dev_info(&adapter->pdev->dev, "IOV Disabled\n");
-	}
+		/* disable SR-IOV for non MSI-X configurations */
+		if (adapter->vf_data) {
+			struct e1000_hw *hw = &adapter->hw;
+			/*
+			 *  disable iov and allow time for transactions
+			 *  to clear
+			*/
+			pci_disable_sriov(adapter->pdev);
+			msleep(500);
+
+			kfree(adapter->vf_data);
+			adapter->vf_data = NULL;
+			wr32(E1000_IOVCTL, E1000_IOVCTL_REUSE_VFQ);
+			msleep(100);
+			dev_info(&adapter->pdev->dev, "IOV Disabled\n");
+		}
 #endif
-	adapter->vfs_allocated_count = 0;
-	adapter->rss_queues = 1;
-	adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
-	adapter->num_rx_queues = 1;
-	adapter->num_tx_queues = 1;
-	adapter->num_q_vectors = 1;
-	if (!pci_enable_msi(adapter->pdev))
-		adapter->flags |= IGB_FLAG_HAS_MSI;
-out:
+		/* disable advanced features and set number of queues to 1 */
+		adapter->vfs_allocated_count = 0;
+		adapter->rss_queues = 1;
+		adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
+		adapter->num_rx_queues = 1;
+		adapter->num_tx_queues = 1;
+		adapter->num_q_vectors = 1;
+		/* Don't do anything; this is system default */
+		break;
+	}
+
 	/* Notify the stack of the (possibly) reduced Tx Queue count. */
 	adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
 	return;
@@ -1411,6 +1426,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 	const struct e1000_info *ei = igb_info_tbl[ent->driver_data];
 	unsigned long mmio_start, mmio_len;
 	int err, pci_using_dac;
+	static int cards_found;
 	u16 eeprom_apme_mask = IGB_EEPROM_APME;
 	u32 part_num;
 
@@ -1477,6 +1493,8 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 
 	strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
 
+	adapter->bd_number = cards_found;
+
 	netdev->mem_start = mmio_start;
 	netdev->mem_end = mmio_start + mmio_len;
 
@@ -1675,6 +1693,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 		(adapter->flags & IGB_FLAG_HAS_MSI) ? "MSI" : "legacy",
 		adapter->num_rx_queues, adapter->num_tx_queues);
 
+	cards_found++;
 	return 0;
 
 err_register:
@@ -1945,6 +1964,8 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
 	adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
 	adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
 
+	igb_check_options(adapter);
+
 #ifdef CONFIG_PCI_IOV
 	if (hw->mac.type == e1000_82576)
 		adapter->vfs_allocated_count = max_vfs;
diff --git a/drivers/net/igb/igb_param.c b/drivers/net/igb/igb_param.c
new file mode 100644
index 0000000..af9d07f
--- /dev/null
+++ b/drivers/net/igb/igb_param.c
@@ -0,0 +1,133 @@
+/*******************************************************************************
+
+  Intel(R) Gigabit Ethernet Linux driver
+  Copyright(c) 2007-2010 Intel Corporation.
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms and conditions of the GNU General Public License,
+  version 2, as published by the Free Software Foundation.
+
+  This program is distributed in the hope it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+  more details.
+
+  You should have received a copy of the GNU General Public License along with
+  this program; if not, write to the Free Software Foundation, Inc.,
+  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+
+  The full GNU General Public License is included in this distribution in
+  the file called "COPYING".
+
+  Contact Information:
+  e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
+  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
+*******************************************************************************/
+
+#include <linux/netdevice.h>
+#include <linux/pci.h>
+
+#include "igb.h"
+
+/*
+ * This is the only thing that needs to be changed to adjust the
+ * maximum number of ports that the driver can manage.
+ */
+
+#define IGB_MAX_NIC 32
+
+#define OPTION_UNSET   -1
+
+/*
+ * All parameters are treated the same, as an integer array of values.
+ * This macro just reduces the need to repeat the same declaration code
+ * over and over (plus this helps to avoid typo bugs).
+ */
+
+#define IGB_PARAM_INIT { [0 ... IGB_MAX_NIC] = OPTION_UNSET }
+#define IGB_PARAM(X, desc)					\
+	static int __devinitdata X[IGB_MAX_NIC+1]		\
+		= IGB_PARAM_INIT;				\
+	static unsigned int num_##X;				\
+	module_param_array_named(X, X, int, &num_##X, 0);	\
+	MODULE_PARM_DESC(X, desc);
+
+/* IntMode (Interrupt Mode)
+ *
+ * Valid Range: 0 - 2
+ *
+ * Default Value: 2 (MSI-X)
+ */
+IGB_PARAM(IntMode, "Interrupt Mode");
+#define MAX_INTMODE		IGB_INT_MODE_MSIX
+#define MIN_INTMODE		IGB_INT_MODE_LEGACY
+
+struct igb_option {
+	const char *name;
+	const char *err;
+	int def;
+	int min;
+	int max;
+};
+
+static int __devinit igb_validate_option(unsigned int *value,
+					   const struct igb_option *opt,
+					   struct igb_adapter *adapter)
+{
+	struct pci_dev *pdev = adapter->pdev;
+
+	if (*value == OPTION_UNSET) {
+		*value = opt->def;
+		return 0;
+	}
+
+	if (*value >= opt->min && *value <= opt->max) {
+		dev_info(&pdev->dev, "%s set to %d\n", opt->name, *value);
+		return 0;
+	} else {
+		dev_info(&pdev->dev, "Invalid %s value specified (%d) %s\n",
+		    opt->name, *value, opt->err);
+		*value = opt->def;
+		return -1;
+	}
+}
+
+/**
+ * igb_check_options - Range Checking for Command Line Parameters
+ * @adapter: board private structure
+ *
+ * This routine checks all command line parameters for valid user
+ * input.  If an invalid value is given, or if no user specified
+ * value exists, a default value is used.  The final value is stored
+ * in a variable in the adapter structure.
+ **/
+void __devinit igb_check_options(struct igb_adapter *adapter)
+{
+	struct pci_dev *pdev = adapter->pdev;
+	int bd = adapter->bd_number;
+
+	if (bd >= IGB_MAX_NIC) {
+		dev_notice(&pdev->dev, "Warning: no configuration for "
+			   "board #%d\n", bd);
+		dev_notice(&pdev->dev, "Using defaults for all values\n");
+	}
+
+	{ /* Interrupt Mode */
+		struct igb_option opt = {
+			.name = "Interrupt Mode",
+			.err  = "defaulting to 2 (MSI-X)",
+			.def  = IGB_INT_MODE_MSIX,
+			.min = MIN_INTMODE,
+			.max = MAX_INTMODE
+		};
+
+		if (num_IntMode > bd) {
+			unsigned int int_mode = IntMode[bd];
+			igb_validate_option(&int_mode, &opt, adapter);
+			adapter->int_mode = int_mode;
+		} else {
+			adapter->int_mode = opt.def;
+		}
+	}
+}


^ permalink raw reply related

* [net-next-2.6 PATCH 1/3] igb: Do not overwrite mdicnfg register when accessing 82580 phy
From: Jeff Kirsher @ 2010-03-23  0:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

This change removes the extra configuration we were doing on the mdicnfg
register which should be set by EEPROM and which we should not need to
write again afterwards.  This code was a holdover from some earlier
development work that was being done on a board with an incomplete EEPROM
and is no longer needed now that the production EEPROMs are in place.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/e1000_82575.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 0bc990e..ea944f5 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1446,7 +1446,6 @@ void igb_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable)
  **/
 static s32 igb_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data)
 {
-	u32 mdicnfg = 0;
 	s32 ret_val;
 
 
@@ -1454,15 +1453,6 @@ static s32 igb_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data)
 	if (ret_val)
 		goto out;
 
-	/*
-	 * We config the phy address in MDICNFG register now. Same bits
-	 * as before. The values in MDIC can be written but will be
-	 * ignored. This allows us to call the old function after
-	 * configuring the PHY address in the new register
-	 */
-	mdicnfg = (hw->phy.addr << E1000_MDIC_PHY_SHIFT);
-	wr32(E1000_MDICNFG, mdicnfg);
-
 	ret_val = igb_read_phy_reg_mdic(hw, offset, data);
 
 	hw->phy.ops.release(hw);
@@ -1481,7 +1471,6 @@ out:
  **/
 static s32 igb_write_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 data)
 {
-	u32 mdicnfg = 0;
 	s32 ret_val;
 
 
@@ -1489,15 +1478,6 @@ static s32 igb_write_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 data)
 	if (ret_val)
 		goto out;
 
-	/*
-	 * We config the phy address in MDICNFG register now. Same bits
-	 * as before. The values in MDIC can be written but will be
-	 * ignored. This allows us to call the old function after
-	 * configuring the PHY address in the new register
-	 */
-	mdicnfg = (hw->phy.addr << E1000_MDIC_PHY_SHIFT);
-	wr32(E1000_MDICNFG, mdicnfg);
-
 	ret_val = igb_write_phy_reg_mdic(hw, offset, data);
 
 	hw->phy.ops.release(hw);


^ permalink raw reply related

* [net-next-2.6 PATCH 2/3] igb: cleanup usage of virtualization registers
From: Jeff Kirsher @ 2010-03-23  0:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher
In-Reply-To: <20100323000724.19939.17642.stgit@localhost.localdomain>

From: Alexander Duyck <alexander.h.duyck@intel.com>

The igb driver was incorrectly attempting to write to registers that do not
exist on 82580 hardware.  This wasn't causing any issues that I can tell,
but it is not recommended behavior either so I have changed this so we are
determining which registers to write to based on mac type.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_main.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 83431e9..61029e8 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -6158,19 +6158,23 @@ static void igb_vmm_control(struct igb_adapter *adapter)
 	struct e1000_hw *hw = &adapter->hw;
 	u32 reg;
 
-	/* replication is not supported for 82575 */
-	if (hw->mac.type == e1000_82575)
+	switch (hw->mac.type) {
+	case e1000_82575:
+	default:
+		/* replication is not supported for 82575 */
 		return;
-
-	/* enable replication vlan tag stripping */
-	reg = rd32(E1000_RPLOLR);
-	reg |= E1000_RPLOLR_STRVLAN;
-	wr32(E1000_RPLOLR, reg);
-
-	/* notify HW that the MAC is adding vlan tags */
-	reg = rd32(E1000_DTXCTL);
-	reg |= E1000_DTXCTL_VLAN_ADDED;
-	wr32(E1000_DTXCTL, reg);
+	case e1000_82576:
+		/* notify HW that the MAC is adding vlan tags */
+		reg = rd32(E1000_DTXCTL);
+		reg |= E1000_DTXCTL_VLAN_ADDED;
+		wr32(E1000_DTXCTL, reg);
+	case e1000_82580:
+		/* enable replication vlan tag stripping */
+		reg = rd32(E1000_RPLOLR);
+		reg |= E1000_RPLOLR_STRVLAN;
+		wr32(E1000_RPLOLR, reg);
+		break;
+	}
 
 	if (adapter->vfs_allocated_count) {
 		igb_vmdq_set_loopback_pf(hw, true);


^ permalink raw reply related

* [net-next-2.6 PATCH 3/3] igb: add support for Intel I350 Gigabit Network Connection
From: Jeff Kirsher @ 2010-03-23  0:08 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher, James Hearn
In-Reply-To: <20100323000724.19939.17642.stgit@localhost.localdomain>

From: Alexander Duyck <alexander.h.duyck@intel.com>

This patch adds support for the the I350 Gigabit network connection which
is the follow-on part to the 82580.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: James Hearn <james.r.hearn@intel.com>
---

 drivers/net/igb/e1000_82575.c   |   13 +++++++++-
 drivers/net/igb/e1000_82575.h   |    7 +++--
 drivers/net/igb/e1000_defines.h |    1 +
 drivers/net/igb/e1000_hw.h      |    5 ++++
 drivers/net/igb/igb_ethtool.c   |   50 +++++++++++++++++++++++++++++++++++++++
 drivers/net/igb/igb_main.c      |   12 +++++++++
 6 files changed, 83 insertions(+), 5 deletions(-)

diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index ea944f5..430631f 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -105,6 +105,12 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
 	case E1000_DEV_ID_82580_COPPER_DUAL:
 		mac->type = e1000_82580;
 		break;
+	case E1000_DEV_ID_I350_COPPER:
+	case E1000_DEV_ID_I350_FIBER:
+	case E1000_DEV_ID_I350_SERDES:
+	case E1000_DEV_ID_I350_SGMII:
+		mac->type = e1000_i350;
+		break;
 	default:
 		return -E1000_ERR_MAC_INIT;
 		break;
@@ -154,8 +160,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
 		mac->rar_entry_count = E1000_RAR_ENTRIES_82576;
 	if (mac->type == e1000_82580)
 		mac->rar_entry_count = E1000_RAR_ENTRIES_82580;
+	if (mac->type == e1000_i350)
+		mac->rar_entry_count = E1000_RAR_ENTRIES_I350;
 	/* reset */
-	if (mac->type == e1000_82580)
+	if (mac->type >= e1000_82580)
 		mac->ops.reset_hw = igb_reset_hw_82580;
 	else
 		mac->ops.reset_hw = igb_reset_hw_82575;
@@ -226,7 +234,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
 		phy->ops.reset              = igb_phy_hw_reset_sgmii_82575;
 		phy->ops.read_reg           = igb_read_phy_reg_sgmii_82575;
 		phy->ops.write_reg          = igb_write_phy_reg_sgmii_82575;
-	} else if (hw->mac.type == e1000_82580) {
+	} else if (hw->mac.type >= e1000_82580) {
 		phy->ops.reset              = igb_phy_hw_reset;
 		phy->ops.read_reg           = igb_read_phy_reg_82580;
 		phy->ops.write_reg          = igb_write_phy_reg_82580;
@@ -262,6 +270,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
 		phy->ops.set_d3_lplu_state  = igb_set_d3_lplu_state;
 		break;
 	case I82580_I_PHY_ID:
+	case I350_I_PHY_ID:
 		phy->type                   = e1000_phy_82580;
 		phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_82580;
 		phy->ops.get_cable_length   = igb_get_cable_length_82580;
diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
index fbe1c99..c1cad8a 100644
--- a/drivers/net/igb/e1000_82575.h
+++ b/drivers/net/igb/e1000_82575.h
@@ -38,9 +38,10 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
                                      (ID_LED_DEF1_DEF2 <<  4) | \
                                      (ID_LED_OFF1_ON2))
 
-#define E1000_RAR_ENTRIES_82575   16
-#define E1000_RAR_ENTRIES_82576   24
-#define E1000_RAR_ENTRIES_82580   24
+#define E1000_RAR_ENTRIES_82575        16
+#define E1000_RAR_ENTRIES_82576        24
+#define E1000_RAR_ENTRIES_82580        24
+#define E1000_RAR_ENTRIES_I350         32
 
 #define E1000_SW_SYNCH_MB              0x00000100
 #define E1000_STAT_DEV_RST_SET         0x00100000
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
index fe6cf1b..31d24e0 100644
--- a/drivers/net/igb/e1000_defines.h
+++ b/drivers/net/igb/e1000_defines.h
@@ -629,6 +629,7 @@
 #define M88E1111_I_PHY_ID    0x01410CC0
 #define IGP03E1000_E_PHY_ID  0x02A80390
 #define I82580_I_PHY_ID      0x015403A0
+#define I350_I_PHY_ID        0x015403B0
 #define M88_VENDOR           0x0141
 
 /* M88E1000 Specific Registers */
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 82a533f..593d5fa 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -53,6 +53,10 @@ struct e1000_hw;
 #define E1000_DEV_ID_82580_SERDES             0x1510
 #define E1000_DEV_ID_82580_SGMII              0x1511
 #define E1000_DEV_ID_82580_COPPER_DUAL        0x1516
+#define E1000_DEV_ID_I350_COPPER              0x1521
+#define E1000_DEV_ID_I350_FIBER               0x1522
+#define E1000_DEV_ID_I350_SERDES              0x1523
+#define E1000_DEV_ID_I350_SGMII               0x1524
 
 #define E1000_REVISION_2 2
 #define E1000_REVISION_4 4
@@ -72,6 +76,7 @@ enum e1000_mac_type {
 	e1000_82575,
 	e1000_82576,
 	e1000_82580,
+	e1000_i350,
 	e1000_num_macs  /* List is 1-based, so subtract 1 for true count. */
 };
 
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index a4cead1..1d4ee41 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -901,6 +901,49 @@ struct igb_reg_test {
 #define TABLE64_TEST_LO	5
 #define TABLE64_TEST_HI	6
 
+/* i350 reg test */
+static struct igb_reg_test reg_test_i350[] = {
+	{ E1000_FCAL,	   0x100, 1,  PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+	{ E1000_FCAH,	   0x100, 1,  PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
+	{ E1000_FCT,	   0x100, 1,  PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
+	{ E1000_VET,	   0x100, 1,  PATTERN_TEST, 0xFFFF0000, 0xFFFF0000 },
+	{ E1000_RDBAL(0),  0x100, 4,  PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
+	{ E1000_RDBAH(0),  0x100, 4,  PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+	{ E1000_RDLEN(0),  0x100, 4,  PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
+	{ E1000_RDBAL(4),  0x40,  4,  PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
+	{ E1000_RDBAH(4),  0x40,  4,  PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+	{ E1000_RDLEN(4),  0x40,  4,  PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
+	/* RDH is read-only for i350, only test RDT. */
+	{ E1000_RDT(0),	   0x100, 4,  PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+	{ E1000_RDT(4),	   0x40,  4,  PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+	{ E1000_FCRTH,	   0x100, 1,  PATTERN_TEST, 0x0000FFF0, 0x0000FFF0 },
+	{ E1000_FCTTV,	   0x100, 1,  PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+	{ E1000_TIPG,	   0x100, 1,  PATTERN_TEST, 0x3FFFFFFF, 0x3FFFFFFF },
+	{ E1000_TDBAL(0),  0x100, 4,  PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
+	{ E1000_TDBAH(0),  0x100, 4,  PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+	{ E1000_TDLEN(0),  0x100, 4,  PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
+	{ E1000_TDBAL(4),  0x40,  4,  PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
+	{ E1000_TDBAH(4),  0x40,  4,  PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
+	{ E1000_TDLEN(4),  0x40,  4,  PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
+	{ E1000_TDT(0),	   0x100, 4,  PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+	{ E1000_TDT(4),	   0x40,  4,  PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
+	{ E1000_RCTL,	   0x100, 1,  SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
+	{ E1000_RCTL, 	   0x100, 1,  SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
+	{ E1000_RCTL, 	   0x100, 1,  SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
+	{ E1000_TCTL,	   0x100, 1,  SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
+	{ E1000_RA,	   0, 16, TABLE64_TEST_LO,
+						0xFFFFFFFF, 0xFFFFFFFF },
+	{ E1000_RA,	   0, 16, TABLE64_TEST_HI,
+						0xC3FFFFFF, 0xFFFFFFFF },
+	{ E1000_RA2,	   0, 16, TABLE64_TEST_LO,
+						0xFFFFFFFF, 0xFFFFFFFF },
+	{ E1000_RA2,	   0, 16, TABLE64_TEST_HI,
+						0xC3FFFFFF, 0xFFFFFFFF },
+	{ E1000_MTA,	   0, 128, TABLE32_TEST,
+						0xFFFFFFFF, 0xFFFFFFFF },
+	{ 0, 0, 0, 0 }
+};
+
 /* 82580 reg test */
 static struct igb_reg_test reg_test_82580[] = {
 	{ E1000_FCAL,	   0x100, 1,  PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
@@ -1076,6 +1119,10 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
 	u32 i, toggle;
 
 	switch (adapter->hw.mac.type) {
+	case e1000_i350:
+		test = reg_test_i350;
+		toggle = 0x7FEFF3FF;
+		break;
 	case e1000_82580:
 		test = reg_test_82580;
 		toggle = 0x7FEFF3FF;
@@ -1237,6 +1284,9 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
 	case e1000_82580:
 		ics_mask = 0x77DCFED5;
 		break;
+	case e1000_i350:
+		ics_mask = 0x77DCFED5;
+		break;
 	default:
 		ics_mask = 0x7FFFFFFF;
 		break;
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 61029e8..d732280 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -61,6 +61,10 @@ static const struct e1000_info *igb_info_tbl[] = {
 };
 
 static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_COPPER), board_82575 },
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_FIBER), board_82575 },
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SERDES), board_82575 },
+	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SGMII), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_FIBER), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), board_82575 },
@@ -327,6 +331,7 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
 		}
 	case e1000_82575:
 	case e1000_82580:
+	case e1000_i350:
 	default:
 		for (; i < adapter->num_rx_queues; i++)
 			adapter->rx_ring[i]->reg_idx = rbase_offset + i;
@@ -470,6 +475,7 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
 		q_vector->eims_value = 1 << msix_vector;
 		break;
 	case e1000_82580:
+	case e1000_i350:
 		/* 82580 uses the same table-based approach as 82576 but has fewer
 		   entries as a result we carry over for queues greater than 4. */
 		if (rx_queue > IGB_N0_QUEUE) {
@@ -550,6 +556,7 @@ static void igb_configure_msix(struct igb_adapter *adapter)
 
 	case e1000_82576:
 	case e1000_82580:
+	case e1000_i350:
 		/* Turn on MSI-X capability first, or our settings
 		 * won't stick.  And it will take days to debug. */
 		wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE |
@@ -1271,6 +1278,7 @@ void igb_reset(struct igb_adapter *adapter)
 	 * To take effect CTRL.RST is required.
 	 */
 	switch (mac->type) {
+	case e1000_i350:
 	case e1000_82580:
 		pba = rd32(E1000_RXPBS);
 		pba = igb_rxpbs_adjust_82580(pba);
@@ -1847,6 +1855,7 @@ static void igb_init_hw_timer(struct igb_adapter *adapter)
 	struct e1000_hw *hw = &adapter->hw;
 
 	switch (hw->mac.type) {
+	case e1000_i350:
 	case e1000_82580:
 		memset(&adapter->cycles, 0, sizeof(adapter->cycles));
 		adapter->cycles.read = igb_read_clock;
@@ -2362,6 +2371,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
 	if (adapter->vfs_allocated_count) {
 		/* 82575 and 82576 supports 2 RSS queues for VMDq */
 		switch (hw->mac.type) {
+		case e1000_i350:
 		case e1000_82580:
 			num_rx_queues = 1;
 			shift = 0;
@@ -6173,6 +6183,8 @@ static void igb_vmm_control(struct igb_adapter *adapter)
 		reg = rd32(E1000_RPLOLR);
 		reg |= E1000_RPLOLR_STRVLAN;
 		wr32(E1000_RPLOLR, reg);
+	case e1000_i350:
+		/* none of the above registers are supported by i350 */
 		break;
 	}
 


^ permalink raw reply related

* [PATCH 14/18] net: Provide config option for enabling SKB tracing
From: Jan Kara @ 2010-03-23  0:32 UTC (permalink / raw)
  To: LKML; +Cc: Jan Kara, David S. Miller, netdev
In-Reply-To: <1269304340-25372-1-git-send-email-jack@suse.cz>

CC: "David S. Miller" <davem@davemloft.net>
CC: netdev@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 include/trace/events/skb.h |    2 ++
 kernel/trace/Kconfig       |   10 ++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 4b2be6d..cd340df 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -1,5 +1,7 @@
 #undef TRACE_SYSTEM
+#undef TRACE_CONFIG
 #define TRACE_SYSTEM skb
+#define TRACE_CONFIG CONFIG_SKB_TRACER
 
 #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
 #define _TRACE_SKB_H
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index a48ff49..a02d577 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -498,6 +498,16 @@ config JBD2_TRACER
 
 	  If unsure, say N.
 
+config SKB_TRACER
+	bool "SKB tracing"
+	depends on NET
+	select GENERIC_TRACER
+	help
+	  Provide tracing for copying datagrams into iovecs and freeing
+	  skbs.
+
+	  If unsure, say N.
+
 config KPROBE_EVENT
 	depends on KPROBES
 	depends on HAVE_REGS_AND_STACK_ACCESS_API
-- 
1.6.4.2


^ permalink raw reply related

* [PATCH 15/18] net: Provide config option for enabling NAPI tracing
From: Jan Kara @ 2010-03-23  0:32 UTC (permalink / raw)
  To: LKML; +Cc: Jan Kara, David S. Miller, netdev
In-Reply-To: <1269304340-25372-1-git-send-email-jack@suse.cz>

CC: "David S. Miller" <davem@davemloft.net>
CC: netdev@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 include/trace/events/napi.h |    2 ++
 kernel/trace/Kconfig        |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h
index a8989c4..70cb4dd 100644
--- a/include/trace/events/napi.h
+++ b/include/trace/events/napi.h
@@ -2,6 +2,8 @@
 #define _TRACE_NAPI_H_
 
 #include <linux/netdevice.h>
+#undef TRACE_CONFIG
+#define TRACE_CONFIG CONFIG_NAPI_TRACER
 #include <linux/tracepoint.h>
 
 DECLARE_TRACE(napi_poll,
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index a02d577..88b556c 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -508,6 +508,15 @@ config SKB_TRACER
 
 	  If unsure, say N.
 
+config NAPI_TRACER
+	bool "NAPI tracing"
+	depends on NET
+	select GENERIC_TRACER
+	help
+	  Provide tracing for NAPI functions.
+
+	  If unsure, say N.
+
 config KPROBE_EVENT
 	depends on KPROBES
 	depends on HAVE_REGS_AND_STACK_ACCESS_API
-- 
1.6.4.2

^ permalink raw reply related

* Re: [RFC Patch 3/3] bonding: make bonding support netpoll
From: Andy Gospodarek @ 2010-03-23  0:56 UTC (permalink / raw)
  To: Amerigo Wang
  Cc: linux-kernel, netdev, bridge, Andy Gospodarek, Neil Horman,
	Stephen Hemminger, bonding-devel, Jay Vosburgh, David Miller
In-Reply-To: <20100322082123.4967.77433.sendpatchset@localhost.localdomain>

On Mon, Mar 22, 2010 at 04:17:40AM -0400, Amerigo Wang wrote:
> 
> Based on Andy's work, but I modify a lot.
> 
> Similar to the patch for bridge, this patch does:
> 
> 1) implement the 4 methods to support netpoll for bonding;
> 
> 2) modify netpoll during forwarding packets in bonding;
> 
> 3) disable netpoll support of bridge when a netpoll-unabled device
>    is added to bonding;
> 
> 4) enable netpoll support when all underlying devices support netpoll.
> 
> Cc: Andy Gospodarek <gospo@redhat.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Jay Vosburgh <fubar@us.ibm.com>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: WANG Cong <amwang@redhat.com>
> 

How much testing was done on this?

One of the potential problems with this code is how gracefully the
system can handle tear-down of interfaces or removal of the bonding
module when netconsole is active.  Was that tested heavily?

> 
> ---
> Index: linux-2.6/drivers/net/bonding/bond_main.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/bonding/bond_main.c
> +++ linux-2.6/drivers/net/bonding/bond_main.c
> @@ -59,6 +59,7 @@
>  #include <linux/uaccess.h>
>  #include <linux/errno.h>
>  #include <linux/netdevice.h>
> +#include <linux/netpoll.h>
>  #include <linux/inetdevice.h>
>  #include <linux/igmp.h>
>  #include <linux/etherdevice.h>
> @@ -430,7 +431,17 @@ int bond_dev_queue_xmit(struct bonding *
>  	}
>  
>  	skb->priority = 1;
> -	dev_queue_xmit(skb);
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +	if (bond->dev->priv_flags & IFF_IN_NETPOLL) {
> +		bond->dev->npinfo->netpoll->dev = skb->dev;
> +		if (!slave_dev->npinfo)
> +			slave_dev->npinfo = bond->dev->npinfo;
> +		slave_dev->priv_flags |= IFF_IN_NETPOLL;
> +		netpoll_send_skb(bond->dev->npinfo->netpoll, skb);
> +		slave_dev->priv_flags &= ~IFF_IN_NETPOLL;
> +	} else
> +#endif
> +		dev_queue_xmit(skb);
>  
>  	return 0;
>  }
> @@ -1324,6 +1335,87 @@ static void bond_detach_slave(struct bon
>  	bond->slave_cnt--;
>  }
>  
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +static bool slaves_support_netpoll(struct net_device *bond_dev)
> +{
> +	struct bonding *bond = netdev_priv(bond_dev);
> +	struct slave *slave;
> +	int i = 0;
> +	bool ret = true;
> +
> +	read_lock_bh(&bond->lock);
> +	bond_for_each_slave(bond, slave, i) {
> +		if ((slave->dev->priv_flags & IFF_DISABLE_NETPOLL)
> +				|| !slave->dev->netdev_ops->ndo_poll_controller)
> +			ret = false;
> +	}
> +	read_unlock_bh(&bond->lock);
> +	return i != 0 && ret;
> +}
> +
> +static void bond_poll_controller(struct net_device *bond_dev)
> +{
> +	struct bonding *bond = netdev_priv(bond_dev);
> +	struct slave *slave;
> +	int i;
> +
> +	read_lock(&bond->lock);
> +	bond_for_each_slave(bond, slave, i) {
> +		if (slave->dev->netdev_ops->ndo_poll_controller)
> +			netpoll_poll_dev(slave->dev);
> +	}
> +	read_unlock(&bond->lock);
> +}
> +
> +static void bond_netpoll_setup(struct net_device *bond_dev,
> +			      struct netpoll_info *npinfo)
> +{
> +	struct bonding *bond = netdev_priv(bond_dev);
> +	struct slave *slave;
> +	int i;
> +
> +	write_lock_bh(&bond->lock);
> +	bond_for_each_slave(bond, slave, i) {
> +		if (slave->dev)
> +			slave->dev->npinfo = npinfo;
> +	}
> +	write_unlock_bh(&bond->lock);
> +}
> +
> +static void bond_netpoll_cleanup(struct net_device *bond_dev)
> +{
> +	struct bonding *bond = netdev_priv(bond_dev);
> +	struct slave *slave;
> +	const struct net_device_ops *ops;
> +	int i;
> +
> +	write_lock_bh(&bond->lock);
> +	bond_dev->npinfo = NULL;
> +	bond_for_each_slave(bond, slave, i) {
> +		if (slave->dev) {
> +			ops = slave->dev->netdev_ops;
> +			if (ops->ndo_netpoll_cleanup)
> +				ops->ndo_netpoll_cleanup(slave->dev);
> +			else
> +				slave->dev->npinfo = NULL;
> +		}
> +	}
> +	write_unlock_bh(&bond->lock);
> +}
> +
> +static int bond_netpoll_xmit(struct netpoll *np, struct sk_buff *skb,
> +			     struct net_device *dev)
> +{
> +	int ret;
> +
> +	dev->priv_flags |= IFF_IN_NETPOLL;
> +	ret = dev->netdev_ops->ndo_start_xmit(skb, dev);
> +	np->dev = dev;
> +	dev->priv_flags &= ~IFF_IN_NETPOLL;
> +	return ret;
> +}
> +#endif
> +
>  /*---------------------------------- IOCTL ----------------------------------*/
>  
>  static int bond_sethwaddr(struct net_device *bond_dev,
> @@ -1741,6 +1833,18 @@ int bond_enslave(struct net_device *bond
>  		new_slave->state == BOND_STATE_ACTIVE ? "n active" : " backup",
>  		new_slave->link != BOND_LINK_DOWN ? "n up" : " down");
>  
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +	if (slaves_support_netpoll(bond_dev)) {
> +		bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
> +		if (bond_dev->npinfo)
> +			slave_dev->npinfo = bond_dev->npinfo;
> +	} else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) {
> +		bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
> +		pr_info("New slave device %s does not support netpoll\n",
> +			slave_dev->name);
> +		pr_info("Disabling netpoll support for %s\n", bond_dev->name);
> +	}
> +#endif
>  	/* enslave is successful */
>  	return 0;
>  
> @@ -1924,6 +2028,15 @@ int bond_release(struct net_device *bond
>  
>  	netdev_set_master(slave_dev, NULL);
>  
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +	if (slaves_support_netpoll(bond_dev))
> +		bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
> +	if (slave_dev->netdev_ops->ndo_netpoll_cleanup)
> +		slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev);
> +	else
> +		slave_dev->npinfo = NULL;
> +#endif
> +
>  	/* close slave before restoring its mac address */
>  	dev_close(slave_dev);
>  
> @@ -2032,6 +2145,9 @@ static int bond_release_all(struct net_d
>  
>  		netdev_set_master(slave_dev, NULL);
>  
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +		slave_dev->npinfo = NULL;
> +#endif
>  		/* close slave before restoring its mac address */
>  		dev_close(slave_dev);
>  
> @@ -4424,6 +4540,12 @@ static const struct net_device_ops bond_
>  	.ndo_vlan_rx_register	= bond_vlan_rx_register,
>  	.ndo_vlan_rx_add_vid 	= bond_vlan_rx_add_vid,
>  	.ndo_vlan_rx_kill_vid	= bond_vlan_rx_kill_vid,
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +	.ndo_netpoll_setup	= bond_netpoll_setup,
> +	.ndo_netpoll_xmit	= bond_netpoll_xmit,
> +	.ndo_netpoll_cleanup	= bond_netpoll_cleanup,
> +	.ndo_poll_controller	= bond_poll_controller,
> +#endif
>  };
>  
>  static void bond_setup(struct net_device *bond_dev)

^ 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