* 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
* Re: pull request: wireless-2.6 2010-07-12
From: David Miller @ 2010-07-12 22:17 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20100712201637.GD2442@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 12 Jul 2010 16:16:38 -0400
> Here are a couple of small fixes for resource leaks in 2.6.35.
Pulled, thanks a lot John.
^ permalink raw reply
* Re: Kernel Oops in neighbour.c 2.6.26.8
From: David Miller @ 2010-07-12 22:23 UTC (permalink / raw)
To: eric.dumazet; +Cc: rdkehn, netdev
In-Reply-To: <1278971334.2465.4.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 12 Jul 2010 23:48:54 +0200
> Your fix seems fine to me.
Me too.
Doug please make a formal submission of your fix with proper signoffs
etc., as per linux/Documentation/SubmittingPatches
Thanks!
^ permalink raw reply
* [PATCH] netfilter: xtables: userspace notification target
From: Samuel Ortiz @ 2010-07-13 0:11 UTC (permalink / raw)
To: Patrick McHardy, David S. Miller; +Cc: netdev, netfilter-devel, Luciano Coelho
The userspace notification Xtables target sends a netlink notification
whenever a packet hits the target. Notifications have a label attribute
for userspace to match it against a previously set rule. The rules also
take a --all option to switch between sending a notification for all
packets or for the first one only.
Userspace can also send a netlink message to toggle this switch while the
target is in place. This target uses the nefilter netlink framework.
This target combined with various matches (quota, rateest, etc..) allows
userspace to make decisions on interfaces handling. One could for example
decide to switch between power saving modes depending on estimated rate
thresholds.
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
include/linux/netfilter/Kbuild | 1 +
include/linux/netfilter/nfnetlink.h | 5 +-
include/linux/netfilter/nfnetlink_compat.h | 1 +
include/linux/netfilter/xt_NFNOTIF.h | 55 +++++
net/netfilter/Kconfig | 17 ++
net/netfilter/Makefile | 1 +
net/netfilter/xt_NFNOTIF.c | 300 ++++++++++++++++++++++++++++
7 files changed, 379 insertions(+), 1 deletions(-)
create mode 100644 include/linux/netfilter/xt_NFNOTIF.h
create mode 100644 net/netfilter/xt_NFNOTIF.c
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index bb103f4..1b80b27 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -12,6 +12,7 @@ header-y += xt_IDLETIMER.h
header-y += xt_LED.h
header-y += xt_MARK.h
header-y += xt_NFLOG.h
+header-y += xt_NFNOTIF.h
header-y += xt_NFQUEUE.h
header-y += xt_RATEEST.h
header-y += xt_SECMARK.h
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 361d6b5..e336f03 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -18,6 +18,8 @@ enum nfnetlink_groups {
#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
NFNLGRP_CONNTRACK_EXP_DESTROY,
#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
+ NFNLGRP_NFNOTIF,
+#define NFNLGRP_NFNOTIF NFNLGRP_NFNOTIF
__NFNLGRP_MAX,
};
#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
@@ -47,7 +49,8 @@ struct nfgenmsg {
#define NFNL_SUBSYS_QUEUE 3
#define NFNL_SUBSYS_ULOG 4
#define NFNL_SUBSYS_OSF 5
-#define NFNL_SUBSYS_COUNT 6
+#define NFNL_SUBSYS_NFNOTIF 6
+#define NFNL_SUBSYS_COUNT 7
#ifdef __KERNEL__
diff --git a/include/linux/netfilter/nfnetlink_compat.h b/include/linux/netfilter/nfnetlink_compat.h
index ffb9503..dca8ab2 100644
--- a/include/linux/netfilter/nfnetlink_compat.h
+++ b/include/linux/netfilter/nfnetlink_compat.h
@@ -13,6 +13,7 @@
#define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008
#define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010
#define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020
+#define NF_NETLINK_NFNOTIF 0x00000040
/* Generic structure for encapsulation optional netfilter information.
* It is reminiscent of sockaddr, but with sa_family replaced
diff --git a/include/linux/netfilter/xt_NFNOTIF.h b/include/linux/netfilter/xt_NFNOTIF.h
new file mode 100644
index 0000000..8fae827
--- /dev/null
+++ b/include/linux/netfilter/xt_NFNOTIF.h
@@ -0,0 +1,55 @@
+/*
+ * linux/include/linux/netfilter/xt_NFNOTIF.h
+ *
+ * Header file for Xtables notification target module.
+ *
+ * Copyright (C) 2010 Intel Corporation
+ * Samuel Ortiz <samuel.ortiz@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef _XT_NFNOTIF_H
+#define _XT_NFNOTIF_H
+
+#include <linux/types.h>
+
+enum nfnotif_msg_type {
+ NFNOTIF_TG_MSG_PACKETS,
+
+ NFNOTIF_TG_MSG_MAX
+};
+
+enum nfnotif_attr_type {
+ NFNOTIF_TG_ATTR_UNSPEC,
+ NFNOTIF_TG_ATTR_LABEL,
+ NFNOTIF_TG_ATTR_SEND_NOTIF,
+
+ __NFNOTIF_TG_ATTR_AFTER_LAST
+};
+#define NFNOTIF_TG_ATTR_MAX (__NFNOTIF_TG_ATTR_AFTER_LAST - 1)
+
+#define MAX_NFNOTIF_LABEL_SIZE 31
+
+struct nfnotif_tg_info {
+ __u8 all_packets;
+
+ char label[MAX_NFNOTIF_LABEL_SIZE];
+
+ /* for kernel module internal use only */
+ struct nfnotif_tg *notif __attribute((aligned(8)));
+};
+
+#endif
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index aa2f106..0e2de36 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -469,6 +469,23 @@ config NETFILTER_XT_TARGET_NFQUEUE
To compile it as a module, choose M here. If unsure, say N.
+config NETFILTER_XT_TARGET_NFNOTIF
+ tristate '"NFNOTIF" target Support'
+ depends on NETFILTER_ADVANCED
+ select NETFILTER_NETLINK
+ help
+
+ This option adds the `NFNOTIF' target, which allows to send
+ netfilter netlink messages when packets hit the target.
+
+ This target comes with an option to specify if one wants all
+ packets hitting the target to trigger the netlink message
+ transmission, or only the first one.
+ It also listen on its netfilter netlink subsystem for messages
+ allowing to reset the above option.
+
+ To compile it as a module, choose M here. If unsure, say N.
+
config NETFILTER_XT_TARGET_NOTRACK
tristate '"NOTRACK" target support'
depends on IP_NF_RAW || IP6_NF_RAW
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
index e28420a..5d9c9e9 100644
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP) += xt_TCPOPTSTRIP.o
obj-$(CONFIG_NETFILTER_XT_TARGET_TEE) += xt_TEE.o
obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o
obj-$(CONFIG_NETFILTER_XT_TARGET_IDLETIMER) += xt_IDLETIMER.o
+obj-$(CONFIG_NETFILTER_XT_TARGET_NFNOTIF) += xt_NFNOTIF.o
# matches
obj-$(CONFIG_NETFILTER_XT_MATCH_CLUSTER) += xt_cluster.o
diff --git a/net/netfilter/xt_NFNOTIF.c b/net/netfilter/xt_NFNOTIF.c
new file mode 100644
index 0000000..e6e906b
--- /dev/null
+++ b/net/netfilter/xt_NFNOTIF.c
@@ -0,0 +1,300 @@
+/*
+ * linux/net/netfilter/xt_NFNOTIF.c
+ *
+ * Copyright (C) 2010 Intel Corporation
+ * Samuel Ortiz <samuel.ortiz@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/module.h>
+#include <linux/list.h>
+#include <linux/mutex.h>
+#include <linux/netfilter.h>
+#include <linux/netfilter/x_tables.h>
+#include <linux/netfilter/nfnetlink.h>
+#include <linux/netfilter/xt_NFNOTIF.h>
+
+struct nfnotif_tg {
+ struct list_head entry;
+ struct work_struct work;
+
+ char *label;
+ __u8 all_packets;
+ struct net *net;
+
+ __u8 send_notif;
+
+ unsigned int refcnt;
+};
+
+static LIST_HEAD(nfnotif_tg_list);
+static DEFINE_MUTEX(list_mutex);
+
+static int __nfnotif_tg_netlink_send(struct nfnotif_tg *nfnotif)
+{
+ struct nlmsghdr *nlh;
+ struct nfgenmsg *nfmsg;
+ struct sk_buff *skb;
+ struct net *net = nfnotif->net;
+ unsigned int type;
+ int flags;
+
+ type = NFNL_SUBSYS_NFNOTIF << 8;
+ flags = NLM_F_CREATE;
+
+ skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (skb == NULL)
+ goto error_out;
+
+ nlh = nlmsg_put(skb, 0, 0, type, sizeof(*nfmsg), flags);
+ if (nlh == NULL)
+ goto nlmsg_put_failure;
+
+ nfmsg = nlmsg_data(nlh);
+ nfmsg->version = NFNETLINK_V0;
+ nfmsg->res_id = 0;
+
+ NLA_PUT_STRING(skb, NFNOTIF_TG_ATTR_LABEL, nfnotif->label);
+
+ nlmsg_end(skb, nlh);
+
+ return nfnetlink_send(skb, net, 0, NFNLGRP_NFNOTIF, 0, GFP_KERNEL);
+
+nla_put_failure:
+ nlmsg_cancel(skb, nlh);
+
+nlmsg_put_failure:
+ kfree_skb(skb);
+
+error_out:
+ return nfnetlink_set_err(net, 0, 0, -ENOBUFS);
+}
+
+static void nfnotif_tg_work(struct work_struct *work)
+{
+ struct nfnotif_tg *notif = container_of(work, struct nfnotif_tg, work);
+
+
+ if (__nfnotif_tg_netlink_send(notif) < 0)
+ pr_debug("Could not send notification");
+
+ if (!notif->all_packets)
+ notif->send_notif = 0;
+}
+
+static struct nfnotif_tg *__nfnotif_tg_find_by_label(const char *label)
+{
+ struct nfnotif_tg *entry;
+
+ BUG_ON(!label);
+
+ list_for_each_entry(entry, &nfnotif_tg_list, entry) {
+ if (!strcmp(label, entry->label))
+ return entry;
+ }
+
+ return NULL;
+}
+
+static int nfnotif_tg_create(struct nfnotif_tg_info *info)
+{
+ info->notif = kmalloc(sizeof(*info->notif), GFP_KERNEL);
+ if (!info->notif) {
+ pr_debug("Couldn't allocate notification\n");
+ return -ENOMEM;
+ }
+
+ info->notif->label = kstrdup(info->label, GFP_KERNEL);
+ if (!info->notif->label) {
+ pr_debug("Couldn't allocate label\n");
+ kfree(info->notif);
+ return -ENOMEM;
+ }
+
+ info->notif->all_packets = info->all_packets;
+ info->notif->send_notif = 1;
+
+ list_add(&info->notif->entry, &nfnotif_tg_list);
+
+ info->notif->refcnt = 1;
+
+ INIT_WORK(&info->notif->work, nfnotif_tg_work);
+
+ return 0;
+}
+
+static unsigned int nfnotif_tg_target(struct sk_buff *skb,
+ const struct xt_action_param *par)
+{
+ const struct nfnotif_tg_info *info = par->targinfo;
+
+ BUG_ON(!info->notif);
+
+ if (!info->notif->send_notif)
+ return XT_CONTINUE;
+
+ pr_debug("Sending notification for %s\n", info->label);
+
+ schedule_work(&info->notif->work);
+
+ return XT_CONTINUE;
+}
+
+static int nfnotif_tg_checkentry(const struct xt_tgchk_param *par)
+{
+ struct nfnotif_tg_info *info = par->targinfo;
+ int ret;
+
+ pr_debug("Checkentry targinfo %s\n", info->label);
+
+ if (info->label[0] == '\0' ||
+ strnlen(info->label,
+ MAX_NFNOTIF_LABEL_SIZE) == MAX_NFNOTIF_LABEL_SIZE) {
+ pr_debug("Label is empty or not nul-terminated\n");
+ return -EINVAL;
+ }
+
+ mutex_lock(&list_mutex);
+
+ info->notif = __nfnotif_tg_find_by_label(info->label);
+ if (info->notif) {
+ info->notif->refcnt++;
+
+ pr_debug("Increased refcnt for %s to %u\n",
+ info->label, info->notif->refcnt);
+ } else {
+ ret = nfnotif_tg_create(info);
+ if (ret < 0) {
+ pr_debug("Failed to create notification\n");
+ mutex_unlock(&list_mutex);
+ return ret;
+ }
+ }
+
+ info->notif->net = par->net;
+
+ mutex_unlock(&list_mutex);
+ return 0;
+}
+
+static void nfnotif_tg_destroy(const struct xt_tgdtor_param *par)
+{
+ const struct nfnotif_tg_info *info = par->targinfo;
+
+ pr_debug("Destroy targinfo %s\n", info->label);
+
+ mutex_lock(&list_mutex);
+
+ if (--info->notif->refcnt == 0) {
+ pr_debug("Deleting notification %s\n", info->label);
+
+ list_del(&info->notif->entry);
+ kfree(info->notif->label);
+ kfree(info->notif);
+ }
+
+ mutex_unlock(&list_mutex);
+}
+
+static struct xt_target nfnotif_tg __read_mostly = {
+ .name = "NFNOTIF",
+ .family = NFPROTO_UNSPEC,
+ .target = nfnotif_tg_target,
+ .targetsize = sizeof(struct nfnotif_tg_info),
+ .checkentry = nfnotif_tg_checkentry,
+ .destroy = nfnotif_tg_destroy,
+ .me = THIS_MODULE,
+};
+
+static int nfnotif_msg_send_notif(struct sock *nfnl, struct sk_buff *skb,
+ const struct nlmsghdr *nlh,
+ const struct nlattr * const attrs[])
+{
+ struct nfnotif_tg *notif;
+ char *label;
+ u8 send_notif;
+
+ if (attrs[NFNOTIF_TG_ATTR_LABEL] == NULL ||
+ attrs[NFNOTIF_TG_ATTR_SEND_NOTIF] == NULL)
+ return -EINVAL;
+
+ label = nla_data(attrs[NFNOTIF_TG_ATTR_LABEL]);
+ send_notif = nla_get_u8(attrs[NFNOTIF_TG_ATTR_SEND_NOTIF]);
+
+ pr_debug("Label %s send %d\n", label, send_notif);
+
+ notif = __nfnotif_tg_find_by_label(label);
+ if (notif == NULL)
+ return -EINVAL;
+
+ notif->send_notif = send_notif;
+
+ return 0;
+}
+
+
+static const struct nla_policy nfnotif_nla_policy[NFNOTIF_TG_ATTR_MAX + 1] = {
+ [NFNOTIF_TG_ATTR_LABEL] = { .type = NLA_NUL_STRING },
+ [NFNOTIF_TG_ATTR_SEND_NOTIF] = { .type = NLA_U8 },
+};
+
+static const struct nfnl_callback nfnotif_cb[NFNOTIF_TG_MSG_MAX] = {
+ [NFNOTIF_TG_MSG_PACKETS] = { .call = nfnotif_msg_send_notif,
+ .attr_count = NFNOTIF_TG_ATTR_MAX,
+ .policy = nfnotif_nla_policy },
+};
+
+static const struct nfnetlink_subsystem nfnotif_subsys = {
+ .name = "nfnotif",
+ .subsys_id = NFNL_SUBSYS_NFNOTIF,
+ .cb_count = NFNOTIF_TG_MSG_MAX,
+ .cb = nfnotif_cb,
+};
+
+static int __init nfnotif_tg_init(void)
+{
+ int ret;
+
+ ret = nfnetlink_subsys_register(&nfnotif_subsys);
+ if (ret < 0) {
+ pr_err("%s: Cannot register with nfnetlink\n", __func__);
+ return ret;
+ }
+
+ ret = xt_register_target(&nfnotif_tg);
+ if (ret < 0) {
+ pr_err("%s: Cannot register target\n", __func__);
+ nfnetlink_subsys_unregister(&nfnotif_subsys);
+ }
+
+ return ret;
+}
+
+static void __exit nfnotif_tg_exit(void)
+{
+ nfnetlink_subsys_unregister(&nfnotif_subsys);
+ xt_unregister_target(&nfnotif_tg);
+}
+
+module_init(nfnotif_tg_init);
+module_exit(nfnotif_tg_exit);
+
+MODULE_AUTHOR("Samuel Ortiz <samuel.ortiz@intel.com>");
+MODULE_DESCRIPTION("Xtables: userspace notification");
+MODULE_LICENSE("GPL v2");
--
1.7.1
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply related
* RE: [REGRESSION] e1000e stopped working [MANUALLY BISECTED]
From: Maxim Levitsky @ 2010-07-13 0:38 UTC (permalink / raw)
To: Tantilov, Emil S
Cc: Kirsher, Jeffrey T, netdev@vger.kernel.org, Allan, Bruce W,
Pieper, Jeffrey E
In-Reply-To: <EA929A9653AAE14F841771FB1DE5A1365FF4A9B949@rrsmsx501.amr.corp.intel.com>
On Mon, 2010-07-12 at 15:23 -0600, Tantilov, Emil S wrote:
> 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
I did send -e and -d output.
Since you probably want -S output during failure, I need to recompile
kernel for that. I will do that soon.
One question, in two weeks I hope 2.6.35 won't be released?
If so, I will have enough free time then to narrow down this issue.
Other solution, is to revert this commit.
(I have never seen this problem with it reverted).
Best regards,
Maxim Levitsky
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox