Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] adm8211: fix memory leak
From: Luis R. Rodriguez @ 2010-07-12 14:51 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors@vger.kernel.org, Michael Wu, John W. Linville,
	David S. Miller, Johannes Berg, Kalle Valo, Luis Rodriguez,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <1278764938-9417-1-git-send-email-segooon@gmail.com>

On Sat, Jul 10, 2010 at 05:28:57AM -0700, Kulikov Vasiliy wrote:
> We must free priv->eeprom allocated in adm8211_read_eeprom().
> 
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>

Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>

Good catch.

  Luis

^ permalink raw reply

* [PATCH v2] depca: fix leaks in depca_module_init()
From: Kulikov Vasiliy @ 2010-07-12 14:52 UTC (permalink / raw)
  To: David Miller
  Cc: kernel-janitors, jpirko, joe, shemminger, eric.dumazet, netdev
In-Reply-To: <20100711.181300.58435799.davem@davemloft.net>

Since some of xxx_register_driver() can return error we must unregister
already registered drivers.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 drivers/net/depca.c |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index bf66e9b..44c0694 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -2061,18 +2061,35 @@ static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 
 static int __init depca_module_init (void)
 {
-        int err = 0;
+	int err = 0;
 
 #ifdef CONFIG_MCA
-        err = mca_register_driver (&depca_mca_driver);
+	err = mca_register_driver(&depca_mca_driver);
+	if (err)
+		goto err;
 #endif
 #ifdef CONFIG_EISA
-        err |= eisa_driver_register (&depca_eisa_driver);
+	err = eisa_driver_register(&depca_eisa_driver);
+	if (err)
+		goto err_mca;
 #endif
-	err |= platform_driver_register (&depca_isa_driver);
-	depca_platform_probe ();
+	err = platform_driver_register(&depca_isa_driver);
+	if (err)
+		goto err_eisa;
 
-        return err;
+	depca_platform_probe();
+	return 0;
+
+err_eisa:
+#ifdef CONFIG_EISA
+	eisa_driver_unregister(&depca_eisa_driver);
+err_mca:
+#endif
+#ifdef CONFIG_MCA
+	mca_unregister_driver(&depca_mca_driver);
+err:
+#endif
+	return err;
 }
 
 static void __exit depca_module_exit (void)
-- 
1.7.0.4


^ permalink raw reply related

* Re: [PATCH] sky2: enable rx/tx in sky2_phy_reinit()
From: Stephen Hemminger @ 2010-07-12 15:48 UTC (permalink / raw)
  To: Brandon Philips; +Cc: netdev, davem, Mike McCormack
In-Reply-To: <20100712110410.GA13679@chota.scz.novell.com>

On Mon, 12 Jul 2010 04:04:10 -0700
Brandon Philips <brandon@ifup.org> wrote:

> On 10:00 Wed 23 Jun 2010, Brandon Philips wrote:
> > While testing this I just noticed that if I turn off speed autoneg the
> > interface stops sending packets until I turn off pause autoneg too.
> > 
> > To illustrate start pinging some machine and run this:
> > 
> >  $ ethtool --change eth0 speed 100 duplex full autoneg off
> >  # At this point the ping stops
> > 
> >  $ ethtool -A eth0 autoneg off
> >  # Ping starts up again
> > 
> > When I tried capturing packets nothing was coming from the device.
> > 
> > 0ea065e52eb6a0f029b5fa5ed2f142be1b66a153 implemeneted the behaviour of
> > having seperate pause and speed ethtool controls for sky2. Reverting
> > this (see quick ugly revert below) obviously fixes the issue.
> > 
> > Any ideas on how to fix this in a proper way though?

No quick ideas; try doing walkthrough with debugging to see what PHY
interrupt status is.

^ permalink raw reply

* Re: [REGRESSION] e1000e stopped working [MANUALLY BISECTED]
From: Maxim Levitsky @ 2010-07-12 15:56 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: Tantilov, Emil S, netdev@vger.kernel.org, Allan, Bruce W,
	Pieper, Jeffrey E
In-Reply-To: <1278323885.5277.0.camel@localhost.localdomain>

On Mon, 2010-07-05 at 12:58 +0300, Maxim Levitsky wrote:
> On Mon, 2010-07-05 at 01:13 -0700, Jeff Kirsher wrote:
> > On Sun, Jul 4, 2010 at 15:48, Maxim Levitsky <maximlevitsky@gmail.com> wrote:
> > > Did few guesses, and now I see that reverting the below commit fixes the
> > > problem.
> > >
> > > "e1000e: Fix/cleanup PHY reset code for ICHx/PCHx"
> > > e98cac447cc1cc418dff1d610a5c79c4f2bdec7f.
> > >
> > >
> > > Best regards,
> > >        Maxim Levitsky
> > >
> > > --
> > 
> > Can you give us till Tuesday to respond?  I know that there are some
> > additional e1000e patches in my queue, which may resolve the issue,
> > but this weekend the power is down to do some infrastructure upgrades
> > which prevents us from doing any investigation.debugging until
> > Tuesday.
> > 
> 
> Sure.
> 
> Best regards,
> 	Maxim Levitsky
> 

Updates?

or 2.6.35 will ship with e0000e ? :-)

I really have very little time to help further with that for now.


Best regards,
	Maxim Levitsky


^ permalink raw reply

* Re: [PATCH] tproxy: nf_tproxy_assign_sock() can handle tw sockets
From: Felipe W Damasio @ 2010-07-12 18:49 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Avi Kivity, David Miller, Patrick McHardy, linux-kernel, netdev
In-Reply-To: <AANLkTikEGuFtTlIKUfti6GDsdBz99PpKRCs5lEeEM86u@mail.gmail.com>

Hi Mr. Dumazet,

2010/7/11 Felipe W Damasio <felipewd@gmail.com>:
> We're using eth1 facing the user and eth2 facing the internet.

Here's the result using ethtool-2.6.34:

./ethtool -k eth1

Offload parameters for eth1:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: on
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: off
large-receive-offload: off
ntuple-filters: off
receive-hashing: off


./ethtool -k eth2

Offload parameters for eth2:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: on
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: off
large-receive-offload: off
ntuple-filters: off
receive-hashing: off

^ permalink raw reply

* Re: [PATCH v2 linux-2.6.35-rc3] ks8842 driver
From: David Miller @ 2010-07-12 19:56 UTC (permalink / raw)
  To: David.Choi; +Cc: horms, netdev, Charles.Li
In-Reply-To: <C43529A246480145B0A6D0234BDB0F0D0212A5@MELANITE.micrel.com>

From: "Choi, David" <David.Choi@Micrel.Com>
Date: Fri, 9 Jul 2010 14:22:35 -0700

> I change the ks8842 driver so that the platform private data is used to pass
> different parameters like selection of 16/32bit, as suggested.

This looks good, could you submit this formally with a proper full
commit message and signoff?

THanks!

^ permalink raw reply

* Re: [PATCH net-next-2.6] net/core: EXPORT_SYMBOL cleanups
From: David Miller @ 2010-07-12 19:58 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1278746524.2538.40.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 10 Jul 2010 09:22:04 +0200

> CodingStyle cleanups
> 
> EXPORT_SYMBOL should immediately follow the symbol declaration.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6] net/ipv4: EXPORT_SYMBOL cleanups
From: David Miller @ 2010-07-12 19:58 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1278746530.2538.41.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 10 Jul 2010 09:22:10 +0200

> CodingStyle cleanups
> 
> EXPORT_SYMBOL should immediately follow the symbol declaration.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply

* Re: [patch] 9p: strlen() doesn't count the terminator
From: Andrew Morton @ 2010-07-12 20:04 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Eric Van Hensbergen, David S. Miller, Abhishek Kulkarni,
	Venkateswararao Jujjuri, linux-kernel, Tilman Sauerbeck, netdev,
	kernel-janitors
In-Reply-To: <20100710095154.GU19184@bicker>

On Sat, 10 Jul 2010 11:51:54 +0200
Dan Carpenter <error27@gmail.com> wrote:

> This is an off by one bug because strlen() doesn't count the NULL
> terminator.  We strcpy() addr into a fixed length array of size
> UNIX_PATH_MAX later on.
> 
> The addr variable is the name of the device being mounted.
> 
> CC: stable@kernel.org
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
> index 98ce9bc..c85109d 100644
> --- a/net/9p/trans_fd.c
> +++ b/net/9p/trans_fd.c
> @@ -948,7 +948,7 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
>  
>  	csocket = NULL;
>  
> -	if (strlen(addr) > UNIX_PATH_MAX) {
> +	if (strlen(addr) >= UNIX_PATH_MAX) {
>  		P9_EPRINTK(KERN_ERR, "p9_trans_unix: address too long: %s\n",
>  			addr);
>  		return -ENAMETOOLONG;

This bug doesn't strike me as serious enough to warrant backporting the fix
into -stable.  What was your thinking there?

^ permalink raw reply

* Re: sysfs bug when using tun with network namespaces
From: Michael Leun @ 2010-07-12 20:07 UTC (permalink / raw)
  To: Max Krasnyansky; +Cc: lkml, netdev
In-Reply-To: <4C3B5D68.5010809@qualcomm.com>

Max,

On Mon, 12 Jul 2010 11:22:32 -0700
Max Krasnyansky <maxk@qualcomm.com> wrote:

> Thanks for forwarding this report. I'll take a look and try to
> reproduce and fix it when I get a chance.

Sorry, I should have send the further communication CC: to you.

This one is resolved, it is due to missing support for namespaces
almost at all in sysfs prior to 2.6.35-rc, bug does not appear
in .35-rcX anymore.

But I have found another one:

On Sat, 10 Jul 2010 16:52:08 +0200
Michael Leun <lkml20100708@newton.leun.net> wrote:

> # tunctl -u ml -t tap1    

> works as expected, but    

> # unshare -n /bin/bash
> # tunctl -u ml -t tap1    
[bug  (no sysfs support for net namespaces at all) solved in 2.6.35-rcX
- I used 2.6.34.1]

Now that we have solved that last one I've another glitch (this time using 2.6.35-rc4):

In an network namespace I can use an tun/tap tunnel through ssh and
when closing that namespace then eveything is fine.

But when using openvpn (also tunnel trough tun/tap) in an network
namespace and then closing that namespace I get:

unregister_netdevice: waiting for lo to become free
[repeated]

Please see the following two examples showing that difference:

# > unshare -n /bin/bash
# > # how to setup veth device pair to get connectivity into namespace not shown here
# > tunctl -u ml -t tap1
# > ssh -o Tunnel=Ethernet -w 1:1 somewhere
[ running some traffic over tap1 not shown here ]
^d # logging out from somewhere
# > tunctl -d tap1
# > exit # logging out from shell in network namespace

Now the veth device pair used automagically vanishes and nothing
from that different network namespace remains - very well.

but

# > unshare -n /bin/bash
# > # how to setup veth device pair to get connectivity into namespace not shown here
# > openvpn --config some.config
[ running some traffic over vpn device not shown here ]
^c # stopping openvpn
# > lsof -i
# > netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
# > ps ax|grep openvpn|grep -v grep
# > # cannot find anything that suggests there is anything left from that openvpn session
# > exit # logging out from shell in network namespace

Now I get

Jul 10 20:02:36 doris kernel: unregister_netdevice: waiting for lo to become free. Usage count = 3
[repeated]

Now one might say it is fault of openvpn (used OpenVPN 2.1_rc20
i586-suse-linux - the one in openSuSE 11.2 package), openvpn didn't
close some ressource and ssh does fine.

But: should'nt kernel clean up after process when it exits?
And/or: Should'nt kernel clean up if last process in network namespace
exits - there is nothing left which might use that interface?!

Greg KH <greg@kroah.com> wrote:

> Yes, you are correct.  Care to resend all of this to the
> network-namespace developer(s) and the netdev mailing list so that the
> correct people are notified so they can fix it all?  

[X] done - hopefully, cannot find a particular network namespace
developer in MAINTAINERS or source files. If such a one exists, please
forward.

Thanks.


-- 
MfG,

Michael Leun


^ permalink raw reply

* pull request: wireless-2.6 2010-07-12
From: John W. Linville @ 2010-07-12 20:16 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

Dave,

Here are a couple of small fixes for resource leaks in 2.6.35.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit 17c99297212a2d1b1779a08caf4b0d83a85545df:

  r8169: incorrect identifier for a 8168dp (2010-07-11 17:10:09 -0700)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master

Rajkumar Manoharan (1):
      ath9k_htc: fix memory leak in ath9k_hif_usb_alloc_urbs

Reinette Chatre (1):
      iwlwifi: remove key information during device restart

 drivers/net/wireless/ath/ath9k/hif_usb.c |    8 ++++++--
 drivers/net/wireless/iwlwifi/iwl-sta.h   |   11 +++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 77b3591..23c15aa 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -730,13 +730,17 @@ static int ath9k_hif_usb_alloc_urbs(struct hif_device_usb *hif_dev)
 
 	/* RX */
 	if (ath9k_hif_usb_alloc_rx_urbs(hif_dev) < 0)
-		goto err;
+		goto err_rx;
 
 	/* Register Read */
 	if (ath9k_hif_usb_alloc_reg_in_urb(hif_dev) < 0)
-		goto err;
+		goto err_reg;
 
 	return 0;
+err_reg:
+	ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
+err_rx:
+	ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
 err:
 	return -ENOMEM;
 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h
index c2a453a..dc43ebd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.h
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.h
@@ -97,6 +97,17 @@ static inline void iwl_clear_driver_stations(struct iwl_priv *priv)
 	spin_lock_irqsave(&priv->sta_lock, flags);
 	memset(priv->stations, 0, sizeof(priv->stations));
 	priv->num_stations = 0;
+
+	/*
+	 * Remove all key information that is not stored as part of station
+	 * information since mac80211 may not have had a
+	 * chance to remove all the keys. When device is reconfigured by
+	 * mac80211 after an error all keys will be reconfigured.
+	 */
+	priv->ucode_key_table = 0;
+	priv->key_mapping_key = 0;
+	memset(priv->wep_keys, 0, sizeof(priv->wep_keys));
+
 	spin_unlock_irqrestore(&priv->sta_lock, flags);
 }
 
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply related

* [PATCH 10/36] drivers/isdn: Remove unnecessary casts of private_data
From: Joe Perches @ 2010-07-12 20:50 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, Karsten Keil, netdev
In-Reply-To: <cover.1278967120.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/isdn/capi/capi.c           |    6 +++---
 drivers/isdn/hysdn/hysdn_proclog.c |    2 +-
 drivers/isdn/i4l/isdn_ppp.c        |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 0cabe31..c2d4ba4 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -691,7 +691,7 @@ unlock_out:
 static ssize_t
 capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
-	struct capidev *cdev = (struct capidev *)file->private_data;
+	struct capidev *cdev = file->private_data;
 	struct sk_buff *skb;
 	size_t copied;
 	int err;
@@ -726,7 +726,7 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 static ssize_t
 capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-	struct capidev *cdev = (struct capidev *)file->private_data;
+	struct capidev *cdev = file->private_data;
 	struct sk_buff *skb;
 	u16 mlen;
 
@@ -773,7 +773,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
 static unsigned int
 capi_poll(struct file *file, poll_table * wait)
 {
-	struct capidev *cdev = (struct capidev *)file->private_data;
+	struct capidev *cdev = file->private_data;
 	unsigned int mask = 0;
 
 	if (!cdev->ap.applid)
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index e83f6fd..c58a72d 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -157,7 +157,7 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t
 	int found = 0;
 	unsigned char *cp, valbuf[128];
 	long base = 10;
-	hysdn_card *card = (hysdn_card *) file->private_data;
+	hysdn_card *card = file->private_data;
 
 	if (count > (sizeof(valbuf) - 1))
 		count = sizeof(valbuf) - 1;	/* limit length */
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 8c46bae..fe824e0 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -477,7 +477,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 	struct isdn_ppp_comp_data data;
 	void __user *argp = (void __user *)arg;
 
-	is = (struct ippp_struct *) file->private_data;
+	is = file->private_data;
 	lp = is->lp;
 
 	if (is->debug & 0x1)
-- 
1.7.1.337.g6068.dirty

^ permalink raw reply related

* [PATCH 13/36] drivers/net/caif: Remove unnecessary casts of private_data
From: Joe Perches @ 2010-07-12 20:50 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, netdev
In-Reply-To: <cover.1278967120.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/caif/caif_spi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 03049e8..6c94803 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -134,7 +134,7 @@ static ssize_t dbgfs_state(struct file *file, char __user *user_buf,
 	char *buf;
 	int len = 0;
 	ssize_t size;
-	struct cfspi *cfspi = (struct cfspi *)file->private_data;
+	struct cfspi *cfspi = file->private_data;
 
 	buf = kzalloc(DEBUGFS_BUF_SIZE, GFP_KERNEL);
 	if (!buf)
@@ -205,7 +205,7 @@ static ssize_t dbgfs_frame(struct file *file, char __user *user_buf,
 	ssize_t size;
 	struct cfspi *cfspi;
 
-	cfspi = (struct cfspi *)file->private_data;
+	cfspi = file->private_data;
 	buf = kzalloc(DEBUGFS_BUF_SIZE, GFP_KERNEL);
 	if (!buf)
 		return 0;
-- 
1.7.1.337.g6068.dirty

^ permalink raw reply related

* [PATCH 14/36] drivers/net/wireless: Remove unnecessary casts of private_data
From: Joe Perches @ 2010-07-12 20:50 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, John W. Linville,
	Luis R. Rodriguez, Jouni Malinen, Sujith Manoharan,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	Reinette Chatre, Wey-Yi Guy, Intel Linux Wireless, Dan Williams,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, ath9k-devel-xDcbHBWguxHbcTqmT+pZeQ,
	libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <cover.1278967120.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>

Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 drivers/net/wireless/airo.c                   |   22 +++++++++++-----------
 drivers/net/wireless/ath/ath9k/htc_drv_main.c |    9 +++------
 drivers/net/wireless/iwlwifi/iwl-debugfs.c    |   10 +++++-----
 drivers/net/wireless/libertas/debugfs.c       |    4 ++--
 4 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 6b605df..115442b 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -4657,7 +4657,7 @@ static ssize_t proc_write( struct file *file,
 			   loff_t *offset )
 {
 	loff_t pos = *offset;
-	struct proc_data *priv = (struct proc_data*)file->private_data;
+	struct proc_data *priv = file->private_data;
 
 	if (!priv->wbuffer)
 		return -EINVAL;
@@ -4689,7 +4689,7 @@ static int proc_status_open(struct inode *inode, struct file *file)
 
 	if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
-	data = (struct proc_data *)file->private_data;
+	data = file->private_data;
 	if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
 		kfree (file->private_data);
 		return -ENOMEM;
@@ -4772,7 +4772,7 @@ static int proc_stats_rid_open( struct inode *inode,
 
 	if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
-	data = (struct proc_data *)file->private_data;
+	data = file->private_data;
 	if ((data->rbuffer = kmalloc( 4096, GFP_KERNEL )) == NULL) {
 		kfree (file->private_data);
 		return -ENOMEM;
@@ -5045,7 +5045,7 @@ static int proc_config_open(struct inode *inode, struct file *file)
 
 	if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
-	data = (struct proc_data *)file->private_data;
+	data = file->private_data;
 	if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
 		kfree (file->private_data);
 		return -ENOMEM;
@@ -5127,7 +5127,7 @@ static int proc_config_open(struct inode *inode, struct file *file)
 
 static void proc_SSID_on_close(struct inode *inode, struct file *file)
 {
-	struct proc_data *data = (struct proc_data *)file->private_data;
+	struct proc_data *data = file->private_data;
 	struct proc_dir_entry *dp = PDE(inode);
 	struct net_device *dev = dp->data;
 	struct airo_info *ai = dev->ml_priv;
@@ -5163,7 +5163,7 @@ static void proc_SSID_on_close(struct inode *inode, struct file *file)
 }
 
 static void proc_APList_on_close( struct inode *inode, struct file *file ) {
-	struct proc_data *data = (struct proc_data *)file->private_data;
+	struct proc_data *data = file->private_data;
 	struct proc_dir_entry *dp = PDE(inode);
 	struct net_device *dev = dp->data;
 	struct airo_info *ai = dev->ml_priv;
@@ -5309,7 +5309,7 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
 
 	memset(key, 0, sizeof(key));
 
-	data = (struct proc_data *)file->private_data;
+	data = file->private_data;
 	if ( !data->writelen ) return;
 
 	if (data->wbuffer[0] >= '0' && data->wbuffer[0] <= '3' &&
@@ -5363,7 +5363,7 @@ static int proc_wepkey_open( struct inode *inode, struct file *file )
 	if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
 	memset(&wkr, 0, sizeof(wkr));
-	data = (struct proc_data *)file->private_data;
+	data = file->private_data;
 	if ((data->rbuffer = kzalloc( 180, GFP_KERNEL )) == NULL) {
 		kfree (file->private_data);
 		return -ENOMEM;
@@ -5409,7 +5409,7 @@ static int proc_SSID_open(struct inode *inode, struct file *file)
 
 	if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
-	data = (struct proc_data *)file->private_data;
+	data = file->private_data;
 	if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
 		kfree (file->private_data);
 		return -ENOMEM;
@@ -5453,7 +5453,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
 
 	if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
-	data = (struct proc_data *)file->private_data;
+	data = file->private_data;
 	if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
 		kfree (file->private_data);
 		return -ENOMEM;
@@ -5495,7 +5495,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
 
 	if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
-	data = (struct proc_data *)file->private_data;
+	data = file->private_data;
 	if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) {
 		kfree (file->private_data);
 		return -ENOMEM;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index e38ca66..47f7603 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -492,8 +492,7 @@ static int ath9k_debugfs_open(struct inode *inode, struct file *file)
 static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf,
 				   size_t count, loff_t *ppos)
 {
-	struct ath9k_htc_priv *priv =
-		(struct ath9k_htc_priv *) file->private_data;
+	struct ath9k_htc_priv *priv = file->private_data;
 	struct ath9k_htc_target_stats cmd_rsp;
 	char buf[512];
 	unsigned int len = 0;
@@ -536,8 +535,7 @@ static const struct file_operations fops_tgt_stats = {
 static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
 			      size_t count, loff_t *ppos)
 {
-	struct ath9k_htc_priv *priv =
-		(struct ath9k_htc_priv *) file->private_data;
+	struct ath9k_htc_priv *priv = file->private_data;
 	char buf[512];
 	unsigned int len = 0;
 
@@ -582,8 +580,7 @@ static const struct file_operations fops_xmit = {
 static ssize_t read_file_recv(struct file *file, char __user *user_buf,
 			      size_t count, loff_t *ppos)
 {
-	struct ath9k_htc_priv *priv =
-		(struct ath9k_htc_priv *) file->private_data;
+	struct ath9k_htc_priv *priv = file->private_data;
 	char buf[512];
 	unsigned int len = 0;
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 088a2c1..7b25d14 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1267,7 +1267,7 @@ static ssize_t iwl_dbgfs_ucode_tracing_read(struct file *file,
 					char __user *user_buf,
 					size_t count, loff_t *ppos) {
 
-	struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+	struct iwl_priv *priv = file->private_data;
 	int pos = 0;
 	char buf[128];
 	const size_t bufsz = sizeof(buf);
@@ -1317,7 +1317,7 @@ static ssize_t iwl_dbgfs_rxon_flags_read(struct file *file,
 					 char __user *user_buf,
 					 size_t count, loff_t *ppos) {
 
-	struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+	struct iwl_priv *priv = file->private_data;
 	int len = 0;
 	char buf[20];
 
@@ -1329,7 +1329,7 @@ static ssize_t iwl_dbgfs_rxon_filter_flags_read(struct file *file,
 						char __user *user_buf,
 						size_t count, loff_t *ppos) {
 
-	struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+	struct iwl_priv *priv = file->private_data;
 	int len = 0;
 	char buf[20];
 
@@ -1342,7 +1342,7 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file,
 					 char __user *user_buf,
 					 size_t count, loff_t *ppos)
 {
-	struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+	struct iwl_priv *priv = file->private_data;
 	char *buf;
 	int pos = 0;
 	ssize_t ret = -EFAULT;
@@ -1404,7 +1404,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file,
 					char __user *user_buf,
 					size_t count, loff_t *ppos) {
 
-	struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+	struct iwl_priv *priv = file->private_data;
 	int pos = 0;
 	char buf[12];
 	const size_t bufsz = sizeof(buf);
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 1736746..667695b 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -839,7 +839,7 @@ static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf,
 
 	p = buf;
 
-	d = (struct debug_data *)file->private_data;
+	d = file->private_data;
 
 	for (i = 0; i < num_of_items; i++) {
 		if (d[i].size == 1)
@@ -878,7 +878,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
 	char *p0;
 	char *p1;
 	char *p2;
-	struct debug_data *d = (struct debug_data *)f->private_data;
+	struct debug_data *d = f->private_data;
 
 	pdata = kmalloc(cnt, GFP_KERNEL);
 	if (pdata == NULL)
-- 
1.7.1.337.g6068.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 33/36] net/sunrpc: Remove unnecessary casts of private_data
From: Joe Perches @ 2010-07-12 20:50 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: linux-kernel, Trond Myklebust, J. Bruce Fields, Neil Brown,
	David S. Miller, linux-nfs, netdev
In-Reply-To: <cover.1278967120.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sunrpc/rpc_pipe.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 95ccbcf..1f7fc50 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -204,7 +204,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
 	mutex_lock(&inode->i_mutex);
 	if (rpci->ops == NULL)
 		goto out;
-	msg = (struct rpc_pipe_msg *)filp->private_data;
+	msg = filp->private_data;
 	if (msg != NULL) {
 		spin_lock(&inode->i_lock);
 		msg->errno = -EAGAIN;
@@ -322,7 +322,7 @@ rpc_pipe_ioctl_unlocked(struct file *filp, unsigned int cmd, unsigned long arg)
 		len = rpci->pipelen;
 		if (filp->private_data) {
 			struct rpc_pipe_msg *msg;
-			msg = (struct rpc_pipe_msg *)filp->private_data;
+			msg = filp->private_data;
 			len += msg->len - msg->copied;
 		}
 		return put_user(len, (int __user *)arg);
-- 
1.7.1.337.g6068.dirty

^ permalink raw reply related

* [PATCH 31/36] net/core: Remove unnecessary casts of private_data
From: Joe Perches @ 2010-07-12 20:50 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, David S. Miller, netdev
In-Reply-To: <cover.1278967120.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/core/pktgen.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 1ee2ebd..24a19de 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -846,7 +846,7 @@ static ssize_t pktgen_if_write(struct file *file,
 			       const char __user * user_buffer, size_t count,
 			       loff_t * offset)
 {
-	struct seq_file *seq = (struct seq_file *)file->private_data;
+	struct seq_file *seq = file->private_data;
 	struct pktgen_dev *pkt_dev = seq->private;
 	int i = 0, max, len;
 	char name[16], valstr[32];
@@ -1776,7 +1776,7 @@ static ssize_t pktgen_thread_write(struct file *file,
 				   const char __user * user_buffer,
 				   size_t count, loff_t * offset)
 {
-	struct seq_file *seq = (struct seq_file *)file->private_data;
+	struct seq_file *seq = file->private_data;
 	struct pktgen_thread *t = seq->private;
 	int i = 0, max, len, ret;
 	char name[40];
-- 
1.7.1.337.g6068.dirty


^ permalink raw reply related

* [PATCH 32/36] net/irda: Remove unnecessary casts of private_data
From: Joe Perches @ 2010-07-12 20:50 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-kernel, Samuel Ortiz, David S. Miller, netdev
In-Reply-To: <cover.1278967120.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/irda/irnet/irnet_ppp.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c
index 6a1a202..800bc53 100644
--- a/net/irda/irnet/irnet_ppp.c
+++ b/net/irda/irnet/irnet_ppp.c
@@ -527,7 +527,7 @@ static int
 dev_irnet_close(struct inode *	inode,
 		struct file *	file)
 {
-  irnet_socket *	ap = (struct irnet_socket *) file->private_data;
+  irnet_socket *	ap = file->private_data;
 
   DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
 	 file, ap);
@@ -564,7 +564,7 @@ dev_irnet_write(struct file *	file,
 		size_t		count,
 		loff_t *	ppos)
 {
-  irnet_socket *	ap = (struct irnet_socket *) file->private_data;
+  irnet_socket *	ap = file->private_data;
 
   DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n",
 	file, ap, count);
@@ -588,7 +588,7 @@ dev_irnet_read(struct file *	file,
 	       size_t		count,
 	       loff_t *		ppos)
 {
-  irnet_socket *	ap = (struct irnet_socket *) file->private_data;
+  irnet_socket *	ap = file->private_data;
 
   DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n",
 	file, ap, count);
@@ -609,7 +609,7 @@ static unsigned int
 dev_irnet_poll(struct file *	file,
 	       poll_table *	wait)
 {
-  irnet_socket *	ap = (struct irnet_socket *) file->private_data;
+  irnet_socket *	ap = file->private_data;
   unsigned int		mask;
 
   DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
@@ -638,7 +638,7 @@ dev_irnet_ioctl(
 		unsigned int	cmd,
 		unsigned long	arg)
 {
-  irnet_socket *	ap = (struct irnet_socket *) file->private_data;
+  irnet_socket *	ap = file->private_data;
   int			err;
   int			val;
   void __user *argp = (void __user *)arg;
-- 
1.7.1.337.g6068.dirty


^ permalink raw reply related

* net/dsa
From: Karl Beldan @ 2010-07-12 20:59 UTC (permalink / raw)
  To: netdev

Hi,

I found the dsa code very handy to help manage a switch.
Yet I was surprised I had to tweak the code to simply use the phy layer
state machine.
And I don't see much activity in the code nor any discussion, e.g no
follow up to http://patchwork.ozlabs.org/patch/16578.

So I was wondering if there was anybody playing with this code, or
having ideas about features to add (vlan/stp callbacks) ?



Karl

^ permalink raw reply

* Kernel Oops in neighbour.c 2.6.26.8
From: Doug Kehn @ 2010-07-12 20:55 UTC (permalink / raw)
  To: netdev

Hi All,

I know my kernel version is old.  I'm working on an embedded system and updating to a newer kernel is time consuming.  Having said that, there are not that many differences in neighbour.c between 2.6.26.8 and the newer kernel revisions.

The Oops (included below) only occurs when configuring DMVPN (GRE + openNHRP) and a GRE Remote address is configured.  I found and included the neighbour.c patch outlined in
http://web.archiveorange.com/archive/v/iRKxruZnSerMcYadyaYq.  This patch did not eliminate the Oops.  The Oops I observed was in neigh_update_hhs. neigh->dev->header_ops is NULL thus the line

void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
= neigh->dev->header_ops->cache_update;

causes the Oops.  The dev associated with the NULL header_ops was the GRE interface.  The following patch guards against the possibility that headers_ops is NULL.

--- neighbour.c.old	2010-07-12 15:29:24.000000000 -0500
+++ neighbour.c	2010-07-12 15:32:28.000000000 -0500
@@ -945,7 +945,10 @@
 {
 	struct hh_cache *hh;
 	void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
-		= neigh->dev->header_ops->cache_update;
+		= NULL;
+
+	if (neigh->dev->header_ops)
+		update = neigh->dev->header_ops->cache_update;
 
 	if (update) {
 		for (hh = neigh->hh; hh; hh = hh->hh_next) {

I'm not sure if the above patch is the proper fix.  Since neigh_update_hhs in newer kernels is identical to 2.6.26.8, I thought I'd post my findings and solicit feedback.

Regards,
...doug


Unable to handle kernel NULL pointer dereference at virtual address 00000010
pgd = c745c000
[00000010] *pgd=07fe6031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
Modules linked in: ppp_synctty ppp_async ppp_generic crc_ccitt slhc sierra md5 e
cb arc4 authenc xfrm4_tunnel xfrm_user tunnel4 ipcomp deflate ah4 esp4 aead cbc 
hmac sha1_generic des_generic aes_generic cryptomgr crypto_null crypto_blkcipher
 crypto_hash crypto_algapi af_key ipt_MASQUERADE xt_state xt_mac xt_tcpudp xt_mu
ltiport xt_dscp xt_CLASSIFY xt_DSCP xt_MARK iptable_mangle iptable_nat nf_nat xt
_conntrack nf_conntrack_ipv4 nf_conntrack iptable_filter ip_tables x_tables usbs
erial ehci_hcd usbcore spidev ixp4xx_spi ssp rtc_s35390a rtc_core i2c_gpio i2c_a
lgo_bit i2c_dev i2c_core ip_gre 8021q bridge ks8842_pci ixp4xx_eth ixp4xx_qmgr i
xp4xx_npe llc firmware_class ctdfs_irq ctdfs_ioreset ctdfs_cmb ctdfs_wdt ctdfs_b
eep ctdfs_reedswitch ctdfs_cpld ctdfs
CPU: 0    Not tainted  (2.6.26.8 #14)
PC is at neigh_update+0x1f8/0x3bc
LR is at 0x3f5840d4
pc : [<c016dca8>]    lr : [<3f5840d4>]    psr: 40000013
sp : c7449c38  ip : 0000001c  fp : c7449c6c
r10: c75457c4  r9 : 80000001  r8 : 00000040
r7 : c7541028  r6 : 00000002  r5 : c75457a0  r4 : c75457c4
r3 : 00000000  r2 : 00000000  r1 : c754102c  r0 : c75457c4
Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 000039ff  Table: 0745c000  DAC: 00000015
Process opennhrp (pid: 1110, stack limit = 0xc7448260)
Stack: (0xc7449c38 to 0xc744a000)
9c20:                                                       c7412000 00000000 
9c40: 00000040 c75457a0 c026b4f0 c7541020 c7412000 c7541000 c7541028 c7541010 
9c60: c7449cb0 c7449c70 c016eacc c016dabc 00000000 00000000 c754101c c7541024 
9c80: 00000000 00000000 0000002c c7541000 0000000c 00000002 00000003 fffffffc 
9ca0: c7c32ba0 c7449ce4 c7449cb4 c0170a6c c016e8ec 22222222 c7f1a0a0 c7541000 
9cc0: c7f1a0a0 c0170880 c7449d1c c7443600 00000000 00000000 c7449d00 c7449ce8 
9ce0: c017c460 c017088c c7f1a0a0 0000002c c7f1a0a0 c7449d14 c7449d04 c0170870 
9d00: c017c418 c7c37e00 c7449d48 c7449d18 c017beec c0170858 0000002c 7fffffff 
9d20: 00000000 c7f1a0a0 c7443600 c7449f58 c7838ce0 c7449e1c 00000000 c7449d94 
9d40: c7449d4c c017c1f8 c017bcd8 c7f1a5e0 0000002c 00000000 00000456 00000000 
9d60: 00000000 00000000 00000000 c7da4640 c7449f58 c7449d98 0000002c c7449ef8 
9d80: 00000000 00000008 c7449e74 c7449d98 c015a31c c017bfa0 00000000 c7541200 
9da0: 00000000 00000001 ffffffff 00000000 00000000 00000000 00000000 00000000 
9dc0: c7da4640 00000000 00000000 c7449e3c c7da4640 c004b89c c7449dd8 c7449dd8 
9de0: c740d005 0000004f c7449e1c 00000000 00000000 0000004f 00000456 00000000 
9e00: 00000000 00000000 00000000 c7449e2c 00000000 c7449eac c7f861a0 00000001 
9e20: c7449e60 c7449ef8 0000002c c7838ce0 c7449ef8 c7449d58 c7449f58 c7449e78 
9e40: 00000128 c7449ef8 c7449ef8 00000008 00000000 c7449f58 c0161f74 c7449f38 
9e60: 00000000 c7838ce0 c7449fa4 c7449e78 c015a4ec c015a278 00100000 00000000 
9e80: 00000000 c7449eac c7449f30 c7449f80 fffffdee c7449f58 c7449ea8 c007c1f8 
9ea0: c0159130 00000000 00000000 c0086ed0 c008631c 00000000 00000001 ffffffff 
9ec0: c7f861a0 00000000 00000000 00000000 00000000 c7da4640 00000000 00000000 
9ee0: c7c0c320 c7da4640 c004b89c c7449eec c7449eec 00000000 bedcfa38 00000000 
9f00: c0025fd4 c7449f2c 00000024 0000004f c7448000 0000000f 00000000 00000003 
9f20: 0000000b 00000000 00000000 c78042e4 00000002 c78041e4 0000004f c7449f80 
9f40: c7449f78 00000000 0000000d 000000ae c0020c44 c7449fa4 c7449e78 0000000c 
9f60: c7449ef8 00000001 00000000 00000000 00000000 00000000 ffffff97 000392d0 
9f80: bedcf9cc bedcfcd4 00000128 c0020c44 c7448000 0000934c 00000000 c7449fa8 
9fa0: c0020aa0 c015a348 000392d0 bedcf9cc 00000008 bedcf938 00000000 00000008 
9fc0: 000392d0 bedcf9cc bedcfcd4 bedcfc50 00000002 0001022c 0000934c bedcf978 
9fe0: 000290c8 bedcf920 0002148c 4008ca98 00000010 00000008 00000000 00000000 
Backtrace: 
[<c016dab0>] (neigh_update+0x0/0x3bc) from [<c016eacc>] (neigh_add+0x1ec/0x278)
[<c016e8e0>] (neigh_add+0x0/0x278) from [<c0170a6c>] (rtnetlink_rcv_msg+0x1ec/0x
228)
[<c0170880>] (rtnetlink_rcv_msg+0x0/0x228) from [<c017c460>] (netlink_rcv_skb+0x
54/0xb8)
[<c017c40c>] (netlink_rcv_skb+0x0/0xb8) from [<c0170870>] (rtnetlink_rcv+0x24/0x
34)
 r6:c7f1a0a0 r5:0000002c r4:c7f1a0a0
[<c017084c>] (rtnetlink_rcv+0x0/0x34) from [<c017beec>] (netlink_unicast+0x220/0
x2c8)
 r4:c7c37e00
[<c017bccc>] (netlink_unicast+0x0/0x2c8) from [<c017c1f8>] (netlink_sendmsg+0x26
4/0x278)
[<c017bf94>] (netlink_sendmsg+0x0/0x278) from [<c015a31c>] (sock_sendmsg+0xb0/0x
d0)
[<c015a26c>] (sock_sendmsg+0x0/0xd0) from [<c015a4ec>] (sys_sendmsg+0x1b0/0x20c)
 r6:c7838ce0 r5:00000000 r4:c7449f38
[<c015a33c>] (sys_sendmsg+0x0/0x20c) from [<c0020aa0>] (ret_fast_syscall+0x0/0x2
c)
Code: e5d320f0 ebfe51d7 e595300c e59330b0 (e5937010) 
Kernel panic - not syncing: Fatal exception in interrupt



      

^ permalink raw reply

* RE: [REGRESSION] e1000e stopped working [MANUALLY BISECTED]
From: Tantilov, Emil S @ 2010-07-12 21:23 UTC (permalink / raw)
  To: Maxim Levitsky, Kirsher, Jeffrey T
  Cc: netdev@vger.kernel.org, Allan, Bruce W, Pieper, Jeffrey E
In-Reply-To: <1278950178.17933.2.camel@localhost.localdomain>

Maxim Levitsky wrote:
> On Mon, 2010-07-05 at 12:58 +0300, Maxim Levitsky wrote:
>> On Mon, 2010-07-05 at 01:13 -0700, Jeff Kirsher wrote:
>>> On Sun, Jul 4, 2010 at 15:48, Maxim Levitsky
>>> <maximlevitsky@gmail.com> wrote: 
>>>> Did few guesses, and now I see that reverting the below commit
>>>> fixes the problem. 
>>>> 
>>>> "e1000e: Fix/cleanup PHY reset code for ICHx/PCHx"
>>>> e98cac447cc1cc418dff1d610a5c79c4f2bdec7f.
>>>> 
>>>> 
>>>> Best regards,
>>>>        Maxim Levitsky
>>>> 
>>>> --
>>> 
>>> Can you give us till Tuesday to respond?  I know that there are some
>>> additional e1000e patches in my queue, which may resolve the issue,
>>> but this weekend the power is down to do some infrastructure
>>> upgrades 
>>> which prevents us from doing any investigation.debugging until
>>> Tuesday.
>>> 
>> 
>> Sure.
>> 
>> Best regards,
>> 	Maxim Levitsky
>> 
> 
> Updates?

We are working on reproducing the issue. So far we have not seen the problem when testing with net-next.

I asked in previous email about some additional info from ethtool (-d, -e, -S) and kernel config. That would help us to narrow it down.

Thanks,
Emil

^ permalink raw reply

* [PATCH net-next] cxgb4vf: fix TX Queue restart
From: Casey Leedom @ 2010-07-12 21:43 UTC (permalink / raw)
  To: netdev

>From e1c7a6e339a47c42aaf3e425fa3228b33a425a8f Mon Sep 17 00:00:00 2001
From: Casey Leedom <leedom@chelsio.com>
Date: Mon, 12 Jul 2010 14:39:07 -0700
Subject: [PATCH net-next] cxgb4vf: fix TX Queue restart

Fix up TX Queue Host Flow Control to cause an Egress Queue Status Update to
be generated when we run out of TX Queue Descriptors.  This will, in turn,
allow us to restart a stopped TX Queue.
---
 drivers/net/cxgb4vf/cxgb4vf_main.c |   32 +++++++-------------------------
 drivers/net/cxgb4vf/sge.c          |   12 +++++++++---
 2 files changed, 16 insertions(+), 28 deletions(-)

diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index e988031..d065516 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -423,12 +423,13 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp,
 
 	case CPL_SGE_EGR_UPDATE: {
 		/*
-		 * We've received an Egress Queue status update message.
-		 * We get these, as the SGE is currently configured, when
-		 * the firmware passes certain points in processing our
-		 * TX Ethernet Queue.  We use these updates to determine
-		 * when we may need to restart a TX Ethernet Queue which
-		 * was stopped for lack of free slots ...
+		 * We've received an Egress Queue Status Update message.  We
+		 * get these, if the SGE is configured to send these when the
+		 * firmware passes certain points in processing our TX
+		 * Ethernet Queue or if we make an explicit request for one.
+		 * We use these updates to determine when we may need to
+		 * restart a TX Ethernet Queue which was stopped for lack of
+		 * free TX Queue Descriptors ...
 		 */
 		const struct cpl_sge_egr_update *p = (void *)cpl;
 		unsigned int qid = EGR_QID(be32_to_cpu(p->opcode_qid));
@@ -436,7 +437,6 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp,
 		struct sge_txq *tq;
 		struct sge_eth_txq *txq;
 		unsigned int eq_idx;
-		int hw_cidx, reclaimable, in_use;
 
 		/*
 		 * Perform sanity checking on the Queue ID to make sure it
@@ -466,24 +466,6 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp,
 		}
 
 		/*
-		 * Skip TX Queues which aren't stopped.
-		 */
-		if (likely(!netif_tx_queue_stopped(txq->txq)))
-			break;
-
-		/*
-		 * Skip stopped TX Queues which have more than half of their
-		 * DMA rings occupied with unacknowledged writes.
-		 */
-		hw_cidx = be16_to_cpu(txq->q.stat->cidx);
-		reclaimable = hw_cidx - txq->q.cidx;
-		if (reclaimable < 0)
-			reclaimable += txq->q.size;
-		in_use = txq->q.in_use - reclaimable;
-		if (in_use >= txq->q.size/2)
-			break;
-
-		/*
 		 * Restart a stopped TX Queue which has less than half of its
 		 * TX ring in use ...
 		 */
diff --git a/drivers/net/cxgb4vf/sge.c b/drivers/net/cxgb4vf/sge.c
index 37c6354..f2ee9b0 100644
--- a/drivers/net/cxgb4vf/sge.c
+++ b/drivers/net/cxgb4vf/sge.c
@@ -1070,6 +1070,7 @@ static inline void txq_advance(struct sge_txq *tq, unsigned int n)
  */
 int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 {
+	u32 wr_mid;
 	u64 cntrl, *end;
 	int qidx, credits;
 	unsigned int flits, ndesc;
@@ -1143,14 +1144,19 @@ int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 		goto out_free;
 	}
 
+	wr_mid = FW_WR_LEN16(DIV_ROUND_UP(flits, 2));
 	if (unlikely(credits < ETHTXQ_STOP_THRES)) {
 		/*
 		 * After we're done injecting the Work Request for this
 		 * packet, we'll be below our "stop threshhold" so stop the TX
-		 * Queue now.  The queue will get started later on when the
-		 * firmware informs us that space has opened up.
+		 * Queue now and schedule a request for an SGE Egress Queue
+		 * Update message.  The queue will get started later on when
+		 * the firmware processes this Work Request and sends us an
+		 * Egress Queue Status Update message indicating that space
+		 * has opened up.
 		 */
 		txq_stop(txq);
+		wr_mid |= FW_WR_EQUEQ | FW_WR_EQUIQ;
 	}
 
 	/*
@@ -1161,7 +1167,7 @@ int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 	 */
 	BUG_ON(DIV_ROUND_UP(ETHTXQ_MAX_HDR, TXD_PER_EQ_UNIT) > 1);
 	wr = (void *)&txq->q.desc[txq->q.pidx];
-	wr->equiq_to_len16 = cpu_to_be32(FW_WR_LEN16(DIV_ROUND_UP(flits, 2)));
+	wr->equiq_to_len16 = cpu_to_be32(wr_mid);
 	wr->r3[0] = cpu_to_be64(0);
 	wr->r3[1] = cpu_to_be64(0);
 	skb_copy_from_linear_data(skb, (void *)wr->ethmacdst, fw_hdr_copy_len);
-- 
1.7.0.4


^ permalink raw reply related

* Re: Kernel Oops in neighbour.c 2.6.26.8
From: Eric Dumazet @ 2010-07-12 21:48 UTC (permalink / raw)
  To: Doug Kehn; +Cc: netdev
In-Reply-To: <452968.10877.qm@web52007.mail.re2.yahoo.com>

Le lundi 12 juillet 2010 à 13:55 -0700, Doug Kehn a écrit :
> Hi All,
> 
> I know my kernel version is old.  I'm working on an embedded system
> and updating to a newer kernel is time consuming.  Having said that,
> there are not that many differences in neighbour.c between 2.6.26.8
> and the newer kernel revisions.
> 
> The Oops (included below) only occurs when configuring DMVPN (GRE +
> openNHRP) and a GRE Remote address is configured.  I found and
> included the neighbour.c patch outlined in
> http://web.archiveorange.com/archive/v/iRKxruZnSerMcYadyaYq.  This
> patch did not eliminate the Oops.  The Oops I observed was in
> neigh_update_hhs. neigh->dev->header_ops is NULL thus the line
> 
> void (*update)(struct hh_cache*, const struct net_device*, const
> unsigned char *)
> = neigh->dev->header_ops->cache_update;
> 
> causes the Oops.  The dev associated with the NULL header_ops was the
> GRE interface.  The following patch guards against the possibility
> that headers_ops is NULL.
> 
> --- neighbour.c.old	2010-07-12 15:29:24.000000000 -0500
> +++ neighbour.c	2010-07-12 15:32:28.000000000 -0500
> @@ -945,7 +945,10 @@
>  {
>  	struct hh_cache *hh;
>  	void (*update)(struct hh_cache*, const struct net_device*, const
> unsigned char *)
> -		= neigh->dev->header_ops->cache_update;
> +		= NULL;
> +
> +	if (neigh->dev->header_ops)
> +		update = neigh->dev->header_ops->cache_update;
>  
>  	if (update) {
>  		for (hh = neigh->hh; hh; hh = hh->hh_next) {
> 
> I'm not sure if the above patch is the proper fix.  Since
> neigh_update_hhs in newer kernels is identical to 2.6.26.8, I thought
> I'd post my findings and solicit feedback.
> 
> Regards,
> ...doug
> 
> 
> Unable to handle kernel NULL pointer dereference at virtual address
> 00000010
> pgd = c745c000
> [00000010] *pgd=07fe6031, *pte=00000000, *ppte=00000000
> Internal error: Oops: 17 [#1]
> Modules linked in: ppp_synctty ppp_async ppp_generic crc_ccitt slhc
> sierra md5 e
> cb arc4 authenc xfrm4_tunnel xfrm_user tunnel4 ipcomp deflate ah4 esp4
> aead cbc 
> hmac sha1_generic des_generic aes_generic cryptomgr crypto_null
> crypto_blkcipher
>  crypto_hash crypto_algapi af_key ipt_MASQUERADE xt_state xt_mac
> xt_tcpudp xt_mu
> ltiport xt_dscp xt_CLASSIFY xt_DSCP xt_MARK iptable_mangle iptable_nat
> nf_nat xt
> _conntrack nf_conntrack_ipv4 nf_conntrack iptable_filter ip_tables
> x_tables usbs
> erial ehci_hcd usbcore spidev ixp4xx_spi ssp rtc_s35390a rtc_core
> i2c_gpio i2c_a
> lgo_bit i2c_dev i2c_core ip_gre 8021q bridge ks8842_pci ixp4xx_eth
> ixp4xx_qmgr i
> xp4xx_npe llc firmware_class ctdfs_irq ctdfs_ioreset ctdfs_cmb
> ctdfs_wdt ctdfs_b
> eep ctdfs_reedswitch ctdfs_cpld ctdfs
> CPU: 0    Not tainted  (2.6.26.8 #14)
> PC is at neigh_update+0x1f8/0x3bc
> LR is at 0x3f5840d4
> pc : [<c016dca8>]    lr : [<3f5840d4>]    psr: 40000013
> sp : c7449c38  ip : 0000001c  fp : c7449c6c
> r10: c75457c4  r9 : 80000001  r8 : 00000040
> r7 : c7541028  r6 : 00000002  r5 : c75457a0  r4 : c75457c4
> r3 : 00000000  r2 : 00000000  r1 : c754102c  r0 : c75457c4
> Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
> Control: 000039ff  Table: 0745c000  DAC: 00000015
> Process opennhrp (pid: 1110, stack limit = 0xc7448260)
> Stack: (0xc7449c38 to 0xc744a000)
> 9c20:                                                       c7412000
> 00000000 
> 9c40: 00000040 c75457a0 c026b4f0 c7541020 c7412000 c7541000 c7541028
> c7541010 
> 9c60: c7449cb0 c7449c70 c016eacc c016dabc 00000000 00000000 c754101c
> c7541024 
> 9c80: 00000000 00000000 0000002c c7541000 0000000c 00000002 00000003
> fffffffc 
> 9ca0: c7c32ba0 c7449ce4 c7449cb4 c0170a6c c016e8ec 22222222 c7f1a0a0
> c7541000 
> 9cc0: c7f1a0a0 c0170880 c7449d1c c7443600 00000000 00000000 c7449d00
> c7449ce8 
> 9ce0: c017c460 c017088c c7f1a0a0 0000002c c7f1a0a0 c7449d14 c7449d04
> c0170870 
> 9d00: c017c418 c7c37e00 c7449d48 c7449d18 c017beec c0170858 0000002c
> 7fffffff 
> 9d20: 00000000 c7f1a0a0 c7443600 c7449f58 c7838ce0 c7449e1c 00000000
> c7449d94 
> 9d40: c7449d4c c017c1f8 c017bcd8 c7f1a5e0 0000002c 00000000 00000456
> 00000000 
> 9d60: 00000000 00000000 00000000 c7da4640 c7449f58 c7449d98 0000002c
> c7449ef8 
> 9d80: 00000000 00000008 c7449e74 c7449d98 c015a31c c017bfa0 00000000
> c7541200 
> 9da0: 00000000 00000001 ffffffff 00000000 00000000 00000000 00000000
> 00000000 
> 9dc0: c7da4640 00000000 00000000 c7449e3c c7da4640 c004b89c c7449dd8
> c7449dd8 
> 9de0: c740d005 0000004f c7449e1c 00000000 00000000 0000004f 00000456
> 00000000 
> 9e00: 00000000 00000000 00000000 c7449e2c 00000000 c7449eac c7f861a0
> 00000001 
> 9e20: c7449e60 c7449ef8 0000002c c7838ce0 c7449ef8 c7449d58 c7449f58
> c7449e78 
> 9e40: 00000128 c7449ef8 c7449ef8 00000008 00000000 c7449f58 c0161f74
> c7449f38 
> 9e60: 00000000 c7838ce0 c7449fa4 c7449e78 c015a4ec c015a278 00100000
> 00000000 
> 9e80: 00000000 c7449eac c7449f30 c7449f80 fffffdee c7449f58 c7449ea8
> c007c1f8 
> 9ea0: c0159130 00000000 00000000 c0086ed0 c008631c 00000000 00000001
> ffffffff 
> 9ec0: c7f861a0 00000000 00000000 00000000 00000000 c7da4640 00000000
> 00000000 
> 9ee0: c7c0c320 c7da4640 c004b89c c7449eec c7449eec 00000000 bedcfa38
> 00000000 
> 9f00: c0025fd4 c7449f2c 00000024 0000004f c7448000 0000000f 00000000
> 00000003 
> 9f20: 0000000b 00000000 00000000 c78042e4 00000002 c78041e4 0000004f
> c7449f80 
> 9f40: c7449f78 00000000 0000000d 000000ae c0020c44 c7449fa4 c7449e78
> 0000000c 
> 9f60: c7449ef8 00000001 00000000 00000000 00000000 00000000 ffffff97
> 000392d0 
> 9f80: bedcf9cc bedcfcd4 00000128 c0020c44 c7448000 0000934c 00000000
> c7449fa8 
> 9fa0: c0020aa0 c015a348 000392d0 bedcf9cc 00000008 bedcf938 00000000
> 00000008 
> 9fc0: 000392d0 bedcf9cc bedcfcd4 bedcfc50 00000002 0001022c 0000934c
> bedcf978 
> 9fe0: 000290c8 bedcf920 0002148c 4008ca98 00000010 00000008 00000000
> 00000000 
> Backtrace: 
> [<c016dab0>] (neigh_update+0x0/0x3bc) from [<c016eacc>] (neigh_add
> +0x1ec/0x278)
> [<c016e8e0>] (neigh_add+0x0/0x278) from [<c0170a6c>]
> (rtnetlink_rcv_msg+0x1ec/0x
> 228)
> [<c0170880>] (rtnetlink_rcv_msg+0x0/0x228) from [<c017c460>]
> (netlink_rcv_skb+0x
> 54/0xb8)
> [<c017c40c>] (netlink_rcv_skb+0x0/0xb8) from [<c0170870>]
> (rtnetlink_rcv+0x24/0x
> 34)
>  r6:c7f1a0a0 r5:0000002c r4:c7f1a0a0
> [<c017084c>] (rtnetlink_rcv+0x0/0x34) from [<c017beec>]
> (netlink_unicast+0x220/0
> x2c8)
>  r4:c7c37e00
> [<c017bccc>] (netlink_unicast+0x0/0x2c8) from [<c017c1f8>]
> (netlink_sendmsg+0x26
> 4/0x278)
> [<c017bf94>] (netlink_sendmsg+0x0/0x278) from [<c015a31c>]
> (sock_sendmsg+0xb0/0x
> d0)
> [<c015a26c>] (sock_sendmsg+0x0/0xd0) from [<c015a4ec>] (sys_sendmsg
> +0x1b0/0x20c)
>  r6:c7838ce0 r5:00000000 r4:c7449f38
> [<c015a33c>] (sys_sendmsg+0x0/0x20c) from [<c0020aa0>]
> (ret_fast_syscall+0x0/0x2
> c)
> Code: e5d320f0 ebfe51d7 e595300c e59330b0 (e5937010) 
> Kernel panic - not syncing: Fatal exception in interrupt
> 
> 
> 

Hi Doug !

I confirm I get a panic on latest kernel too (net-next-2.6) and x86
machine.

ip tunnel add netb mode gre remote 172.19.20.21 local 172.16.17.18 ttl 255
ip link set netb up
ip addr add 10.0.1.1 dev netb
ip route add 10.0.2.0/24 dev netb
ip neigh add 10.0.1.2 dev netb
ip neigh change 10.0.1.2 lladdr 01:02:03:04 dev netb

Your fix seems fine to me.

Thanks



^ permalink raw reply

* Re: [patch] 9p: strlen() doesn't count the terminator
From: Dan Carpenter @ 2010-07-12 21:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Eric Van Hensbergen, David S. Miller, Abhishek Kulkarni,
	Venkateswararao Jujjuri, linux-kernel, Tilman Sauerbeck, netdev,
	kernel-janitors
In-Reply-To: <20100712130458.bb8ae751.akpm@linux-foundation.org>

On Mon, Jul 12, 2010 at 01:04:58PM -0700, Andrew Morton wrote:
> > diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
> > index 98ce9bc..c85109d 100644
> > --- a/net/9p/trans_fd.c
> > +++ b/net/9p/trans_fd.c
> > @@ -948,7 +948,7 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
> >  
> >  	csocket = NULL;
> >  
> > -	if (strlen(addr) > UNIX_PATH_MAX) {
> > +	if (strlen(addr) >= UNIX_PATH_MAX) {
> >  		P9_EPRINTK(KERN_ERR, "p9_trans_unix: address too long: %s\n",
> >  			addr);
> >  		return -ENAMETOOLONG;
> 
> This bug doesn't strike me as serious enough to warrant backporting the fix
> into -stable.  What was your thinking there?

I don't feel strongly about it.  It's safe enough and it applies
cleanly.  On the other hand, root should always control the name of the
device to mount so it's not a big deal.

regards,
dan carpenter

^ permalink raw reply

* Re: [PATCH net-next] cxgb4vf: fix TX Queue restart
From: Casey Leedom @ 2010-07-12 21:51 UTC (permalink / raw)
  To: netdev
In-Reply-To: <201007121443.09841.leedom@chelsio.com>

  Please drop the previous patch.  My nacscent efforts at getting correctly 
formatted patches out have failed yet again.  I missed the "Signed-off-by" (sigh)

Casey

^ permalink raw reply

* [PATCH net-next] cxgb4vf: fix TX Queue restart
From: Casey Leedom @ 2010-07-12 22:02 UTC (permalink / raw)
  To: netdev

>From e1c7a6e339a47c42aaf3e425fa3228b33a425a8f Mon Sep 17 00:00:00 2001
From: Casey Leedom <leedom@chelsio.com>
Date: Mon, 12 Jul 2010 14:39:07 -0700
Subject: [PATCH net-next] cxgb4vf: fix TX Queue restart

Fix up TX Queue Host Flow Control to cause an Egress Queue Status Update to
be generated when we run out of TX Queue Descriptors.  This will, in turn,
allow us to restart a stopped TX Queue.

Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
 drivers/net/cxgb4vf/cxgb4vf_main.c |   32 +++++++-------------------------
 drivers/net/cxgb4vf/sge.c          |   12 +++++++++---
 2 files changed, 16 insertions(+), 28 deletions(-)

diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index e988031..d065516 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -423,12 +423,13 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp,
 
 	case CPL_SGE_EGR_UPDATE: {
 		/*
-		 * We've received an Egress Queue status update message.
-		 * We get these, as the SGE is currently configured, when
-		 * the firmware passes certain points in processing our
-		 * TX Ethernet Queue.  We use these updates to determine
-		 * when we may need to restart a TX Ethernet Queue which
-		 * was stopped for lack of free slots ...
+		 * We've received an Egress Queue Status Update message.  We
+		 * get these, if the SGE is configured to send these when the
+		 * firmware passes certain points in processing our TX
+		 * Ethernet Queue or if we make an explicit request for one.
+		 * We use these updates to determine when we may need to
+		 * restart a TX Ethernet Queue which was stopped for lack of
+		 * free TX Queue Descriptors ...
 		 */
 		const struct cpl_sge_egr_update *p = (void *)cpl;
 		unsigned int qid = EGR_QID(be32_to_cpu(p->opcode_qid));
@@ -436,7 +437,6 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp,
 		struct sge_txq *tq;
 		struct sge_eth_txq *txq;
 		unsigned int eq_idx;
-		int hw_cidx, reclaimable, in_use;
 
 		/*
 		 * Perform sanity checking on the Queue ID to make sure it
@@ -466,24 +466,6 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp,
 		}
 
 		/*
-		 * Skip TX Queues which aren't stopped.
-		 */
-		if (likely(!netif_tx_queue_stopped(txq->txq)))
-			break;
-
-		/*
-		 * Skip stopped TX Queues which have more than half of their
-		 * DMA rings occupied with unacknowledged writes.
-		 */
-		hw_cidx = be16_to_cpu(txq->q.stat->cidx);
-		reclaimable = hw_cidx - txq->q.cidx;
-		if (reclaimable < 0)
-			reclaimable += txq->q.size;
-		in_use = txq->q.in_use - reclaimable;
-		if (in_use >= txq->q.size/2)
-			break;
-
-		/*
 		 * Restart a stopped TX Queue which has less than half of its
 		 * TX ring in use ...
 		 */
diff --git a/drivers/net/cxgb4vf/sge.c b/drivers/net/cxgb4vf/sge.c
index 37c6354..f2ee9b0 100644
--- a/drivers/net/cxgb4vf/sge.c
+++ b/drivers/net/cxgb4vf/sge.c
@@ -1070,6 +1070,7 @@ static inline void txq_advance(struct sge_txq *tq, unsigned int n)
  */
 int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 {
+	u32 wr_mid;
 	u64 cntrl, *end;
 	int qidx, credits;
 	unsigned int flits, ndesc;
@@ -1143,14 +1144,19 @@ int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 		goto out_free;
 	}
 
+	wr_mid = FW_WR_LEN16(DIV_ROUND_UP(flits, 2));
 	if (unlikely(credits < ETHTXQ_STOP_THRES)) {
 		/*
 		 * After we're done injecting the Work Request for this
 		 * packet, we'll be below our "stop threshhold" so stop the TX
-		 * Queue now.  The queue will get started later on when the
-		 * firmware informs us that space has opened up.
+		 * Queue now and schedule a request for an SGE Egress Queue
+		 * Update message.  The queue will get started later on when
+		 * the firmware processes this Work Request and sends us an
+		 * Egress Queue Status Update message indicating that space
+		 * has opened up.
 		 */
 		txq_stop(txq);
+		wr_mid |= FW_WR_EQUEQ | FW_WR_EQUIQ;
 	}
 
 	/*
@@ -1161,7 +1167,7 @@ int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
 	 */
 	BUG_ON(DIV_ROUND_UP(ETHTXQ_MAX_HDR, TXD_PER_EQ_UNIT) > 1);
 	wr = (void *)&txq->q.desc[txq->q.pidx];
-	wr->equiq_to_len16 = cpu_to_be32(FW_WR_LEN16(DIV_ROUND_UP(flits, 2)));
+	wr->equiq_to_len16 = cpu_to_be32(wr_mid);
 	wr->r3[0] = cpu_to_be64(0);
 	wr->r3[1] = cpu_to_be64(0);
 	skb_copy_from_linear_data(skb, (void *)wr->ethmacdst, fw_hdr_copy_len);
-- 
1.7.0.4


^ 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