* [PATCH 2/2 2.6.25] netns: separate af_packet netns data
From: Denis V. Lunev @ 2007-12-11 11:55 UTC (permalink / raw)
To: davem; +Cc: containers, devel, netdev, herbert
netns: move af_packet data to the separate header
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
include/net/net_namespace.h | 6 ++----
include/net/netns/packet.h | 15 +++++++++++++++
net/packet/af_packet.c | 28 ++++++++++++++--------------
3 files changed, 31 insertions(+), 18 deletions(-)
create mode 100644 include/net/netns/packet.h
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index d943fd4..18da0af 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -9,6 +9,7 @@
#include <linux/list.h>
#include <net/netns/unix.h>
+#include <net/netns/packet.h>
struct proc_dir_entry;
struct net_device;
@@ -43,10 +44,7 @@ struct net {
struct ctl_table_header *sysctl_core_hdr;
int sysctl_somaxconn;
- /* List of all packet sockets. */
- rwlock_t packet_sklist_lock;
- struct hlist_head packet_sklist;
-
+ struct netns_packet packet;
struct netns_unix unx;
};
diff --git a/include/net/netns/packet.h b/include/net/netns/packet.h
new file mode 100644
index 0000000..637daf6
--- /dev/null
+++ b/include/net/netns/packet.h
@@ -0,0 +1,15 @@
+/*
+ * Packet network namespace
+ */
+#ifndef __NETNS_PACKET_H__
+#define __NETNS_PACKET_H__
+
+#include <linux/list.h>
+#include <linux/spinlock.h>
+
+struct netns_packet {
+ rwlock_t sklist_lock;
+ struct hlist_head sklist;
+};
+
+#endif /* __NETNS_PACKET_H__ */
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index ace29f1..485af56 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -803,9 +803,9 @@ static int packet_release(struct socket *sock)
net = sk->sk_net;
po = pkt_sk(sk);
- write_lock_bh(&net->packet_sklist_lock);
+ write_lock_bh(&net->packet.sklist_lock);
sk_del_node_init(sk);
- write_unlock_bh(&net->packet_sklist_lock);
+ write_unlock_bh(&net->packet.sklist_lock);
/*
* Unhook packet receive handler.
@@ -1015,9 +1015,9 @@ static int packet_create(struct net *net, struct socket *sock, int protocol)
po->running = 1;
}
- write_lock_bh(&net->packet_sklist_lock);
- sk_add_node(sk, &net->packet_sklist);
- write_unlock_bh(&net->packet_sklist_lock);
+ write_lock_bh(&net->packet.sklist_lock);
+ sk_add_node(sk, &net->packet.sklist);
+ write_unlock_bh(&net->packet.sklist_lock);
return(0);
out:
return err;
@@ -1452,8 +1452,8 @@ static int packet_notifier(struct notifier_block *this, unsigned long msg, void
struct net_device *dev = data;
struct net *net = dev->nd_net;
- read_lock(&net->packet_sklist_lock);
- sk_for_each(sk, node, &net->packet_sklist) {
+ read_lock(&net->packet.sklist_lock);
+ sk_for_each(sk, node, &net->packet.sklist) {
struct packet_sock *po = pkt_sk(sk);
switch (msg) {
@@ -1492,7 +1492,7 @@ static int packet_notifier(struct notifier_block *this, unsigned long msg, void
break;
}
}
- read_unlock(&net->packet_sklist_lock);
+ read_unlock(&net->packet.sklist_lock);
return NOTIFY_DONE;
}
@@ -1862,7 +1862,7 @@ static inline struct sock *packet_seq_idx(struct net *net, loff_t off)
struct sock *s;
struct hlist_node *node;
- sk_for_each(s, node, &net->packet_sklist) {
+ sk_for_each(s, node, &net->packet.sklist) {
if (!off--)
return s;
}
@@ -1872,7 +1872,7 @@ static inline struct sock *packet_seq_idx(struct net *net, loff_t off)
static void *packet_seq_start(struct seq_file *seq, loff_t *pos)
{
struct net *net = seq_file_net(seq);
- read_lock(&net->packet_sklist_lock);
+ read_lock(&net->packet.sklist_lock);
return *pos ? packet_seq_idx(net, *pos - 1) : SEQ_START_TOKEN;
}
@@ -1881,14 +1881,14 @@ static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos)
struct net *net = seq->private;
++*pos;
return (v == SEQ_START_TOKEN)
- ? sk_head(&net->packet_sklist)
+ ? sk_head(&net->packet.sklist)
: sk_next((struct sock*)v) ;
}
static void packet_seq_stop(struct seq_file *seq, void *v)
{
struct net *net = seq->private;
- read_unlock(&net->packet_sklist_lock);
+ read_unlock(&net->packet.sklist_lock);
}
static int packet_seq_show(struct seq_file *seq, void *v)
@@ -1940,8 +1940,8 @@ static const struct file_operations packet_seq_fops = {
static int packet_net_init(struct net *net)
{
- rwlock_init(&net->packet_sklist_lock);
- INIT_HLIST_HEAD(&net->packet_sklist);
+ rwlock_init(&net->packet.sklist_lock);
+ INIT_HLIST_HEAD(&net->packet.sklist);
if (!proc_net_fops_create(net, "packet", 0, &packet_seq_fops))
return -ENOMEM;
--
1.5.3.rc5
^ permalink raw reply related
* [PATCH 1/2 2.6.25] netns: struct net content re-work (v3)
From: Denis V. Lunev @ 2007-12-11 11:55 UTC (permalink / raw)
To: davem; +Cc: containers, devel, netdev, herbert
Recently David Miller and Herbert Xu pointed out that struct net becomes
overbloated and un-maintainable. There are two solutions:
- provide a pointer to a network subsystem definition from struct net.
This costs an additional dereferrence
- place sub-system definition into the structure itself. This will speedup
run-time access at the cost of recompilation time
The second approach looks better for us. Other sub-systems will follow.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
---
include/net/net_namespace.h | 6 +++---
include/net/netns/unix.h | 13 +++++++++++++
net/unix/af_unix.c | 4 ++--
net/unix/sysctl_net_unix.c | 12 ++++++------
4 files changed, 24 insertions(+), 11 deletions(-)
create mode 100644 include/net/netns/unix.h
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index b62e31f..d943fd4 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -8,6 +8,8 @@
#include <linux/workqueue.h>
#include <linux/list.h>
+#include <net/netns/unix.h>
+
struct proc_dir_entry;
struct net_device;
struct sock;
@@ -45,9 +47,7 @@ struct net {
rwlock_t packet_sklist_lock;
struct hlist_head packet_sklist;
- /* unix sockets */
- int sysctl_unix_max_dgram_qlen;
- struct ctl_table_header *unix_ctl;
+ struct netns_unix unx;
};
#ifdef CONFIG_NET
diff --git a/include/net/netns/unix.h b/include/net/netns/unix.h
new file mode 100644
index 0000000..284649d
--- /dev/null
+++ b/include/net/netns/unix.h
@@ -0,0 +1,13 @@
+/*
+ * Unix network namespace
+ */
+#ifndef __NETNS_UNIX_H__
+#define __NETNS_UNIX_H__
+
+struct ctl_table_header;
+struct netns_unix {
+ int sysctl_max_dgram_qlen;
+ struct ctl_table_header *ctl;
+};
+
+#endif /* __NETNS_UNIX_H__ */
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index b8a2189..63a9239 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -592,7 +592,7 @@ static struct sock * unix_create1(struct net *net, struct socket *sock)
&af_unix_sk_receive_queue_lock_key);
sk->sk_write_space = unix_write_space;
- sk->sk_max_ack_backlog = net->sysctl_unix_max_dgram_qlen;
+ sk->sk_max_ack_backlog = net->unx.sysctl_max_dgram_qlen;
sk->sk_destruct = unix_sock_destructor;
u = unix_sk(sk);
u->dentry = NULL;
@@ -2138,7 +2138,7 @@ static int unix_net_init(struct net *net)
{
int error = -ENOMEM;
- net->sysctl_unix_max_dgram_qlen = 10;
+ net->unx.sysctl_max_dgram_qlen = 10;
if (unix_sysctl_register(net))
goto out;
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index 553ef6a..77513d7 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -18,7 +18,7 @@ static ctl_table unix_table[] = {
{
.ctl_name = NET_UNIX_MAX_DGRAM_QLEN,
.procname = "max_dgram_qlen",
- .data = &init_net.sysctl_unix_max_dgram_qlen,
+ .data = &init_net.unx.sysctl_max_dgram_qlen,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
@@ -40,9 +40,9 @@ int unix_sysctl_register(struct net *net)
if (table == NULL)
goto err_alloc;
- table[0].data = &net->sysctl_unix_max_dgram_qlen;
- net->unix_ctl = register_net_sysctl_table(net, unix_path, table);
- if (net->unix_ctl == NULL)
+ table[0].data = &net->unx.sysctl_max_dgram_qlen;
+ net->unx.ctl = register_net_sysctl_table(net, unix_path, table);
+ if (net->unx.ctl == NULL)
goto err_reg;
return 0;
@@ -57,8 +57,8 @@ void unix_sysctl_unregister(struct net *net)
{
struct ctl_table *table;
- table = net->unix_ctl->ctl_table_arg;
- unregister_sysctl_table(net->unix_ctl);
+ table = net->unx.ctl->ctl_table_arg;
+ unregister_sysctl_table(net->unx.ctl);
kfree(table);
}
--
1.5.3.rc5
^ permalink raw reply related
* [PATCH 2.6.25] UNIX: remove unused declaration of sysctl_unix_max_dgram_qlen (resend, wrong patch was sent)
From: Denis V. Lunev @ 2007-12-11 11:53 UTC (permalink / raw)
To: davem; +Cc: containers, devel, netdev
UNIX: remove unused declaration of sysctl_unix_max_dgram_qlen
Signed-off-by: Denis V. Lunev <den@openvz.org>
--
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -59,7 +59,6 @@ struct unix_sock {
#define unix_sk(__sk) ((struct unix_sock *)__sk)
#ifdef CONFIG_SYSCTL
-extern int sysctl_unix_max_dgram_qlen;
extern int unix_sysctl_register(struct net *net);
extern void unix_sysctl_unregister(struct net *net);
#else
^ permalink raw reply
* RE: [PATCH] Increase virtual FIFOs in ucc_geth.
From: Li Yang @ 2007-12-11 11:51 UTC (permalink / raw)
To: joakim.tjernlund; +Cc: netdev
In-Reply-To: <1197370676.6790.17.camel@gentoo-jocke.transmode.se>
> -----Original Message-----
> From: Joakim Tjernlund [mailto:joakim.tjernlund@transmode.se]
> Sent: Tuesday, December 11, 2007 6:58 PM
> To: Li Yang
> Cc: netdev@vger.kernel.org
> Subject: RE: [PATCH] Increase virtual FIFOs in ucc_geth.
>
>
> On Tue, 2007-12-11 at 11:11 +0100, Joakim Tjernlund wrote:
> > On Tue, 2007-12-11 at 17:49 +0800, Li Yang wrote:
> > > > -----Original Message-----
> > > > From: Joakim Tjernlund [mailto:Joakim.Tjernlund@transmode.se]
> > > > Sent: Tuesday, December 11, 2007 2:46 AM
> > > > To: Li Yang-r58472 <LeoLi@freescale.com> Netdev
> > > > Cc: Joakim Tjernlund
> > > > Subject: [PATCH] Increase virtual FIFOs in ucc_geth.
> > > >
> > > > Increase UCC_GETH_URFS_INIT to 1152 and
> > > > UCC_GETH_UTFS_INIT to 896 to avoid HW Overrun/Underrun.
> > >
> > > Please be noted that these values are only used for
> 10/100Mbps speed.
> > > Did you get Overrun in 10/100M mode?
> >
> > I get both TX Underrun and RX overrun in 100Mbps, FD, just
> > by running a tftp transfer. It feels like the URFET and/or URSFET
> > isn't working. Why I don't know. CPU is MPC832x
> >
> > Jocke
>
> I am a bit confused how the RBMR and TBMR is supposed to work. In
> ucc_get there is:
> out_be32(&ugeth->p_tx_glbl_pram->tstate, ((u32)
> function_code) << 24);
> ugeth->p_rx_glbl_pram->rstate = function_code;
> First, should not the rx part look the same as tx?
To be consist with the chip RM, type for tstate is u32 and type for
rstate is u8. Personally I don't think that it will be different to
access tstate as u8, but it will be more readable to be the same as
manual. Well, rstate probably should be changed to use IO accessor too.
> Does programing rstate/tstate replace RBMR and TBMR?
RBMR and TBMR? These are for other protocols.
- Leo
^ permalink raw reply
* [PATCH 1/2] [TCP]: Push fack_count calculation deeper into functions
From: Ilpo Järvinen @ 2007-12-11 11:50 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <11973738391620-git-send-email-ilpo.jarvinen@helsinki.fi>
This shouldn't have a significant impact because the call to
tcp_sacktag_one is typically made just once per ACK (this
doesn't hold if there were some ACK losses in between or the
receiver didn't generate all ACKs that it should have, but
those are not very likely events to occur).
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/ipv4/tcp_input.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 75a16b3..977c68c 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1214,11 +1214,15 @@ static int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb,
}
static int tcp_sacktag_one(struct sk_buff *skb, struct sock *sk,
- int *reord, int dup_sack, int fack_count)
+ int *reord, int dup_sack)
{
struct tcp_sock *tp = tcp_sk(sk);
u8 sacked = TCP_SKB_CB(skb)->sacked;
int flag = 0;
+ int fack_count;
+
+ fack_count = TCP_SKB_CB(skb)->fack_count -
+ TCP_SKB_CB(tcp_write_queue_head(sk))->fack_count;
/* Account D-SACK for retransmitted packet. */
if (dup_sack && (sacked & TCPCB_RETRANS)) {
@@ -1315,13 +1319,9 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
int queue)
{
struct sk_buff *next;
- unsigned int fack_count_base;
-
- fack_count_base = TCP_SKB_CB(tcp_write_queue_head(sk))->fack_count;
tcp_for_write_queue_from_safe(skb, next, sk, queue) {
int in_sack = 0;
- unsigned int fack_count;
if (skb == tcp_send_head(sk))
break;
@@ -1334,10 +1334,8 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
if (unlikely(in_sack < 0))
break;
- if (in_sack) {
- fack_count = TCP_SKB_CB(skb)->fack_count - fack_count_base;
- *flag |= tcp_sacktag_one(skb, sk, reord, dup_sack, fack_count);
- }
+ if (in_sack)
+ *flag |= tcp_sacktag_one(skb, sk, reord, dup_sack);
}
return skb;
}
--
1.5.0.6
^ permalink raw reply related
* [PATCH net-2.6.25 0/2]: TCP minor
From: Ilpo Järvinen @ 2007-12-11 11:50 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Hi Dave,
Here are two TCP patches. The first one removes not so useful
parameter (my avoid GSO skb fragment RFC patch that I'll send
separately right after I get this out depends it). The second
applies cleanly only after the other fack_count fix patch.
--
i.
^ permalink raw reply
* [PATCH 2/2] [TCP]: Include __tcp_reset_fack_counts to non-__ version
From: Ilpo Järvinen @ 2007-12-11 11:50 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <11973738393633-git-send-email-ilpo.jarvinen@helsinki.fi>
This makes flow more obvious in case of short-circuit and
removes need for prev double pointer & fc recount per queue
switch.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/net/tcp.h | 54 ++++++++++++++++++----------------------------------
1 files changed, 19 insertions(+), 35 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 2d9949e..5e6c433 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1467,38 +1467,6 @@ static inline void __tcp_add_write_queue_head(struct sock *sk, struct sk_buff *s
tcp_rb_insert(skb, &tcp_sk(sk)->write_queue_rb);
}
-static inline struct sk_buff *__tcp_reset_fack_counts(struct sock *sk,
- struct sk_buff *skb,
- struct sk_buff **prev,
- int queue)
-{
- unsigned int fc = 0;
-
- if (*prev != NULL)
- fc = TCP_SKB_CB(*prev)->fack_count + tcp_skb_pcount(*prev);
-
- BUG_ON((*prev != NULL) && !tcp_skb_adjacent(sk, *prev, skb));
-
- tcp_for_write_queue_from(skb, sk, queue) {
- if ((*prev != NULL) && !tcp_skb_adjacent(sk, *prev, skb))
- break;
-
- /* Terminate whole search? */
- if (!before(TCP_SKB_CB(skb)->seq, tcp_sk(sk)->snd_nxt) ||
- TCP_SKB_CB(skb)->fack_count == fc) {
- *prev = NULL;
- return NULL;
- }
-
- TCP_SKB_CB(skb)->fack_count = fc;
- fc += tcp_skb_pcount(skb);
-
- *prev = skb;
- }
-
- return skb;
-}
-
/* An insert into the middle of the write queue causes the fack
* counts in subsequent packets to become invalid, fix them up.
*
@@ -1509,6 +1477,7 @@ static inline void tcp_reset_fack_counts(struct sock *sk, struct sk_buff *inskb)
struct sk_buff *prev;
struct sk_buff *skb[2] = {NULL, NULL};
int queue;
+ unsigned int fc = 0;
if (!before(TCP_SKB_CB(inskb)->seq, tcp_sk(sk)->snd_nxt))
return;
@@ -1531,6 +1500,9 @@ static inline void tcp_reset_fack_counts(struct sock *sk, struct sk_buff *inskb)
skb[otherq] = prev->next;
}
+ if (prev != NULL)
+ fc = TCP_SKB_CB(prev)->fack_count + tcp_skb_pcount(prev);
+
while (skb[queue] != (struct sk_buff *)__tcp_list_select(sk, queue)) {
/* Lazy find for the other queue */
if (skb[queue] == NULL) {
@@ -1540,9 +1512,21 @@ static inline void tcp_reset_fack_counts(struct sock *sk, struct sk_buff *inskb)
break;
}
- skb[queue] = __tcp_reset_fack_counts(sk, skb[queue], &prev, queue);
- if (skb[queue] == NULL)
- break;
+ BUG_ON((prev != NULL) && !tcp_skb_adjacent(sk, prev, skb[queue]));
+
+ tcp_for_write_queue_from(skb[queue], sk, queue) {
+ if ((prev != NULL) && !tcp_skb_adjacent(sk, prev, skb[queue]))
+ break;
+
+ if (!before(TCP_SKB_CB(skb[queue])->seq, tcp_sk(sk)->snd_nxt) ||
+ TCP_SKB_CB(skb[queue])->fack_count == fc)
+ return;
+
+ TCP_SKB_CB(skb[queue])->fack_count = fc;
+ fc += tcp_skb_pcount(skb[queue]);
+
+ prev = skb[queue];
+ }
queue ^= TCP_WQ_SACKED;
}
--
1.5.0.6
^ permalink raw reply related
* Re: [Bugme-new] [Bug 9543] New: RTNL: assertion failed at net/ipv6/addrconf.c (2164)/RTNL: assertion failed at net/ipv4/devinet.c (1055)
From: Andrew Morton @ 2007-12-11 11:46 UTC (permalink / raw)
To: olel; +Cc: bugme-daemon, Stephen Hemminger, David S. Miller, netdev
In-Reply-To: <bug-9543-10286@http.bugzilla.kernel.org/>
On Tue, 11 Dec 2007 03:20:48 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=9543
>
> Summary: RTNL: assertion failed at net/ipv6/addrconf.c
> (2164)/RTNL: assertion failed at net/ipv4/devinet.c
> (1055)
> Product: Drivers
> Version: 2.5
> KernelVersion: 2.6.24-rc4-git7
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: Network
> AssignedTo: jgarzik@pobox.com
> ReportedBy: olel@ans.pl
>
>
> Most recent kernel where this bug did not occur: 2.6.23
> Distribution: Gentoo
>
> Problem Description:
> ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
> RTNL: assertion failed at net/ipv6/addrconf.c (2164)
> Pid: 9, comm: events/0 Not tainted 2.6.24-rc4-git7 #1
> [<78402cfb>] addrconf_notify+0x5b4/0x7b7
> [<7812203a>] finish_task_switch+0x0/0x8c
> [<781346ff>] worker_thread+0x0/0x85
> [<78438e23>] schedule+0x545/0x55f
> [<781408d1>] print_lock_contention_bug+0x11/0xd2
> [<783bfa72>] rt_run_flush+0x43/0x8b
> [<783bfa93>] rt_run_flush+0x64/0x8b
> [<7813ac54>] notifier_call_chain+0x2a/0x52
> [<7813ac9e>] raw_notifier_call_chain+0x17/0x1a
> [<783a3471>] netdev_state_change+0x18/0x29
> [<783ac6a9>] __linkwatch_run_queue+0x150/0x17e
> [<783ac6f4>] linkwatch_event+0x1d/0x22
> [<78133cdf>] run_workqueue+0xdb/0x1b6
> [<78133c8b>] run_workqueue+0x87/0x1b6
> [<783ac6d7>] linkwatch_event+0x0/0x22
> [<781346ff>] worker_thread+0x0/0x85
> [<78134778>] worker_thread+0x79/0x85
> [<781371ad>] autoremove_wake_function+0x0/0x35
> [<781370f6>] kthread+0x38/0x5e
> [<781370be>] kthread+0x0/0x5e
> [<78104baf>] kernel_thread_helper+0x7/0x10
> =======================
> RTNL: assertion failed at net/ipv6/addrconf.c (1610)
Hopefully this is due to the bug you reported in bug #9542.
Does this patch fix both issues?
From: Andrew Morton <akpm@linux-foundation.org>
Remove stray rtnl_unlock().
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=9542
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Krzysztof Oledzki <olel@ans.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/bonding/bond_sysfs.c | 2 --
1 file changed, 2 deletions(-)
diff -puN drivers/net/bonding/bond_sysfs.c~bonding-locking-fix drivers/net/bonding/bond_sysfs.c
--- a/drivers/net/bonding/bond_sysfs.c~bonding-locking-fix
+++ a/drivers/net/bonding/bond_sysfs.c
@@ -1111,8 +1111,6 @@ static ssize_t bonding_store_primary(str
out:
write_unlock_bh(&bond->lock);
- rtnl_unlock();
-
return count;
}
static DEVICE_ATTR(primary, S_IRUGO | S_IWUSR, bonding_show_primary, bonding_store_primary);
_
^ permalink raw reply
* [TCP]: fack_counts more fixes (the previous ones were incomplete)
From: Ilpo Järvinen @ 2007-12-11 11:43 UTC (permalink / raw)
To: David Miller; +Cc: Netdev, Reuben Farrelly, Andrew Morton
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1959 bytes --]
Noticed later on that the things are still somewhat broken. Here's yet
another fix to that same function. In addition, I'll do later on a patch
to remove the __-version altogether.
--
i.
--
[PATCH] [TCP]: fack_counts more fixes (the previous ones were incomplete)
1) Prev NULL check should also dereference
2) The loop reorganization did make things only slightly better,
just changing the same not-updated problem to occur in
another scenario. And I also noticed that in worst case it
would be an infinite loop (could do that also before the
change), but it required losses in the same window when TCP
runs out new data. Now check really against the list heads
rather than a valid skb which should still be processed.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/net/tcp.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 11a7e3e..2d9949e 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1474,7 +1474,7 @@ static inline struct sk_buff *__tcp_reset_fack_counts(struct sock *sk,
{
unsigned int fc = 0;
- if (prev != NULL)
+ if (*prev != NULL)
fc = TCP_SKB_CB(*prev)->fack_count + tcp_skb_pcount(*prev);
BUG_ON((*prev != NULL) && !tcp_skb_adjacent(sk, *prev, skb));
@@ -1531,7 +1531,7 @@ static inline void tcp_reset_fack_counts(struct sock *sk, struct sk_buff *inskb)
skb[otherq] = prev->next;
}
- do {
+ while (skb[queue] != (struct sk_buff *)__tcp_list_select(sk, queue)) {
/* Lazy find for the other queue */
if (skb[queue] == NULL) {
skb[queue] = tcp_write_queue_find(sk, TCP_SKB_CB(prev)->seq,
@@ -1545,7 +1545,7 @@ static inline void tcp_reset_fack_counts(struct sock *sk, struct sk_buff *inskb)
break;
queue ^= TCP_WQ_SACKED;
- } while (skb[queue] != __tcp_write_queue_tail(sk, queue));
+ }
}
static inline void __tcp_insert_write_queue_after(struct sk_buff *skb,
--
1.5.0.6
^ permalink raw reply related
* [PATCH resent] virtio_net: Fix stalled inbound traffic on early packets
From: Christian Borntraeger @ 2007-12-11 11:42 UTC (permalink / raw)
To: Rusty Russell; +Cc: netdev, virtualization, kvm-devel
Hello Rusty,
while implementing and testing virtio on s390 I found a problem in
virtio_net: The current virtio_net driver has a startup race, which
prevents any incoming traffic:
If try_fill_recv submits buffers to the host system data might be
filled in and an interrupt is sent, before napi_enable finishes.
In that case the interrupt will kick skb_recv_done which will then
call netif_rx_schedule. netif_rx_schedule checks, if NAPI_STATE_SCHED
is set - which is not as we did not run napi_enable. No poll routine
is scheduled. Furthermore, skb_recv_done returns false, we disables
interrupts for this device.
One solution is the enable napi before inbound buffer are available.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
drivers/net/virtio_net.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: kvm/drivers/net/virtio_net.c
===================================================================
--- kvm.orig/drivers/net/virtio_net.c
+++ kvm/drivers/net/virtio_net.c
@@ -285,13 +285,15 @@ static int virtnet_open(struct net_devic
{
struct virtnet_info *vi = netdev_priv(dev);
+ napi_enable(&vi->napi);
try_fill_recv(vi);
/* If we didn't even get one input buffer, we're useless. */
- if (vi->num == 0)
+ if (vi->num == 0) {
+ napi_disable(&vi->napi);
return -ENOMEM;
+ }
- napi_enable(&vi->napi);
return 0;
}
^ permalink raw reply
* [PATCH resend] virtio_net: remove double ether_setup
From: Christian Borntraeger @ 2007-12-11 11:38 UTC (permalink / raw)
To: Rusty Russell, virtualization-qjLDD68F18O7TbgM5vRIOg
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
netdev-u79uwXL29TY76Z2rM5mHXA
Hello Rusty,
this is a small fix for virtio_net.
virtnet_probe already calls alloc_etherdev, which calls ether_setup.
There is no need to do that again.
Signed-off-by: Christian Borntraeger <borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
---
drivers/net/virtio_net.c | 1 -
1 file changed, 1 deletion(-)
Index: kvm/drivers/net/virtio_net.c
===================================================================
--- kvm.orig/drivers/net/virtio_net.c
+++ kvm/drivers/net/virtio_net.c
@@ -329,11 +329,10 @@ static int virtnet_probe(struct virtio_d
dev = alloc_etherdev(sizeof(struct virtnet_info));
if (!dev)
return -ENOMEM;
/* Set up network device as normal. */
- ether_setup(dev);
dev->open = virtnet_open;
dev->stop = virtnet_close;
dev->hard_start_xmit = start_xmit;
dev->features = NETIF_F_HIGHDMA;
SET_NETDEV_DEV(dev, &vdev->dev);
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
^ permalink raw reply
* Re: routing policy based on u32 classifier
From: Marco Berizzi @ 2007-12-11 11:11 UTC (permalink / raw)
To: Brian S Julin; +Cc: netdev
In-Reply-To: <5A630F46702DD1498FFD48394B4A664C347275E0@john.ad.clarku.edu>
Brian S Julin wrote:
> Marco wrote:
>
>> Brian S Julin wrote:
>>> Almost clear... why can you not just add "src <ADSL
>>> IP>" to the fwmark
>>> route to set the default source address for locally
>>> originating
>>> packets?
>>
>> IIRC, it doesn't work because netfilter isn't called in
>> ip source address selection.
>
> Ah I see. Referring to this diagram...
>
> http://www.shorewall.net/images/Netfilter.png
>
> ...and to many people I see posting about similar issues,
> you are correct in that. A process socket cannot default to
> the correct (final) source address to use if there is a
> fwmark
> rule as it stands.
>
> I'll take a wild guess and conjecture that the reason fwmark
> rules work at all for output routing is that applying a
> fwmark on OUTPUT/mangle constitutes "changing the packet"
> and qualifies it for the NAT reroute. But by the time a
> packet gets sent the source address has already been chosen.
>
> About the only suggestion I can make is that "dumb nat"
> might be more elegant if you are not already using it,
> and looking into getting squid to explicitly set its
> source address.
my solution is cleaner :-) the kernel select the ip for
squid and then it get SNATed.
Thanks for the feedback.
> In fact it may be the case with some daemons
> that even if this were fixed inside the kernel, they will
> ignore the source address configured kernel side because they
> explicitly set it (usually by a reverse of their "Listen"
> configuration.) It's likely that this could be fixed and
> squid require NAT still. Perhaps the best solution is
> for individual daemons to be given configuration options
> telling them what source addresses to use.
>
> Has anyone worked up a patch already to do this kernel
> side? I could see it being fairly complicated. You
> would have to hand the packet directly to netfilter, then
> have netfilter perform a first-run RPDB lookup only for
> packets where it needs to (or packets which it decides
> not to touch) and then a second RPDB lookup if the
> packet is modified. Might speed things up a bit for
> some cases as a side benefit but worth it? I don't
> know.
>
^ permalink raw reply
* RE: [PATCH] Increase virtual FIFOs in ucc_geth.
From: Joakim Tjernlund @ 2007-12-11 10:57 UTC (permalink / raw)
To: Li Yang; +Cc: netdev
In-Reply-To: <1197367919.6790.3.camel@gentoo-jocke.transmode.se>
On Tue, 2007-12-11 at 11:11 +0100, Joakim Tjernlund wrote:
> On Tue, 2007-12-11 at 17:49 +0800, Li Yang wrote:
> > > -----Original Message-----
> > > From: Joakim Tjernlund [mailto:Joakim.Tjernlund@transmode.se]
> > > Sent: Tuesday, December 11, 2007 2:46 AM
> > > To: Li Yang-r58472 <LeoLi@freescale.com> Netdev
> > > Cc: Joakim Tjernlund
> > > Subject: [PATCH] Increase virtual FIFOs in ucc_geth.
> > >
> > > Increase UCC_GETH_URFS_INIT to 1152 and
> > > UCC_GETH_UTFS_INIT to 896 to avoid HW Overrun/Underrun.
> >
> > Please be noted that these values are only used for 10/100Mbps speed.
> > Did you get Overrun in 10/100M mode?
>
> I get both TX Underrun and RX overrun in 100Mbps, FD, just
> by running a tftp transfer. It feels like the URFET and/or URSFET
> isn't working. Why I don't know. CPU is MPC832x
>
> Jocke
I am a bit confused how the RBMR and TBMR is supposed to work. In
ucc_get there is:
out_be32(&ugeth->p_tx_glbl_pram->tstate, ((u32) function_code) << 24);
ugeth->p_rx_glbl_pram->rstate = function_code;
First, should not the rx part look the same as tx?
Does programing rstate/tstate replace RBMR and TBMR?
Jocke
^ permalink raw reply
* Re: [PATCH] vlan: fix potential race in vlan_cleanup_module vs vlan_ioctl_handler
From: David Miller @ 2007-12-11 10:41 UTC (permalink / raw)
To: kaber; +Cc: xemul, netdev, devel
In-Reply-To: <475E68AE.6090708@trash.net>
From: Patrick McHardy <kaber@trash.net>
Date: Tue, 11 Dec 2007 11:38:38 +0100
> Pavel Emelyanov wrote:
> > AFAIS there's a tiny race window between these two
> > calls - after rtnl unregistered all the vlans, but
> > the ioctl handler isn't set to NULL yet, user can
> > manage to call this ioctl and create one vlan device,
> > and that this function will later BUG_ON seeing
> > non-emply hashes.
>
> Indeed, I can't see anything preventing this.
>
> > I think, that we must first close the vlan ioctl
> > and only after this remove all the vlans with the
> > vlan_netlink_fini() call.
>
> That looks correct, thanks Pavel. Dave, please apply.
Applied to net-2.6, thanks!
^ permalink raw reply
* Re: [PATCH] vlan: fix potential race in vlan_cleanup_module vs vlan_ioctl_handler
From: Patrick McHardy @ 2007-12-11 10:38 UTC (permalink / raw)
To: Pavel Emelyanov; +Cc: David Miller, Linux Netdev List, devel
In-Reply-To: <475E6587.1090306@openvz.org>
Pavel Emelyanov wrote:
> The vlan module cleanup function starts with
>
> vlan_netlink_fini();
> vlan_ioctl_set(NULL);
>
> The first call removes all the vlan devices and
> the second one closes the vlan ioctl.
>
> AFAIS there's a tiny race window between these two
> calls - after rtnl unregistered all the vlans, but
> the ioctl handler isn't set to NULL yet, user can
> manage to call this ioctl and create one vlan device,
> and that this function will later BUG_ON seeing
> non-emply hashes.
Indeed, I can't see anything preventing this.
> I think, that we must first close the vlan ioctl
> and only after this remove all the vlans with the
> vlan_netlink_fini() call.
That looks correct, thanks Pavel. Dave, please apply.
^ permalink raw reply
* Re: [PATCH] [NET]: Fix Ooops of napi net_rx_action.
From: David Miller @ 2007-12-11 10:32 UTC (permalink / raw)
To: joonwpark81; +Cc: netdev, linux-kernel
In-Reply-To: <001801c83bd6$2001d410$9c94fea9@jason>
From: "Joonwoo Park" <joonwpark81@gmail.com>
Date: Tue, 11 Dec 2007 18:13:34 +0900
Joonwoo-ssi annyoung haseyo,
> [NET]: Fix Ooops of napi net_rx_action.
> Before doing list_move_tail napi poll_list, it should be ensured
>
> Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
> ---
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 86d6261..74bd5ab 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2207,7 +2207,8 @@ static void net_rx_action(struct softirq_action *h)
> * still "owns" the NAPI instance and therefore can
> * move the instance around on the list at-will.
> */
> - if (unlikely(work == weight))
> + if (unlikely((test_bit(NAPI_STATE_SCHED, &n->state))
> + && (work == weight)))
> list_move_tail(&n->poll_list, list);
>
> netpoll_poll_unlock(have);
How can the NAPI_STATE_SCHED bit be cleared externally yet we take
this list_move_tail() code path?
If NAPI_STATE_SCHED is cleared, work will be zero which will never be
equal to 'weight', and this we'll never attempt the list_move_tail().
If something clears NAPI_STATE_SCHED meanwhile, we have a serious race
and your patch is an incomplete bandaid. For example, if it can
happen, then a case like:
if (test_bit(NAPI_STATE_SCHED, &n->state))
... something clears NAPI_STATE_SCHED right now ...
work = n->poll(n, weight);
can crash too.
^ permalink raw reply
* Re: [PATCH] NET: Fix wrong comments for unregister_net*
From: David Miller @ 2007-12-11 10:28 UTC (permalink / raw)
To: wangchen; +Cc: netdev
In-Reply-To: <475E4F42.8060102@cn.fujitsu.com>
From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Tue, 11 Dec 2007 16:50:10 +0800
> [PATCH] NET: Fix wrong comments for unregister_net*
>
> There are some return value comments for void functions.
> Fixed it.
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Applied to net-2.6, thanks!
^ permalink raw reply
* Re: [PATCH 2.6.25] netns: struct net content re-work
From: David Miller @ 2007-12-11 10:27 UTC (permalink / raw)
To: den; +Cc: ebiederm, den, containers, netdev, herbert
In-Reply-To: <475E3D59.10804@sw.ru>
From: "Denis V. Lunev" <den@sw.ru>
Date: Tue, 11 Dec 2007 10:33:45 +0300
> Eric W. Biederman wrote:
> > The idea of separate structures make sense, and seems needed and useful.
> >
> > "Denis V. Lunev" <den@openvz.org> writes:
> >
> >> diff --git a/include/net/netns/unix.h b/include/net/netns/unix.h
> >> new file mode 100644
> >> index 0000000..27b4e7f
> >> --- /dev/null
> >> +++ b/include/net/netns/unix.h
> > ^^^^^^
> > Given that we are making this per protocol adding a separate directory
> > to hold them seems to be the wrong grouping. Ideally we want everything
> > for the protocol all together in the same location so it is easy
> > to find. Possibly with a user/kernel split.
> >
> > So perhaps unix_net.h
> The idea was simple:
> - I can name 5 files right now
> - I want them to be shown to gather by ls
> - so, there are 2 ways, namely:
> # include/net/netns/unix.h
> # include/net/netns-unix.h
I have no real objection to the new directory.
^ permalink raw reply
* Re: [PATCH 2.6.25] netns: struct net content re-work (v2)
From: David Miller @ 2007-12-11 10:27 UTC (permalink / raw)
To: den; +Cc: containers, devel, netdev, herbert
In-Reply-To: <20071211074504.GA8334@iris.sw.ru>
From: "Denis V. Lunev" <den@openvz.org>
Date: Tue, 11 Dec 2007 10:45:04 +0300
> Changes from v1:
> - renamed fields according to Daniel Lezcano suggestion
More changes from v1:
- Forgot to include net/netns/unix.h in the patch
Please fix this :-)
^ permalink raw reply
* Re: [patch 5/5] ipv6: make the protocol initialization to return an error code
From: David Miller @ 2007-12-11 10:25 UTC (permalink / raw)
To: dlezcano; +Cc: yoshfuji, pekkas, netdev
In-Reply-To: <20071210151440.241406358@ICON-9-164-138-215.megacenter.de.ibm.com>
From: Daniel Lezcano <dlezcano@fr.ibm.com>
Date: Mon, 10 Dec 2007 16:09:15 +0100
> This patchset makes the different protocols to return an error code, so
> the af_inet6 module can check the initialization was correct or not.
>
> The raw6 was taken into account to be consistent with the rest of the
> protocols, but the registration is at the same place.
> Because the raw6 has its own init function, the proto and the ops structure
> can be moved inside the raw6.c file.
>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Also applied, thanks Daniel.
^ permalink raw reply
* [PATCH] vlan: fix potential race in vlan_cleanup_module vs vlan_ioctl_handler
From: Pavel Emelyanov @ 2007-12-11 10:25 UTC (permalink / raw)
To: David Miller, Patrick McHardy; +Cc: Linux Netdev List, devel
The vlan module cleanup function starts with
vlan_netlink_fini();
vlan_ioctl_set(NULL);
The first call removes all the vlan devices and
the second one closes the vlan ioctl.
AFAIS there's a tiny race window between these two
calls - after rtnl unregistered all the vlans, but
the ioctl handler isn't set to NULL yet, user can
manage to call this ioctl and create one vlan device,
and that this function will later BUG_ON seeing
non-emply hashes.
I think, that we must first close the vlan ioctl
and only after this remove all the vlans with the
vlan_netlink_fini() call.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 5b18315..4add9bd 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -124,8 +124,8 @@ static void __exit vlan_cleanup_module(void)
{
int i;
- vlan_netlink_fini();
vlan_ioctl_set(NULL);
+ vlan_netlink_fini();
/* Un-register us from receiving netdevice events */
unregister_netdevice_notifier(&vlan_notifier_block);
^ permalink raw reply related
* Re: [patch 4/5] ipv6: make inet6_register_protosw to return an error code
From: David Miller @ 2007-12-11 10:25 UTC (permalink / raw)
To: dlezcano; +Cc: yoshfuji, pekkas, netdev
In-Reply-To: <20071210151437.362338020@ICON-9-164-138-215.megacenter.de.ibm.com>
From: Daniel Lezcano <dlezcano@fr.ibm.com>
Date: Mon, 10 Dec 2007 16:09:14 +0100
> This patch makes the inet6_register_protosw to return an error code.
> The different protocols can be aware the registration was successful or
> not and can pass the error to the initial caller, af_inet6.
>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Applied.
^ permalink raw reply
* Re: [patch 3/5] ipv6: make frag to return an error at initialization
From: David Miller @ 2007-12-11 10:24 UTC (permalink / raw)
To: dlezcano; +Cc: yoshfuji, pekkas, netdev
In-Reply-To: <20071210151434.595423844@ICON-9-164-138-215.megacenter.de.ibm.com>
From: Daniel Lezcano <dlezcano@fr.ibm.com>
Date: Mon, 10 Dec 2007 16:09:13 +0100
> This patch makes the frag_init to return an error code, so the af_inet6
> module can handle the error.
>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Applied, thanks!
^ permalink raw reply
* Re: [patch 2/5] ipv6: make extended headers to return an error at initialization
From: David Miller @ 2007-12-11 10:24 UTC (permalink / raw)
To: dlezcano; +Cc: yoshfuji, pekkas, netdev
In-Reply-To: <20071210151431.005904948@ICON-9-164-138-215.megacenter.de.ibm.com>
From: Daniel Lezcano <dlezcano@fr.ibm.com>
Date: Mon, 10 Dec 2007 16:09:12 +0100
> This patch factorize the code for the differents init functions for rthdr,
> nodata, destopt in a single function exthdrs_init.
> This function returns an error so the af_inet6 module can check correctly
> the initialization.
>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Applied.
^ permalink raw reply
* Re: [patch 1/5] ipv6: make flowlabel to return an error
From: David Miller @ 2007-12-11 10:23 UTC (permalink / raw)
To: dlezcano; +Cc: yoshfuji, pekkas, netdev
In-Reply-To: <20071210151425.106827965@ICON-9-164-138-215.megacenter.de.ibm.com>
From: Daniel Lezcano <dlezcano@fr.ibm.com>
Date: Mon, 10 Dec 2007 16:09:11 +0100
> This patch makes the flowlab subsystem to return an error code and makes
> some cleanup with procfs ifdefs.
> The af_inet6 will use the flowlabel init return code to check the initialization
> was correct.
>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Applied.
^ 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