Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: improve latencies of timer triggered events
From: Eric Dumazet @ 2012-07-20 15:45 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Tom Herbert, Yuchung Cheng, Neal Cardwell,
	Nandita Dukkipati, John Heffner, H.K. Jerry Chu

From: Eric Dumazet <edumazet@google.com>

Modern TCP stack highly depends on tcp_write_timer() having a small
latency, but current implementation doesn't exactly meet the
expectations.

When a timer fires but finds the socket is owned by the user, it rearms
itself for an additional delay hoping next run will be more
successful.

tcp_write_timer() for example uses a 50ms delay for next try, and it
defeats many attempts to get predictable TCP behavior in term of
latencies.

Use the recently introduced tcp_release_cb(), so that the user owning
the socket will call various handlers right before socket release.

This will permit us to post a followup patch to address the
tcp_tso_should_defer() syndrome (some deferred packets have to wait
RTO timer to be transmitted, while cwnd should allow us to send them
sooner)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Nandita Dukkipati <nanditad@google.com>
Cc: H.K. Jerry Chu <hkchu@google.com>
Cc: John Heffner <johnwheffner@gmail.com>
---
 include/linux/tcp.h   |    4 +-
 include/net/tcp.h     |    2 +
 net/ipv4/tcp_output.c |   46 ++++++++++++++++----------
 net/ipv4/tcp_timer.c  |   70 +++++++++++++++++++++-------------------
 4 files changed, 71 insertions(+), 51 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 9febfb6..2761856 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -515,7 +515,9 @@ struct tcp_sock {
 enum tsq_flags {
 	TSQ_THROTTLED,
 	TSQ_QUEUED,
-	TSQ_OWNED, /* tcp_tasklet_func() found socket was locked */
+	TCP_TSQ_DEFERRED,	   /* tcp_tasklet_func() found socket was owned */
+	TCP_WRITE_TIMER_DEFERRED,  /* tcp_write_timer() found socket was owned */
+	TCP_DELACK_TIMER_DEFERRED, /* tcp_delack_timer() found socket was owned */
 };
 
 static inline struct tcp_sock *tcp_sk(const struct sock *sk)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index bc7c134..e19124b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -350,6 +350,8 @@ extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 extern int tcp_sendpage(struct sock *sk, struct page *page, int offset,
 			size_t size, int flags);
 extern void tcp_release_cb(struct sock *sk);
+extern void tcp_write_timer_handler(struct sock *sk);
+extern void tcp_delack_timer_handler(struct sock *sk);
 extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
 extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 				 const struct tcphdr *th, unsigned int len);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 27a32ac..950aebf 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -837,6 +837,13 @@ struct tsq_tasklet {
 };
 static DEFINE_PER_CPU(struct tsq_tasklet, tsq_tasklet);
 
+static void tcp_tsq_handler(struct sock *sk)
+{
+	if ((1 << sk->sk_state) &
+	    (TCPF_ESTABLISHED | TCPF_FIN_WAIT1 | TCPF_CLOSING |
+	     TCPF_CLOSE_WAIT  | TCPF_LAST_ACK))
+		tcp_write_xmit(sk, tcp_current_mss(sk), 0, 0, GFP_ATOMIC);
+}
 /*
  * One tasklest per cpu tries to send more skbs.
  * We run in tasklet context but need to disable irqs when
@@ -864,16 +871,10 @@ static void tcp_tasklet_func(unsigned long data)
 		bh_lock_sock(sk);
 
 		if (!sock_owned_by_user(sk)) {
-			if ((1 << sk->sk_state) &
-			    (TCPF_ESTABLISHED | TCPF_FIN_WAIT1 |
-			     TCPF_CLOSING | TCPF_CLOSE_WAIT | TCPF_LAST_ACK))
-				tcp_write_xmit(sk,
-					       tcp_current_mss(sk),
-					       0, 0,
-					       GFP_ATOMIC);
+			tcp_tsq_handler(sk);
 		} else {
 			/* defer the work to tcp_release_cb() */
-			set_bit(TSQ_OWNED, &tp->tsq_flags);
+			set_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
 		}
 		bh_unlock_sock(sk);
 
@@ -882,6 +883,9 @@ static void tcp_tasklet_func(unsigned long data)
 	}
 }
 
+#define TCP_DEFERRED_ALL ((1UL << TCP_TSQ_DEFERRED) |		\
+			  (1UL << TCP_WRITE_TIMER_DEFERRED) |	\
+			  (1UL << TCP_DELACK_TIMER_DEFERRED))
 /**
  * tcp_release_cb - tcp release_sock() callback
  * @sk: socket
@@ -892,16 +896,24 @@ static void tcp_tasklet_func(unsigned long data)
 void tcp_release_cb(struct sock *sk)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
+	unsigned long flags, nflags;
 
-	if (test_and_clear_bit(TSQ_OWNED, &tp->tsq_flags)) {
-		if ((1 << sk->sk_state) &
-		    (TCPF_ESTABLISHED | TCPF_FIN_WAIT1 |
-		     TCPF_CLOSING | TCPF_CLOSE_WAIT | TCPF_LAST_ACK))
-			tcp_write_xmit(sk,
-				       tcp_current_mss(sk),
-				       0, 0,
-				       GFP_ATOMIC);
-	}
+	/* perform an atomic operation only if at least one flag is set */
+	do {
+		flags = tp->tsq_flags;
+		if (!(flags & TCP_DEFERRED_ALL))
+			return;
+		nflags = flags & ~TCP_DEFERRED_ALL;
+	} while (cmpxchg(&tp->tsq_flags, flags, nflags) != flags);
+
+	if (flags & (1UL << TCP_TSQ_DEFERRED))
+		tcp_tsq_handler(sk);
+
+	if (flags & (1UL << TCP_WRITE_TIMER_DEFERRED))
+		tcp_write_timer_handler(sk);
+
+	if (flags & (1UL << TCP_DELACK_TIMER_DEFERRED))
+		tcp_delack_timer_handler(sk);
 }
 EXPORT_SYMBOL(tcp_release_cb);
 
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index e911e6c..6df36ad 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -32,17 +32,6 @@ int sysctl_tcp_retries2 __read_mostly = TCP_RETR2;
 int sysctl_tcp_orphan_retries __read_mostly;
 int sysctl_tcp_thin_linear_timeouts __read_mostly;
 
-static void tcp_write_timer(unsigned long);
-static void tcp_delack_timer(unsigned long);
-static void tcp_keepalive_timer (unsigned long data);
-
-void tcp_init_xmit_timers(struct sock *sk)
-{
-	inet_csk_init_xmit_timers(sk, &tcp_write_timer, &tcp_delack_timer,
-				  &tcp_keepalive_timer);
-}
-EXPORT_SYMBOL(tcp_init_xmit_timers);
-
 static void tcp_write_err(struct sock *sk)
 {
 	sk->sk_err = sk->sk_err_soft ? : ETIMEDOUT;
@@ -205,21 +194,11 @@ static int tcp_write_timeout(struct sock *sk)
 	return 0;
 }
 
-static void tcp_delack_timer(unsigned long data)
+void tcp_delack_timer_handler(struct sock *sk)
 {
-	struct sock *sk = (struct sock *)data;
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct inet_connection_sock *icsk = inet_csk(sk);
 
-	bh_lock_sock(sk);
-	if (sock_owned_by_user(sk)) {
-		/* Try again later. */
-		icsk->icsk_ack.blocked = 1;
-		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
-		sk_reset_timer(sk, &icsk->icsk_delack_timer, jiffies + TCP_DELACK_MIN);
-		goto out_unlock;
-	}
-
 	sk_mem_reclaim_partial(sk);
 
 	if (sk->sk_state == TCP_CLOSE || !(icsk->icsk_ack.pending & ICSK_ACK_TIMER))
@@ -260,7 +239,21 @@ static void tcp_delack_timer(unsigned long data)
 out:
 	if (sk_under_memory_pressure(sk))
 		sk_mem_reclaim(sk);
-out_unlock:
+}
+
+static void tcp_delack_timer(unsigned long data)
+{
+	struct sock *sk = (struct sock *)data;
+
+	bh_lock_sock(sk);
+	if (!sock_owned_by_user(sk)) {
+		tcp_delack_timer_handler(sk);
+	} else {
+		inet_csk(sk)->icsk_ack.blocked = 1;
+		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
+		/* deleguate our work to tcp_release_cb() */
+		set_bit(TCP_WRITE_TIMER_DEFERRED, &tcp_sk(sk)->tsq_flags);
+	}
 	bh_unlock_sock(sk);
 	sock_put(sk);
 }
@@ -450,19 +443,11 @@ out_reset_timer:
 out:;
 }
 
-static void tcp_write_timer(unsigned long data)
+void tcp_write_timer_handler(struct sock *sk)
 {
-	struct sock *sk = (struct sock *)data;
 	struct inet_connection_sock *icsk = inet_csk(sk);
 	int event;
 
-	bh_lock_sock(sk);
-	if (sock_owned_by_user(sk)) {
-		/* Try again later */
-		sk_reset_timer(sk, &icsk->icsk_retransmit_timer, jiffies + (HZ / 20));
-		goto out_unlock;
-	}
-
 	if (sk->sk_state == TCP_CLOSE || !icsk->icsk_pending)
 		goto out;
 
@@ -485,7 +470,19 @@ static void tcp_write_timer(unsigned long data)
 
 out:
 	sk_mem_reclaim(sk);
-out_unlock:
+}
+
+static void tcp_write_timer(unsigned long data)
+{
+	struct sock *sk = (struct sock *)data;
+
+	bh_lock_sock(sk);
+	if (!sock_owned_by_user(sk)) {
+		tcp_write_timer_handler(sk);
+	} else {
+		/* deleguate our work to tcp_release_cb() */
+		set_bit(TCP_WRITE_TIMER_DEFERRED, &tcp_sk(sk)->tsq_flags);
+	}
 	bh_unlock_sock(sk);
 	sock_put(sk);
 }
@@ -602,3 +599,10 @@ out:
 	bh_unlock_sock(sk);
 	sock_put(sk);
 }
+
+void tcp_init_xmit_timers(struct sock *sk)
+{
+	inet_csk_init_xmit_timers(sk, &tcp_write_timer, &tcp_delack_timer,
+				  &tcp_keepalive_timer);
+}
+EXPORT_SYMBOL(tcp_init_xmit_timers);

^ permalink raw reply related

* Re: [PATCH net/for-next V1 1/1] IB/ipoib: break linkage to neighbouring system
From: Or Gerlitz @ 2012-07-20 15:49 UTC (permalink / raw)
  To: roland, davem; +Cc: linux-rdma, erezsh, Shlomo Pongratz, Or Gerlitz, netdev
In-Reply-To: <1342703938-29904-2-git-send-email-ogerlitz@mellanox.com>

On Thu, Jul 19, 2012 at 4:18 PM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
> From: Shlomo Pongratz <shlomop@mellanox.com>
>
> Dave Miller <davem@davemloft.net> provided a detailed description of why the
> way IPoIB is using neighbours for its own ipoib_neigh struct is buggy:
[...]

> This patch aims to solve the race conditions found in the IPoIB driver.
>
> The patch breaks the connection between the core networking neighbour structure
> and the ipoib_neigh structure. Except for avoiding the race, it allows to in
> under a setup where SKBs carrying IP packets that don't have any associated
> neighbour are transmitted through IPoIB.
>
> We add an ipoib_neigh hash table with 1024 buckets. The hash table key is the destin
> hardware address. Thus the ipoib_neigh is fetched from the hash table and not
> dereferenced from the stashed location at the neighbour structure. The hash table uses
> both RCU and reference count mechanisms to guarantee that no ipoib_neigh instance is
> ever deleted while in use.
>
> Fetching the ipoib_neigh structure instance from the hash also makes the special
> code in ipoib_start_xmit that handles remote and local bonding failover redundant.
>
> Aged ipoib_neigh instances are deleted by a garbage collection task that runs every
> 30 seconds and deletes every ipoib_neigh instance that was idle for at least 60
> seconds. The deletion is safe since the ipoib_neigh instances are protected
> using RCU and reference count mechanisms.

Hi Dave, Roland, Eric

So how does this look? in the right direction? anything that need to be fixed?

Or.

^ permalink raw reply

* Re: [patch iproute2] iplink: add support for num[tr]xqueues
From: Stephen Hemminger @ 2012-07-20 15:52 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, David Miller, edumazet, shemminger

I like the option, but  numtxqueue is too verbose for the syntax model
of iproute. Why not use txq and rxq?

Sent from my ASUS Pad

Jiri Pirko <jiri@resnulli.us> wrote:

>Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>---
> include/linux/if_link.h |    2 ++
> ip/iplink.c             |   20 ++++++++++++++++++++
> man/man8/ip-link.8.in   |   13 +++++++++++++
> 3 files changed, 35 insertions(+)
>
>diff --git a/include/linux/if_link.h b/include/linux/if_link.h
>index 00e5868..46f03db 100644
>--- a/include/linux/if_link.h
>+++ b/include/linux/if_link.h
>@@ -140,6 +140,8 @@ enum {
> 	IFLA_EXT_MASK,		/* Extended info mask, VFs, etc */
> 	IFLA_PROMISCUITY,	/* Promiscuity count: > 0 means acts PROMISC */
> #define IFLA_PROMISCUITY IFLA_PROMISCUITY
>+	IFLA_NUM_TX_QUEUES,
>+	IFLA_NUM_RX_QUEUES,
> 	__IFLA_MAX
> };
> 
>diff --git a/ip/iplink.c b/ip/iplink.c
>index 679091e..0baa128 100644
>--- a/ip/iplink.c
>+++ b/ip/iplink.c
>@@ -48,6 +48,8 @@ void iplink_usage(void)
> 		fprintf(stderr, "                   [ address LLADDR ]\n");
> 		fprintf(stderr, "                   [ broadcast LLADDR ]\n");
> 		fprintf(stderr, "                   [ mtu MTU ]\n");
>+		fprintf(stderr, "                   [ numtxqueues QUEUE_COUNT ]\n");
>+		fprintf(stderr, "                   [ numrxqueues QUEUE_COUNT ]\n");
> 		fprintf(stderr, "                   type TYPE [ ARGS ]\n");
> 		fprintf(stderr, "       ip link delete DEV type TYPE [ ARGS ]\n");
> 		fprintf(stderr, "\n");
>@@ -279,6 +281,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
> 	int mtu = -1;
> 	int netns = -1;
> 	int vf = -1;
>+	int numtxqueues = -1;
>+	int numrxqueues = -1;
> 
> 	*group = -1;
> 	ret = argc;
>@@ -445,6 +449,22 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
> 				invarg("Invalid operstate\n", *argv);
> 
> 			addattr8(&req->n, sizeof(*req), IFLA_OPERSTATE, state);
>+		} else if (strcmp(*argv, "numtxqueues") == 0) {
>+			NEXT_ARG();
>+			if (numtxqueues != -1)
>+				duparg("numtxqueues", *argv);
>+			if (get_integer(&numtxqueues, *argv, 0))
>+				invarg("Invalid \"numtxqueues\" value\n", *argv);
>+			addattr_l(&req->n, sizeof(*req), IFLA_NUM_TX_QUEUES,
>+				  &numtxqueues, 4);
>+		} else if (strcmp(*argv, "numrxqueues") == 0) {
>+			NEXT_ARG();
>+			if (numrxqueues != -1)
>+				duparg("numrxqueues", *argv);
>+			if (get_integer(&numrxqueues, *argv, 0))
>+				invarg("Invalid \"numrxqueues\" value\n", *argv);
>+			addattr_l(&req->n, sizeof(*req), IFLA_NUM_RX_QUEUES,
>+				  &numrxqueues, 4);
> 		} else {
> 			if (strcmp(*argv, "dev") == 0) {
> 				NEXT_ARG();
>diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
>index 9386cc6..8a24e51 100644
>--- a/man/man8/ip-link.8.in
>+++ b/man/man8/ip-link.8.in
>@@ -40,6 +40,11 @@ ip-link \- network device configuration
> .RB "[ " mtu
> .IR MTU " ]"
> .br
>+.RB "[ " numtxqueues
>+.IR QUEUE_COUNT " ]"
>+.RB "[ " numrxqueues
>+.IR QUEUE_COUNT " ]"
>+.br
> .BR type " TYPE"
> .RI "[ " ARGS " ]"
> 
>@@ -156,6 +161,14 @@ Link types:
> - Ethernet Bridge device
> .in -8
> 
>+.TP
>+.BI numtxqueues " QUEUE_COUNT "
>+specifies the number of transmit queues for new device.
>+
>+.TP
>+.BI numrxqueues " QUEUE_COUNT "
>+specifies the number of receive queues for new device.
>+
> .SS ip link delete - delete virtual link
> .I DEVICE
> specifies the virtual  device to act operate on.
>-- 
>1.7.10.4
>

^ permalink raw reply

* Re: New commands to configure IOV features
From: Don Dutile @ 2012-07-20 15:56 UTC (permalink / raw)
  To: Chris Friesen
  Cc: David Miller, yuvalmin, bhutchings, gregory.v.rose, netdev,
	linux-pci
In-Reply-To: <500978C7.5050004@genband.com>

On 07/20/2012 11:27 AM, Chris Friesen wrote:
> On 07/17/2012 03:11 PM, David Miller wrote:
>> From: Chris Friesen<chris.friesen@genband.com>
>> Date: Tue, 17 Jul 2012 15:08:45 -0600
>>
>>> From that perspective a sysfs-based interface is ideal since it is
>>> directly scriptable.
>>
>> As is anything ethtool or netlink based, since we have 'ethtool'
>> and 'ip' for scripting.
>
> I'm not picky...whatever works.
>
> To me the act of creating virtual functions seems generic enough (I'm aware of SR-IOV capable storage controllers, I'm sure there is other hardware as well) that ethtool/ip don't really seem like the most appropriate tools for the job.
>
Yes, and then there are 'other network' controllers too ... IB  which I don't know if it adheres to ethtool, since it's not an Ethernet device ... isn't that why they call it Infiniband ... ;-) )
In the telecom space, they use NTBs and PCI as a 'network' ... I know, not common in Linux space, and VFs in that space aren't being discussed (that I've ever heard), but another example where 'network' != Ethernet, so ethtool doesn't solve PCI-level configuration/use.

So, VFs are a PCI defined entity, so their enable/disablement should be handled by PCI.

Conversely, when dealing with networking attributes of a PCI-VF ethernet-nic, networking tools should be used, not PCI tools.

> I would have thought it would make more sense as a generic PCI functionality, in which case I'm not aware of an existing binary tool that would be a logical choice to extend.
>
> Chris

^ permalink raw reply

* RE: [RFC] r8169 : why SG / TX checksum are default disabled
From: hayeswang @ 2012-07-20 16:01 UTC (permalink / raw)
  To: 'Francois Romieu'; +Cc: 'David Miller', eric.dumazet, netdev
In-Reply-To: <20120720100846.GA17398@electric-eye.fr.zoreil.com>

 Francois Romieu [mailto:romieu@fr.zoreil.com] 

[...]
> > I find that the total length field of IP header would be 
> modified if the hw
> > checksum is enabled. Therefore, skb_padto + hw checksum 
> wouldn't work.
> 
> Ok, my patch completely ignored the fact that skb_padto does 
> not change the
> length.
> 
> However skb_padto + length adjustement + hw checksum should 
> work (at least in
> theory if not in the patch below) ?

If the hw only fills in the checksum fields of IP header, UDP header, and TCP
header, the patch would work. However, the hw would also fill in the total
length field of IP header, so it causes problems. For example, I send a packet
with ethernet header 14 bytes + IP header 20 bytes + data 20 bytes = 54 bytes.

Case 1: Software checksum + pad zeroes to 60 bytes
   Receiver gets this packet and finds the total length in IP header would be 40
bytes. Therefore, the receiver knows the data would be 40 - 20 (IP header) = 20
bytes.

Case 2: pad zeroes to 60 bytes + hw checksum
   Receiver gets this packet and would find the total length in IP header is 40
+ (60-54) = 46 bytes, not 40 bytes. Therefore, the receiver consider the data
would be 46 - 20 = 26 bytes. However, the final 6 bytes should not be the parts
of data.
 
Best Regards,
Hayes

^ permalink raw reply

* Re: [PATCH v2 net-next] tcp: fix ABC in tcp_slow_start()
From: Neal Cardwell @ 2012-07-20 16:03 UTC (permalink / raw)
  To: Yuchung Cheng
  Cc: Eric Dumazet, David Miller, netdev, Tom Herbert,
	Stephen Hemminger, John Heffner, Nandita Dukkipati
In-Reply-To: <CAK6E8=dkwruGMtW2uQ--xZ_so9aZQt-KcmHsy2yE5GApKphrJQ@mail.gmail.com>

On Fri, Jul 20, 2012 at 8:07 AM, Yuchung Cheng <ycheng@google.com> wrote:
> On Fri, Jul 20, 2012 at 8:02 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>         tp->snd_cwnd_cnt += cnt;
>>         while (tp->snd_cwnd_cnt >= tp->snd_cwnd) {

Nice catch, Eric.

One thing that's always bothered me about the tp->snd_cwnd_cnt code is
that the slow start and congestion avoidance use different criteria
for incrementing snd_cwnd_cnt. tcp_slow_start() increments
snd_cwnd_cnt by snd_cwnd for each ACKed packet, and congestion
avoidance increases snd_cwnd_cnt by just 1 for each packet.

This means that if we exit slow start and enter congestion avoidance,
then we think we can have a "credit" for a bunch of ACKs that never
happened (up to snd_cwnd-1), so we can conceivably do our first
additive increase in congestion avoidance up to almost 1RTT too
early. Can we just get rid of the use of snd_cwnd_cnt in slow start,
and just use local variables in tcp_slow_start() rather than trying to
carry state between ACKs?

neal

^ permalink raw reply

* Re: [PATCH v2 net-next] tcp: fix ABC in tcp_slow_start()
From: Eric Dumazet @ 2012-07-20 16:08 UTC (permalink / raw)
  To: Neal Cardwell
  Cc: Yuchung Cheng, David Miller, netdev, Tom Herbert,
	Stephen Hemminger, John Heffner, Nandita Dukkipati
In-Reply-To: <CADVnQy=nJz33pzd+o1WoCOR6Mk2pbB2x+bujqbfLUi8-+J=hGA@mail.gmail.com>

On Fri, 2012-07-20 at 09:03 -0700, Neal Cardwell wrote:
> On Fri, Jul 20, 2012 at 8:07 AM, Yuchung Cheng <ycheng@google.com> wrote:
> > On Fri, Jul 20, 2012 at 8:02 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >>         tp->snd_cwnd_cnt += cnt;
> >>         while (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
> 
> Nice catch, Eric.
> 
> One thing that's always bothered me about the tp->snd_cwnd_cnt code is
> that the slow start and congestion avoidance use different criteria
> for incrementing snd_cwnd_cnt. tcp_slow_start() increments
> snd_cwnd_cnt by snd_cwnd for each ACKed packet, and congestion
> avoidance increases snd_cwnd_cnt by just 1 for each packet.
> 
> This means that if we exit slow start and enter congestion avoidance,
> then we think we can have a "credit" for a bunch of ACKs that never
> happened (up to snd_cwnd-1), so we can conceivably do our first
> additive increase in congestion avoidance up to almost 1RTT too
> early. Can we just get rid of the use of snd_cwnd_cnt in slow start,
> and just use local variables in tcp_slow_start() rather than trying to
> carry state between ACKs?

Apparently tcp_slow_start() needs the snd_cwnd_cnt in case 
"limited slow start"  is used :

cnt = sysctl_tcp_max_ssthresh >> 1;

So to address your point, maybe we should clear  snd_cwnd_cnt
when leaving slow start for congestion avoidance phase ?

^ permalink raw reply

* Re: [RFC] r8169 : why SG / TX checksum are default disabled
From: David Miller @ 2012-07-20 16:17 UTC (permalink / raw)
  To: hayeswang; +Cc: eric.dumazet, romieu, netdev
In-Reply-To: <EF06A7B3C1E6432BB660CDEF8E1D2A1B@realtek.com.tw>

From: hayeswang <hayeswang@realtek.com>
Date: Fri, 20 Jul 2012 15:14:26 +0800

> I find that the total length field of IP header would be modified if the hw
> checksum is enabled. Therefore, skb_padto + hw checksum wouldn't work. The
> software checksum is necessary.

It's really strange that the hardware has any reason to update the IP
header length field when it is asked to compute the checksum.

^ permalink raw reply

* Re: [PATCH 00/16]: Kill the ipv4 routing cache.
From: David Miller @ 2012-07-20 16:26 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev
In-Reply-To: <1342796969.2678.12.camel@bwh-desktop.uk.solarflarecom.com>

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 20 Jul 2012 16:09:29 +0100

> On Thu, 2012-07-19 at 14:34 -0700, David Miller wrote:
>> The ipv4 routing cache is non-deterministic, performance wise, and is
>> subject to reasonably easy to launch denial of service attacks.
> [...]
> 
> This is a great explanation, but it still doesn't appear to be going
> into the commit log...

What in the world do you mean?

When I actually commit this stuff, I'll have it all in a branch and
merge it into net-next's master using "git merge --no-ff" and then use
the merge commit to add this commit message test.

Every damn set of changes I've commited over the past few weeks have
used this technique, are you simply not paying attention?

^ permalink raw reply

* pull-request: can-next 2012-07-20
From: Marc Kleine-Budde @ 2012-07-20 16:27 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, linux-can@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 2704 bytes --]

Hello David,

the fifth pull request for upcoming v3.6 net-next cleans up and
improves the janz-ican3 driver (6 patches by Ira W. Snyder, one by me).
A patch by Steffen Trumtrar adds imx53 support to the flexcan driver.
And another patch by me, which marks the bit timing constant in the CAN
drivers as "const".

regards, Marc

---

The following changes since commit 769162e38b91e1d300752e666260fa6c7b203fbc:

  Merge branch 'net' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile (2012-07-19 13:39:27 -0700)

are available in the git repository at:


  git://gitorious.org/linux-can/linux-can-next.git for-davem

for you to fetch changes up to 3b5c6b9e49f78f07ebcd34b38c1185e57a0fd9eb:

  can: janz-ican3: add support for one shot mode (2012-07-20 17:49:05 +0200)

----------------------------------------------------------------
Ira W. Snyder (6):
      can: janz-ican3: remove dead code
      can: janz-ican3: drop invalid skbs
      can: janz-ican3: fix error and byte counters
      can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS
      can: janz-ican3: avoid firmware lockup caused by infinite bus error quota
      can: janz-ican3: add support for one shot mode

Marc Kleine-Budde (2):
      can: mark bittiming_const pointer in struct can_priv as const
      can: janz-ican3: cleanup of ican3_to_can_frame and can_frame_to_ican3

Steffen Trumtrar (1):
      can: flexcan: add 2nd clock to support imx53 and newer

 drivers/net/can/at91_can.c                   |    2 +-
 drivers/net/can/bfin_can.c                   |    2 +-
 drivers/net/can/c_can/c_can.c                |    2 +-
 drivers/net/can/cc770/cc770.c                |    2 +-
 drivers/net/can/flexcan.c                    |   47 +++--
 drivers/net/can/janz-ican3.c                 |  241 ++++++++++++++++++++------
 drivers/net/can/mcp251x.c                    |    2 +-
 drivers/net/can/mscan/mscan.c                |    2 +-
 drivers/net/can/pch_can.c                    |    2 +-
 drivers/net/can/sja1000/sja1000.c            |    2 +-
 drivers/net/can/ti_hecc.c                    |    2 +-
 drivers/net/can/usb/ems_usb.c                |    2 +-
 drivers/net/can/usb/esd_usb2.c               |    2 +-
 drivers/net/can/usb/peak_usb/pcan_usb_core.h |    2 +-
 include/linux/can/dev.h                      |    2 +-
 15 files changed, 226 insertions(+), 88 deletions(-)

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply

* Re: [RFC] r8169 : why SG / TX checksum are default disabled
From: David Miller @ 2012-07-20 16:28 UTC (permalink / raw)
  To: hayeswang; +Cc: romieu, eric.dumazet, netdev
In-Reply-To: <A4FD513AF09D40849B8A75C371F1D431@realtek.com.tw>

From: hayeswang <hayeswang@realtek.com>
Date: Sat, 21 Jul 2012 00:01:38 +0800

> However, the hw would also fill in the total length field of IP
> header, so it causes problems.

Why does the HW modify fields we did not ask it to?

^ permalink raw reply

* Re: [RFC PATCH] net: Add support for virtual machine device queues (VMDQ)
From: John Fastabend @ 2012-07-20 16:30 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: or.gerlitz, davem, roland, netdev, ali, sean.hefty, shlomop,
	Ronciak, John
In-Reply-To: <20120719064258.GA1665@minipsycho.orion>

On 7/18/2012 11:42 PM, Jiri Pirko wrote:
> Thu, Jul 19, 2012 at 12:05:44AM CEST, john.r.fastabend@intel.com wrote:
>> This adds support to allow virtual net devices to be created. These
>> devices can be managed independtly of the physical function but
>> use the same physical link.

[...]

>> +
>> +size_t vmdq_getpriv_size(struct net *src_net, struct nlattr *tb[])
>> +{
>> +	struct net_device *lowerdev;
>> +
>> +	if (!tb[IFLA_LINK])
>> +		return -EINVAL;
>> +
>> +	lowerdev = __dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
>> +	if (!lowerdev)
>> +		return -ENODEV;
>> +
>> +	return sizeof(netdev_priv(lowerdev));
>> +}
>
> Why exactly do you need to have the priv of same size as lowerdev? I do
> not see you use that anywhere...
>

When we add a child device the hardware/sw may have some private data
it needs to manage this device.

I made an assumption here that the priv space for child devices is the
same as the lowerdev but this might be a bad assumption.

.John

^ permalink raw reply

* Re: [PATCH 00/16]: Kill the ipv4 routing cache.
From: Eric Dumazet @ 2012-07-20 16:43 UTC (permalink / raw)
  To: David Miller; +Cc: bhutchings, netdev
In-Reply-To: <20120720.092614.1285553995467252576.davem@davemloft.net>

On Fri, 2012-07-20 at 09:26 -0700, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Fri, 20 Jul 2012 16:09:29 +0100
> 
> > On Thu, 2012-07-19 at 14:34 -0700, David Miller wrote:
> >> The ipv4 routing cache is non-deterministic, performance wise, and is
> >> subject to reasonably easy to launch denial of service attacks.
> > [...]
> > 
> > This is a great explanation, but it still doesn't appear to be going
> > into the commit log...
> 
> What in the world do you mean?
> 
> When I actually commit this stuff, I'll have it all in a branch and
> merge it into net-next's master using "git merge --no-ff" and then use
> the merge commit to add this commit message test.

I am not familiar with this "git merge --no-ff", so the following
might be completely irrelevant :

It would be nice if you can copy the changelog of 00/16 to 01/16

01/16 has no changelog, and it probably can confuse git users in the
future, since this patch is not trivial.

^ permalink raw reply

* Re: [PATCH v2 net-next] tcp: fix ABC in tcp_slow_start()
From: Neal Cardwell @ 2012-07-20 16:50 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Yuchung Cheng, David Miller, netdev, Tom Herbert,
	Stephen Hemminger, John Heffner, Nandita Dukkipati
In-Reply-To: <1342800536.2626.7670.camel@edumazet-glaptop>

On Fri, Jul 20, 2012 at 9:08 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> So to address your point, maybe we should clear  snd_cwnd_cnt
> when leaving slow start for congestion avoidance phase ?

Sounds good. That can be a separate commit to add the new logic to the
end of tcp_slow_start() to check to see if we've bumped into ssthresh
and reset snd_cwnd_cnt.

neal

^ permalink raw reply

* Re: [PATCH] sunrpc: clnt: Add missing braces
From: Joe Perches @ 2012-07-20 16:50 UTC (permalink / raw)
  To: David S. Miller
  Cc: Trond Myklebust, J. Bruce Fields, Chuck Lever,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1342635431.9551.41.camel@joe2Laptop>

On Wed, 2012-07-18 at 11:17 -0700, Joe Perches wrote:
> Add a missing set of braces that commit 4e0038b6b24
> ("SUNRPC: Move clnt->cl_server into struct rpc_xprt")
> forgot.
> 
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
> ---
>  net/sunrpc/clnt.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> index f56f045..aaf70aa 100644
> --- a/net/sunrpc/clnt.c
> +++ b/net/sunrpc/clnt.c
> @@ -1844,12 +1844,13 @@ call_timeout(struct rpc_task *task)
>  		return;
>  	}
>  	if (RPC_IS_SOFT(task)) {
> -		if (clnt->cl_chatty)
> +		if (clnt->cl_chatty) {
>  			rcu_read_lock();
>  			printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
>  				clnt->cl_protname,
>  				rcu_dereference(clnt->cl_xprt)->servername);
>  			rcu_read_unlock();
> +		}
>  		if (task->tk_flags & RPC_TASK_TIMEOUT)
>  			rpc_exit(task, -ETIMEDOUT);
>  		else

Hi David.

I think it'd be good to get this into 3.6 as a bug fix.

This is marked in netdev patchwork as "not applicable".

Do you need the sunrpc maintainers to apply or ack it
and then push it to you?

Trond?  Bruce?

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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

* Re: [PATCH v3] sctp: Implement quick failover draft from tsvwg
From: Flavio Leitner @ 2012-07-20 16:51 UTC (permalink / raw)
  To: Neil Horman
  Cc: netdev, Vlad Yasevich, Sridhar Samudrala, David S. Miller,
	linux-sctp, joe
In-Reply-To: <1342716704-6532-1-git-send-email-nhorman@tuxdriver.com>

On Thu, 19 Jul 2012 12:51:44 -0400
Neil Horman <nhorman@tuxdriver.com> wrote:
[...]
>  
> +pf_retrans - INTEGER
> +	The number of retransmissions that will be attempted on a given path
> +	before traffic is redirected to an alternate transport (should one
> +	exist).  Note this is distinct from path_max_retrans, as a path that
> +	passes the pf_retrans threshold can still be used.  Its only
> +	deprioritized when a transmission path is selected by the stack.  This
> +	setting is primarily used to enable fast failover mechanisms without
> +	having to reduce path_max_retrans to a very low value.  See:
> +	http://www.ietf.org/id/draft-nishida-tsvwg-sctp-failover-05.txt
> +	for details.  Note also that a value of pf_retrans > path_max_retrans
> +	disables this feature
> +
> +	Default: 0
> +
>  rto_initial - INTEGER
[...]
> diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
> index e4652fe..f70726c 100644
> --- a/include/net/sctp/structs.h
> +++ b/include/net/sctp/structs.h
> @@ -160,6 +160,7 @@ extern struct sctp_globals {
>  	int max_retrans_association;
>  	int max_retrans_path;
>  	int max_retrans_init;
> +	int pf_retrans;

[...]
>  
> +	/* This is the partially failed retrans value for the transport
> +	 * and will be initialized from the assocs value.  This can be changed
> +	 * using the SCTP_PEER_ADDR_THLDS socket option
> +	 */
> +	int pf_retrans;
>  	/* PMTU	      : The current known path MTU.  */
>  	__u32 pathmtu;
>  
> @@ -1660,6 +1667,8 @@ struct sctp_association {
>  	 */
>  	int max_retrans;
>  
> +	int pf_retrans;
> +


You've documented in one place, but not in the others.  I suggest to include
references like this
       /* See the description in struct sctp_transport */
at the two missing places.

Nice feature,
fbl

^ permalink raw reply

* [PATCH v4] sctp: Implement quick failover draft from tsvwg
From: Neil Horman @ 2012-07-20 17:19 UTC (permalink / raw)
  To: netdev
  Cc: Neil Horman, Vlad Yasevich, Sridhar Samudrala, David S. Miller,
	linux-sctp, joe
In-Reply-To: <1342203998-24037-1-git-send-email-nhorman@tuxdriver.com>

I've seen several attempts recently made to do quick failover of sctp transports
by reducing various retransmit timers and counters.  While its possible to
implement a faster failover on multihomed sctp associations, its not
particularly robust, in that it can lead to unneeded retransmits, as well as
false connection failures due to intermittent latency on a network.

Instead, lets implement the new ietf quick failover draft found here:
http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05

This will let the sctp stack identify transports that have had a small number of
errors, and avoid using them quickly until their reliability can be
re-established.  I've tested this out on two virt guests connected via multiple
isolated virt networks and believe its in compliance with the above draft and
works well.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Vlad Yasevich <vyasevich@gmail.com>
CC: Sridhar Samudrala <sri@us.ibm.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: linux-sctp@vger.kernel.org
CC: joe@perches.com

---
Change notes:

V2)
- Added socket option API from section 6.1 of the specification, as per
request from Vlad. Adding this socket option allows us to alter both the path
maximum retransmit value and the path partial failure threshold for each
transport and the association as a whole.

- Added a per transport pf_retrans value, and initialized it from the
association value.  This makes each transport independently configurable as per
the socket option above, and prevents changes in the sysctl from bleeding into
an already created association.

V3)
- Cleaned up some line spacing (Joe Perches)
- Fixed some socket option user data sanitization (Vlad Yasevich)

V4)
- Added additional documentation (Flavio Leitner)
---
 Documentation/networking/ip-sysctl.txt |   14 +++++
 include/net/sctp/constants.h           |    1 +
 include/net/sctp/structs.h             |   20 ++++++-
 include/net/sctp/user.h                |   11 ++++
 net/sctp/associola.c                   |   37 ++++++++++--
 net/sctp/outqueue.c                    |    6 +-
 net/sctp/sm_sideeffect.c               |   33 +++++++++-
 net/sctp/socket.c                      |  100 ++++++++++++++++++++++++++++++++
 net/sctp/sysctl.c                      |    9 +++
 net/sctp/transport.c                   |    4 +-
 10 files changed, 220 insertions(+), 15 deletions(-)

diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 47b6c79..c636f9c 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1408,6 +1408,20 @@ path_max_retrans - INTEGER
 
 	Default: 5
 
+pf_retrans - INTEGER
+	The number of retransmissions that will be attempted on a given path
+	before traffic is redirected to an alternate transport (should one
+	exist).  Note this is distinct from path_max_retrans, as a path that
+	passes the pf_retrans threshold can still be used.  Its only
+	deprioritized when a transmission path is selected by the stack.  This
+	setting is primarily used to enable fast failover mechanisms without
+	having to reduce path_max_retrans to a very low value.  See:
+	http://www.ietf.org/id/draft-nishida-tsvwg-sctp-failover-05.txt
+	for details.  Note also that a value of pf_retrans > path_max_retrans
+	disables this feature
+
+	Default: 0
+
 rto_initial - INTEGER
 	The initial round trip timeout value in milliseconds that will be used
 	in calculating round trip times.  This is the initial time interval
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 942b864..d053d2e 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -334,6 +334,7 @@ typedef enum {
 typedef enum {
 	SCTP_TRANSPORT_UP,
 	SCTP_TRANSPORT_DOWN,
+	SCTP_TRANSPORT_PF,
 } sctp_transport_cmd_t;
 
 /* These are the address scopes defined mainly for IPv4 addresses
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index e4652fe..cee0678 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -161,6 +161,12 @@ extern struct sctp_globals {
 	int max_retrans_path;
 	int max_retrans_init;
 
+	/* Potentially-Failed.Max.Retrans sysctl value
+	 * taken from:
+	 * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05
+	 */
+	int pf_retrans;
+
 	/*
 	 * Policy for preforming sctp/socket accounting
 	 * 0   - do socket level accounting, all assocs share sk_sndbuf
@@ -258,6 +264,7 @@ extern struct sctp_globals {
 #define sctp_sndbuf_policy	 	(sctp_globals.sndbuf_policy)
 #define sctp_rcvbuf_policy	 	(sctp_globals.rcvbuf_policy)
 #define sctp_max_retrans_path		(sctp_globals.max_retrans_path)
+#define sctp_pf_retrans			(sctp_globals.pf_retrans)
 #define sctp_max_retrans_init		(sctp_globals.max_retrans_init)
 #define sctp_sack_timeout		(sctp_globals.sack_timeout)
 #define sctp_hb_interval		(sctp_globals.hb_interval)
@@ -987,10 +994,15 @@ struct sctp_transport {
 
 	/* This is the max_retrans value for the transport and will
 	 * be initialized from the assocs value.  This can be changed
-	 * using SCTP_SET_PEER_ADDR_PARAMS socket option.
+	 * using the SCTP_SET_PEER_ADDR_PARAMS socket option.
 	 */
 	__u16 pathmaxrxt;
 
+	/* This is the partially failed retrans value for the transport
+	 * and will be initialized from the assocs value.  This can be changed
+	 * using the SCTP_PEER_ADDR_THLDS socket option
+	 */
+	int pf_retrans;
 	/* PMTU	      : The current known path MTU.  */
 	__u32 pathmtu;
 
@@ -1660,6 +1672,12 @@ struct sctp_association {
 	 */
 	int max_retrans;
 
+	/* This is the partially failed retrans value for the transport
+	 * and will be initialized from the assocs value.  This can be
+	 * changed using the SCTP_PEER_ADDR_THLDS socket option
+	 */
+	int pf_retrans;
+
 	/* Maximum number of times the endpoint will retransmit INIT  */
 	__u16 max_init_attempts;
 
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 0842ef0..1b02d7a 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -93,6 +93,7 @@ typedef __s32 sctp_assoc_t;
 #define SCTP_GET_ASSOC_NUMBER	28	/* Read only */
 #define SCTP_GET_ASSOC_ID_LIST	29	/* Read only */
 #define SCTP_AUTO_ASCONF       30
+#define SCTP_PEER_ADDR_THLDS	31
 
 /* Internal Socket Options. Some of the sctp library functions are
  * implemented using these socket options.
@@ -649,6 +650,7 @@ struct sctp_paddrinfo {
  */
 enum sctp_spinfo_state {
 	SCTP_INACTIVE,
+	SCTP_PF,
 	SCTP_ACTIVE,
 	SCTP_UNCONFIRMED,
 	SCTP_UNKNOWN = 0xffff  /* Value used for transport state unknown */
@@ -741,4 +743,13 @@ typedef struct {
 	int sd;
 } sctp_peeloff_arg_t;
 
+/*
+ *  Peer Address Thresholds socket option
+ */
+struct sctp_paddrthlds {
+	sctp_assoc_t spt_assoc_id;
+	struct sockaddr_storage spt_address;
+	__u16 spt_pathmaxrxt;
+	__u16 spt_pathpfthld;
+};
 #endif /* __net_sctp_user_h__ */
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 5bc9ab1..90fe36b 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -124,6 +124,8 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
 	 * socket values.
 	 */
 	asoc->max_retrans = sp->assocparams.sasoc_asocmaxrxt;
+	asoc->pf_retrans  = sctp_pf_retrans;
+
 	asoc->rto_initial = msecs_to_jiffies(sp->rtoinfo.srto_initial);
 	asoc->rto_max = msecs_to_jiffies(sp->rtoinfo.srto_max);
 	asoc->rto_min = msecs_to_jiffies(sp->rtoinfo.srto_min);
@@ -685,6 +687,9 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
 	/* Set the path max_retrans.  */
 	peer->pathmaxrxt = asoc->pathmaxrxt;
 
+	/* And the partial failure retrnas threshold */
+	peer->pf_retrans = asoc->pf_retrans;
+
 	/* Initialize the peer's SACK delay timeout based on the
 	 * association configured value.
 	 */
@@ -840,6 +845,7 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
 	struct sctp_ulpevent *event;
 	struct sockaddr_storage addr;
 	int spc_state = 0;
+	bool ulp_notify = true;
 
 	/* Record the transition on the transport.  */
 	switch (command) {
@@ -853,6 +859,14 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
 			spc_state = SCTP_ADDR_CONFIRMED;
 		else
 			spc_state = SCTP_ADDR_AVAILABLE;
+		/* Don't inform ULP about transition from PF to
+		 * active state and set cwnd to 1, see SCTP
+		 * Quick failover draft section 5.1, point 5
+		 */
+		if (transport->state == SCTP_PF) {
+			ulp_notify = false;
+			transport->cwnd = 1;
+		}
 		transport->state = SCTP_ACTIVE;
 		break;
 
@@ -871,6 +885,11 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
 		spc_state = SCTP_ADDR_UNREACHABLE;
 		break;
 
+	case SCTP_TRANSPORT_PF:
+		transport->state = SCTP_PF;
+		ulp_notify = false;
+		break;
+
 	default:
 		return;
 	}
@@ -878,12 +897,15 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
 	/* Generate and send a SCTP_PEER_ADDR_CHANGE notification to the
 	 * user.
 	 */
-	memset(&addr, 0, sizeof(struct sockaddr_storage));
-	memcpy(&addr, &transport->ipaddr, transport->af_specific->sockaddr_len);
-	event = sctp_ulpevent_make_peer_addr_change(asoc, &addr,
-				0, spc_state, error, GFP_ATOMIC);
-	if (event)
-		sctp_ulpq_tail_event(&asoc->ulpq, event);
+	if (ulp_notify) {
+		memset(&addr, 0, sizeof(struct sockaddr_storage));
+		memcpy(&addr, &transport->ipaddr,
+		       transport->af_specific->sockaddr_len);
+		event = sctp_ulpevent_make_peer_addr_change(asoc, &addr,
+					0, spc_state, error, GFP_ATOMIC);
+		if (event)
+			sctp_ulpq_tail_event(&asoc->ulpq, event);
+	}
 
 	/* Select new active and retran paths. */
 
@@ -899,7 +921,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
 			transports) {
 
 		if ((t->state == SCTP_INACTIVE) ||
-		    (t->state == SCTP_UNCONFIRMED))
+		    (t->state == SCTP_UNCONFIRMED) ||
+		    (t->state == SCTP_PF))
 			continue;
 		if (!first || t->last_time_heard > first->last_time_heard) {
 			second = first;
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index a0fa19f..e7aa177c 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -792,7 +792,8 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
 			if (!new_transport)
 				new_transport = asoc->peer.active_path;
 		} else if ((new_transport->state == SCTP_INACTIVE) ||
-			   (new_transport->state == SCTP_UNCONFIRMED)) {
+			   (new_transport->state == SCTP_UNCONFIRMED) ||
+			   (new_transport->state == SCTP_PF)) {
 			/* If the chunk is Heartbeat or Heartbeat Ack,
 			 * send it to chunk->transport, even if it's
 			 * inactive.
@@ -987,7 +988,8 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
 			new_transport = chunk->transport;
 			if (!new_transport ||
 			    ((new_transport->state == SCTP_INACTIVE) ||
-			     (new_transport->state == SCTP_UNCONFIRMED)))
+			     (new_transport->state == SCTP_UNCONFIRMED) ||
+			     (new_transport->state == SCTP_PF)))
 				new_transport = asoc->peer.active_path;
 			if (new_transport->state == SCTP_UNCONFIRMED)
 				continue;
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index c96d1a8..285e26a 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -76,6 +76,8 @@ static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
 			     sctp_cmd_seq_t *commands,
 			     gfp_t gfp);
 
+static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds,
+				     struct sctp_transport *t);
 /********************************************************************
  * Helper functions
  ********************************************************************/
@@ -470,7 +472,8 @@ sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES] = {
  * notification SHOULD be sent to the upper layer.
  *
  */
-static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
+static void sctp_do_8_2_transport_strike(sctp_cmd_seq_t *commands,
+					 struct sctp_association *asoc,
 					 struct sctp_transport *transport,
 					 int is_hb)
 {
@@ -495,6 +498,23 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
 			transport->error_count++;
 	}
 
+	/* If the transport error count is greater than the pf_retrans
+	 * threshold, and less than pathmaxrtx, then mark this transport
+	 * as Partially Failed, ee SCTP Quick Failover Draft, secon 5.1,
+	 * point 1
+	 */
+	if ((transport->state != SCTP_PF) &&
+	   (asoc->pf_retrans < transport->pathmaxrxt) &&
+	   (transport->error_count > asoc->pf_retrans)) {
+
+		sctp_assoc_control_transport(asoc, transport,
+					     SCTP_TRANSPORT_PF,
+					     0);
+
+		/* Update the hb timer to resend a heartbeat every rto */
+		sctp_cmd_hb_timer_update(commands, transport);
+	}
+
 	if (transport->state != SCTP_INACTIVE &&
 	    (transport->error_count > transport->pathmaxrxt)) {
 		SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p",
@@ -699,6 +719,10 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
 					     SCTP_HEARTBEAT_SUCCESS);
 	}
 
+	if (t->state == SCTP_PF)
+		sctp_assoc_control_transport(asoc, t, SCTP_TRANSPORT_UP,
+					     SCTP_HEARTBEAT_SUCCESS);
+
 	/* The receiver of the HEARTBEAT ACK should also perform an
 	 * RTT measurement for that destination transport address
 	 * using the time value carried in the HEARTBEAT ACK chunk.
@@ -1565,8 +1589,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
 
 		case SCTP_CMD_STRIKE:
 			/* Mark one strike against a transport.  */
-			sctp_do_8_2_transport_strike(asoc, cmd->obj.transport,
-						    0);
+			sctp_do_8_2_transport_strike(commands, asoc,
+						    cmd->obj.transport, 0);
 			break;
 
 		case SCTP_CMD_TRANSPORT_IDLE:
@@ -1576,7 +1600,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
 
 		case SCTP_CMD_TRANSPORT_HB_SENT:
 			t = cmd->obj.transport;
-			sctp_do_8_2_transport_strike(asoc, t, 1);
+			sctp_do_8_2_transport_strike(commands, asoc,
+						     t, 1);
 			t->hb_sent = 1;
 			break;
 
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index b3b8a8d..fef9bfa 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3470,6 +3470,56 @@ static int sctp_setsockopt_auto_asconf(struct sock *sk, char __user *optval,
 }
 
 
+/*
+ * SCTP_PEER_ADDR_THLDS
+ *
+ * This option allows us to alter the partially failed threshold for one or all
+ * transports in an association.  See Section 6.1 of:
+ * http://www.ietf.org/id/draft-nishida-tsvwg-sctp-failover-05.txt
+ */
+static int sctp_setsockopt_paddr_thresholds(struct sock *sk,
+					    char __user *optval,
+					    unsigned int optlen)
+{
+	struct sctp_paddrthlds val;
+	struct sctp_transport *trans;
+	struct sctp_association *asoc;
+
+	if (optlen < sizeof(struct sctp_paddrthlds))
+		return -EINVAL;
+	if (copy_from_user(&val, (struct sctp_paddrthlds __user *)optval,
+			   sizeof(struct sctp_paddrthlds)))
+		return -EFAULT;
+
+	/* path_max_retrans shouldn't ever be zero */
+	if (!val.spt_pathmaxrxt)
+		return -EINVAL;
+
+	if (sctp_is_any(sk, (const union sctp_addr *)&val.spt_address)) {
+		asoc = sctp_id2assoc(sk, val.spt_assoc_id);
+		if (!asoc)
+			return -ENOENT;
+		list_for_each_entry(trans, &asoc->peer.transport_addr_list,
+				    transports) {
+			trans->pathmaxrxt = val.spt_pathmaxrxt;
+			trans->pf_retrans = val.spt_pathpfthld;
+		}
+
+		asoc->pf_retrans = val.spt_pathpfthld;
+		asoc->pathmaxrxt = val.spt_pathmaxrxt;
+	} else {
+		trans = sctp_addr_id2transport(sk, &val.spt_address,
+					       val.spt_assoc_id);
+		if (!trans)
+			return -ENOENT;
+
+		trans->pathmaxrxt = val.spt_pathmaxrxt;
+		trans->pf_retrans = val.spt_pathpfthld;
+	}
+
+	return 0;
+}
+
 /* API 6.2 setsockopt(), getsockopt()
  *
  * Applications use setsockopt() and getsockopt() to set or retrieve
@@ -3619,6 +3669,9 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname,
 	case SCTP_AUTO_ASCONF:
 		retval = sctp_setsockopt_auto_asconf(sk, optval, optlen);
 		break;
+	case SCTP_PEER_ADDR_THLDS:
+		retval = sctp_setsockopt_paddr_thresholds(sk, optval, optlen);
+		break;
 	default:
 		retval = -ENOPROTOOPT;
 		break;
@@ -5490,6 +5543,50 @@ static int sctp_getsockopt_assoc_ids(struct sock *sk, int len,
 	return 0;
 }
 
+/*
+ * SCTP_PEER_ADDR_THLDS
+ *
+ * This option allows us to fetch the partially failed threshold for one or all
+ * transports in an association.  See Section 6.1 of:
+ * http://www.ietf.org/id/draft-nishida-tsvwg-sctp-failover-05.txt
+ */
+static int sctp_getsockopt_paddr_thresholds(struct sock *sk,
+					    char __user *optval,
+					    int optlen)
+{
+	struct sctp_paddrthlds val;
+	struct sctp_transport *trans;
+	struct sctp_association *asoc;
+
+	if (optlen < sizeof(struct sctp_paddrthlds))
+		return -EINVAL;
+	optlen = sizeof(struct sctp_paddrthlds);
+	if (copy_from_user(&val, (struct sctp_paddrthlds __user *)optval, optlen))
+		return -EFAULT;
+
+	if (sctp_is_any(sk, (const union sctp_addr *)&val.spt_address)) {
+		asoc = sctp_id2assoc(sk, val.spt_assoc_id);
+		if (!asoc)
+			return -ENOENT;
+
+		val.spt_pathpfthld = asoc->pf_retrans;
+		val.spt_pathmaxrxt = asoc->pathmaxrxt;
+	} else {
+		trans = sctp_addr_id2transport(sk, &val.spt_address,
+					       val.spt_assoc_id);
+		if (!trans)
+			return -ENOENT;
+
+		val.spt_pathmaxrxt = trans->pathmaxrxt;
+		val.spt_pathpfthld = trans->pf_retrans;
+	}
+
+	if (copy_to_user(optval, &val, optlen))
+		return -EFAULT;
+
+	return 0;
+}
+
 SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname,
 				char __user *optval, int __user *optlen)
 {
@@ -5628,6 +5725,9 @@ SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname,
 	case SCTP_AUTO_ASCONF:
 		retval = sctp_getsockopt_auto_asconf(sk, len, optval, optlen);
 		break;
+	case SCTP_PEER_ADDR_THLDS:
+		retval = sctp_getsockopt_paddr_thresholds(sk, optval, len);
+		break;
 	default:
 		retval = -ENOPROTOOPT;
 		break;
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index e5fe639..2b2bfe9 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -141,6 +141,15 @@ static ctl_table sctp_table[] = {
 		.extra2		= &int_max
 	},
 	{
+		.procname	= "pf_retrans",
+		.data		= &sctp_pf_retrans,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec_minmax,
+		.extra1		= &zero,
+		.extra2		= &int_max
+	},
+	{
 		.procname	= "max_init_retransmits",
 		.data		= &sctp_max_retrans_init,
 		.maxlen		= sizeof(int),
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index b026ba0..194d0f3 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -85,6 +85,7 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
 
 	/* Initialize the default path max_retrans.  */
 	peer->pathmaxrxt  = sctp_max_retrans_path;
+	peer->pf_retrans  = sctp_pf_retrans;
 
 	INIT_LIST_HEAD(&peer->transmitted);
 	INIT_LIST_HEAD(&peer->send_ready);
@@ -585,7 +586,8 @@ unsigned long sctp_transport_timeout(struct sctp_transport *t)
 {
 	unsigned long timeout;
 	timeout = t->rto + sctp_jitter(t->rto);
-	if (t->state != SCTP_UNCONFIRMED)
+	if ((t->state != SCTP_UNCONFIRMED) &&
+	    (t->state != SCTP_PF))
 		timeout += t->hbinterval;
 	timeout += jiffies;
 	return timeout;
-- 
1.7.7.6

^ permalink raw reply related

* Re: [PATCH 00/16]: Kill the ipv4 routing cache.
From: Ben Hutchings @ 2012-07-20 17:22 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20120720.092614.1285553995467252576.davem@davemloft.net>

On Fri, 2012-07-20 at 09:26 -0700, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Fri, 20 Jul 2012 16:09:29 +0100
> 
> > On Thu, 2012-07-19 at 14:34 -0700, David Miller wrote:
> >> The ipv4 routing cache is non-deterministic, performance wise, and is
> >> subject to reasonably easy to launch denial of service attacks.
> > [...]
> > 
> > This is a great explanation, but it still doesn't appear to be going
> > into the commit log...
> 
> What in the world do you mean?
> 
> When I actually commit this stuff, I'll have it all in a branch and
> merge it into net-next's master using "git merge --no-ff" and then use
> the merge commit to add this commit message test.
> 
> Every damn set of changes I've commited over the past few weeks have
> used this technique, are you simply not paying attention?

Sorry, I get it now.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
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] sunrpc: clnt: Add missing braces
From: Myklebust, Trond @ 2012-07-20 17:25 UTC (permalink / raw)
  To: Joe Perches
  Cc: David S. Miller, Myklebust, Trond, J. Bruce Fields, Chuck Lever,
	<linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
In-Reply-To: <1342803059.21447.45.camel@joe2Laptop>

No. It should go through the NFS client tree.

I can queue it up.


--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org
www.netapp.com

On Jul 20, 2012, at 6:50 PM, Joe Perches wrote:

> On Wed, 2012-07-18 at 11:17 -0700, Joe Perches wrote:
>> Add a missing set of braces that commit 4e0038b6b24
>> ("SUNRPC: Move clnt->cl_server into struct rpc_xprt")
>> forgot.
>> 
>> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
>> ---
>> net/sunrpc/clnt.c |    3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>> 
>> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
>> index f56f045..aaf70aa 100644
>> --- a/net/sunrpc/clnt.c
>> +++ b/net/sunrpc/clnt.c
>> @@ -1844,12 +1844,13 @@ call_timeout(struct rpc_task *task)
>> 		return;
>> 	}
>> 	if (RPC_IS_SOFT(task)) {
>> -		if (clnt->cl_chatty)
>> +		if (clnt->cl_chatty) {
>> 			rcu_read_lock();
>> 			printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
>> 				clnt->cl_protname,
>> 				rcu_dereference(clnt->cl_xprt)->servername);
>> 			rcu_read_unlock();
>> +		}
>> 		if (task->tk_flags & RPC_TASK_TIMEOUT)
>> 			rpc_exit(task, -ETIMEDOUT);
>> 		else
> 
> Hi David.
> 
> I think it'd be good to get this into 3.6 as a bug fix.
> 
> This is marked in netdev patchwork as "not applicable".
> 
> Do you need the sunrpc maintainers to apply or ack it
> and then push it to you?
> 
> Trond?  Bruce?
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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

* pull request: wireless-next 2012-07-20
From: John W. Linville @ 2012-07-20 17:20 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev

[-- Attachment #1: Type: text/plain, Size: 23676 bytes --]

commit 90b90f60c4f8e3a8525dfeb4aec46a9c7a29c857

Dave,

Here is what I hope to be the last non-fix pull request for wireless
bits going into 3.6.  It's mostly normal stuff, including driver
updates to ath9k, mwifiex, libertas, iwlwifi, and a few other bits.

Also included is a bluetooth pull.  Gustavo says:

	"This is my last pull towards 3.6, the biggest thing here is
	the new 3-wire UART Bluetooth driver by Johan Hedberg. The
	rest is just fixes and clean ups."

Finally, there is a pull of the wireless tree to pick-up a few minor
fixes I had queued that were not really worthy for this late in the
3.5 cycle.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit 769162e38b91e1d300752e666260fa6c7b203fbc:

  Merge branch 'net' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile (2012-07-19 13:39:27 -0700)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git for-davem

for you to fetch changes up to 90b90f60c4f8e3a8525dfeb4aec46a9c7a29c857:

  Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem (2012-07-20 12:30:48 -0400)

----------------------------------------------------------------

Alan Cox (1):
      mac80211: fix use after free

Amitkumar Karwar (5):
      mwifiex: correction in mcs index check
      mwifiex: remove redundant code in set channel path
      mwifiex: remove unnecessary code in data rate configuration
      mwifiex: add support to use basic rates in ibss join request
      mwifiex: improvement in cfg80211 set_bitrate_mask handler

Andre Guedes (4):
      Bluetooth: Remove magic value in disconnect mgmt handler
      Bluetooth: Use GFP_KERNEL in mgmt_handlers
      Bluetooth: Use GFP_KERNEL in mgmt_pending_add
      Bluetooth: Use GFP_KERNEL in mgmt events functions

Andrei Emeltchenko (20):
      Bluetooth: Use standard HCI cmd timeout for RESET
      Bluetooth: Update HCI timeouts constants to use msecs_to_jiffies
      Bluetooth: Add opcode to error message
      Bluetooth: Correct debug print specifier for u16 objects
      Bluetooth: Fix not setting HCI_RESET flag for AMP
      Bluetooth: Fix compile warnings in mgmt
      Bluetooth: Use AUTO_OFF constant in jiffies
      Bluetooth: Improve debugging messages for hci_conn
      Bluetooth: Fix warning: using int as NULL pointer
      Bluetooth: Route traffic only through BR/EDR controller
      Bluetooth: bluecard_cs: Shorten scope for iobase
      Bluetooth: Do not auto off AMP controller
      Bluetooth: btmrvl: trivial style fixes
      Bluetooth: debug: Add printing num of cmds queued
      Bluetooth: debug: Correct types specifiers for L2CAP
      Bluetooth: debug: Print CID and PSM in hex format
      Bluetooth: debug: Add debug to l2cap_security_cfm
      Bluetooth: debug: Use standard hex object specifiers in hci_event
      Bluetooth: debug: Print l2cap_chan refcount
      Bluetooth: debug: Print amp_mgr refcnt

Andy Shevchenko (1):
      wireless: brcm80211: use %pM to print BSSID

Arik Nemtsov (5):
      mac80211: fix invalid band deref building preq IEs
      wl18xx: alloc conf.phy memory to ensure alignemnt
      wl18xx: fix bogus compile warning on cc config option
      wlcore: don't issue SLEEP_AUTH command during recovery
      wl18xx: enable MIMO rates when connected as a MIMO STA

Christian Lamparter (2):
      mac80211: request TX status for BlockAck Requests
      mac80211: fix read outside array bounds

Chun-Yeow Yeoh (1):
      mac80211: Fix the Problem of Unreachable Mesh STA from DS

Daniel Drake (3):
      libertas: Update 11d info only when interface is active
      libertas: handle command failure immediately
      libertas USB: don't set surpriseremoved flag

Dave Jones (1):
      NFC: NCI module license 'unspecified' taints kernel

Devendra Naga (1):
      Bluetooth: cleanup dtl1_config

Duan Jiong (1):
      libertas: firmware.c: remove duplicated include

Eliad Peller (3):
      mac80211: go out of PS before sending disassoc
      wlcore: use basic rates for non-data packets
      mac80211: flush stations before stop beaconing

Emmanuel Grumbach (1):
      iwlwifi: REPLY_RX doesn't exist any more

Eric Lapuyade (1):
      NFC: Set target nfcid1 for all HCI reader A targets

Eyal Shapira (1):
      wlcore: don't re-configure wakeup conditions if not needed

Felix Fietkau (15):
      cfg80211: ignore channel state for stopped AP/mesh interfaces
      ath9k_hw: fix 5 GHz frequency selection on AR934x/AR955x with 25 MHz refclock
      ath9k_hw: fall back to OTP ROM when platform data has no valid eeprom data
      ath9k: validate rx antenna settings
      ath9k_hw: enable ANI on AR934x
      ath9k_hw: fix tx gain tables for AR934x
      ath9k_hw: remove redundant arguments to INIT_INI_ARRAY
      ath9k/ath9k_htc: fix txop limit handling
      ath9k: make per-WMM-AC queue sizes configurable via debugfs
      ath9k: fix aggregate size limit based on queue TXOP limit
      ath9k_hw: apply XPA timing control values from EEPROM
      ath9k_hw: clean up AR9003 EEPROM code
      ath9k_hw: apply XLNA bias settings from EEPROM
      ath9k_hw: fix SREV checks for applying tuning caps from EEPROM
      ath5k: fix txop limit handling

Forest Bond (1):
      rtlwifi: rtl8192de: Fix phy-based version calculation

Gustavo Padovan (2):
      Merge branch 'for-upstream' of git://git.kernel.org/.../bluetooth/bluetooth
      Merge branch 'for-upstream' of git://git.kernel.org/.../bluetooth/bluetooth

Igal Chernobelsky (1):
      wlcore: send EAPOLs using minimum basic rate for all roles

Jaganath Kanakkassery (1):
      Bluetooth: Refactor PIN code rejection to use user_pairing_resp()

Jefferson Delfes (1):
      Bluetooth: Fix flags of mgmt_device_found event

Johan Hedberg (19):
      Bluetooth: Change page scan interval in fast connectable mode
      Bluetooth: Initial skeleton for Three-wire UART (H5) support
      Bluetooth: Add basic state tracking to Three-wire UART driver
      Bluetooth: Add initial reliable packet support for Three-wire UART
      Bluetooth: Add basic packet parsing to Three-wire UART driver
      Bluetooth: Add initial packet sending support to Three-wire UART
      Bluetooth: Add Three-wire header value convenience macros
      Bluetooth: Fix/implement Three-wire reliable packet sending
      Bluetooth: Add support for Three-wire Link Control packets
      Bluetooth: Simplify hci_uart_tty_close logic
      Bluetooth: Add delayed init sequence support for UART controllers
      Bluetooth: Use delayed init for Three-wire UART
      Bluetooth: Improve rx debug logs for Three-wire UART
      Bluetooth: Add initial sleep support to Three-wire UART
      Bluetooth: Add initialization tracking to HCI Three-wire driver
      Bluetooth: Implement proper low-power support for Three-wire UART
      Bluetooth: Remove unnecessary h5_build_pkt function
      Bluetooth: Improve Three-wire UART configuration handling
      Bluetooth: Introduce a flags variable to Three-wire UART state

Johannes Berg (27):
      mac80211: update BSS info on AC parameters change
      mac80211: remove unused assignment
      mac80211: remove ieee80211_key_removed
      nl80211: prepare for non-netdev wireless devs
      nl80211: add NL80211_FLAG_NEED_WDEV
      nl80211: retrieve interface data by wdev
      nl80211: don't assume wdev->netdev exists
      cfg80211: use wdev in mgmt-tx/ROC APIs
      cfg80211: use wireless_dev for interface management
      nl80211: send interface after creation
      nl80211: move scan API to wdev
      mac80211: make scan_sdata pointer usable with RCU
      mac80211: track scheduled scan virtual interface
      mac80211: redesign scan RX
      mac80211: optimize ieee80211_rx_status struct layout
      mac80211: add time synchronisation with BSS for assoc
      mac80211: restructure key selection
      cfg80211: fix locking and lockdep complaints
      mac80211: iterate the virtual monitor interface
      iwlwifi: don't use stack memory for kmem cache name
      nl80211: allow enabling WoWLAN without triggers
      Revert "mac80211: refactor virtual monitor code"
      cfg80211/mac80211: re-add get_channel operation
      cfg80211: reduce monitor interface tracking
      nl80211: add wdev ID as u64 as it should
      b43: use temporary rate_index for error checking
      b43: fix crash with OpenFWWF

John W. Linville (7):
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-next
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless
      Merge branch 'master' of git://git.kernel.org/.../bluetooth/bluetooth-next
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211-next
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem

Kalle Valo (1):
      cfg80211: fix set_regdom() to cancel requests with same alpha2

Larry Finger (2):
      rtlwifi: Remove extra argument from queue setup routine
      rtlwifi: rtl8192cu: Change buffer allocation for synchronous reads

Luciano Coelho (2):
      wlcore: wait for command completion event when sending CMD_ROLE_STOP
      wlcore: increase command completion timeout

Luis R. Rodriguez (6):
      cfg80211: add CONFIG_CFG80211_CERTIFICATION_ONUS
      cfg80211: add cellular base station regulatory hint support
      cfg80211: rename reg_device_remove() to wiphy_regulatory_deregister()
      cfg80211: make regulatory_update() static
      cfg80211: remove regulatory_update()
      ath9k: make CONFIG_ATH9K_DFS_CERTIFIED depend on CFG80211_CERTIFICATION_ONUS

Mat Martineau (1):
      Bluetooth: Use tx window from config response for ack timing

Mathias Jeppsson (2):
      NFC: Fix empty HCI message list check
      NFC: Fix order of arguments to list_add_tail() when queueing HCP frames

Mohammed Shafi Shajakhan (11):
      ath9k_hw: Add register definitions for WoW support
      ath9k: Add definitions and structures to support WoW
      ath9k_hw: Add WoW hardware capability flags
      ath9k_hw: advertise WoW support for capable chipsets
      ath9k: advertise supported WoW flags to upper layer
      ath9k_hw: INI changes for WoW for AR9002 chipsets
      ath9k_hw: Add hardware code for WoW
      ath: Add Wake-on-Wireless debug mask
      ath9k: Add WoW related mac80211 callbacks
      ath9k: do not disable hardware while wow is enabled
      cfg80211: Fix mutex locking in reg_last_request_cell_base

Nicolas Cavallari (2):
      mac80211: tx: do not drop non-robust mgmt to non-MFP stas.
      mac80211: fix tx-mgmt cookie value being left uninitialized

Rafał Miłecki (6):
      bcma: support alternative (BCM4706) ChipCommon core id
      bcma: fix typo - reading number of slave wrappers
      bcma: add trivial GBIT MAC COMMON driver
      bcma: add new cores at the end of list
      bcma: cc: update defines
      bcma: add place for flash memory support

Rajkumar Manoharan (1):
      ath9k: Fix race in reset-work usage

Sujith Manoharan (11):
      ath9k: Fix beacon setup
      ath9k_hw: Cleanup ath9k_hw_set_tsfadjust
      ath9k: Cleanup interface handling
      ath9k: Simplify ASSOC handling
      ath9k: Cleanup beacon logic
      ath9k: Remove is_bslot_active
      ath9k: Cleanup beacon queue configuration
      ath9k: Set the TSF adjust value properly
      ath9k: Cleanup the beacon tasklet
      ath9k: Fix ANI management
      ath9k: Reconfigure VIF state properly

Sylvain Roger Rieunier (1):
      minstrel_ht: enable frame aggregation for fixed rate

Thomas Huehn (3):
      mwl8k: fix possible race condition in info->control.sta use
      brcmsmac: restructure info->control.sta handling as it is goning to be removed soon.
      mac80211_hwsim: fix race condition with sta/vif pointers

Thomas Pedersen (1):
      cfg80211: support TX error rate CQM

Vladimir Kondratiev (1):
      cfg80211: fix oops due to unassigned set_monitor_enabled callback

Wey-Yi Guy (1):
      iwlwifi: set correct 32 bit boost register value

Yair Shapira (5):
      wl18xx: add support for ht_mode in conf.h
      wlcore: add plt_mode including new PLT_FEM_DETECT
      wl18xx: disable calibrator based fem detect
      wlcore/wl12xx: calibrator fem detect implementation
      wlcore: make usage of nla_put clearer

 Documentation/DocBook/80211.tmpl                   |    1 -
 drivers/bcma/Kconfig                               |   19 +
 drivers/bcma/Makefile                              |    3 +
 drivers/bcma/bcma_private.h                        |   22 +
 drivers/bcma/driver_chipcommon_nflash.c            |   19 +
 drivers/bcma/driver_chipcommon_sflash.c            |   19 +
 drivers/bcma/driver_gmac_cmn.c                     |   14 +
 drivers/bcma/driver_mips.c                         |   15 +-
 drivers/bcma/main.c                                |   25 +-
 drivers/bcma/scan.c                                |   20 +-
 drivers/bcma/scan.h                                |    2 +-
 drivers/bluetooth/Kconfig                          |   12 +
 drivers/bluetooth/Makefile                         |    1 +
 drivers/bluetooth/bluecard_cs.c                    |    6 +-
 drivers/bluetooth/bt3c_cs.c                        |    2 +-
 drivers/bluetooth/btmrvl_main.c                    |    8 +-
 drivers/bluetooth/btmrvl_sdio.c                    |    3 +-
 drivers/bluetooth/btuart_cs.c                      |    2 +-
 drivers/bluetooth/dtl1_cs.c                        |   18 +-
 drivers/bluetooth/hci_h5.c                         |  747 ++++++++++++++++++++
 drivers/bluetooth/hci_ldisc.c                      |   66 +-
 drivers/bluetooth/hci_uart.h                       |   10 +
 drivers/net/wireless/ath/ath.h                     |    2 +
 drivers/net/wireless/ath/ath5k/mac80211-ops.c      |    2 +-
 drivers/net/wireless/ath/ath6kl/cfg80211.c         |   58 +-
 drivers/net/wireless/ath/ath6kl/cfg80211.h         |    6 +-
 drivers/net/wireless/ath/ath6kl/core.c             |    8 +-
 drivers/net/wireless/ath/ath6kl/core.h             |    5 +
 drivers/net/wireless/ath/ath6kl/wmi.c              |   10 +-
 drivers/net/wireless/ath/ath9k/Kconfig             |    2 +-
 drivers/net/wireless/ath/ath9k/Makefile            |    1 +
 drivers/net/wireless/ath/ath9k/ar9002_hw.c         |  160 ++---
 drivers/net/wireless/ath/ath9k/ar9002_initvals.h   |   14 +
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c     |  198 +++---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.h     |    3 +-
 drivers/net/wireless/ath/ath9k/ar9003_hw.c         |  546 ++++----------
 drivers/net/wireless/ath/ath9k/ar9003_phy.c        |    4 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.h        |    5 +
 drivers/net/wireless/ath/ath9k/ath9k.h             |   40 +-
 drivers/net/wireless/ath/ath9k/beacon.c            |  523 ++++++--------
 drivers/net/wireless/ath/ath9k/calib.h             |    6 +-
 drivers/net/wireless/ath/ath9k/debug.c             |   13 +-
 drivers/net/wireless/ath/ath9k/debug.h             |   24 +-
 drivers/net/wireless/ath/ath9k/eeprom.h            |    4 -
 drivers/net/wireless/ath/ath9k/htc_drv_main.c      |    4 +-
 drivers/net/wireless/ath/ath9k/hw.c                |   16 +-
 drivers/net/wireless/ath/ath9k/hw.h                |   84 ++-
 drivers/net/wireless/ath/ath9k/init.c              |   21 +-
 drivers/net/wireless/ath/ath9k/link.c              |   73 +-
 drivers/net/wireless/ath/ath9k/main.c              |  691 +++++++++++++-----
 drivers/net/wireless/ath/ath9k/mci.c               |    2 +-
 drivers/net/wireless/ath/ath9k/pci.c               |    3 +
 drivers/net/wireless/ath/ath9k/recv.c              |    2 +-
 drivers/net/wireless/ath/ath9k/reg.h               |  145 +++-
 drivers/net/wireless/ath/ath9k/wow.c               |  532 ++++++++++++++
 drivers/net/wireless/ath/ath9k/xmit.c              |  102 +--
 drivers/net/wireless/b43/b43.h                     |    7 -
 drivers/net/wireless/b43/main.c                    |   32 +-
 drivers/net/wireless/b43/xmit.c                    |    9 +-
 .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c  |    7 +-
 drivers/net/wireless/brcm80211/brcmsmac/ampdu.c    |   11 +-
 .../net/wireless/brcm80211/brcmsmac/mac80211_if.c  |    2 +
 drivers/net/wireless/brcm80211/brcmsmac/main.c     |    2 +-
 drivers/net/wireless/iwlegacy/common.c             |    2 +-
 drivers/net/wireless/iwlwifi/dvm/commands.h        |    1 +
 drivers/net/wireless/iwlwifi/dvm/lib.c             |    2 +
 drivers/net/wireless/iwlwifi/dvm/main.c            |    1 -
 drivers/net/wireless/iwlwifi/dvm/rx.c              |   44 +-
 drivers/net/wireless/iwlwifi/dvm/rxon.c            |    2 +-
 drivers/net/wireless/iwlwifi/iwl-config.h          |    2 +-
 drivers/net/wireless/iwlwifi/iwl-trans.h           |    1 +
 drivers/net/wireless/iwlwifi/pcie/2000.c           |    2 +-
 drivers/net/wireless/iwlwifi/pcie/trans.c          |    7 +-
 drivers/net/wireless/libertas/cfg.c                |    7 +-
 drivers/net/wireless/libertas/cmd.c                |   25 +-
 drivers/net/wireless/libertas/cmd.h                |    4 +-
 drivers/net/wireless/libertas/dev.h                |    1 +
 drivers/net/wireless/libertas/firmware.c           |    2 -
 drivers/net/wireless/libertas/if_usb.c             |    1 -
 drivers/net/wireless/libertas/main.c               |    6 +
 drivers/net/wireless/mac80211_hwsim.c              |    5 -
 drivers/net/wireless/mwifiex/cfg80211.c            |  287 ++++----
 drivers/net/wireless/mwifiex/cfp.c                 |   31 -
 drivers/net/wireless/mwifiex/decl.h                |    9 -
 drivers/net/wireless/mwifiex/fw.h                  |   10 -
 drivers/net/wireless/mwifiex/init.c                |    1 -
 drivers/net/wireless/mwifiex/ioctl.h               |    6 -
 drivers/net/wireless/mwifiex/main.c                |    4 +-
 drivers/net/wireless/mwifiex/main.h                |   20 +-
 drivers/net/wireless/mwifiex/sta_cmd.c             |   38 -
 drivers/net/wireless/mwifiex/sta_cmdresp.c         |   70 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c           |  287 +-------
 drivers/net/wireless/mwl8k.c                       |    5 +-
 drivers/net/wireless/orinoco/cfg.c                 |    2 +-
 drivers/net/wireless/rndis_wlan.c                  |    5 +-
 drivers/net/wireless/rt2x00/rt2x00config.c         |    2 +-
 drivers/net/wireless/rtlwifi/base.c                |    2 +-
 drivers/net/wireless/rtlwifi/base.h                |    2 +-
 drivers/net/wireless/rtlwifi/pci.c                 |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c       |    6 +-
 drivers/net/wireless/rtlwifi/usb.c                 |   14 +-
 drivers/net/wireless/rtlwifi/wifi.h                |    1 +
 drivers/net/wireless/ti/wl12xx/cmd.c               |   34 +-
 drivers/net/wireless/ti/wl12xx/main.c              |   23 +
 drivers/net/wireless/ti/wl18xx/conf.h              |   21 +-
 drivers/net/wireless/ti/wl18xx/io.c                |    2 +-
 drivers/net/wireless/ti/wl18xx/main.c              |  117 ++-
 drivers/net/wireless/ti/wlcore/cmd.c               |   12 +
 drivers/net/wireless/ti/wlcore/cmd.h               |    2 +-
 drivers/net/wireless/ti/wlcore/main.c              |   44 +-
 drivers/net/wireless/ti/wlcore/testmode.c          |   85 ++-
 drivers/net/wireless/ti/wlcore/tx.c                |   14 +-
 drivers/net/wireless/ti/wlcore/wlcore.h            |    2 +
 drivers/net/wireless/ti/wlcore/wlcore_i.h          |    8 +-
 include/linux/bcma/bcma.h                          |    2 +
 include/linux/bcma/bcma_driver_chipcommon.h        |   51 +-
 include/linux/bcma/bcma_driver_gmac_cmn.h          |  100 +++
 include/linux/nl80211.h                            |   53 ++
 include/net/bluetooth/hci.h                        |   11 +-
 include/net/bluetooth/hci_core.h                   |    8 +-
 include/net/bluetooth/l2cap.h                      |    5 +
 include/net/bluetooth/mgmt.h                       |    2 +-
 include/net/cfg80211.h                             |  107 ++-
 include/net/mac80211.h                             |   40 +-
 include/net/regulatory.h                           |    5 +
 net/bluetooth/a2mp.c                               |    4 +-
 net/bluetooth/hci_conn.c                           |   47 +-
 net/bluetooth/hci_core.c                           |   77 +-
 net/bluetooth/hci_event.c                          |  170 ++---
 net/bluetooth/l2cap_core.c                         |  151 ++--
 net/bluetooth/mgmt.c                               |   60 +-
 net/mac80211/agg-tx.c                              |    3 +-
 net/mac80211/cfg.c                                 |   62 +-
 net/mac80211/debugfs.c                             |    2 -
 net/mac80211/ieee80211_i.h                         |   24 +-
 net/mac80211/iface.c                               |   60 +-
 net/mac80211/key.c                                 |   20 -
 net/mac80211/main.c                                |    3 +-
 net/mac80211/mlme.c                                |   62 +-
 net/mac80211/offchannel.c                          |   12 +-
 net/mac80211/rc80211_minstrel_ht.c                 |    8 +-
 net/mac80211/rx.c                                  |   49 +-
 net/mac80211/scan.c                                |  116 +--
 net/mac80211/status.c                              |    9 +-
 net/mac80211/trace.h                               |    6 +-
 net/mac80211/tx.c                                  |   30 +-
 net/mac80211/util.c                                |   11 +
 net/nfc/hci/core.c                                 |   20 +-
 net/nfc/hci/hcp.c                                  |    2 +-
 net/nfc/nci/core.c                                 |    3 +
 net/wireless/Kconfig                               |   21 +
 net/wireless/chan.c                                |   24 +-
 net/wireless/core.c                                |   79 +--
 net/wireless/core.h                                |   14 +-
 net/wireless/mlme.c                                |   47 +-
 net/wireless/nl80211.c                             |  537 ++++++++++----
 net/wireless/nl80211.h                             |   21 +-
 net/wireless/reg.c                                 |  132 +++-
 net/wireless/reg.h                                 |    8 +-
 net/wireless/scan.c                                |   24 +-
 net/wireless/sme.c                                 |   10 +-
 net/wireless/util.c                                |   17 +-
 net/wireless/wext-compat.c                         |    9 +-
 163 files changed, 5129 insertions(+), 2905 deletions(-)
 create mode 100644 drivers/bcma/driver_chipcommon_nflash.c
 create mode 100644 drivers/bcma/driver_chipcommon_sflash.c
 create mode 100644 drivers/bcma/driver_gmac_cmn.c
 create mode 100644 drivers/bluetooth/hci_h5.c
 create mode 100644 drivers/net/wireless/ath/ath9k/wow.c
 create mode 100644 include/linux/bcma/bcma_driver_gmac_cmn.h
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 00/16]: Kill the ipv4 routing cache.
From: David Miller @ 2012-07-20 17:42 UTC (permalink / raw)
  To: eric.dumazet; +Cc: bhutchings, netdev
In-Reply-To: <1342802634.2626.7718.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 20 Jul 2012 18:43:54 +0200

> It would be nice if you can copy the changelog of 00/16 to 01/16

I can crib the first few paragraphs that describe the justification,
sure.

^ permalink raw reply

* Re: New commands to configure IOV features
From: Ben Hutchings @ 2012-07-20 17:42 UTC (permalink / raw)
  To: Don Dutile
  Cc: Chris Friesen, David Miller, yuvalmin, gregory.v.rose, netdev,
	linux-pci
In-Reply-To: <50097FBD.9080202@redhat.com>

On Fri, 2012-07-20 at 11:56 -0400, Don Dutile wrote:
> On 07/20/2012 11:27 AM, Chris Friesen wrote:
> > On 07/17/2012 03:11 PM, David Miller wrote:
> >> From: Chris Friesen<chris.friesen@genband.com>
> >> Date: Tue, 17 Jul 2012 15:08:45 -0600
> >>
> >>> From that perspective a sysfs-based interface is ideal since it is
> >>> directly scriptable.
> >>
> >> As is anything ethtool or netlink based, since we have 'ethtool'
> >> and 'ip' for scripting.
> >
> > I'm not picky...whatever works.
> >
> > To me the act of creating virtual functions seems generic enough (I'm aware of SR-IOV capable storage controllers, I'm sure there is other hardware as well) that ethtool/ip don't really seem like the most appropriate tools for the job.
> >
> Yes, and then there are 'other network' controllers too ... IB  which
> I don't know if it adheres to ethtool, since it's not an Ethernet
> device ... isn't that why they call it Infiniband ... ;-) )
> In the telecom space, they use NTBs and PCI as a 'network' ... I know,
> not common in Linux space, and VFs in that space aren't being
> discussed (that I've ever heard), but another example where
> 'network' != Ethernet, so ethtool doesn't solve PCI-level
> configuration/use.
[...]

The ethtool API is typically used for net device operations that can be
largely devolved to individual drivers, and which the network stack can
mostly ignore (though offload features are an historical exception to
this).  It started with Ethernet link settings, but many operations are
applicable (and implemented by) other types of network device.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
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 v4] sctp: Implement quick failover draft from tsvwg
From: Vlad Yasevich @ 2012-07-20 17:55 UTC (permalink / raw)
  To: Neil Horman; +Cc: netdev, Sridhar Samudrala, David S. Miller, linux-sctp, joe
In-Reply-To: <1342804752-17044-1-git-send-email-nhorman@tuxdriver.com>

On 07/20/2012 01:19 PM, Neil Horman wrote:
> I've seen several attempts recently made to do quick failover of sctp transports
> by reducing various retransmit timers and counters.  While its possible to
> implement a faster failover on multihomed sctp associations, its not
> particularly robust, in that it can lead to unneeded retransmits, as well as
> false connection failures due to intermittent latency on a network.
>
> Instead, lets implement the new ietf quick failover draft found here:
> http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05
>
> This will let the sctp stack identify transports that have had a small number of
> errors, and avoid using them quickly until their reliability can be
> re-established.  I've tested this out on two virt guests connected via multiple
> isolated virt networks and believe its in compliance with the above draft and
> works well.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Vlad Yasevich <vyasevich@gmail.com>
> CC: Sridhar Samudrala <sri@us.ibm.com>
> CC: "David S. Miller" <davem@davemloft.net>
> CC: linux-sctp@vger.kernel.org
> CC: joe@perches.com
>
> ---
> Change notes:
>
> V2)
> - Added socket option API from section 6.1 of the specification, as per
> request from Vlad. Adding this socket option allows us to alter both the path
> maximum retransmit value and the path partial failure threshold for each
> transport and the association as a whole.
>
> - Added a per transport pf_retrans value, and initialized it from the
> association value.  This makes each transport independently configurable as per
> the socket option above, and prevents changes in the sysctl from bleeding into
> an already created association.
>
> V3)
> - Cleaned up some line spacing (Joe Perches)
> - Fixed some socket option user data sanitization (Vlad Yasevich)
>
> V4)
> - Added additional documentation (Flavio Leitner)
> ---
>   Documentation/networking/ip-sysctl.txt |   14 +++++
>   include/net/sctp/constants.h           |    1 +
>   include/net/sctp/structs.h             |   20 ++++++-
>   include/net/sctp/user.h                |   11 ++++
>   net/sctp/associola.c                   |   37 ++++++++++--
>   net/sctp/outqueue.c                    |    6 +-
>   net/sctp/sm_sideeffect.c               |   33 +++++++++-
>   net/sctp/socket.c                      |  100 ++++++++++++++++++++++++++++++++
>   net/sctp/sysctl.c                      |    9 +++
>   net/sctp/transport.c                   |    4 +-
>   10 files changed, 220 insertions(+), 15 deletions(-)
>

[ snip ]

>
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index b3b8a8d..fef9bfa 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -3470,6 +3470,56 @@ static int sctp_setsockopt_auto_asconf(struct sock *sk, char __user *optval,
>   }
>
>
> +/*
> + * SCTP_PEER_ADDR_THLDS
> + *
> + * This option allows us to alter the partially failed threshold for one or all
> + * transports in an association.  See Section 6.1 of:
> + * http://www.ietf.org/id/draft-nishida-tsvwg-sctp-failover-05.txt
> + */
> +static int sctp_setsockopt_paddr_thresholds(struct sock *sk,
> +					    char __user *optval,
> +					    unsigned int optlen)
> +{
> +	struct sctp_paddrthlds val;
> +	struct sctp_transport *trans;
> +	struct sctp_association *asoc;
> +
> +	if (optlen < sizeof(struct sctp_paddrthlds))
> +		return -EINVAL;
> +	if (copy_from_user(&val, (struct sctp_paddrthlds __user *)optval,
> +			   sizeof(struct sctp_paddrthlds)))
> +		return -EFAULT;
> +
> +	/* path_max_retrans shouldn't ever be zero */
> +	if (!val.spt_pathmaxrxt)
> +		return -EINVAL;

I am not sure I like this solution.  This means that the application 
must fetch the pathmaxrx and then write the same value back here.
Why not simply ignore the patthmaxrxt if it's 0?  That way someone can 
just tweak the pf value without changing the pathmaxrxt.



> +
> +	if (sctp_is_any(sk, (const union sctp_addr *)&val.spt_address)) {
> +		asoc = sctp_id2assoc(sk, val.spt_assoc_id);
> +		if (!asoc)
> +			return -ENOENT;
> +		list_for_each_entry(trans, &asoc->peer.transport_addr_list,
> +				    transports) {
> +			trans->pathmaxrxt = val.spt_pathmaxrxt;
> +			trans->pf_retrans = val.spt_pathpfthld;
> +		}
> +
> +		asoc->pf_retrans = val.spt_pathpfthld;
> +		asoc->pathmaxrxt = val.spt_pathmaxrxt;
> +	} else {
> +		trans = sctp_addr_id2transport(sk, &val.spt_address,
> +					       val.spt_assoc_id);
> +		if (!trans)
> +			return -ENOENT;
> +
> +		trans->pathmaxrxt = val.spt_pathmaxrxt;
> +		trans->pf_retrans = val.spt_pathpfthld;
> +	}
> +
> +	return 0;
> +}
> +
>   /* API 6.2 setsockopt(), getsockopt()
>    *
>    * Applications use setsockopt() and getsockopt() to set or retrieve
> @@ -3619,6 +3669,9 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname,
>   	case SCTP_AUTO_ASCONF:
>   		retval = sctp_setsockopt_auto_asconf(sk, optval, optlen);
>   		break;
> +	case SCTP_PEER_ADDR_THLDS:
> +		retval = sctp_setsockopt_paddr_thresholds(sk, optval, optlen);
> +		break;
>   	default:
>   		retval = -ENOPROTOOPT;
>   		break;
> @@ -5490,6 +5543,50 @@ static int sctp_getsockopt_assoc_ids(struct sock *sk, int len,
>   	return 0;
>   }
>
> +/*
> + * SCTP_PEER_ADDR_THLDS
> + *
> + * This option allows us to fetch the partially failed threshold for one or all
> + * transports in an association.  See Section 6.1 of:
> + * http://www.ietf.org/id/draft-nishida-tsvwg-sctp-failover-05.txt
> + */
> +static int sctp_getsockopt_paddr_thresholds(struct sock *sk,
> +					    char __user *optval,
> +					    int optlen)
> +{
> +	struct sctp_paddrthlds val;
> +	struct sctp_transport *trans;
> +	struct sctp_association *asoc;
> +
> +	if (optlen < sizeof(struct sctp_paddrthlds))
> +		return -EINVAL;
> +	optlen = sizeof(struct sctp_paddrthlds);
> +	if (copy_from_user(&val, (struct sctp_paddrthlds __user *)optval, optlen))
> +		return -EFAULT;
> +
> +	if (sctp_is_any(sk, (const union sctp_addr *)&val.spt_address)) {
> +		asoc = sctp_id2assoc(sk, val.spt_assoc_id);
> +		if (!asoc)
> +			return -ENOENT;
> +
> +		val.spt_pathpfthld = asoc->pf_retrans;
> +		val.spt_pathmaxrxt = asoc->pathmaxrxt;
> +	} else {
> +		trans = sctp_addr_id2transport(sk, &val.spt_address,
> +					       val.spt_assoc_id);
> +		if (!trans)
> +			return -ENOENT;
> +
> +		val.spt_pathmaxrxt = trans->pathmaxrxt;
> +		val.spt_pathpfthld = trans->pf_retrans;
> +	}
> +
> +	if (copy_to_user(optval, &val, optlen))
> +		return -EFAULT;
> +

getsockopt typically returns the length of the option data that was 
written to the user.

> +	return 0;
> +}
> +
>   SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname,
>   				char __user *optval, int __user *optlen)
>   {
> @@ -5628,6 +5725,9 @@ SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname,
>   	case SCTP_AUTO_ASCONF:
>   		retval = sctp_getsockopt_auto_asconf(sk, len, optval, optlen);
>   		break;
> +	case SCTP_PEER_ADDR_THLDS:
> +		retval = sctp_getsockopt_paddr_thresholds(sk, optval, len);
> +		break;

You are passing the len.  The user may have passed in a bigger buffer 
and is expecting back the length of the option.

-vlad

>   	default:
>   		retval = -ENOPROTOOPT;
>   		break;
> diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
> index e5fe639..2b2bfe9 100644
> --- a/net/sctp/sysctl.c
> +++ b/net/sctp/sysctl.c
> @@ -141,6 +141,15 @@ static ctl_table sctp_table[] = {
>   		.extra2		= &int_max
>   	},
>   	{
> +		.procname	= "pf_retrans",
> +		.data		= &sctp_pf_retrans,
> +		.maxlen		= sizeof(int),
> +		.mode		= 0644,
> +		.proc_handler	= proc_dointvec_minmax,
> +		.extra1		= &zero,
> +		.extra2		= &int_max
> +	},
> +	{
>   		.procname	= "max_init_retransmits",
>   		.data		= &sctp_max_retrans_init,
>   		.maxlen		= sizeof(int),
> diff --git a/net/sctp/transport.c b/net/sctp/transport.c
> index b026ba0..194d0f3 100644
> --- a/net/sctp/transport.c
> +++ b/net/sctp/transport.c
> @@ -85,6 +85,7 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
>
>   	/* Initialize the default path max_retrans.  */
>   	peer->pathmaxrxt  = sctp_max_retrans_path;
> +	peer->pf_retrans  = sctp_pf_retrans;
>
>   	INIT_LIST_HEAD(&peer->transmitted);
>   	INIT_LIST_HEAD(&peer->send_ready);
> @@ -585,7 +586,8 @@ unsigned long sctp_transport_timeout(struct sctp_transport *t)
>   {
>   	unsigned long timeout;
>   	timeout = t->rto + sctp_jitter(t->rto);
> -	if (t->state != SCTP_UNCONFIRMED)
> +	if ((t->state != SCTP_UNCONFIRMED) &&
> +	    (t->state != SCTP_PF))
>   		timeout += t->hbinterval;
>   	timeout += jiffies;
>   	return timeout;
>

^ permalink raw reply

* Re: [PATCH v2 net-next] tcp: fix ABC in tcp_slow_start()
From: Neal Cardwell @ 2012-07-20 17:58 UTC (permalink / raw)
  To: Yuchung Cheng
  Cc: Eric Dumazet, David Miller, netdev, Tom Herbert,
	Stephen Hemminger, John Heffner, Nandita Dukkipati
In-Reply-To: <CAK6E8=dkwruGMtW2uQ--xZ_so9aZQt-KcmHsy2yE5GApKphrJQ@mail.gmail.com>

On Fri, Jul 20, 2012 at 8:07 AM, Yuchung Cheng <ycheng@google.com> wrote:
> On Fri, Jul 20, 2012 at 8:02 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> When/if sysctl_tcp_abc > 1, we expect to increase cwnd by 2 if the
>> received ACK acknowledges more than 2*MSS bytes, in tcp_slow_start()
>>
>> Problem is this RFC 3465 statement is not correctly coded, as
>> the while () loop increases snd_cwnd one by one.
>>
>> Add a new variable to avoid this off-by one error.
>>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Yuchung Cheng <ycheng@google.com>

Acked-by: Neal Cardwell <ncardwell@google.com>

neal

^ permalink raw reply

* Re: [PATCH] myri10ge: update MAINTAINERS
From: David Miller @ 2012-07-20 17:59 UTC (permalink / raw)
  To: jdmason; +Cc: netdev
In-Reply-To: <1342764673-16671-1-git-send-email-jdmason@kudzu.us>

From: Jon Mason <jdmason@kudzu.us>
Date: Thu, 19 Jul 2012 23:11:13 -0700

> Remove myself from myri10ge MAINTAINERS list
> 
> Signed-off-by: Jon Mason <jdmason@kudzu.us>

Applied to net-next

^ permalink raw reply


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