Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v4 00/10] net/fec: add dual fec support for i.MX28
From: Shawn Guo @ 2011-01-10  3:08 UTC (permalink / raw)
  To: David Miller
  Cc: gerg, baruch, eric, bryan.wu, r64343, B32542, u.kleine-koenig, lw,
	w.sang, s.hauer, jamie, jamie, netdev, linux-arm-kernel
In-Reply-To: <20110109.154409.242134862.davem@davemloft.net>

On Sun, Jan 09, 2011 at 03:44:09PM -0800, David Miller wrote:
> From: Shawn Guo <shawn.guo@freescale.com>
> Date: Thu, 6 Jan 2011 15:13:08 +0800
> 
> > This patch series is to add dual fec support for mx28, which is
> > a mxs-based soc. Some code changes related to the following commits
> > are also made in this patch set for some reasons.
> > 
> >  e6b043d512fa8d9a3801bf5d72bfa3b8fc3b3cc8
> >  netdev/fec.c: add phylib supporting to enable carrier detection (v2)
> > 
> >  e3fe8558c7fc182972c3d947d88744482111f304
> >  net/fec: fix pm to survive to suspend/resume
> > 
> > It's been tested on mx28 evk and mx51 babbage. For mx28, it has
> > to work against the tree
> > 
> >  git://git.pengutronix.de/git/imx/linux-2.6.git imx-for-2.6.38
> > 
> > plus patch
> > 
> >  [PATCH v4] ARM: mxs: Change duart device to use amba-pl011
> > 
> > The 3 patches below preceding with * have changes since v3, and
> > the detailed change log can be found in individual patch.
> 
> I've applied all of the "net/fec:" patches (#1 to #5) to net-2.6,
> please push the ARM changes via the appropriate ARM tree.
> 
> Thanks.
> 
Thanks, David.  I will ping Sascha for ARM changes.

-- 
Regards,
Shawn


^ permalink raw reply

* Re: Bad TCP timestamps on non-PC platforms
From: Alex Dubov @ 2011-01-10  3:41 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, David Miller

> > 
> > You dont give new informations ;)
> > 

Some additional information (my wireshark was not validating checksums, so
I missed the real culprit).

It so appears, that when timestamps are enabled on my dev board, TCP
checksum in SYN packet turns out to be incorrect. That's why those packets
are dropped by the remote side. When TCP timestamps are disabled, checksums
are correct.

Any ideas where this particular problem may originate?



      

^ permalink raw reply

* Re: Bad TCP timestamps on non-PC platforms
From: Stephen Hemminger @ 2011-01-10  3:57 UTC (permalink / raw)
  To: Alex Dubov; +Cc: Eric Dumazet, netdev, David Miller
In-Reply-To: <798351.95533.qm@web37603.mail.mud.yahoo.com>

On Sun, 9 Jan 2011 19:41:13 -0800 (PST)
Alex Dubov <oakad@yahoo.com> wrote:

> > > 
> > > You dont give new informations ;)
> > > 
> 
> Some additional information (my wireshark was not validating checksums, so
> I missed the real culprit).
> 
> It so appears, that when timestamps are enabled on my dev board, TCP
> checksum in SYN packet turns out to be incorrect. That's why those packets
> are dropped by the remote side. When TCP timestamps are disabled, checksums
> are correct.
> 
> Any ideas where this particular problem may originate?

Is there a bug in checksum offload in the driver?
Does the hardware correctly handle checksum of packets that are
unaligned or whose length is an odd number of bytes?

If the hardware can't do checksum correctly, the driver should either
disable checksum offload or in worst case copy the packet to a new
buffer that is in a known safe place.

^ permalink raw reply

* [PATCH 0/2] net: Allow allocating different number RX and TX mqs
From: Tom Herbert @ 2011-01-10  5:36 UTC (permalink / raw)
  To: davem, netdev

Add functions so that a different number of TX and RX queues can be
allocated in a netdevice.  Second patch modifies mlx4 driver to call
this function which is an example of a driver that allocates different
numbers for TX and RX queues.


^ permalink raw reply

* [PATCH 1/2] net: Add alloc_netdev_mqs function
From: Tom Herbert @ 2011-01-10  5:36 UTC (permalink / raw)
  To: davem, netdev

Added alloc_netdev_mqs function which allows the number of transmit and
receive queues to be specified independenty.  alloc_netdev_mq was
changed to a macro to call the new function.  Also added
alloc_etherdev_mqs with same purpose.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 include/linux/etherdevice.h |    4 +++-
 include/linux/netdevice.h   |   10 +++++++---
 net/core/dev.c              |   32 +++++++++++++++++++++-----------
 net/ethernet/eth.c          |   12 +++++++-----
 4 files changed, 38 insertions(+), 20 deletions(-)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index f16a010..bec8b82 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -48,8 +48,10 @@ extern int eth_validate_addr(struct net_device *dev);
 
 
 
-extern struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count);
+extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
+					    unsigned int rxqs);
 #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
+#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count)
 
 /**
  * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0f6b1c9..132baf4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2191,11 +2191,15 @@ static inline void netif_addr_unlock_bh(struct net_device *dev)
 extern void		ether_setup(struct net_device *dev);
 
 /* Support for loadable net-drivers */
-extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
+extern struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
 				       void (*setup)(struct net_device *),
-				       unsigned int queue_count);
+				       unsigned int txqs, unsigned int rxqs);
 #define alloc_netdev(sizeof_priv, name, setup) \
-	alloc_netdev_mq(sizeof_priv, name, setup, 1)
+	alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
+
+#define alloc_netdev_mq(sizeof_priv, name, setup, count) \
+	alloc_netdev_mqs(sizeof_priv, name, setup, count, count)
+
 extern int		register_netdev(struct net_device *dev);
 extern void		unregister_netdev(struct net_device *dev);
 
diff --git a/net/core/dev.c b/net/core/dev.c
index a215269..d13cd64 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5621,18 +5621,20 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev)
 }
 
 /**
- *	alloc_netdev_mq - allocate network device
+ *	alloc_netdev_mqs - allocate network device
  *	@sizeof_priv:	size of private data to allocate space for
  *	@name:		device name format string
  *	@setup:		callback to initialize device
- *	@queue_count:	the number of subqueues to allocate
+ *	@txqs:		the number of TX subqueues to allocate
+ *	@rxqs:		the number of RX subqueues to allocate
  *
  *	Allocates a struct net_device with private data area for driver use
  *	and performs basic initialization.  Also allocates subquue structs
- *	for each queue on the device at the end of the netdevice.
+ *	for each queue on the device.
  */
-struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
-		void (*setup)(struct net_device *), unsigned int queue_count)
+struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
+		void (*setup)(struct net_device *),
+		unsigned int txqs, unsigned int rxqs)
 {
 	struct net_device *dev;
 	size_t alloc_size;
@@ -5640,12 +5642,20 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
 
 	BUG_ON(strlen(name) >= sizeof(dev->name));
 
-	if (queue_count < 1) {
+	if (txqs < 1) {
 		pr_err("alloc_netdev: Unable to allocate device "
 		       "with zero queues.\n");
 		return NULL;
 	}
 
+#ifdef CONFIG_RPS
+	if (rxqs < 1) {
+		pr_err("alloc_netdev: Unable to allocate device "
+		       "with zero RX queues.\n");
+		return NULL;
+	}
+#endif
+
 	alloc_size = sizeof(struct net_device);
 	if (sizeof_priv) {
 		/* ensure 32-byte alignment of private area */
@@ -5676,14 +5686,14 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
 
 	dev_net_set(dev, &init_net);
 
-	dev->num_tx_queues = queue_count;
-	dev->real_num_tx_queues = queue_count;
+	dev->num_tx_queues = txqs;
+	dev->real_num_tx_queues = txqs;
 	if (netif_alloc_netdev_queues(dev))
 		goto free_pcpu;
 
 #ifdef CONFIG_RPS
-	dev->num_rx_queues = queue_count;
-	dev->real_num_rx_queues = queue_count;
+	dev->num_rx_queues = rxqs;
+	dev->real_num_rx_queues = rxqs;
 	if (netif_alloc_rx_queues(dev))
 		goto free_pcpu;
 #endif
@@ -5711,7 +5721,7 @@ free_p:
 	kfree(p);
 	return NULL;
 }
-EXPORT_SYMBOL(alloc_netdev_mq);
+EXPORT_SYMBOL(alloc_netdev_mqs);
 
 /**
  *	free_netdev - free network device
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index f00ef2f..f9d7ac9 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -347,10 +347,11 @@ void ether_setup(struct net_device *dev)
 EXPORT_SYMBOL(ether_setup);
 
 /**
- * alloc_etherdev_mq - Allocates and sets up an Ethernet device
+ * alloc_etherdev_mqs - Allocates and sets up an Ethernet device
  * @sizeof_priv: Size of additional driver-private structure to be allocated
  *	for this Ethernet device
- * @queue_count: The number of queues this device has.
+ * @txqs: The number of TX queues this device has.
+ * @txqs: The number of RX queues this device has.
  *
  * Fill in the fields of the device structure with Ethernet-generic
  * values. Basically does everything except registering the device.
@@ -360,11 +361,12 @@ EXPORT_SYMBOL(ether_setup);
  * this private data area.
  */
 
-struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count)
+struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
+				      unsigned int rxqs)
 {
-	return alloc_netdev_mq(sizeof_priv, "eth%d", ether_setup, queue_count);
+	return alloc_netdev_mqs(sizeof_priv, "eth%d", ether_setup, txqs, rxqs);
 }
-EXPORT_SYMBOL(alloc_etherdev_mq);
+EXPORT_SYMBOL(alloc_etherdev_mqs);
 
 static size_t _format_mac_addr(char *buf, int buflen,
 			       const unsigned char *addr, int len)
-- 
1.7.3.1



^ permalink raw reply related

* [PATCH 2/2] mlx4: Call alloc_etherdev to allocate RX and TX queues
From: Tom Herbert @ 2011-01-10  5:36 UTC (permalink / raw)
  To: davem, netdev

Changed driver to call alloc_etherdev_mqs so that the number of TX
and RX queues can be set to correct values in the netdev device.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 drivers/net/mlx4/en_netdev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index 6d6806b..897f576 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -972,7 +972,8 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 	int i;
 	int err;
 
-	dev = alloc_etherdev_mq(sizeof(struct mlx4_en_priv), prof->tx_ring_num);
+	dev = alloc_etherdev_mqs(sizeof(struct mlx4_en_priv),
+	    prof->tx_ring_num, prof->rx_ring_num);
 	if (dev == NULL) {
 		mlx4_err(mdev, "Net device allocation failed\n");
 		return -ENOMEM;
-- 
1.7.3.1


^ permalink raw reply related

* what are txqueuelen and nic ring parameters exactly?
From: MK @ 2011-01-10  5:38 UTC (permalink / raw)
  To: netdev

Hello,

I often come across two variables that can be tuned for networking -

1) txqueuelen (via ifconfig )
2) NIC ring parameters for tx and rx (via ethtool)

Can someone please tell me where these queues are exactly? Are both
the same (seems not since their current values are different on my
computer) . Is txqueuelen somehow part of the linux networking
subsystem whereas the other is purely a h/w device construct?

Thanks a lot!

^ permalink raw reply

* Re: Bad TCP timestamps on non-PC platforms
From: Alex Dubov @ 2011-01-10  6:33 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Eric Dumazet, netdev, David Miller
In-Reply-To: <20110109195711.1d622b2e@nehalam>


> > Any ideas where this particular problem may
> originate?
> 
> Is there a bug in checksum offload in the driver?
> Does the hardware correctly handle checksum of packets that
> are
> unaligned or whose length is an odd number of bytes?
> 
> If the hardware can't do checksum correctly, the driver
> should either
> disable checksum offload or in worst case copy the packet
> to a new
> buffer that is in a known safe place.

I managed to work around the issue by clearing the NETIF_F_IP_CSUM
feature flag of the gianfar network driver, so it appears the bug is
indeed somewhere there.



      

^ permalink raw reply

* Re: Bad TCP timestamps on non-PC platforms
From: Eric Dumazet @ 2011-01-10  7:07 UTC (permalink / raw)
  To: Alex Dubov; +Cc: Stephen Hemminger, netdev, David Miller
In-Reply-To: <373539.88491.qm@web37603.mail.mud.yahoo.com>

Le dimanche 09 janvier 2011 à 22:33 -0800, Alex Dubov a écrit :
> > > Any ideas where this particular problem may
> > originate?
> > 
> > Is there a bug in checksum offload in the driver?
> > Does the hardware correctly handle checksum of packets that
> > are
> > unaligned or whose length is an odd number of bytes?
> > 
> > If the hardware can't do checksum correctly, the driver
> > should either
> > disable checksum offload or in worst case copy the packet
> > to a new
> > buffer that is in a known safe place.
> 
> I managed to work around the issue by clearing the NETIF_F_IP_CSUM
> feature flag of the gianfar network driver, so it appears the bug is
> indeed somewhere there.
> 

Its incredible how TCP timestamps can be "usual suspects" ;)




^ permalink raw reply

* Re: [PATCH V8 02/13] ntp: add ADJ_SETOFFSET mode bit
From: Richard Cochran @ 2011-01-10  7:17 UTC (permalink / raw)
  To: Kuwahara,T.
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	Alan Cox, Arnd Bergmann, Christoph Lameter, David Miller,
	John Stultz, Krzysztof Halasa, Peter Zijlstra, Rodolfo Giometti,
	Thomas Gleixner
In-Reply-To: <AANLkTikigXGSACF6R6kfNHyKZ7GFWrUrCMxygvL3fUC6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, Jan 10, 2011 at 06:07:26AM +0900, Kuwahara,T. wrote:
> On Sun, Jan 9, 2011 at 2:50 AM, Richard Cochran
> <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > we want to be able to jump the clock arbitrarily.
> 
> Another problem remains:  How do you deal with leap seconds?  I mean,
> given that 1 minute is not always 60 seconds, then what time was it
> XXXXX seconds ago?   Maybe some kind of lookup table is necessary, but
> in such case, isn't it a better choice just to use the
> clock_settime/settimeofday syscall?

Well, first of all, the PTP Hardware Clocks for which this whole patch
set was created in the first place will keep their time as TAI. Adding
seconds to such time values is unambiguous.

Secondly, the question you ask applies equally to the existing
interfaces, so it is a mute point with regard to the patch series.

Richard

^ permalink raw reply

* Re: Bad TCP timestamps on non-PC platforms
From: David Miller @ 2011-01-10  7:19 UTC (permalink / raw)
  To: eric.dumazet; +Cc: oakad, shemminger, netdev
In-Reply-To: <1294643276.2709.877.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 10 Jan 2011 08:07:56 +0100

> Le dimanche 09 janvier 2011 à 22:33 -0800, Alex Dubov a écrit :
>> I managed to work around the issue by clearing the NETIF_F_IP_CSUM
>> feature flag of the gianfar network driver, so it appears the bug is
>> indeed somewhere there.
>> 
> 
> Its incredible how TCP timestamps can be "usual suspects" ;)

Or RTC chips! :-)

^ permalink raw reply

* Re: [PATCH V8 02/13] ntp: add ADJ_SETOFFSET mode bit
From: Richard Cochran @ 2011-01-10  7:22 UTC (permalink / raw)
  To: Kuwahara,T.
  Cc: linux-kernel, linux-api, netdev, Alan Cox, Arnd Bergmann,
	Christoph Lameter, David Miller, John Stultz, Krzysztof Halasa,
	Peter Zijlstra, Rodolfo Giometti, Thomas Gleixner
In-Reply-To: <AANLkTikigXGSACF6R6kfNHyKZ7GFWrUrCMxygvL3fUC6@mail.gmail.com>

On Mon, Jan 10, 2011 at 06:07:26AM +0900, Kuwahara,T. wrote:
> 
> Another problem remains:  How do you deal with leap seconds?  I mean,

Since you have changed the topic, does that mean that you now agree
with adding a new mode bit? ;)

Richard

^ permalink raw reply

* Re: [PATCH 1/6] offloading: Accept NETIF_F_HW_CSUM for all protocols.
From: David Miller @ 2011-01-10  7:36 UTC (permalink / raw)
  To: jesse; +Cc: netdev
In-Reply-To: <1294590215-15541-1-git-send-email-jesse@nicira.com>


Thanks for doing this work Jesse, I've applied all of these patches.

I added a "net " prefix to the commit header lines so that people know
what kind of "offloading" these changes are about :-)

^ permalink raw reply

* Re: [PATCH] tlan: Use pr_fmt, pr_<level> and netdev_<level>, remove changelog
From: David Miller @ 2011-01-10  7:39 UTC (permalink / raw)
  To: joe; +Cc: sakari.ailus, netdev, chessman
In-Reply-To: <1294354088.12561.295.camel@Joe-Laptop>

From: Joe Perches <joe@perches.com>
Date: Thu, 06 Jan 2011 14:48:08 -0800

> Neatening and standardization to the standard logging mechanisms.
> The changelog isn't useful anymore.
> Miscellaneous speen/speed typo correction.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

This patch didn't apply cleanly to the current sources.

And anyways, please resubmit this once 2.6.38-rc1 is out and I
start taking net-next-2.6 patches again.

Thanks Joe.

^ permalink raw reply

* Re: [net-next 00/12][pull-request] Intel Wired LAN Driver Updates
From: David Miller @ 2011-01-10  7:45 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips
In-Reply-To: <1294360629.2622.28.camel@jtkirshe-MOBL1>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 06 Jan 2011 16:37:09 -0800

> On Thu, 2011-01-06 at 16:29 -0800, Kirsher, Jeffrey T wrote:
>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>> 
>> The following series contains ixgbe/e1000e cleanups and fixes.  The
>> addition of CE4100 support in e1000, and ixgb VLAN conversion to the
>> new model.
>> 
>> The following changes since commit dbbe68bb12b34f3e450da7a73c20e6fa1f85d63a:
>> 
>>   Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
>> 
>> are available in the git repository at:
>> 
>>   master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6.git master
 ...
> I apologize, I fat fingered Andy Gospodarek's email address.  I have
> corrected it in this response.

Since Jesse Gross found problems with patch #8 (the ixgb conversion to
the new VLAN model) I hand applied every patch except for #8 to my
tree while we wait for Emil's respin of that.

^ permalink raw reply

* Re: [patch] phonet: some signedness bugs
From: Rémi Denis-Courmont @ 2011-01-10  7:58 UTC (permalink / raw)
  To: ext Dan Carpenter
  Cc: David S. Miller, netdev, kernel-janitors, dan.j.rosenberg
In-Reply-To: <20110107203755.GB1959@bicker>

On Friday 07 January 2011 22:37:55 ext Dan Carpenter, you wrote:
> Dan Rosenberg pointed out that there were some signed comparison bugs
> in the phonet protocol.

There are two ways to solve this: change *only* the proto_get function to use 
an unsigned parameter, or cast the protocol to unsigned in the comparison.

As David pointed out, your patch breaks the socket() callback prototype.

-- 
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki

^ permalink raw reply

* [PATCH] vhost: fix signed/unsigned comparison
From: Michael S. Tsirkin @ 2011-01-10  8:03 UTC (permalink / raw)
  To: Michael S. Tsirkin, kvm, virtualization, netdev, linux-kernel,
	Jes.Sorensen, stable

To detect that a sequence number is done, we are doing math on unsigned
integers so the result is unsigned too. Not what was intended for the <=
comparison. The result is user stuck forever in flush call.
Convert to int to fix this.

Further, get rid of ({}) to make code clearer.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

I've put this on my vhost.git tree.

 drivers/vhost/vhost.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 159c77a..522b8fc 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -98,22 +98,26 @@ void vhost_poll_stop(struct vhost_poll *poll)
 	remove_wait_queue(poll->wqh, &poll->wait);
 }
 
+static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work,
+				unsigned seq)
+{
+	int left;
+	spin_lock_irq(&dev->work_lock);
+	left = seq - work->done_seq;
+	spin_unlock_irq(&dev->work_lock);
+	return left <= 0;
+}
+
 static void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work)
 {
 	unsigned seq;
-	int left;
 	int flushing;
 
 	spin_lock_irq(&dev->work_lock);
 	seq = work->queue_seq;
 	work->flushing++;
 	spin_unlock_irq(&dev->work_lock);
-	wait_event(work->done, ({
-		   spin_lock_irq(&dev->work_lock);
-		   left = seq - work->done_seq <= 0;
-		   spin_unlock_irq(&dev->work_lock);
-		   left;
-	}));
+	wait_event(work->done, vhost_work_seq_done(dev, work, seq));
 	spin_lock_irq(&dev->work_lock);
 	flushing = --work->flushing;
 	spin_unlock_irq(&dev->work_lock);
-- 
1.7.3.2.91.g446ac

^ permalink raw reply related

* Re: 2.6.37-rc8: Reported regressions from 2.6.36
From: David Miller @ 2011-01-10  8:08 UTC (permalink / raw)
  To: rjw
  Cc: linux-kernel, maciej.rutecki, florian, akpm, torvalds,
	kernel-testers, netdev, linux-acpi, linux-pm, linux-scsi,
	linux-wireless, dri-devel
In-Reply-To: <96DQe4a_2tH.A.cFB.l27GNB@chimera>

From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Wed, 29 Dec 2010 23:59:38 +0100 (CET)

> Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=24592
> Subject		: 2.6.37-rc5: NULL pointer oops in selinux_socket_unix_stream_connect
> Submitter	: Jeremy Fitzhardinge <jeremy@goop.org>
> Date		: 2010-12-08 21:09 (22 days old)
> Message-ID	: <4CFFF3F3.90100@goop.org>
> References	: http://marc.info/?l=linux-kernel&m=129184256629712&w=2

This bug is intended to be fixed by:

commit 3610cda53f247e176bcbb7a7cca64bc53b12acdb
Author: David S. Miller <davem@davemloft.net>
Date:   Wed Jan 5 15:38:53 2011 -0800

    af_unix: Avoid socket->sk NULL OOPS in stream connect security hooks.
    
    unix_release() can asynchornously set socket->sk to NULL, and
    it does so without holding the unix_state_lock() on "other"
    during stream connects.
    
    However, the reverse mapping, sk->sk_socket, is only transitioned
    to NULL under the unix_state_lock().
    
    Therefore make the security hooks follow the reverse mapping instead
    of the forward mapping.
    
    Reported-by: Jeremy Fitzhardinge <jeremy@goop.org>
    Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>


^ permalink raw reply

* Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style
From: Christoph Paasch @ 2011-01-10  9:03 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Randy Dunlap, davem, netdev, linux-kernel
In-Reply-To: <1294614389.2823.35.camel@localhost>


On Monday, January 10, 2011 wrote Ben Hutchings:
> Yes.
[...]

Ok, then I will make a patch and send it to netdev.

Thanks for your comments, Ben.

Cheers,
Christoph

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

^ permalink raw reply

* RE: [PATCH net-2.6 5/5] bnx2x: Update version to 1.60.01-1
From: Vladislav Zolotarov @ 2011-01-10  9:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, Eilon Greenstein
In-Reply-To: <20110109.155038.68127568.davem@davemloft.net>

> You made these patches against net-2.6 which was inactive for nearly
> a full week as we were largely into the merge window.
> 
> I applied these, but since the version number of the driver is now
> 1.62.x I skipped this last patch.

Thanks, Dave. 
I've missed that the tree is closed - my bad, sorry... :)

vlad


^ permalink raw reply

* Re: Flow Control and Port Mirroring Revisited
From: Simon Horman @ 2011-01-10  9:31 UTC (permalink / raw)
  To: Jesse Gross
  Cc: Eric Dumazet, Rusty Russell, virtualization, dev, virtualization,
	netdev, kvm, Michael S. Tsirkin
In-Reply-To: <20110107012356.GA1257@verge.net.au>

On Fri, Jan 07, 2011 at 10:23:58AM +0900, Simon Horman wrote:
> On Thu, Jan 06, 2011 at 05:38:01PM -0500, Jesse Gross wrote:
> 
> [ snip ]
> > 
> > I know that everyone likes a nice netperf result but I agree with
> > Michael that this probably isn't the right question to be asking.  I
> > don't think that socket buffers are a real solution to the flow
> > control problem: they happen to provide that functionality but it's
> > more of a side effect than anything.  It's just that the amount of
> > memory consumed by packets in the queue(s) doesn't really have any
> > implicit meaning for flow control (think multiple physical adapters,
> > all with the same speed instead of a virtual device and a physical
> > device with wildly different speeds).  The analog in the physical
> > world that you're looking for would be Ethernet flow control.
> > Obviously, if the question is limiting CPU or memory consumption then
> > that's a different story.
> 
> Point taken. I will see if I can control CPU (and thus memory) consumption
> using cgroups and/or tc.

I have found that I can successfully control the throughput using
the following techniques

1) Place a tc egress filter on dummy0

2) Use ovs-ofctl to add a flow that sends skbs to dummy0 and then eth1,
   this is effectively the same as one of my hacks to the datapath
   that I mentioned in an earlier mail. The result is that eth1
   "paces" the connection.

3) 2) + place a tc egress filter on eth1

Which mostly makes sense to me although I am a little confused about
why 1) needs a filter on dummy0 (a filter on eth1 has no effect)
but 3) needs a filter on eth1 (a filter on dummy0 has no effect,
even if the skb is sent to dummy0 last.

I also had some limited success using CPU cgroups, though obviously
that targets CPU usage and thus the effect on throughput is fairly course.
In short, its a useful technique but not one that bares further
discussion here.


^ permalink raw reply

* [PATCH 3/3] qlcnic: change module parameter permissions
From: Amit Kumar Salecha @ 2011-01-10 10:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty
In-Reply-To: <1294654523-3085-1-git-send-email-amit.salecha@qlogic.com>

o Updating module parameter after driver load is not supported
  except auto_fw_reset parameter. Changing these parameter after
  driver load, can have weird result.

o Update driver version to 5.0.15.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic.h      |    4 ++--
 drivers/net/qlcnic/qlcnic_main.c |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 14b6322..44e316f 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -34,8 +34,8 @@
 
 #define _QLCNIC_LINUX_MAJOR 5
 #define _QLCNIC_LINUX_MINOR 0
-#define _QLCNIC_LINUX_SUBVERSION 14
-#define QLCNIC_LINUX_VERSIONID  "5.0.14"
+#define _QLCNIC_LINUX_SUBVERSION 15
+#define QLCNIC_LINUX_VERSIONID  "5.0.15"
 #define QLCNIC_DRV_IDC_VER  0x01
 #define QLCNIC_DRIVER_VERSION  ((_QLCNIC_LINUX_MAJOR << 16) |\
 		 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 11e3a46..37c04b4 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -31,15 +31,15 @@ static const char qlcnic_driver_string[] = "QLogic 1/10 GbE "
 
 static struct workqueue_struct *qlcnic_wq;
 static int qlcnic_mac_learn;
-module_param(qlcnic_mac_learn, int, 0644);
+module_param(qlcnic_mac_learn, int, 0444);
 MODULE_PARM_DESC(qlcnic_mac_learn, "Mac Filter (0=disabled, 1=enabled)");
 
 static int use_msi = 1;
-module_param(use_msi, int, 0644);
+module_param(use_msi, int, 0444);
 MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled");
 
 static int use_msi_x = 1;
-module_param(use_msi_x, int, 0644);
+module_param(use_msi_x, int, 0444);
 MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled");
 
 static int auto_fw_reset = AUTO_FW_RESET_ENABLED;
@@ -47,11 +47,11 @@ module_param(auto_fw_reset, int, 0644);
 MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled");
 
 static int load_fw_file;
-module_param(load_fw_file, int, 0644);
+module_param(load_fw_file, int, 0444);
 MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file");
 
 static int qlcnic_config_npars;
-module_param(qlcnic_config_npars, int, 0644);
+module_param(qlcnic_config_npars, int, 0444);
 MODULE_PARM_DESC(qlcnic_config_npars, "Configure NPARs (0=disabled, 1=enabled");
 
 static int __devinit qlcnic_probe(struct pci_dev *pdev,
-- 
1.7.3.2


^ permalink raw reply related

* [PATCH 2/3] qlcnic: fix ethtool diagnostics test
From: Amit Kumar Salecha @ 2011-01-10 10:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty, Sony Chacko
In-Reply-To: <1294654523-3085-1-git-send-email-amit.salecha@qlogic.com>

From: Sony Chacko <sony.chacko@qlogic.com>

IRQ diag test was getting executed only when both register test
and link test passed. The test should get executed if ETH_TEST_FL_OFFLINE
flag is set.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic_ethtool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 1e7af70..4c14510 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -672,7 +672,7 @@ qlcnic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
 	if (data[1])
 		eth_test->flags |= ETH_TEST_FL_FAILED;
 
-	if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
+	if (eth_test->flags & ETH_TEST_FL_OFFLINE) {
 		data[2] = qlcnic_irq_test(dev);
 		if (data[2])
 			eth_test->flags |= ETH_TEST_FL_FAILED;
-- 
1.7.3.2


^ permalink raw reply related

* [PATCH 0/3]qlcnic:bug fixes
From: Amit Kumar Salecha @ 2011-01-10 10:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty


Hi,
  Series of 3 patches to fix bugs. Apply them on net-2.6.

  Driver is reading incorrect flash fw version and fails to load, 
  "fix flash fw version read" patch fixes this.

-Amit

^ permalink raw reply

* [PATCH 1/3] qlcnic: fix flash fw version read
From: Amit Kumar Salecha @ 2011-01-10 10:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty
In-Reply-To: <1294654523-3085-1-git-send-email-amit.salecha@qlogic.com>

Driver is reading flash fw version from defined address, this address
may be invalid. Indeed Driver should read address for fw version through
flash layout table. Flash layout table has defined region and address for
fw version address should be read from fw image region.

Driver has check for old firmware, this bug can cause driver load fail.
This patch will try to read fw version from flash image region, if that fails,
read from defined address.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic.h      |   20 ++++++++++++
 drivers/net/qlcnic/qlcnic_init.c |   63 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 82 insertions(+), 1 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 9c2a02d..14b6322 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -289,6 +289,26 @@ struct uni_data_desc{
 	u32	reserved[5];
 };
 
+/* Flash Defines and Structures */
+#define QLCNIC_FLT_LOCATION	0x3F1000
+#define QLCNIC_FW_IMAGE_REGION	0x74
+struct qlcnic_flt_header {
+	u16 version;
+	u16 len;
+	u16 checksum;
+	u16 reserved;
+};
+
+struct qlcnic_flt_entry {
+	u8 region;
+	u8 reserved0;
+	u8 attrib;
+	u8 reserved1;
+	u32 size;
+	u32 start_addr;
+	u32 end_add;
+};
+
 /* Magic number to let user know flash is programmed */
 #define	QLCNIC_BDINFO_MAGIC 0x12345678
 
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 9b9c7c3..a7f1d5b 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -627,12 +627,73 @@ qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) {
 	return 0;
 }
 
+static int qlcnic_get_flt_entry(struct qlcnic_adapter *adapter, u8 region,
+				struct qlcnic_flt_entry *region_entry)
+{
+	struct qlcnic_flt_header flt_hdr;
+	struct qlcnic_flt_entry *flt_entry;
+	int i = 0, ret;
+	u32 entry_size;
+
+	memset(region_entry, 0, sizeof(struct qlcnic_flt_entry));
+	ret = qlcnic_rom_fast_read_words(adapter, QLCNIC_FLT_LOCATION,
+					 (u8 *)&flt_hdr,
+					 sizeof(struct qlcnic_flt_header));
+	if (ret) {
+		dev_warn(&adapter->pdev->dev,
+			 "error reading flash layout header\n");
+		return -EIO;
+	}
+
+	entry_size = flt_hdr.len - sizeof(struct qlcnic_flt_header);
+	flt_entry = (struct qlcnic_flt_entry *)vzalloc(entry_size);
+	if (flt_entry == NULL) {
+		dev_warn(&adapter->pdev->dev, "error allocating memory\n");
+		return -EIO;
+	}
+
+	ret = qlcnic_rom_fast_read_words(adapter, QLCNIC_FLT_LOCATION +
+					 sizeof(struct qlcnic_flt_header),
+					 (u8 *)flt_entry, entry_size);
+	if (ret) {
+		dev_warn(&adapter->pdev->dev,
+			 "error reading flash layout entries\n");
+		goto err_out;
+	}
+
+	while (i < (entry_size/sizeof(struct qlcnic_flt_entry))) {
+		if (flt_entry[i].region == region)
+			break;
+		i++;
+	}
+	if (i >= (entry_size/sizeof(struct qlcnic_flt_entry))) {
+		dev_warn(&adapter->pdev->dev,
+			 "region=%x not found in %d regions\n", region, i);
+		ret = -EIO;
+		goto err_out;
+	}
+	memcpy(region_entry, &flt_entry[i], sizeof(struct qlcnic_flt_entry));
+
+err_out:
+	vfree(flt_entry);
+	return ret;
+}
+
 int
 qlcnic_check_flash_fw_ver(struct qlcnic_adapter *adapter)
 {
+	struct qlcnic_flt_entry fw_entry;
 	u32 ver = -1, min_ver;
+	int ret;
 
-	qlcnic_rom_fast_read(adapter, QLCNIC_FW_VERSION_OFFSET, (int *)&ver);
+	ret = qlcnic_get_flt_entry(adapter, QLCNIC_FW_IMAGE_REGION, &fw_entry);
+	if (!ret)
+		/* 0-4:-signature,  4-8:-fw version */
+		qlcnic_rom_fast_read(adapter, fw_entry.start_addr + 4,
+				     (int *)&ver);
+	else
+		qlcnic_rom_fast_read(adapter, QLCNIC_FW_VERSION_OFFSET,
+				     (int *)&ver);
 
 	ver = QLCNIC_DECODE_VERSION(ver);
 	min_ver = QLCNIC_MIN_FW_VERSION;
-- 
1.7.3.2


^ permalink raw reply related


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