* [PATCH 17/20] IPVS: Minimise ip_vs_leave when CONFIG_SYSCTL is undefined
From: Simon Horman @ 2011-03-14 3:45 UTC (permalink / raw)
To: netdev, netfilter-devel, netfilter, lvs-devel
Cc: Eric Dumazet, Julian Anastasov, Hans Schillstrom, Simon Horman
In-Reply-To: <1300074346-13799-1-git-send-email-horms@verge.net.au>
Much of ip_vs_leave() is unnecessary if CONFIG_SYSCTL is undefined.
I tried an approach of breaking the now #ifdef'ed portions out
into a separate function. However this appeared to grow the
compiled code on x86_64 by about 200 bytes in the case where
CONFIG_SYSCTL is defined. So I have gone with the simpler though
less elegant #ifdef'ed solution for now.
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_core.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index d418bc6..07accf6 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -499,11 +499,13 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
struct ip_vs_proto_data *pd)
{
- struct net *net;
- struct netns_ipvs *ipvs;
__be16 _ports[2], *pptr;
struct ip_vs_iphdr iph;
+#ifdef CONFIG_SYSCTL
+ struct net *net;
+ struct netns_ipvs *ipvs;
int unicast;
+#endif
ip_vs_fill_iphdr(svc->af, skb_network_header(skb), &iph);
@@ -512,6 +514,8 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
ip_vs_service_put(svc);
return NF_DROP;
}
+
+#ifdef CONFIG_SYSCTL
net = skb_net(skb);
#ifdef CONFIG_IP_VS_IPV6
@@ -563,6 +567,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
ip_vs_conn_put(cp);
return ret;
}
+#endif
/*
* When the virtual ftp service is presented, packets destined
--
1.7.2.3
^ permalink raw reply related
* [PATCH 20/20] IPVS: Conditionally include sysctl members of struct netns_ipvs
From: Simon Horman @ 2011-03-14 3:45 UTC (permalink / raw)
To: netdev, netfilter-devel, netfilter, lvs-devel
Cc: Eric Dumazet, Julian Anastasov, Hans Schillstrom, Simon Horman
In-Reply-To: <1300074346-13799-1-git-send-email-horms@verge.net.au>
There is now no need to include sysctl members of struct netns_ipvs
unless CONFIG_SYSCTL is defined.
Signed-off-by: Simon Horman <horms@verge.net.au>
---
include/net/ip_vs.h | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 299aeb5..272f593 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -839,6 +839,17 @@ struct netns_ipvs {
struct ip_vs_stats tot_stats; /* Statistics & est. */
int num_services; /* no of virtual services */
+
+ rwlock_t rs_lock; /* real services table */
+ /* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */
+ struct lock_class_key ctl_key; /* ctl_mutex debuging */
+ /* Trash for destinations */
+ struct list_head dest_trash;
+ /* Service counters */
+ atomic_t ftpsvc_counter;
+ atomic_t nullsvc_counter;
+
+#ifdef CONFIG_SYSCTL
/* 1/rate drop and drop-entry variables */
struct delayed_work defense_work; /* Work handler */
int drop_rate;
@@ -848,18 +859,12 @@ struct netns_ipvs {
spinlock_t dropentry_lock; /* drop entry handling */
spinlock_t droppacket_lock; /* drop packet handling */
spinlock_t securetcp_lock; /* state and timeout tables */
- rwlock_t rs_lock; /* real services table */
- /* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */
- struct lock_class_key ctl_key; /* ctl_mutex debuging */
- /* Trash for destinations */
- struct list_head dest_trash;
- /* Service counters */
- atomic_t ftpsvc_counter;
- atomic_t nullsvc_counter;
/* sys-ctl struct */
struct ctl_table_header *sysctl_hdr;
struct ctl_table *sysctl_tbl;
+#endif
+
/* sysctl variables */
int sysctl_amemthresh;
int sysctl_am_droprate;
--
1.7.2.3
^ permalink raw reply related
* [PATCH 16/20] IPVS: Conditional ip_vs_conntrack_enabled()
From: Simon Horman @ 2011-03-14 3:45 UTC (permalink / raw)
To: netdev, netfilter-devel, netfilter, lvs-devel
Cc: Eric Dumazet, Julian Anastasov, Hans Schillstrom, Simon Horman
In-Reply-To: <1300074346-13799-1-git-send-email-horms@verge.net.au>
ip_vs_conntrack_enabled() becomes a noop when CONFIG_SYSCTL is undefined.
In preparation for not including sysctl_conntrack in
struct netns_ipvs when CONFIG_SYCTL is not defined.
Signed-off-by: Simon Horman <horms@verge.net.au>
---
include/net/ip_vs.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 77ebece..299aeb5 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1359,7 +1359,11 @@ static inline void ip_vs_notrack(struct sk_buff *skb)
*/
static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs)
{
+#ifdef CONFIG_SYSCTL
return ipvs->sysctl_conntrack;
+#else
+ return 0;
+#endif
}
extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
--
1.7.2.3
^ permalink raw reply related
* Re: [PATCH 03/20] ipvs: properly zero stats and rates
From: Eric Dumazet @ 2011-03-14 4:09 UTC (permalink / raw)
To: Simon Horman
Cc: netdev, netfilter-devel, netfilter, lvs-devel, Julian Anastasov,
Hans Schillstrom
In-Reply-To: <1300074346-13799-4-git-send-email-horms@verge.net.au>
Le lundi 14 mars 2011 à 12:45 +0900, Simon Horman a écrit :
> From: Julian Anastasov <ja@ssi.bg>
>
> Currently, the new percpu counters are not zeroed and
> the zero commands do not work as expected, we still show the old
> sum of percpu values. OTOH, we can not reset the percpu counters
> from user context without causing the incrementing to use old
> and bogus values.
>
> So, as Eric Dumazet suggested fix that by moving all overhead
> to stats reading in user context. Do not introduce overhead in
> timer context (estimator) and incrementing (packet handling in
> softirqs).
>
> The new ustats0 field holds the zero point for all
> counter values, the rates always use 0 as base value as before.
> When showing the values to user space just give the difference
> between counters and the base values. The only drawback is that
> percpu stats are not zeroed, they are accessible only from /proc
> and are new interface, so it should not be a compatibility problem
> as long as the sum stats are correct after zeroing.
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
^ permalink raw reply
* [PATCH net-next-2.6] inetpeer: should use call_rcu() variant
From: Eric Dumazet @ 2011-03-14 4:15 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20110313.164215.193721466.davem@davemloft.net>
Le dimanche 13 mars 2011 à 16:42 -0700, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Sun, 13 Mar 2011 11:04:09 +0100
>
> > David, I am not sure this is safe, since we use call_rcu_bh() when
> > freeing one item. One cpu could decide to kfree() one item while another
> > cpu could still use it.
> >
> > rcu_read_lock_bh() was signalling to others cpu we were in a softirq
> > section, so we were delaying a possible kfree().
>
> Ok, could we use normal call_rcu() to solve this then?
Yes, this should be good.
Thanks
[PATCH net-next-2.6] inetpeer: should use call_rcu() variant
After commit 7b46ac4e77f3224a (inetpeer: Don't disable BH for initial
fast RCU lookup.), we should use call_rcu() to wait proper RCU grace
period.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv4/inetpeer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 86b1d08..dd1b20e 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -399,7 +399,7 @@ static void unlink_from_pool(struct inet_peer *p, struct inet_peer_base *base)
write_sequnlock_bh(&base->lock);
if (do_free)
- call_rcu_bh(&p->rcu, inetpeer_free_rcu);
+ call_rcu(&p->rcu, inetpeer_free_rcu);
else
/* The node is used again. Decrease the reference counter
* back. The loop "cleanup -> unlink_from_unused
^ permalink raw reply related
* linux-next: build failure after merge of the net tree
From: Stephen Rothwell @ 2011-03-14 4:24 UTC (permalink / raw)
To: David Miller, netdev
Cc: linux-next, linux-kernel, Ben Hutchings, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, Peter Zijlstra
[-- Attachment #1: Type: text/plain, Size: 820 bytes --]
Hi all,
After merging the net tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:
kernel/irq/manage.c: In function 'irq_affinity_notify':
kernel/irq/manage.c:182: error: 'struct irq_desc' has no member named 'affinity'
Caused by commit cd7eab44e994 ("genirq: Add IRQ affinity notifiers")
(which is also in the tip tree). I am guessing that there is a fix for
this also in the tip tree ... yep commit 1fb0ef31f428 ("genirq: Fix
affinity notifier fallout").
I tried using the net tree from next-20110311 for today but that had the
same problem. So I merged the above fix commit from the tip tree.
I have no idea why this has suddenly become a problem in the net tree.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: [PATCH 02/20] ipvs: reorganize tot_stats
From: Eric Dumazet @ 2011-03-14 4:28 UTC (permalink / raw)
To: Simon Horman
Cc: netdev, netfilter-devel, netfilter, lvs-devel, Julian Anastasov,
Hans Schillstrom
In-Reply-To: <1300074346-13799-3-git-send-email-horms@verge.net.au>
Le lundi 14 mars 2011 à 12:45 +0900, Simon Horman a écrit :
> From: Julian Anastasov <ja@ssi.bg>
>
> The global tot_stats contains cpustats field just like the
> stats for dest and svc, so better use it to simplify the usage
> in estimation_timer. As tot_stats is registered as estimator
> we can remove the special ip_vs_read_cpu_stats call for
> tot_stats. Fix ip_vs_read_cpu_stats to be called under
> stats lock because it is still used as synchronization between
> estimation timer and user context (the stats readers).
>
> Also, make sure ip_vs_stats_percpu_show reads properly
> the u64 stats from user context.
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> Signed-off-by: Simon Horman <horms@verge.net.au>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
One comment : per cpu stats are really good to avoid cache misses, but I
see tot_stats is included in struct netns_ipvs right after "conn_count",
possibly sharing a hot cache line ?
Thanks
^ permalink raw reply
* Re: linux-next: build failure after merge of the net tree
From: Ben Hutchings @ 2011-03-14 4:59 UTC (permalink / raw)
To: Stephen Rothwell
Cc: David Miller, netdev, linux-next, linux-kernel, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, Peter Zijlstra
In-Reply-To: <20110314152456.b49b2693.sfr@canb.auug.org.au>
On Mon, 2011-03-14 at 15:24 +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the net tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> kernel/irq/manage.c: In function 'irq_affinity_notify':
> kernel/irq/manage.c:182: error: 'struct irq_desc' has no member named 'affinity'
>
> Caused by commit cd7eab44e994 ("genirq: Add IRQ affinity notifiers")
> (which is also in the tip tree). I am guessing that there is a fix for
> this also in the tip tree ... yep commit 1fb0ef31f428 ("genirq: Fix
> affinity notifier fallout").
>
> I tried using the net tree from next-20110311 for today but that had the
> same problem. So I merged the above fix commit from the tip tree.
>
> I have no idea why this has suddenly become a problem in the net tree.
Commit cd7eab44e994 ("genirq: Add IRQ affinity notifiers") was a
prerequisite for some changes in networking. Thomas Gleixner applied it
on a branch of its own so that David Miller could pull just that commit
into net-next-2.6. Of course, this means net-next-2.6 doesn't have the
later fix (and won't for a while).
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [patch net-next-2.6 5/6] bonding: get rid of IFF_SLAVE_INACTIVE netdev->priv_flag
From: WANG Cong @ 2011-03-14 5:29 UTC (permalink / raw)
To: netdev
In-Reply-To: <1299935679-18135-6-git-send-email-jpirko@redhat.com>
On Sat, 12 Mar 2011 14:14:38 +0100, Jiri Pirko wrote:
> Since bond-related code was moved from net/core/dev.c into bonding,
> IFF_SLAVE_INACTIVE is no longer needed. Replace is with flag "inactive"
> stored in slave structure
>
Good work, Jiri!
IFF_ flags are valuable and are going to be exhausted, moving
these slave-specific flags to struct slave is indeed good.
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Thanks.
^ permalink raw reply
* Re: linux-next: build failure after merge of the net tree
From: Stephen Rothwell @ 2011-03-14 5:31 UTC (permalink / raw)
To: Ben Hutchings
Cc: David Miller, netdev, linux-next, linux-kernel, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, Peter Zijlstra
In-Reply-To: <1300078778.3962.22.camel@localhost>
[-- Attachment #1: Type: text/plain, Size: 720 bytes --]
Hi Ben,
On Mon, 14 Mar 2011 04:59:38 +0000 Ben Hutchings <bhutchings@solarflare.com> wrote:
>
> Commit cd7eab44e994 ("genirq: Add IRQ affinity notifiers") was a
> prerequisite for some changes in networking. Thomas Gleixner applied it
> on a branch of its own so that David Miller could pull just that commit
> into net-next-2.6. Of course, this means net-next-2.6 doesn't have the
> later fix (and won't for a while).
Yeah, but Dave merged that into the net-next-2.6 tree some time ago
(late January) and it hasn't caused a problem in my builds until now.
Maybe some config option changed ...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: linux-next: build failure after merge of the net tree
From: David Miller @ 2011-03-14 5:53 UTC (permalink / raw)
To: sfr; +Cc: bhutchings, netdev, linux-next, linux-kernel, tglx, mingo, hpa,
peterz
In-Reply-To: <20110314163135.f366742e.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 14 Mar 2011 16:31:35 +1100
> Maybe some config option changed ...
Perhaps GENERIC_HARDIRQS_NO_DEPRECATED?
^ permalink raw reply
* Re: [Patch V2] bonding: fix netpoll in active-backup mode
From: Cong Wang @ 2011-03-14 6:04 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: linux-kernel, Neil Horman, Jay Vosburgh, netdev
In-Reply-To: <20110311143557.GY11864@gospo.rdu.redhat.com>
于 2011年03月11日 22:35, Andy Gospodarek 写道:
>
> I'm happy to submit the patch if it works in your environment.
>
> I do not think anyone likes un-tested patches.
>
Just test it by hands, it works, you can add
Tested-by: WANG Cong <amwang@redhat.com>
Thanks!
^ permalink raw reply
* Re: linux-next: build failure after merge of the net tree
From: Stephen Rothwell @ 2011-03-14 6:05 UTC (permalink / raw)
To: David Miller
Cc: bhutchings, netdev, linux-next, linux-kernel, tglx, mingo, hpa,
peterz
In-Reply-To: <20110313.225312.193696949.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 538 bytes --]
Hi Dave,
On Sun, 13 Mar 2011 22:53:12 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 14 Mar 2011 16:31:35 +1100
>
> > Maybe some config option changed ...
>
> Perhaps GENERIC_HARDIRQS_NO_DEPRECATED?
Yep, that has been turned on for powerpc now. I guess you will have the
same problem on sparc64 of you merge the net-next and sparc trees ...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: linux-next: build failure after merge of the net tree
From: David Miller @ 2011-03-14 6:18 UTC (permalink / raw)
To: sfr; +Cc: bhutchings, netdev, linux-next, linux-kernel, tglx, mingo, hpa,
peterz
In-Reply-To: <20110314170546.af552b4e.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 14 Mar 2011 17:05:46 +1100
> On Sun, 13 Mar 2011 22:53:12 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
>>
>> From: Stephen Rothwell <sfr@canb.auug.org.au>
>> Date: Mon, 14 Mar 2011 16:31:35 +1100
>>
>> > Maybe some config option changed ...
>>
>> Perhaps GENERIC_HARDIRQS_NO_DEPRECATED?
>
> Yep, that has been turned on for powerpc now. I guess you will have the
> same problem on sparc64 of you merge the net-next and sparc trees ...
I've done this as recently as last night, and for some reason I have no
build problems.
^ permalink raw reply
* Re: [PATCH net-next-2.6] inetpeer: should use call_rcu() variant
From: David Miller @ 2011-03-14 6:22 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1300076131.2761.61.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 14 Mar 2011 05:15:31 +0100
> [PATCH net-next-2.6] inetpeer: should use call_rcu() variant
>
> After commit 7b46ac4e77f3224a (inetpeer: Don't disable BH for initial
> fast RCU lookup.), we should use call_rcu() to wait proper RCU grace
> period.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks a lot Eric.
^ permalink raw reply
* Re: [PATCH 3/3] tcp_cubic: fix low utilization of CUBIC with HyStart
From: Lucas Nussbaum @ 2011-03-14 6:28 UTC (permalink / raw)
To: Sangtae Ha
Cc: Stephen Hemminger, David Miller, Injong Rhee, Bill Fink, netdev
In-Reply-To: <AANLkTi=bO+7d7W0O-m4=62xcM5P2qao9pzOyPJ1-jtox@mail.gmail.com>
On 13/03/11 at 19:07 -0500, Sangtae Ha wrote:
> Hi Lucas,
>
> Thank you for reporting this problem and the results below show what
> happened with low resolution clocks.
> The detailed testing setup and results at
> http://netsrv.csc.ncsu.edu/wiki/index.php/HyStart_testing_between_Princeton_and_NCSU
> I will add the results in long rtt paths soon.
Thanks. What do you use to generate those graphs?
The graphs from HyStart(fixed) are a bit strange. Did HyStart really
detect something? It seems that it exited slow start due to losses, not
due to detection, since cwnd is decreased.
--
| Lucas Nussbaum MCF Université Nancy 2 |
| lucas.nussbaum@loria.fr LORIA / AlGorille |
| http://www.loria.fr/~lnussbau/ +33 3 54 95 86 19 |
^ permalink raw reply
* [PATCH 1/4] netfilter: xt_connlimit: fix daddr connlimit in SNAT scenario
From: Changli Gao @ 2011-03-14 6:50 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netfilter-devel, netdev, Changli Gao
We use the reply tuples when limiting the connections by the destination
addresses, however, in SNAT scenario, the final reply tuples won't be
ready until SNAT is done in POSTROUING or INPUT chain, and the following
nf_conntrack_find_get() in count_tem() will get nothing, so connlimit
can't work as expected.
In this patch, the original tuples are always used, and an additional
member addr is appended to save the address in either end.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
net/netfilter/xt_connlimit.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index e029c48..1f4b9f9 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -33,8 +33,9 @@
/* we will save the tuples of all connections we care about */
struct xt_connlimit_conn {
- struct list_head list;
- struct nf_conntrack_tuple tuple;
+ struct list_head list;
+ struct nf_conntrack_tuple tuple;
+ union nf_inet_addr addr;
};
struct xt_connlimit_data {
@@ -151,7 +152,7 @@ static int count_them(struct net *net,
continue;
}
- if (same_source_net(addr, mask, &conn->tuple.src.u3, family))
+ if (same_source_net(addr, mask, &conn->addr, family))
/* same source network -> be counted! */
++matches;
nf_ct_put(found_ct);
@@ -165,6 +166,7 @@ static int count_them(struct net *net,
if (conn == NULL)
return -ENOMEM;
conn->tuple = *tuple;
+ conn->addr = *addr;
list_add(&conn->list, hash);
++matches;
}
@@ -185,15 +187,11 @@ connlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
int connections;
ct = nf_ct_get(skb, &ctinfo);
- if (ct != NULL) {
- if (info->flags & XT_CONNLIMIT_DADDR)
- tuple_ptr = &ct->tuplehash[IP_CT_DIR_REPLY].tuple;
- else
- tuple_ptr = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple;
- } else if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb),
- par->family, &tuple)) {
+ if (ct != NULL)
+ tuple_ptr = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple;
+ else if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb),
+ par->family, &tuple))
goto hotdrop;
- }
if (par->family == NFPROTO_IPV6) {
const struct ipv6hdr *iph = ipv6_hdr(skb);
^ permalink raw reply related
* [PATCH 2/4] netfilter: xt_connlimit: use kmalloc() instead of kzalloc()
From: Changli Gao @ 2011-03-14 6:50 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netfilter-devel, netdev, Changli Gao
In-Reply-To: <1300085414-27275-1-git-send-email-xiaosuo@gmail.com>
All the members are initialized after kzalloc().
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
net/netfilter/xt_connlimit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index 1f4b9f9..ade2a80 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -162,7 +162,7 @@ static int count_them(struct net *net,
if (addit) {
/* save the new connection in our list */
- conn = kzalloc(sizeof(*conn), GFP_ATOMIC);
+ conn = kmalloc(sizeof(*conn), GFP_ATOMIC);
if (conn == NULL)
return -ENOMEM;
conn->tuple = *tuple;
^ permalink raw reply related
* [PATCH 3/4] netfilter: xt_connlimit: use hlist instead
From: Changli Gao @ 2011-03-14 6:50 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netfilter-devel, netdev, Changli Gao
In-Reply-To: <1300085414-27275-1-git-send-email-xiaosuo@gmail.com>
The header of hlist is smaller than list.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
net/netfilter/xt_connlimit.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index ade2a80..da56d6e 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -33,14 +33,14 @@
/* we will save the tuples of all connections we care about */
struct xt_connlimit_conn {
- struct list_head list;
+ struct hlist_node node;
struct nf_conntrack_tuple tuple;
union nf_inet_addr addr;
};
struct xt_connlimit_data {
- struct list_head iphash[256];
- spinlock_t lock;
+ struct hlist_head iphash[256];
+ spinlock_t lock;
};
static u_int32_t connlimit_rnd __read_mostly;
@@ -102,9 +102,9 @@ static int count_them(struct net *net,
{
const struct nf_conntrack_tuple_hash *found;
struct xt_connlimit_conn *conn;
- struct xt_connlimit_conn *tmp;
+ struct hlist_node *pos, *n;
struct nf_conn *found_ct;
- struct list_head *hash;
+ struct hlist_head *hash;
bool addit = true;
int matches = 0;
@@ -116,7 +116,7 @@ static int count_them(struct net *net,
rcu_read_lock();
/* check the saved connections */
- list_for_each_entry_safe(conn, tmp, hash, list) {
+ hlist_for_each_entry_safe(conn, pos, n, hash, node) {
found = nf_conntrack_find_get(net, NF_CT_DEFAULT_ZONE,
&conn->tuple);
found_ct = NULL;
@@ -136,7 +136,7 @@ static int count_them(struct net *net,
if (found == NULL) {
/* this one is gone */
- list_del(&conn->list);
+ hlist_del(&conn->node);
kfree(conn);
continue;
}
@@ -147,7 +147,7 @@ static int count_them(struct net *net,
* closed already -> ditch it
*/
nf_ct_put(found_ct);
- list_del(&conn->list);
+ hlist_del(&conn->node);
kfree(conn);
continue;
}
@@ -167,7 +167,7 @@ static int count_them(struct net *net,
return -ENOMEM;
conn->tuple = *tuple;
conn->addr = *addr;
- list_add(&conn->list, hash);
+ hlist_add_head(&conn->node, hash);
++matches;
}
@@ -246,7 +246,7 @@ static int connlimit_mt_check(const struct xt_mtchk_param *par)
spin_lock_init(&info->data->lock);
for (i = 0; i < ARRAY_SIZE(info->data->iphash); ++i)
- INIT_LIST_HEAD(&info->data->iphash[i]);
+ INIT_HLIST_HEAD(&info->data->iphash[i]);
return 0;
}
@@ -255,15 +255,15 @@ static void connlimit_mt_destroy(const struct xt_mtdtor_param *par)
{
const struct xt_connlimit_info *info = par->matchinfo;
struct xt_connlimit_conn *conn;
- struct xt_connlimit_conn *tmp;
- struct list_head *hash = info->data->iphash;
+ struct hlist_node *pos, *n;
+ struct hlist_head *hash = info->data->iphash;
unsigned int i;
nf_ct_l3proto_module_put(par->family);
for (i = 0; i < ARRAY_SIZE(info->data->iphash); ++i) {
- list_for_each_entry_safe(conn, tmp, &hash[i], list) {
- list_del(&conn->list);
+ hlist_for_each_entry_safe(conn, pos, n, &hash[i], node) {
+ hlist_del(&conn->node);
kfree(conn);
}
}
^ permalink raw reply related
* [PATCH 4/4] netfilter: xt_connlimit: remove connlimit_rnd_inited
From: Changli Gao @ 2011-03-14 6:50 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netfilter-devel, netdev, Changli Gao
In-Reply-To: <1300085414-27275-1-git-send-email-xiaosuo@gmail.com>
A potential race condition when generating connlimit_rnd is also fixed.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
net/netfilter/xt_connlimit.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index da56d6e..c6d5a83 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -44,7 +44,6 @@ struct xt_connlimit_data {
};
static u_int32_t connlimit_rnd __read_mostly;
-static bool connlimit_rnd_inited __read_mostly;
static inline unsigned int connlimit_iphash(__be32 addr)
{
@@ -226,9 +225,13 @@ static int connlimit_mt_check(const struct xt_mtchk_param *par)
unsigned int i;
int ret;
- if (unlikely(!connlimit_rnd_inited)) {
- get_random_bytes(&connlimit_rnd, sizeof(connlimit_rnd));
- connlimit_rnd_inited = true;
+ if (unlikely(!connlimit_rnd)) {
+ u_int32_t rand;
+
+ do {
+ get_random_bytes(&rand, sizeof(rand));
+ } while (!rand);
+ cmpxchg(&connlimit_rnd, 0, rand);
}
ret = nf_ct_l3proto_try_module_get(par->family);
if (ret < 0) {
^ permalink raw reply related
* Re: [patch net-next-2.6 1/6] af_packet: use skb->skb_iif instead of orig_dev->ifindex
From: Jiri Pirko @ 2011-03-14 6:54 UTC (permalink / raw)
To: Changli Gao
Cc: netdev, davem, shemminger, kaber, fubar, eric.dumazet,
nicolas.2p.debian, andy
In-Reply-To: <AANLkTimkUQ7JPAozRWnYgfwGu5wqeY-ikfdmWEGeUkrK@mail.gmail.com>
Mon, Mar 14, 2011 at 12:52:37AM CET, xiaosuo@gmail.com wrote:
>On Sat, Mar 12, 2011 at 9:14 PM, Jiri Pirko <jpirko@redhat.com> wrote:
>> Since skb_iif has the desired value (ifindex of physical device actually
>> received the traffic) use that instead.
>>
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>> Reviewed-by: Changli Gao <xiaosuo@gmail.com>
>> Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
>> ---
>
>This may "break" the ptype handlers in TX path, as we always assign
>skb->dev to origdev there. Thanks.
Changli, would you please point me the relevant code?. Thanks!
Jirka
>
>--
>Regards,
>Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [patch net-next-2.6 1/6] af_packet: use skb->skb_iif instead of orig_dev->ifindex
From: Changli Gao @ 2011-03-14 6:59 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, shemminger, kaber, fubar, eric.dumazet,
nicolas.2p.debian, andy
In-Reply-To: <20110314065454.GA2751@psychotron.redhat.com>
On Mon, Mar 14, 2011 at 2:54 PM, Jiri Pirko <jpirko@redhat.com> wrote:
> Mon, Mar 14, 2011 at 12:52:37AM CET, xiaosuo@gmail.com wrote:
>>On Sat, Mar 12, 2011 at 9:14 PM, Jiri Pirko <jpirko@redhat.com> wrote:
>>> Since skb_iif has the desired value (ifindex of physical device actually
>>> received the traffic) use that instead.
>>>
>>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>>> Reviewed-by: Changli Gao <xiaosuo@gmail.com>
>>> Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
>>> ---
>>
>>This may "break" the ptype handlers in TX path, as we always assign
>>skb->dev to origdev there. Thanks.
>
> Changli, would you please point me the relevant code?. Thanks!
>
1557 static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
....
1571 if (pt_prev) {
1572 deliver_skb(skb2, pt_prev, skb->dev);
1573 pt_prev = ptype;
1574 continue;
1575 }
...
1603 }
1604 if (pt_prev)
1605 pt_prev->func(skb2, skb->dev, pt_prev, skb->dev);
1606 rcu_read_unlock();
1607 }
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH 3/3] tcp_cubic: fix low utilization of CUBIC with HyStart
From: Sangtae Ha @ 2011-03-14 7:36 UTC (permalink / raw)
To: Lucas Nussbaum
Cc: Stephen Hemminger, David Miller, Injong Rhee, Bill Fink, netdev
In-Reply-To: <20110314062824.GA22755@xanadu.blop.info>
On Mon, Mar 14, 2011 at 2:28 AM, Lucas Nussbaum <lucas.nussbaum@loria.fr> wrote:
> On 13/03/11 at 19:07 -0500, Sangtae Ha wrote:
>> Hi Lucas,
>>
>> Thank you for reporting this problem and the results below show what
>> happened with low resolution clocks.
>> The detailed testing setup and results at
>> http://netsrv.csc.ncsu.edu/wiki/index.php/HyStart_testing_between_Princeton_and_NCSU
>> I will add the results in long rtt paths soon.
>
> Thanks. What do you use to generate those graphs?
I used net/ipv4/tcp_probe.c and gnuplot to generate the graphs.
>
> The graphs from HyStart(fixed) are a bit strange. Did HyStart really
> detect something? It seems that it exited slow start due to losses, not
> due to detection, since cwnd is decreased.
You can see green points which indicate that ssthresh is set before the loss,
and right after that, the cwnd increases 20% per RTT since the
available bandwidth is still unknown.
This logic incurs far less number of losses compared to slow start and
hence more throughput.
> --
> | Lucas Nussbaum MCF Université Nancy 2 |
> | lucas.nussbaum@loria.fr LORIA / AlGorille |
> | http://www.loria.fr/~lnussbau/ +33 3 54 95 86 19 |
>
Sangtae
^ permalink raw reply
* Re: [PATCH 1/2] NET: cdc-phonet, fix stop-queue handling
From: Rémi Denis-Courmont @ 2011-03-14 7:39 UTC (permalink / raw)
To: ext Jiri Slaby; +Cc: davem, jirislaby, netdev, gregkh, linux-usb, linux-kernel
In-Reply-To: <1300035271-8138-1-git-send-email-jslaby@suse.cz>
On Sunday 13 March 2011 18:54:30 ext Jiri Slaby, you wrote:
> Currently there is a warning emitted by the cdc-phonet driver:
> WARNING: at include/linux/netdevice.h:1557 usbpn_probe+0x3bb/0x3f0
> [cdc_phonet]() Modules linked in: ...
> Pid: 5877, comm: insmod Not tainted 2.6.37.3-16-desktop #1
> Call Trace:
> [<ffffffff810059b9>] dump_trace+0x79/0x340
> [<ffffffff81520fdc>] dump_stack+0x69/0x6f
> [<ffffffff810580eb>] warn_slowpath_common+0x7b/0xc0
> [<ffffffffa00254fb>] usbpn_probe+0x3bb/0x3f0 [cdc_phonet]
> ...
> ---[ end trace f5d3e02908603ab4 ]---
> netif_stop_queue() cannot be called before register_netdev()
>
> So remove netif_stop_queue from the probe funtction to avoid that.
>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> Cc: David S. Miller <davem@davemloft.net>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
--
Rémi Denis-Courmont
http://www.remlab.net/
^ permalink raw reply
* Re: [patch net-next-2.6 1/6] af_packet: use skb->skb_iif instead of orig_dev->ifindex
From: Jiri Pirko @ 2011-03-14 7:43 UTC (permalink / raw)
To: Changli Gao
Cc: netdev, davem, shemminger, kaber, fubar, eric.dumazet,
nicolas.2p.debian, andy
In-Reply-To: <AANLkTik6-qCHW-5vRUY4BdXJL1jVFsD85rTRWucUdkRe@mail.gmail.com>
Mon, Mar 14, 2011 at 07:59:39AM CET, xiaosuo@gmail.com wrote:
>On Mon, Mar 14, 2011 at 2:54 PM, Jiri Pirko <jpirko@redhat.com> wrote:
>> Mon, Mar 14, 2011 at 12:52:37AM CET, xiaosuo@gmail.com wrote:
>>>On Sat, Mar 12, 2011 at 9:14 PM, Jiri Pirko <jpirko@redhat.com> wrote:
>>>> Since skb_iif has the desired value (ifindex of physical device actually
>>>> received the traffic) use that instead.
>>>>
>>>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>>>> Reviewed-by: Changli Gao <xiaosuo@gmail.com>
>>>> Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
>>>> ---
>>>
>>>This may "break" the ptype handlers in TX path, as we always assign
>>>skb->dev to origdev there. Thanks.
>>
>> Changli, would you please point me the relevant code?. Thanks!
>>
>
>1557 static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
>....
>
>1571 if (pt_prev) {
>1572 deliver_skb(skb2, pt_prev, skb->dev);
>1573 pt_prev = ptype;
>1574 continue;
>1575 }
>...
>1603 }
>1604 if (pt_prev)
>1605 pt_prev->func(skb2, skb->dev, pt_prev, skb->dev);
>1606 rcu_read_unlock();
>1607 }
I'm probably missign something but I do not see the connection between
this and setting up sll->sll_ifindex in net/packet/af_packet.c
>
>--
>Regards,
>Changli Gao(xiaosuo@gmail.com)
^ 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