Netdev List
 help / color / mirror / Atom feed
* Re: Blackfin Ethernet MAC driver compile error
From: Bryan Wu @ 2007-10-04  9:20 UTC (permalink / raw)
  To: Robin Getz; +Cc: Kalle Pokki, linux-kernel, netdev, bryan.wu
In-Reply-To: <200710021136.38514.rgetz@blackfin.uclinux.org>

On Tue, 2007-10-02 at 23:36 +0800, Robin Getz wrote:
> On Tue 2 Oct 2007 07:30, Kalle Pokki pondered: 
> > The Blackfin Ethernet MAC driver does not compile. It seems the
> driver is 
> > missing some pinmux defines. 
> > 
> >   CC      drivers/net/bfin_mac.o 
> > drivers/net/bfin_mac.c: In function 'setup_pin_mux': 
> > drivers/net/bfin_mac.c:275: error: 'P_MII0' undeclared (first use
> in 
> > this function) 
> > drivers/net/bfin_mac.c:275: error: (Each undeclared identifier is 
> > reported only once 
> > drivers/net/bfin_mac.c:275: error: for each function it appears in.)
> 
> Unfortunately, Bryan is out for the week, so he can't update things..

I am here, although it is National Day holiday in China and I am not in
office.
> 
> The updates to include/asm-blackfin/mach-bf537/portmux.h seem to have
> been 
> missing from Bryan's git tree, and therefore were not pushed to
> Linus's tree.
> 
Yes, it was not merged to Linus's tree almost one month ago.
But now Linus git-pull it from my git-tree 
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=66b1f1a982bf4dbad9fa0de25b8d95c4936f05c4

> Sigh. - Sorry about that.
> 
> When Bryan gets back, he will update things, but for now, this might
> work. (I 
> don't know if there are any other interdependencies).
> 
Sorry again, some important core API changes should be merged before
drivers.
> 
> --- portmux.h   2007-10-02 11:18:34.000000000 -0400 
> +++ ./linux-2.6.x/include/asm-blackfin/mach-bf537/portmux.h
> 2007-08-18 
> 19:37:22.000000000 -0400 
> @@ -99,11 +99,44 @@ 
>  #define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(PORT_PJ8) | P_FUNCT(0)) 
>  #define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(PORT_PJ9) | P_FUNCT(0)) 
>  #define P_SPORT0_TFS   (P_DEFINED | P_IDENT(PORT_PJ10) | P_FUNCT(0)) 
> -#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1)) 
> +#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(0)) 
>  #define P_CAN0_RX      (P_DEFINED | P_IDENT(PORT_PJ4) | P_FUNCT(1)) 
>  #define P_CAN0_TX      (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(1)) 
>  #define P_SPI0_SSEL3   (P_DEFINED | P_IDENT(PORT_PJ10) | P_FUNCT(1)) 
>  #define P_SPI0_SSEL2   (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1)) 
>  #define P_SPI0_SSEL7   (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2)) 
>   
> -#endif /* _MACH_PORTMUX_H_ */ 
> +#define P_MII0 {\ 
> +       P_MII0_ETxD0, \ 
> +       P_MII0_ETxD1, \ 
> +       P_MII0_ETxD2, \ 
> +       P_MII0_ETxD3, \ 
> +       P_MII0_ETxEN, \ 
> +       P_MII0_TxCLK, \ 
> +       P_MII0_PHYINT, \ 
> +       P_MII0_COL, \ 
> +       P_MII0_ERxD0, \ 
> +       P_MII0_ERxD1, \ 
> +       P_MII0_ERxD2, \ 
> +       P_MII0_ERxD3, \ 
> +       P_MII0_ERxDV, \ 
> +       P_MII0_ERxCLK, \ 
> +       P_MII0_ERxER, \ 
> +       P_MII0_CRS, \ 
> +       P_MDC, \ 
> +       P_MDIO, 0} 
> + 
> + 
> +#define P_RMII0 {\ 
> +       P_MII0_ETxD0, \ 
> +       P_MII0_ETxD1, \ 
> +       P_MII0_ETxEN, \ 
> +       P_MII0_ERxD0, \ 
> +       P_MII0_ERxD1, \ 
> +       P_MII0_ERxER, \ 
> +       P_RMII0_REF_CLK, \ 
> +       P_RMII0_MDINT, \ 
> +       P_RMII0_CRS_DV, \ 
> +       P_MDC, \ 
> +       P_MDIO, 0} 
> +#endif                                 /* _MACH_PORTMUX_H_ */
> 
> > drivers/net/bfin_mac.c:279: error: implicit declaration of function 
> > 'peripheral_request_list' 
> > drivers/net/bfin_mac.c:285: error: implicit declaration of function 
> > 'peripheral_free_list'
> 
> Arg.
> 
> This was in an arch/blackfin/kernel/bfin_gpio.c update that hasn't
> seem to 
> made it either.
> 
> In the future - we will make sure driver submissions are done in the
> correct 
> order - so the proper infrastructure is in the tree before the driver
> is 
> submitted. - Sorry.
> 
I will try my best to keep them in order or fix it as soon as possible,
-:)))

[!snip!]
> 
Thanks
-Bryan
> 

^ permalink raw reply

* Re: [PATCH net-2.6.24 0/3]: More TCP fixes
From: Ilpo Järvinen @ 2007-10-04 10:13 UTC (permalink / raw)
  To: Cedric Le Goater; +Cc: David Miller, Netdev
In-Reply-To: <4703B16C.2000106@fr.ibm.com>

On Wed, 3 Oct 2007, Cedric Le Goater wrote:

> Cedric Le Goater wrote:
> > 
> > Below are the messages I got on 2) right after running ketchup (which does 
> > a wget www.kernel.org) 

Oops, those tcp_fragment WARNINGs in the other mail were due to bug in 
the debug patch as it called verify too early in there (before queue was 
adjusted, no wonder it finds state inconsistent at that point, fixed that)...

...So please discard all old debug patches, they're all broken in this 
respect... :-(

> > not a warning on 1) with your extra verbose patch.
> 
> bummer, I got this one on 1) :(
>
> WARNING: at /home/legoater/linux/net-2.6.24.git/net/ipv4/tcp_input.c:2325 tcp_fastretrans_alert()
> Call Trace:
>  <IRQ>  [<ffffffff8022ddb6>] __wake_up+0x1f/0x4c
>  [<ffffffff803fd9d3>] tcp_ack+0xcee/0x18ac
>  [<ffffffff80400764>] tcp_rcv_established+0x61f/0x6df

...I just wonder why that's the first place where it occurs... Can you try 
the debug patch below (fixed verify place in tcp_fragment/collapse, added 
some of them to narrow it down, and handled GSO more user friendly way in 
the printout). Put it on top of those three patches (mm should be fine :-)).
...I wish the verify triggers way before the fastretrans trap (for some 
reason it didn't do that in the quoted trace, maybe I had some verifys 
missing in that old patch or something)...


-- 
 i.

 include/net/tcp.h     |    3 +
 net/ipv4/tcp_input.c  |   41 +++++++++++++++---
 net/ipv4/tcp_ipv4.c   |  113 +++++++++++++++++++++++++++++++++++++++++++++++++
 net/ipv4/tcp_output.c |    4 +-
 4 files changed, 154 insertions(+), 7 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 991ccdc..54a0d91 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -43,6 +43,9 @@
 
 #include <linux/seq_file.h>
 
+extern void tcp_verify_fackets(struct sock *sk);
+extern void tcp_print_queue(struct sock *sk);
+
 extern struct inet_hashinfo tcp_hashinfo;
 
 extern atomic_t tcp_orphan_count;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 87c9ef5..7707b1d 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1140,7 +1140,7 @@ static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb,
 	return dup_sack;
 }
 
-static int
+int
 tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_una)
 {
 	const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -1159,6 +1159,9 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 	int i;
 	int first_sack_index;
 
+	if (WARN_ON(!tp->sacked_out && tp->fackets_out))
+		tcp_print_queue(sk);
+
 	if (!tp->sacked_out) {
 		if (WARN_ON(tp->fackets_out))
 			tp->fackets_out = 0;
@@ -1421,6 +1424,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 			}
 		}
 	}
+	tcp_verify_fackets(sk);
 
 	/* Check for lost retransmit. This superb idea is
 	 * borrowed from "ratehalving". Event "C".
@@ -1633,13 +1637,14 @@ void tcp_enter_frto(struct sock *sk)
 	tcp_set_ca_state(sk, TCP_CA_Disorder);
 	tp->high_seq = tp->snd_nxt;
 	tp->frto_counter = 1;
+	tcp_verify_fackets(sk);
 }
 
 /* Enter Loss state after F-RTO was applied. Dupack arrived after RTO,
  * which indicates that we should follow the traditional RTO recovery,
  * i.e. mark everything lost and do go-back-N retransmission.
  */
-static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
+void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct sk_buff *skb;
@@ -1676,6 +1681,7 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
 		}
 	}
 	tcp_verify_left_out(tp);
+	tcp_verify_fackets(sk);
 
 	tp->snd_cwnd = tcp_packets_in_flight(tp) + allowed_segments;
 	tp->snd_cwnd_cnt = 0;
@@ -1754,6 +1760,7 @@ void tcp_enter_loss(struct sock *sk, int how)
 		}
 	}
 	tcp_verify_left_out(tp);
+	tcp_verify_fackets(sk);
 
 	tp->reordering = min_t(unsigned int, tp->reordering,
 					     sysctl_tcp_reordering);
@@ -2309,7 +2316,7 @@ static void tcp_mtup_probe_success(struct sock *sk, struct sk_buff *skb)
  * It does _not_ decide what to send, it is made in function
  * tcp_xmit_retransmit_queue().
  */
-static void
+void
 tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);
@@ -2318,13 +2325,20 @@ tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
 	int do_lost = is_dupack || ((flag&FLAG_DATA_SACKED) &&
 				    (tp->fackets_out > tp->reordering));
 
+	tcp_verify_fackets(sk);
+
 	/* Some technical things:
 	 * 1. Reno does not count dupacks (sacked_out) automatically. */
-	if (!tp->packets_out)
+	if (!tp->packets_out) {
+		WARN_ON(tcp_is_sack(tp) && tp->sacked_out);
 		tp->sacked_out = 0;
+	}
 
-	if (WARN_ON(!tp->sacked_out && tp->fackets_out))
+	if (WARN_ON(!tp->sacked_out && tp->fackets_out)) {
+		printk(KERN_ERR "TCP %d\n", tcp_is_reno(tp));
+		tcp_print_queue(sk);
 		tp->fackets_out = 0;
+	}
 
 	/* Now state machine starts.
 	 * A. ECE, hence prohibit cwnd undoing, the reduction is required. */
@@ -2334,6 +2348,8 @@ tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
 	/* B. In all the states check for reneging SACKs. */
 	if (tp->sacked_out && tcp_check_sack_reneging(sk))
 		return;
+	
+	tcp_verify_fackets(sk);
 
 	/* C. Process data loss notification, provided it is valid. */
 	if ((flag&FLAG_DATA_LOST) &&
@@ -2390,6 +2406,8 @@ tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
 		}
 	}
 
+	tcp_verify_fackets(sk);
+
 	/* F. Process state. */
 	switch (icsk->icsk_ca_state) {
 	case TCP_CA_Recovery:
@@ -2405,6 +2423,7 @@ tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
 		if (!tcp_try_undo_loss(sk)) {
 			tcp_moderate_cwnd(tp);
 			tcp_xmit_retransmit_queue(sk);
+			tcp_verify_fackets(sk);
 			return;
 		}
 		if (icsk->icsk_ca_state != TCP_CA_Open)
@@ -2423,6 +2442,7 @@ tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
 
 		if (!tcp_time_to_recover(sk)) {
 			tcp_try_to_open(sk, flag);
+			tcp_verify_fackets(sk);
 			return;
 		}
 
@@ -2434,6 +2454,7 @@ tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
 			/* Restores the reduction we did in tcp_mtup_probe() */
 			tp->snd_cwnd++;
 			tcp_simple_retransmit(sk);
+			tcp_verify_fackets(sk);
 			return;
 		}
 
@@ -2460,11 +2481,13 @@ tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
 		tp->snd_cwnd_cnt = 0;
 		tcp_set_ca_state(sk, TCP_CA_Recovery);
 	}
+	tcp_verify_fackets(sk);
 
 	if (do_lost || tcp_head_timedout(sk))
 		tcp_update_scoreboard(sk);
 	tcp_cwnd_down(sk, flag);
 	tcp_xmit_retransmit_queue(sk);
+	tcp_verify_fackets(sk);
 }
 
 /* Read draft-ietf-tcplw-high-performance before mucking
@@ -2573,7 +2596,7 @@ static u32 tcp_tso_acked(struct sock *sk, struct sk_buff *skb)
  * is before the ack sequence we can discard it as it's confirmed to have
  * arrived at the other end.
  */
-static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
+int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -2695,6 +2718,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p)
 			ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
 		}
 	}
+	tcp_verify_fackets(sk);
+
 
 #if FASTRETRANS_DEBUG > 0
 	BUG_TRAP((int)tp->sacked_out >= 0);
@@ -3011,6 +3036,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
 		tcp_ca_event(sk, CA_EVENT_SLOW_ACK);
 	}
 
+	tcp_verify_fackets(sk);
 	/* We passed data and got it acked, remove any soft error
 	 * log. Something worked...
 	 */
@@ -3031,6 +3057,8 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
 	if (tp->frto_counter)
 		frto_cwnd = tcp_process_frto(sk, flag);
 
+	tcp_verify_fackets(sk);
+
 	if (tcp_ack_is_dubious(sk, flag)) {
 		/* Advance CWND, if state allows this. */
 		if ((flag & FLAG_DATA_ACKED) && !frto_cwnd &&
@@ -3040,6 +3068,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
 	} else {
 		if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
 			tcp_cong_avoid(sk, ack, prior_in_flight, 1);
+		tcp_verify_fackets(sk);
 	}
 
 	if ((flag & FLAG_FORWARD_PROGRESS) || !(flag&FLAG_NOT_DUP))
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 7fed0a6..6a450a7 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -108,6 +108,119 @@ struct inet_hashinfo __cacheline_aligned tcp_hashinfo = {
 	.lhash_wait  = __WAIT_QUEUE_HEAD_INITIALIZER(tcp_hashinfo.lhash_wait),
 };
 
+void tcp_print_queue(struct sock *sk)
+{
+	struct tcp_sock *tp = tcp_sk(sk);
+	struct sk_buff *skb;
+	char s[50+1];
+	char p[50+1];
+	int idx = 0, i;
+	u32 hs = tp->highest_sack;
+	
+	if (!tp->sacked_out)
+		hs = tp->snd_una;
+	
+	tcp_for_write_queue(skb, sk) {
+		if (skb == tcp_send_head(sk))
+			break;
+		
+		for (i = 0; i < tcp_skb_pcount(skb); i++) {
+			if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED) {
+				if (i)
+					s[idx] = 'g';
+				else if (tcp_skb_pcount(skb) > 1)
+					s[idx] = 'G';
+				else if (skb->len < tp->mss_cache)
+					s[idx] = 's';
+				else
+					s[idx] = 'S';
+			} else {
+				if (i)
+					s[idx] = '-';
+				else
+					s[idx] = '+';
+			}
+			p[idx] = ' ';
+			if (!i) {
+				if ((TCP_SKB_CB(skb)->seq == hs) && (tp->fastpath_skb_hint == skb))
+					p[idx] = 'x';
+				else if (tp->fastpath_skb_hint == skb)
+					p[idx] = 'f';
+				else if (TCP_SKB_CB(skb)->seq == hs)
+					p[idx] = 'h';
+			}
+			
+			if (++idx >= 50) {
+				s[idx] = 0;
+				p[idx] = 0;
+				printk(KERN_ERR "TCP wq(s) %s\n", s);
+				printk(KERN_ERR "TCP wq(i) %s\n", p);
+				idx = 0;
+			}
+		}
+	}
+	if (idx) {
+		s[idx] = '<';
+		s[idx+1] = 0;
+		p[idx] = '<';
+		p[idx+1] = 0;
+		printk(KERN_ERR "TCP wq(s) %s\n", s);
+		printk(KERN_ERR "TCP wq(i) %s\n", p);
+	}
+	printk(KERN_ERR "s%u f%u (%u) p%u seq: su%u hs%u sn%u (%u)\n",
+		tp->sacked_out, tp->fackets_out, tp->fastpath_cnt_hint,
+		tp->packets_out,
+		tp->snd_una, tp->highest_sack, tp->snd_nxt,
+		((tp->fastpath_skb_hint == NULL) ? 0 :
+			TCP_SKB_CB(tp->fastpath_skb_hint)->seq));
+}
+
+void tcp_verify_fackets(struct sock *sk)
+{
+	struct tcp_sock *tp = tcp_sk(sk);
+	struct sk_buff *skb;
+	u32 fackets = 0;
+	int hisack_valid = 0;
+	int err = 0;
+	
+	if (tcp_is_reno(tp))
+		return;
+	
+	if (!tp->sacked_out) {
+		if (WARN_ON(tp->fackets_out))
+			err = 1;
+		else if (tp->fastpath_skb_hint == NULL)
+			return;
+	}
+	
+	/* ...expensive processing here... */
+	tcp_for_write_queue(skb, sk) {
+		if (skb == tcp_send_head(sk))
+			break;
+
+		if (tp->sacked_out && (TCP_SKB_CB(skb)->seq == tp->highest_sack)) {
+			hisack_valid = 1;
+			if (WARN_ON(tp->fackets_out != fackets + tcp_skb_pcount(skb)))
+				err = 1;
+		}
+
+		if (skb == tp->fastpath_skb_hint)
+			if (WARN_ON(fackets != tp->fastpath_cnt_hint))
+				err = 1;
+
+		if (WARN_ON((fackets > tp->fackets_out) && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)))
+			err = 1;
+
+		fackets += tcp_skb_pcount(skb);
+	}
+	
+	if (WARN_ON(tp->sacked_out && !hisack_valid))
+		err = 1;
+	
+	if (err)
+		tcp_print_queue(sk);
+}
+
 static int tcp_v4_get_port(struct sock *sk, unsigned short snum)
 {
 	return inet_csk_get_port(&tcp_hashinfo, sk, snum,
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 5329675..8a2917f 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -778,6 +778,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
 	/* Link BUFF into the send queue. */
 	skb_header_release(buff);
 	tcp_insert_write_queue_after(skb, buff, sk);
+	tcp_verify_fackets(sk);
 
 	return 0;
 }
@@ -1688,7 +1689,7 @@ u32 __tcp_select_window(struct sock *sk)
 }
 
 /* Attempt to collapse two adjacent SKB's during retransmission. */
-static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int mss_now)
+void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int mss_now)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct sk_buff *next_skb = tcp_write_queue_next(sk, skb);
@@ -1767,6 +1768,7 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
 		}
 
 		sk_stream_free_skb(sk, next_skb);
+		tcp_verify_fackets(sk);
 	}
 }
 
-- 
1.5.0.6


^ permalink raw reply related

* [RFC][PATCH 1/2] TCP: fix lost retransmit detection
From: TAKANO Ryousei @ 2007-10-04  9:45 UTC (permalink / raw)
  To: netdev; +Cc: y-kodama

This patch allows to detect loss of retransmitted packets more
accurately by using the highest end sequence number among SACK 
blocks.  Before the retransmission queue is scanned, the highest
end sequence number (high_end_seq) is retrieved, and this value
is compared with the ack_seq of each packet.

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Yuetsu Kodama <y-kodama@aist.go.jp>
---
 net/ipv4/tcp_input.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index bbad2cd..12db4b3 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -978,6 +978,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 	int cached_fack_count;
 	int i;
 	int first_sack_index;
+	__u32 high_end_seq;
 
 	if (!tp->sacked_out)
 		tp->fackets_out = 0;
@@ -1012,6 +1013,14 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 	if (before(TCP_SKB_CB(ack_skb)->ack_seq, prior_snd_una - tp->max_window))
 		return 0;
 
+	/* Retrieve the highest end_seq among SACK blocks. */
+	high_end_seq = ntohl(sp[0].end_seq);
+	for (i = 1; i < num_sacks; i++) {
+		__u32 end_seq = ntohl(sp[i].end_seq);
+		if (after(end_seq, high_end_seq))
+			high_end_seq = end_seq;
+	}
+
 	/* SACK fastpath:
 	 * if the only SACK change is the increase of the end_seq of
 	 * the first block then only apply that SACK block
@@ -1161,9 +1170,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 			}
 
 			if ((sacked&TCPCB_SACKED_RETRANS) &&
-			    after(end_seq, TCP_SKB_CB(skb)->ack_seq) &&
-			    (!lost_retrans || after(end_seq, lost_retrans)))
-				lost_retrans = end_seq;
+			    after(high_end_seq, TCP_SKB_CB(skb)->ack_seq))
+				lost_retrans = high_end_seq;
 
 			if (!in_sack)
 				continue;
-- 
1.5.2.4


^ permalink raw reply related

* [RFC][PATCH 2.6.23-rc9 0/2] detection of loss of retransmitted packets
From: TAKANO Ryousei @ 2007-10-04  9:44 UTC (permalink / raw)
  To: netdev; +Cc: y-kodama

Hi all,

We found a performance problem which occurs in heavy packet loss
conditions. It seems there is a problem in detecting loss of 
retransmitted packets.

In the retransmission queue, status of sent packets are registered.
When a packet is retransmitted, it is so marked, and snd_nxt (sequence
number of the next new (non-retransmission) packet to be sent) at that
moment is registered as ack_seq. A retransmitted packet is lost if it 
is not SACKed, and its ack_seq is smaller than the sequence number of 
any SACKed packet.

An ACK packet can have up to three SACK blocks. A SACK block has a
"start sequence number (start_seq)" and an "end sequence number
(end_seq)" of received packets. In the current implementation of
tcp_sacktag_write_queue(), if an ACK packet has multiple SACK blocks,
the SACK blocks are sorted by the start_seq in an ascending order, and
processed in the order.  For scoreboarding packets in retransmission
queue, the queue is scanned from the the snd_una (the lowest sequence
number of not yet ACKed packets) to the end_seq of the SACK block. To
optimize the scanning process, the next SACK block is processed not
from the snd_una but from the end_seq of the previously processed SACK
block. In the current implementation, for detecting the loss of
retransmitted packets, the ack_seq of a retransmitted packet is
compared with the end_seq of each SACK block during the scoreboarding.
Therefore, a retransmitted packet which ack_seq is smaller than the
end_seq of the last SACK block but larger than that of the currently
being processed SACK block can not be detected as lost.
Such undetected loss may eventually cause an RTO and performance may 
be degraded.

PATCH #1 fixes this problem by comparing the the ack_seq with the
largest end_seq of the SACK blocks.

In addition, some of SACK blocks in an ACK packet may be already
reported in preceding ACK packets. PATCH #2 optimizes processing by
skipping such already reported SACK blocks. Usually, only the first
SACK block of an ACK packet is the new one to be processed. 
Therefore, in most cases, applying PATCH #2 also solves the problem. 
However, to ensure accurate processing in case there are multiple 
new SACK blocks in an ACK packet, PATCH #2 should be applied in 
conjunction with PATCH #1.

The experimental network is as follows:

Node A ----> Router -------> Delay -------> Node B
            (Policing rate:  emulator
   	     500Mbps)        (RTT: 20ms)

You can find the detail of our experimental setting at
http://projects.gtrc.aist.go.jp/gnet/sack-bug.html

We transferred 1 GByte of data from Node A to Node B for ten times. 
Here is the performance comparison of the cases with and without 
these patches.

	Ave. goodput	Ave. RTO
2.6.22	376 Mbps	26
PATCH#1	481 Mbps	0
PATCH#2	483 Mbps	0

In the vanilla kernel, several RTOs (TCPTimeouts + TCPSackRecoveryFail)
occur.  On the other hand, our patches eliminate RTOs and improve the
average goodput by 28%.

Any comments and ideas would be appreciated.

Regards,
Ryousei Takano

^ permalink raw reply

* [RFC][PATCH 2/2] TCP: skip processing cached SACK blocks
From: TAKANO Ryousei @ 2007-10-04  9:44 UTC (permalink / raw)
  To: netdev; +Cc: y-kodama

This patch allows to process only newly reported SACK blocks at the
sender side. An ACK packet contains up to three SACK blocks, and some
of them may be already reported and processed blocks.  This patch 
prevents processing of such already processed SACK blocks.

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Yuetsu Kodama <y-kodama@aist.go.jp>
---
 net/ipv4/tcp_input.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index bbad2cd..9615fc9 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -978,6 +978,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 	int cached_fack_count;
 	int i;
 	int first_sack_index;
+	u8 sack_block_skip[4] = {0,0,0,0};
 
 	if (!tp->sacked_out)
 		tp->fackets_out = 0;
@@ -1012,6 +1013,21 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 	if (before(TCP_SKB_CB(ack_skb)->ack_seq, prior_snd_una - tp->max_window))
 		return 0;
 
+	/* Skip processing cached SACK blocks. */
+	for (i = 0; i < num_sacks; i++) {
+		__be32 start_seq = sp[i].start_seq;
+		__be32 end_seq = sp[i].end_seq;
+		int j;
+
+		for (j = 0; j < ARRAY_SIZE(tp->recv_sack_cache); j++) {
+			if ((tp->recv_sack_cache[j].start_seq == start_seq) &&
+			    (tp->recv_sack_cache[j].end_seq == end_seq)) {
+				sack_block_skip[i] = 1;
+				break;
+			}
+		}
+	}
+
 	/* SACK fastpath:
 	 * if the only SACK change is the increase of the end_seq of
 	 * the first block then only apply that SACK block
@@ -1051,11 +1067,16 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 				if (after(ntohl(sp[j].start_seq),
 					  ntohl(sp[j+1].start_seq))){
 					struct tcp_sack_block_wire tmp;
+					u8 sbtmp;
 
 					tmp = sp[j];
 					sp[j] = sp[j+1];
 					sp[j+1] = tmp;
 
+					sbtmp = sack_block_skip[j];
+					sack_block_skip[j] = sack_block_skip[j+1];
+					sack_block_skip[j+1] = sbtmp;
+
 					/* Track where the first SACK block goes to */
 					if (j == first_sack_index)
 						first_sack_index = j+1;
@@ -1083,6 +1104,9 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 		int fack_count;
 		int dup_sack = (found_dup_sack && (i == first_sack_index));
 
+		if (sack_block_skip[i])
+			continue;
+
 		skb = cached_skb;
 		fack_count = cached_fack_count;
 
-- 
1.5.2.4


^ permalink raw reply related

* [PATCH] mac80211: Fix TX after monitor interface is converted to managed
From: Daniel Drake @ 2007-10-04 11:33 UTC (permalink / raw)
  To: linville-2XuSBdqkA4R54TAoqtyWWQ
  Cc: johannes-cdvu00un1VgdHxzADdlk8Q, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA

This sequence of events causes loss of connectivity:

<plug in>
<associate as normal in managed mode>
ifconfig eth7 down
iwconfig eth7 mode monitor
ifconfig eth7 up
ifconfig eth7 down
iwconfig eth7 mode managed
<associate as normal>

At this point you are associated but TX does not work. This is because
the eth7 hard_start_xmit is still ieee80211_monitor_start_xmit.

Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit. It
will then be reinitialised to the default (ieee80211_subif_start_xmit) in
ieee80211_if_set_type.

Signed-off-by: Daniel Drake <dsd-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
---
 net/mac80211/ieee80211_iface.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/ieee80211_iface.c b/net/mac80211/ieee80211_iface.c
index 08c1e18..40d4b63 100644
--- a/net/mac80211/ieee80211_iface.c
+++ b/net/mac80211/ieee80211_iface.c
@@ -242,6 +242,9 @@ void ieee80211_if_reinit(struct net_device *dev)
 
 	ieee80211_if_sdata_deinit(sdata);
 
+	BUG_ON(netif_running(dev));
+	dev->hard_start_xmit = NULL;
+
 	switch (sdata->type) {
 	case IEEE80211_IF_TYPE_MGMT:
 		/* nothing to do */
-- 
1.5.3.3

^ permalink raw reply related

* Re: [PATCH 2/7] CAN: Add PF_CAN core module
From: Urs Thuermann @ 2007-10-04 11:51 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: netdev, David Miller, Patrick McHardy, Thomas Gleixner,
	Oliver Hartkopp, Oliver Hartkopp
In-Reply-To: <20071002143855.GG7881@ghostprotocols.net>

Arnaldo Carvalho de Melo <acme@ghostprotocols.net> writes:

> > +struct sockaddr_can {
> > +	sa_family_t can_family;
> > +	int         can_ifindex;
> > +	union {
> > +		struct { canid_t rx_id, tx_id; } tp16;
> > +		struct { canid_t rx_id, tx_id; } tp20;
> > +		struct { canid_t rx_id, tx_id; } mcnet;
> > +		struct { canid_t rx_id, tx_id; } isotp;
> > +	} can_addr;
> 
> Again being curious, what is the value of this union of all its members
> have the same definition? Backward source code compatibility?

As Oliver already wrote, different CAN transport protocols may use
different sockaddr structures.  Therefore, we have made can_addr a
union.  The four we have defined already, all look the same, but
other, future protocols may define a different structure.

> > +struct can_proto {
> > +	int              type;
> > +	int              protocol;
> > +	int              capability;
> > +	struct proto_ops *ops;
> > +	struct proto     *prot;
> > +};
> > +
> > +/* function prototypes for the CAN networklayer core (af_can.c) */
> > +
> > +extern int  can_proto_register(struct can_proto *cp);
> > +extern void can_proto_unregister(struct can_proto *cp);
> 
> We have proto registering infrastructure for bluetooth, inet and now
> CAN, have you looked at:
> 
> struct inet_protosw;
> proto_{register,unregister}, etc?

Yes, I know inet_protosw and inet_{,un}register_protosw().  But we
can't use inet_register_protosw().

And can_proto_register() does use proto_register().  What exactly do
you want to suggest?

urs

^ permalink raw reply

* Re: [PATCH 3/7] CAN: Add raw protocol
From: Urs Thuermann @ 2007-10-04 11:52 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: netdev, David Miller, Patrick McHardy, Thomas Gleixner,
	Oliver Hartkopp, Oliver Hartkopp
In-Reply-To: <20071002143001.GF7881@ghostprotocols.net>

Arnaldo Carvalho de Melo <acme@ghostprotocols.net> writes:

> > +static inline struct raw_sock *raw_sk(const struct sock *sk)
> > +{
> > +	return (struct raw_sock *)sk;
> > +}
> 
> 
> What if I want to do some kernel module that uses INET raw sockets
> (include/net/icmp.h) and CAN raw sockets? Namespace collision, could you
> please use can_raw_ for this namespace?

raw_sk is static so you can't use in another file where you include
include/net/icmp.h.  There is no collision.  Also, since it's inline
you won't even see it in a symbol table.

Hm, it's more than 10 years that I've tested ctags(1) and etags(1)
with several identical static names in different files and I don't
remember my results.  Do these tools have a problem with multiple
defs?  I think they shouldn't since C is explicitly designed for that.

> > +static unsigned int raw_poll(struct file *file, struct socket *sock,
> > +			     poll_table *wait)
> > +{
> > +	unsigned int mask = 0;
> > +
> > +	DBG("socket %p\n", sock);
> > +
> > +	mask = datagram_poll(file, sock, wait);
> > +	return mask;
> 
> What is the value of 'mask' here? Leftover from debugging?

Ah, yes.  We should remove it.

> > +static int raw_setsockopt(struct socket *sock, int level, int optname,
> > +			  char __user *optval, int optlen)
> > +{

> > +		lock_sock(sk);
> > +
> > +		if (ro->bound && ro->ifindex)
> > +			dev = dev_get_by_index(&init_net, ro->ifindex);
> 
> dev_get_by_index can fail, are you sure that raw_enable_filters can cope
> with this possibility?

When ro->ifindex != 0, the call to dev_get_by_index() shouldn't fail.
We also use lock_sock() here and in NETDEV_UNREGISTER, so there should
be no problem.


urs

^ permalink raw reply

* Re: [PATCH 5/7] CAN: Add virtual CAN netdevice driver
From: Urs Thuermann @ 2007-10-04 11:52 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: netdev, David Miller, Patrick McHardy, Thomas Gleixner,
	Oliver Hartkopp, Oliver Hartkopp
In-Reply-To: <20071002142016.GE7881@ghostprotocols.net>

Arnaldo Carvalho de Melo <acme@ghostprotocols.net> writes:

> > +#ifdef CONFIG_CAN_DEBUG_DEVICES
> > +static int debug;
> > +module_param(debug, int, S_IRUGO);
> > +#endif
> 
> Can debug be a boolean? Like its counterpart on DCCP:

debug used to a bit mask, like it still is in core.h.  You can see
this in the test

        debug & 1 ? ... : ...

below.  Only the test for bit 0 is left, so we could change it to bool.

> net/dccp/proto.c:
> 
> module_param(dccp_debug, bool, 0444);
> 
> Where we also use a namespace prefix, for those of us who use ctags or
> cscope.

I think ctags should be able to handle multiple identical static
symbols.  Isn't it?  I find it somewhat clumsy to write

        modprobe vcan vcan_debug=1

I think it would be nice to change the module_param() macro so that
you can name the module argument and the corresponding variable
independently, like

        module_param(can_debug, "debug", bool, 0444);

OK, forget that last paragraph.  I've looked at the definition of
module_param() and have seen that we have module_param_named().  I
think we should use that.

> > +
> > +/* To be moved to linux/can/dev.h */
> 
> Is this comment still valid? If so can this move happen now? If not I
> think it would be better to stick a "FIXME: " just before it, no?

OK.

> > +static int echo; /* echo testing. Default: 0 (Off) */
> > +module_param(echo, int, S_IRUGO);
> > +MODULE_PARM_DESC(echo, "Echo sent frames (for testing). Default: 0 (Off)");
> 
> echo also seems to be a boolean

ACK.

> > +static int vcan_open(struct net_device *dev)
> > +{
> > +	DBG("%s: interface up\n", dev->name);
> > +
> > +	netif_start_queue(dev);
> > +	return 0;
> > +}
> > +
> > +static int vcan_stop(struct net_device *dev)
> > +{
> > +	DBG("%s: interface down\n", dev->name);
> > +
> > +	netif_stop_queue(dev);
> > +	return 0;
> > +}
> 
> Thinking out loud: I guess these days we can try to reduce the clutter
> on the source code for things like "hey, I entered function foo" using
> simple systemtap scripts, that could even be shipped with the kernel
> sources. Not something pressing right now, just a suggestion.

I've never heard of systemtap before.  I've ust looked at its overview
web page which sounds promising.  I think I'll check it out when time
permits...


urs

^ permalink raw reply

* Re: [PATCH 2/7] CAN: Add PF_CAN core module
From: Arnaldo Carvalho de Melo @ 2007-10-04 13:40 UTC (permalink / raw)
  To: Urs Thuermann
  Cc: netdev, David Miller, Patrick McHardy, Thomas Gleixner,
	Oliver Hartkopp, Oliver Hartkopp
In-Reply-To: <ygfbqbf14j0.fsf@janus.isnogud.escape.de>

Em Thu, Oct 04, 2007 at 01:51:47PM +0200, Urs Thuermann escreveu:
> Arnaldo Carvalho de Melo <acme@ghostprotocols.net> writes:
> 
> > > +struct sockaddr_can {
> > > +	sa_family_t can_family;
> > > +	int         can_ifindex;
> > > +	union {
> > > +		struct { canid_t rx_id, tx_id; } tp16;
> > > +		struct { canid_t rx_id, tx_id; } tp20;
> > > +		struct { canid_t rx_id, tx_id; } mcnet;
> > > +		struct { canid_t rx_id, tx_id; } isotp;
> > > +	} can_addr;
> > 
> > Again being curious, what is the value of this union of all its members
> > have the same definition? Backward source code compatibility?
> 
> As Oliver already wrote, different CAN transport protocols may use
> different sockaddr structures.  Therefore, we have made can_addr a
> union.  The four we have defined already, all look the same, but
> other, future protocols may define a different structure.
> 
> > > +struct can_proto {
> > > +	int              type;
> > > +	int              protocol;
> > > +	int              capability;
> > > +	struct proto_ops *ops;
> > > +	struct proto     *prot;
> > > +};
> > > +
> > > +/* function prototypes for the CAN networklayer core (af_can.c) */
> > > +
> > > +extern int  can_proto_register(struct can_proto *cp);
> > > +extern void can_proto_unregister(struct can_proto *cp);
> > 
> > We have proto registering infrastructure for bluetooth, inet and now
> > CAN, have you looked at:
> > 
> > struct inet_protosw;
> > proto_{register,unregister}, etc?
> 
> Yes, I know inet_protosw and inet_{,un}register_protosw().  But we
> can't use inet_register_protosw().
> 
> And can_proto_register() does use proto_register().  What exactly do
> you want to suggest?

Sorry, I was in a hurry and didn't completed my thoughts on how to share
more code and data structures.

My first reaction was: hey, struct can_proto has almost the same
definition as struct inet_protosw, and can_proto_register() looks like
inet_register_protosw().

can_proto_register() calls proto_register, inet_register_protosw
doesn't. But protocols such as DCCP and SCTP, call both
inet_register_protosw and proto_register. Perhaps we can make
inet_register_protosw behave like can_proto_register and do the
proto_register(inet_protosw->prot) for us.

Looking at inet_init in net/ipv4/af_inet.c we see that we do the same
for udp, tcp and raw too. There we also call proto_register +
inet_register_protosw.

See the possibilites for code sharing? Having just one way of
registering protocols would reduce complexity for new protocol writers
and for people that browse the code only when trying to fix some problem
and don't want to get lost in many ways of doing the same thing.

struct can_proto could be removed and struct inet_protosw could be
renamed to reflect the fact that it is, after all, not inet specific at
all.

So this is not something to "fix" on your implementation. It looks OK.
But we could use more hands on reducing complexity on the Linux network
protocol infrastructure and you would get free fixes and improvements
when people improve the inet protocols 8)

DCCP has been collecting dividends for quite a while for working like
that 8)

- Arnaldo

^ permalink raw reply

* [PATCH][NETNS] Move some code into __init section when CONFIG_NET_NS=n
From: Pavel Emelyanov @ 2007-10-04 13:54 UTC (permalink / raw)
  To: David Miller; +Cc: Eric W. Biederman, Linux Netdev List, devel

With the net namespaces many code leaved the __init section,
thus making the kernel occupy more memory than it did before.
Since we have a config option that prohibits the namespace
creation, the functions that initialize/finalize some netns
stuff are simply not needed and can be freed after the boot.

Currently, this is almost not noticeable, since few calls
are no longer in __init, but when the namespaces will be
merged it will be possible to free more code. I propose to 
use the __net_init, __net_exit and __net_initdata "attributes"
for functions/variables that are not used if the CONFIG_NET_NS
is not set to save more space in memory.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 934c840..747170f 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -99,6 +99,15 @@ static inline void release_net(struct ne
 #define for_each_net(VAR)				\
 	list_for_each_entry(VAR, &net_namespace_list, list)
 
+#ifdef CONFIG_NET_NS
+#define __net_init
+#define __net_exit
+#define __net_initdata
+#else
+#define __net_init	__init
+#define __net_exit	__exit
+#define __net_initdata	__initdata
+#endif
 
 struct pernet_operations {
 	struct list_head list;
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index d6997ae..be25aa3 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -250,7 +250,7 @@ static void loopback_setup(struct net_de
 }
 
 /* Setup and register the loopback device. */
-static int loopback_net_init(struct net *net)
+static __net_init int loopback_net_init(struct net *net)
 {
 	struct net_device *dev;
 	int err;
@@ -278,14 +278,14 @@ out_free_netdev:
 	goto out;
 }
 
-static void loopback_net_exit(struct net *net)
+static __net_exit void loopback_net_exit(struct net *net)
 {
 	struct net_device *dev = net->loopback_dev;
 
 	unregister_netdev(dev);
 }
 
-static struct pernet_operations loopback_net_ops = {
+static struct pernet_operations __net_initdata loopback_net_ops = {
        .init = loopback_net_init,
        .exit = loopback_net_exit,
 };
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index 85cc8e8..2e91fb7 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -140,7 +140,7 @@ static struct inode_operations proc_net_
 	.setattr	= proc_net_setattr,
 };
 
-static int proc_net_ns_init(struct net *net)
+static __net_init int proc_net_ns_init(struct net *net)
 {
 	struct proc_dir_entry *root, *netd, *net_statd;
 	int err;
@@ -178,19 +178,19 @@ free_root:
 	goto out;
 }
 
-static void proc_net_ns_exit(struct net *net)
+static __net_exit void proc_net_ns_exit(struct net *net)
 {
 	remove_proc_entry("stat", net->proc_net);
 	remove_proc_entry("net", net->proc_net_root);
 	kfree(net->proc_net_root);
 }
 
-struct pernet_operations proc_net_ns_ops = {
+struct pernet_operations __net_initdata proc_net_ns_ops = {
 	.init = proc_net_ns_init,
 	.exit = proc_net_ns_exit,
 };
 
-int proc_net_init(void)
+int __init proc_net_init(void)
 {
 	proc_net_shadow = proc_mkdir("net", NULL);
 	proc_net_shadow->proc_iops = &proc_net_dir_inode_operations;
diff --git a/net/core/dev.c b/net/core/dev.c
index d998646..37f8858 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2611,7 +2611,7 @@ static const struct file_operations ptyp
 };
 
 
-static int dev_proc_net_init(struct net *net)
+static int __net_init dev_proc_net_init(struct net *net)
 {
 	int rc = -ENOMEM;
 
@@ -2636,7 +2636,7 @@ out_dev:
 	goto out;
 }
 
-static void dev_proc_net_exit(struct net *net)
+static void __net_exit dev_proc_net_exit(struct net *net)
 {
 	wext_proc_exit(net);
 
@@ -2645,7 +2645,7 @@ static void dev_proc_net_exit(struct net
 	proc_net_remove(net, "dev");
 }
 
-static struct pernet_operations dev_proc_ops = {
+static struct pernet_operations __net_initdata dev_proc_ops = {
 	.init = dev_proc_net_init,
 	.exit = dev_proc_net_exit,
 };
@@ -4250,7 +4250,7 @@ static struct hlist_head *netdev_create_
 }
 
 /* Initialize per network namespace state */
-static int netdev_init(struct net *net)
+static int __net_init netdev_init(struct net *net)
 {
 	INIT_LIST_HEAD(&net->dev_base_head);
 	rwlock_init(&dev_base_lock);
@@ -4271,18 +4271,18 @@ err_name:
 	return -ENOMEM;
 }
 
-static void netdev_exit(struct net *net)
+static void __net_exit netdev_exit(struct net *net)
 {
 	kfree(net->dev_name_head);
 	kfree(net->dev_index_head);
 }
 
-static struct pernet_operations netdev_net_ops = {
+static struct pernet_operations __net_initdata netdev_net_ops = {
 	.init = netdev_init,
 	.exit = netdev_exit,
 };
 
-static void default_device_exit(struct net *net)
+static void __net_exit default_device_exit(struct net *net)
 {
 	struct net_device *dev, *next;
 	/*
@@ -4308,7 +4308,7 @@ static void default_device_exit(struct n
 	rtnl_unlock();
 }
 
-static struct pernet_operations default_device_ops = {
+static struct pernet_operations __net_initdata default_device_ops = {
 	.exit = default_device_exit,
 };
 
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index 896b0ca..15241cf 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -273,19 +273,19 @@ static const struct file_operations dev_
 
 #endif
 
-static int dev_mc_net_init(struct net *net)
+static int __net_init dev_mc_net_init(struct net *net)
 {
 	if (!proc_net_fops_create(net, "dev_mcast", 0, &dev_mc_seq_fops))
 		return -ENOMEM;
 	return 0;
 }
 
-static void dev_mc_net_exit(struct net *net)
+static void __net_exit dev_mc_net_exit(struct net *net)
 {
 	proc_net_remove(net, "dev_mcast");
 }
 
-static struct pernet_operations dev_mc_net_ops = {
+static struct pernet_operations __net_initdata dev_mc_net_ops = {
 	.init = dev_mc_net_init,
 	.exit = dev_mc_net_exit,
 };
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 46eb5ea..3ef3282 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1924,7 +1924,7 @@ static struct net_proto_family netlink_f
 	.owner	= THIS_MODULE,	/* for consistency 8) */
 };
 
-static int netlink_net_init(struct net *net)
+static int __net_init netlink_net_init(struct net *net)
 {
 #ifdef CONFIG_PROC_FS
 	if (!proc_net_fops_create(net, "netlink", 0, &netlink_seq_fops))
@@ -1933,14 +1933,14 @@ static int netlink_net_init(struct net *
 	return 0;
 }
 
-static void netlink_net_exit(struct net *net)
+static void __net_exit netlink_net_exit(struct net *net)
 {
 #ifdef CONFIG_PROC_FS
 	proc_net_remove(net, "netlink");
 #endif
 }
 
-static struct pernet_operations netlink_net_ops = {
+static struct pernet_operations __net_initdata netlink_net_ops = {
 	.init = netlink_net_init,
 	.exit = netlink_net_exit,
 };

^ permalink raw reply related

* Re: [Devel] [PATCH][NETNS] Move some code into __init section when CONFIG_NET_NS=n
From: Alexey Dobriyan @ 2007-10-04 14:02 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: David Miller, Linux Netdev List, devel
In-Reply-To: <4704F083.7090203@openvz.org>

On Thu, Oct 04, 2007 at 05:54:11PM +0400, Pavel Emelyanov wrote:
> With the net namespaces many code leaved the __init section,
> thus making the kernel occupy more memory than it did before.
> Since we have a config option that prohibits the namespace
> creation, the functions that initialize/finalize some netns
> stuff are simply not needed and can be freed after the boot.
> 
> Currently, this is almost not noticeable, since few calls
> are no longer in __init, but when the namespaces will be
> merged it will be possible to free more code. I propose to 
> use the __net_init, __net_exit and __net_initdata "attributes"
> for functions/variables that are not used if the CONFIG_NET_NS
> is not set to save more space in memory.

> +#ifdef CONFIG_NET_NS
> +#define __net_init
> +#define __net_exit
> +#define __net_initdata
> +#else
> +#define __net_init	__init
> +#define __net_exit	__exit
> +#define __net_initdata	__initdata
> +#endif

Yet another set of double-underscored section annotations is the last thing
that is needed, methinks. :)


^ permalink raw reply

* Re: Blackfin Ethernet MAC driver compile error
From: Kalle Pokki @ 2007-10-04 14:26 UTC (permalink / raw)
  To: bryan.wu; +Cc: linux-kernel, netdev
In-Reply-To: <1191489141.6139.1.camel@roc-laptop>

On 10/4/07, Bryan Wu <bryan.wu@analog.com> wrote:
> Sorry for missing the pinmux patches.
> After Linus's git-pull, it should be fixed in the latest Linus mainline
> git tree.

Thanks, it is working now. I was also glad to see the binfmt_flat
patch going in.

Do you plan to get the PHY abstraction layer patches for the Blackfin
EMAC included in the upcoming merge window?

^ permalink raw reply

* Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed
From: Michael Wu @ 2007-10-04 14:34 UTC (permalink / raw)
  To: Daniel Drake; +Cc: linville, johannes, netdev, linux-wireless
In-Reply-To: <20071004113343.552139D502B@zog.reactivated.net>

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

On Thursday 04 October 2007 07:33, Daniel Drake wrote:
> Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit.
> It will then be reinitialised to the default (ieee80211_subif_start_xmit)
> in ieee80211_if_set_type.
>
Well.. this kinda sucks, but we can clean up the logic here later.

> +	BUG_ON(netif_running(dev));
This will never happen, so there's no point.

ACK with that bit removed.

Thanks,
-Michael Wu

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

^ permalink raw reply

* [patch 0/2] [AF_IUCV] fixes for net-2.6.24
From: Ursula Braun @ 2007-10-04 14:46 UTC (permalink / raw)
  To: davem, netdev, linux-s390; +Cc: heiko.carstens

-- 
Dave,

the following 2 patches are intended for 2.6.24 and contain:
- removal of static declarations in af_iucv header file
- postpone receival of inbound packets in af_iucv

^ permalink raw reply

* [patch 1/2] af_iucv: remove static declarations from header file.
From: Ursula Braun @ 2007-10-04 14:46 UTC (permalink / raw)
  To: davem, netdev, linux-s390; +Cc: heiko.carstens
In-Reply-To: <20071004144608.880229000@linux.vnet.ibm.com>

[-- Attachment #1: 711-afiucv-statics.diff --]
[-- Type: text/plain, Size: 2543 bytes --]

From: Heiko Carstens <heiko.carstens@de.ibm.com>

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---

 include/net/iucv/af_iucv.h |   21 ---------------------
 net/iucv/af_iucv.c         |    3 +++
 2 files changed, 3 insertions(+), 21 deletions(-)

Index: net-2.6-uschi/include/net/iucv/af_iucv.h
===================================================================
--- net-2.6-uschi.orig/include/net/iucv/af_iucv.h
+++ net-2.6-uschi/include/net/iucv/af_iucv.h
@@ -73,29 +73,8 @@ struct iucv_sock_list {
 	atomic_t	  autobind_name;
 };
 
-static void iucv_sock_destruct(struct sock *sk);
-static void iucv_sock_cleanup_listen(struct sock *parent);
-static void iucv_sock_kill(struct sock *sk);
-static void iucv_sock_close(struct sock *sk);
-static int  iucv_sock_create(struct socket *sock, int proto);
-static int  iucv_sock_bind(struct socket *sock, struct sockaddr *addr,
-			int addr_len);
-static int  iucv_sock_connect(struct socket *sock, struct sockaddr *addr,
-			      int alen, int flags);
-static int  iucv_sock_listen(struct socket *sock, int backlog);
-static int  iucv_sock_accept(struct socket *sock, struct socket *newsock,
-			     int flags);
-static int  iucv_sock_getname(struct socket *sock, struct sockaddr *addr,
-			      int *len, int peer);
-static int  iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
-			      struct msghdr *msg, size_t len);
-static int  iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
-			      struct msghdr *msg, size_t len, int flags);
 unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
 			    poll_table *wait);
-static int iucv_sock_release(struct socket *sock);
-static int iucv_sock_shutdown(struct socket *sock, int how);
-
 void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
 void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
 int  iucv_sock_wait_state(struct sock *sk, int state, int state2,
Index: net-2.6-uschi/net/iucv/af_iucv.c
===================================================================
--- net-2.6-uschi.orig/net/iucv/af_iucv.c
+++ net-2.6-uschi/net/iucv/af_iucv.c
@@ -41,6 +41,9 @@ static struct proto iucv_proto = {
 	.obj_size	= sizeof(struct iucv_sock),
 };
 
+static void iucv_sock_kill(struct sock *sk);
+static void iucv_sock_close(struct sock *sk);
+
 /* Call Back functions */
 static void iucv_callback_rx(struct iucv_path *, struct iucv_message *);
 static void iucv_callback_txdone(struct iucv_path *, struct iucv_message *);

-- 

^ permalink raw reply

* [patch 2/2] af_iucv: postpone receival of iucv-packets
From: Ursula Braun @ 2007-10-04 14:46 UTC (permalink / raw)
  To: davem, netdev, linux-s390; +Cc: heiko.carstens
In-Reply-To: <20071004144608.880229000@linux.vnet.ibm.com>

[-- Attachment #1: 712-afiucv-throttle.diff --]
[-- Type: text/plain, Size: 8576 bytes --]

From: Ursula Braun <braunu@de.ibm.com>

AF_IUCV socket programs may waste Linux storage, because af_iucv
allocates an skb whenever posted by the receive callback routine and
receives the message immediately. 
Message receival is now postponed if data from previous callbacks has 
not yet been transferred to the receiving socket program. Instead a 
message handle is saved in a message queue as a reminder. Once 
messages could be given to the receiving socket program, there is 
an additional checking for entries in the message queue, followed
by skb allocation and message receival if applicable.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---

 include/net/iucv/af_iucv.h |    7 +
 net/iucv/af_iucv.c         |  215 ++++++++++++++++++++++++++-------------------
 2 files changed, 134 insertions(+), 88 deletions(-)

Index: net-2.6-uschi/include/net/iucv/af_iucv.h
===================================================================
--- net-2.6-uschi.orig/include/net/iucv/af_iucv.h
+++ net-2.6-uschi/include/net/iucv/af_iucv.h
@@ -50,6 +50,12 @@ struct sockaddr_iucv {
 
 
 /* Common socket structures and functions */
+struct sock_msg_q {
+	struct iucv_path	*path;
+	struct iucv_message	msg;
+	struct list_head	list;
+	spinlock_t		lock;
+};
 
 #define iucv_sk(__sk) ((struct iucv_sock *) __sk)
 
@@ -64,6 +70,7 @@ struct iucv_sock {
 	struct iucv_path	*path;
 	struct sk_buff_head	send_skb_q;
 	struct sk_buff_head	backlog_skb_q;
+	struct sock_msg_q	message_q;
 	unsigned int		send_tag;
 };
 
Index: net-2.6-uschi/net/iucv/af_iucv.c
===================================================================
--- net-2.6-uschi.orig/net/iucv/af_iucv.c
+++ net-2.6-uschi/net/iucv/af_iucv.c
@@ -223,6 +223,8 @@ static struct sock *iucv_sock_alloc(stru
 	sock_init_data(sock, sk);
 	INIT_LIST_HEAD(&iucv_sk(sk)->accept_q);
 	skb_queue_head_init(&iucv_sk(sk)->send_skb_q);
+	INIT_LIST_HEAD(&iucv_sk(sk)->message_q.list);
+	spin_lock_init(&iucv_sk(sk)->message_q.lock);
 	skb_queue_head_init(&iucv_sk(sk)->backlog_skb_q);
 	iucv_sk(sk)->send_tag = 0;
 
@@ -662,6 +664,90 @@ out:
 	return err;
 }
 
+static int iucv_fragment_skb(struct sock *sk, struct sk_buff *skb, int len)
+{
+	int dataleft, size, copied = 0;
+	struct sk_buff *nskb;
+
+	dataleft = len;
+	while (dataleft) {
+		if (dataleft >= sk->sk_rcvbuf / 4)
+			size = sk->sk_rcvbuf / 4;
+		else
+			size = dataleft;
+
+		nskb = alloc_skb(size, GFP_ATOMIC | GFP_DMA);
+		if (!nskb)
+			return -ENOMEM;
+
+		memcpy(nskb->data, skb->data + copied, size);
+		copied += size;
+		dataleft -= size;
+
+		skb_reset_transport_header(nskb);
+		skb_reset_network_header(nskb);
+		nskb->len = size;
+
+		skb_queue_tail(&iucv_sk(sk)->backlog_skb_q, nskb);
+	}
+
+	return 0;
+}
+
+static void iucv_process_message(struct sock *sk, struct sk_buff *skb,
+				 struct iucv_path *path,
+				 struct iucv_message *msg)
+{
+	int rc;
+
+	if (msg->flags & IPRMDATA) {
+		skb->data = NULL;
+		skb->len = 0;
+	} else {
+		rc = iucv_message_receive(path, msg, 0, skb->data,
+					  msg->length, NULL);
+		if (rc) {
+			kfree_skb(skb);
+			return;
+		}
+		if (skb->truesize >= sk->sk_rcvbuf / 4) {
+			rc = iucv_fragment_skb(sk, skb, msg->length);
+			kfree_skb(skb);
+			skb = NULL;
+			if (rc) {
+				iucv_path_sever(path, NULL);
+				return;
+			}
+			skb = skb_dequeue(&iucv_sk(sk)->backlog_skb_q);
+		} else {
+			skb_reset_transport_header(skb);
+			skb_reset_network_header(skb);
+			skb->len = msg->length;
+		}
+	}
+
+	if (sock_queue_rcv_skb(sk, skb))
+		skb_queue_head(&iucv_sk(sk)->backlog_skb_q, skb);
+}
+
+static void iucv_process_message_q(struct sock *sk)
+{
+	struct iucv_sock *iucv = iucv_sk(sk);
+	struct sk_buff *skb;
+	struct sock_msg_q *p, *n;
+
+	list_for_each_entry_safe(p, n, &iucv->message_q.list, list) {
+		skb = alloc_skb(p->msg.length, GFP_ATOMIC | GFP_DMA);
+		if (!skb)
+			break;
+		iucv_process_message(sk, skb, p->path, &p->msg);
+		list_del(&p->list);
+		kfree(p);
+		if (!skb_queue_empty(&iucv->backlog_skb_q))
+			break;
+	}
+}
+
 static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 			     struct msghdr *msg, size_t len, int flags)
 {
@@ -673,8 +759,9 @@ static int iucv_sock_recvmsg(struct kioc
 	int err = 0;
 
 	if ((sk->sk_state == IUCV_DISCONN || sk->sk_state == IUCV_SEVERED) &&
-		skb_queue_empty(&iucv->backlog_skb_q) &&
-		skb_queue_empty(&sk->sk_receive_queue))
+	    skb_queue_empty(&iucv->backlog_skb_q) &&
+	    skb_queue_empty(&sk->sk_receive_queue) &&
+	    list_empty(&iucv->message_q.list))
 		return 0;
 
 	if (flags & (MSG_OOB))
@@ -713,16 +800,23 @@ static int iucv_sock_recvmsg(struct kioc
 		kfree_skb(skb);
 
 		/* Queue backlog skbs */
-		rskb = skb_dequeue(&iucv_sk(sk)->backlog_skb_q);
+		rskb = skb_dequeue(&iucv->backlog_skb_q);
 		while (rskb) {
 			if (sock_queue_rcv_skb(sk, rskb)) {
-				skb_queue_head(&iucv_sk(sk)->backlog_skb_q,
+				skb_queue_head(&iucv->backlog_skb_q,
 						rskb);
 				break;
 			} else {
-				rskb = skb_dequeue(&iucv_sk(sk)->backlog_skb_q);
+				rskb = skb_dequeue(&iucv->backlog_skb_q);
 			}
 		}
+		if (skb_queue_empty(&iucv->backlog_skb_q)) {
+			spin_lock_bh(&iucv->message_q.lock);
+			if (!list_empty(&iucv->message_q.list))
+				iucv_process_message_q(sk);
+			spin_unlock_bh(&iucv->message_q.lock);
+		}
+
 	} else
 		skb_queue_head(&sk->sk_receive_queue, skb);
 
@@ -963,99 +1057,44 @@ static void iucv_callback_connack(struct
 	sk->sk_state_change(sk);
 }
 
-static int iucv_fragment_skb(struct sock *sk, struct sk_buff *skb, int len,
-			     struct sk_buff_head *fragmented_skb_q)
-{
-	int dataleft, size, copied = 0;
-	struct sk_buff *nskb;
-
-	dataleft = len;
-	while (dataleft) {
-		if (dataleft >= sk->sk_rcvbuf / 4)
-			size = sk->sk_rcvbuf / 4;
-		else
-			size = dataleft;
-
-		nskb = alloc_skb(size, GFP_ATOMIC | GFP_DMA);
-		if (!nskb)
-			return -ENOMEM;
-
-		memcpy(nskb->data, skb->data + copied, size);
-		copied += size;
-		dataleft -= size;
-
-		skb_reset_transport_header(nskb);
-		skb_reset_network_header(nskb);
-		nskb->len = size;
-
-		skb_queue_tail(fragmented_skb_q, nskb);
-	}
-
-	return 0;
-}
-
 static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg)
 {
 	struct sock *sk = path->private;
 	struct iucv_sock *iucv = iucv_sk(sk);
-	struct sk_buff *skb, *fskb;
-	struct sk_buff_head fragmented_skb_q;
-	int rc;
-
-	skb_queue_head_init(&fragmented_skb_q);
+	struct sk_buff *skb;
+	struct sock_msg_q *save_msg;
+	int len;
 
 	if (sk->sk_shutdown & RCV_SHUTDOWN)
 		return;
 
-	skb = alloc_skb(msg->length, GFP_ATOMIC | GFP_DMA);
-	if (!skb) {
-		iucv_path_sever(path, NULL);
-		return;
-	}
+	if (!list_empty(&iucv->message_q.list) ||
+	    !skb_queue_empty(&iucv->backlog_skb_q))
+		goto save_message;
+
+	len = atomic_read(&sk->sk_rmem_alloc);
+	len += msg->length + sizeof(struct sk_buff);
+	if (len > sk->sk_rcvbuf)
+		goto save_message;
 
-	if (msg->flags & IPRMDATA) {
-		skb->data = NULL;
-		skb->len = 0;
-	} else {
-		rc = iucv_message_receive(path, msg, 0, skb->data,
-					  msg->length, NULL);
-		if (rc) {
-			kfree_skb(skb);
-			return;
-		}
-		if (skb->truesize >= sk->sk_rcvbuf / 4) {
-			rc = iucv_fragment_skb(sk, skb, msg->length,
-					       &fragmented_skb_q);
-			kfree_skb(skb);
-			skb = NULL;
-			if (rc) {
-				iucv_path_sever(path, NULL);
-				return;
-			}
-		} else {
-			skb_reset_transport_header(skb);
-			skb_reset_network_header(skb);
-			skb->len = msg->length;
-		}
-	}
-	/* Queue the fragmented skb */
-	fskb = skb_dequeue(&fragmented_skb_q);
-	while (fskb) {
-		if (!skb_queue_empty(&iucv->backlog_skb_q))
-			skb_queue_tail(&iucv->backlog_skb_q, fskb);
-		else if (sock_queue_rcv_skb(sk, fskb))
-			skb_queue_tail(&iucv_sk(sk)->backlog_skb_q, fskb);
-		fskb = skb_dequeue(&fragmented_skb_q);
-	}
-
-	/* Queue the original skb if it exists (was not fragmented) */
-	if (skb) {
-		if (!skb_queue_empty(&iucv->backlog_skb_q))
-			skb_queue_tail(&iucv_sk(sk)->backlog_skb_q, skb);
-		else if (sock_queue_rcv_skb(sk, skb))
-			skb_queue_tail(&iucv_sk(sk)->backlog_skb_q, skb);
-	}
+	skb = alloc_skb(msg->length, GFP_ATOMIC | GFP_DMA);
+	if (!skb)
+		goto save_message;
 
+	spin_lock(&iucv->message_q.lock);
+	iucv_process_message(sk, skb, path, msg);
+	spin_unlock(&iucv->message_q.lock);
+
+	return;
+
+save_message:
+	save_msg = kzalloc(sizeof(struct sock_msg_q), GFP_ATOMIC | GFP_DMA);
+	save_msg->path = path;
+	save_msg->msg = *msg;
+
+	spin_lock(&iucv->message_q.lock);
+	list_add_tail(&save_msg->list, &iucv->message_q.list);
+	spin_unlock(&iucv->message_q.lock);
 }
 
 static void iucv_callback_txdone(struct iucv_path *path,

-- 

^ permalink raw reply

* Re: [PATCH net-2.6.24 0/3]: More TCP fixes
From: Cedric Le Goater @ 2007-10-04 14:53 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: David Miller, Netdev
In-Reply-To: <Pine.LNX.4.64.0710031817540.27745@kivilampi-30.cs.helsinki.fi>

Ilpo Järvinen wrote:
> On Wed, 3 Oct 2007, Cedric Le Goater wrote:
> 
>> Cedric Le Goater wrote:
>>> Below are the messages I got on 2) right after running ketchup (which does 
>>> a wget www.kernel.org) 
> 
> Oops, those tcp_fragment WARNINGs in the other mail were due to bug in 
> the debug patch as it called verify too early in there (before queue was 
> adjusted, no wonder it finds state inconsistent at that point, fixed that)...
> 
> ...So please discard all old debug patches, they're all broken in this 
> respect... :-(
> 
>>> not a warning on 1) with your extra verbose patch.
>> bummer, I got this one on 1) :(
>>
>> WARNING: at /home/legoater/linux/net-2.6.24.git/net/ipv4/tcp_input.c:2325 tcp_fastretrans_alert()
>> Call Trace:
>>  <IRQ>  [<ffffffff8022ddb6>] __wake_up+0x1f/0x4c
>>  [<ffffffff803fd9d3>] tcp_ack+0xcee/0x18ac
>>  [<ffffffff80400764>] tcp_rcv_established+0x61f/0x6df
> 
> ...I just wonder why that's the first place where it occurs... Can you try 
> the debug patch below (fixed verify place in tcp_fragment/collapse, added 
> some of them to narrow it down, and handled GSO more user friendly way in 
> the printout). Put it on top of those three patches (mm should be fine :-)).
> ...I wish the verify triggers way before the fastretrans trap (for some 
> reason it didn't do that in the quoted trace, maybe I had some verifys 
> missing in that old patch or something)...

so here are the results on a net-2.6.24 kernel. 

I've put the patchset here to make sure it's correct: 

	http://legoater.free.fr/patches/2.6.23/net-2.6.24.git-tcp_fastretrans/

and plenty of logs :

	http://legoater.free.fr/patches/2.6.23/net-2.6.24.git-tcp_fastretrans.messages

FYI, config is here :

	http://legoater.free.fr/patches/2.6.23/net-2.6.24.git-tcp_fastretrans.config

C.

^ permalink raw reply

* Re: [patch 3/3] git-net: sctp build fix (not for applying)
From: Vlad Yasevich @ 2007-10-04 15:02 UTC (permalink / raw)
  To: David Miller; +Cc: akpm, netdev
In-Reply-To: <20071003.164542.107940171.davem@davemloft.net>

David Miller wrote:
> From: Vlad Yasevich <vladislav.yasevich@hp.com>
> Date: Wed, 03 Oct 2007 09:50:55 -0400
> 
>> akpm@linux-foundation.org wrote:
>>> From: Andrew Morton <akpm@linux-foundation.org>
>>>
>>> net/sctp/sm_statetable.c:551: error: 'sctp_sf_tabort_8_4_8' undeclared here (not in a function)
>>>
>> Andrew, is the a result of the merge of net-2.6.24 with net-2.6?  
> 
> Actually, it is a result of merging with Linus's tree since your SCTP
> bits were there already, that's why Andrew hit this.
> 
>> That's the only way I see this happening.
> 
> Right.
> 
> I'll resolve this cleanly as I rebase net-2.6.24 today.

OK.  Thanks David.

-vlad

^ permalink raw reply

* Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed
From: Michael Buesch @ 2007-10-04 15:06 UTC (permalink / raw)
  To: Michael Wu; +Cc: Daniel Drake, linville, johannes, netdev, linux-wireless
In-Reply-To: <200710041034.48533.flamingice@sourmilk.net>

On Thursday 04 October 2007 16:34:43 Michael Wu wrote:
> On Thursday 04 October 2007 07:33, Daniel Drake wrote:
> > Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit.
> > It will then be reinitialised to the default (ieee80211_subif_start_xmit)
> > in ieee80211_if_set_type.
> >
> Well.. this kinda sucks, but we can clean up the logic here later.
> 
> > +	BUG_ON(netif_running(dev));
> This will never happen, so there's no point.

The reason why BUG_ON exists is to catch bugs that happen, although
they Should Never Happen (tm) ;)

-- 
Greetings Michael.

^ permalink raw reply

* Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed
From: Michael Wu @ 2007-10-04 15:14 UTC (permalink / raw)
  To: Michael Buesch
  Cc: Daniel Drake, linville-2XuSBdqkA4R54TAoqtyWWQ,
	johannes-cdvu00un1VgdHxzADdlk8Q, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <200710041706.06182.mb-fseUSCV1ubazQB+pC5nmwQ@public.gmane.org>

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

On Thursday 04 October 2007 11:06, Michael Buesch wrote:
> The reason why BUG_ON exists is to catch bugs that happen, although
> they Should Never Happen (tm) ;)
This is just paranoia. There's plenty of other BUG_ONs which we use to catch 
bugs caused by drivers doing silly things. We can verify that this condition 
will never occur within the mac80211 layer, so there's no need to have it. 
The only thing this can catch is someone deciding to manually invoke 
dev->uninit, which only the unregister code should be doing.

-Michael Wu

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

^ permalink raw reply

* Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed
From: John W. Linville @ 2007-10-04 15:19 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Michael Wu, Daniel Drake, johannes, netdev, linux-wireless
In-Reply-To: <200710041706.06182.mb@bu3sch.de>

On Thu, Oct 04, 2007 at 05:06:05PM +0200, Michael Buesch wrote:
> On Thursday 04 October 2007 16:34:43 Michael Wu wrote:
> > On Thursday 04 October 2007 07:33, Daniel Drake wrote:
> > > Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit.
> > > It will then be reinitialised to the default (ieee80211_subif_start_xmit)
> > > in ieee80211_if_set_type.
> > >
> > Well.. this kinda sucks, but we can clean up the logic here later.
> > 
> > > +	BUG_ON(netif_running(dev));
> > This will never happen, so there's no point.
> 
> The reason why BUG_ON exists is to catch bugs that happen, although
> they Should Never Happen (tm) ;)

Precisely.

-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* Re: [PATCH] mac80211: Fix TX after monitor interface is converted to managed
From: Stephen Hemminger @ 2007-10-04 15:54 UTC (permalink / raw)
  To: Daniel Drake; +Cc: linville, johannes, netdev, linux-wireless
In-Reply-To: <20071004113343.552139D502B@zog.reactivated.net>

On Thu,  4 Oct 2007 12:33:43 +0100 (BST)
Daniel Drake <dsd@gentoo.org> wrote:

> This sequence of events causes loss of connectivity:
> 
> <plug in>
> <associate as normal in managed mode>
> ifconfig eth7 down
> iwconfig eth7 mode monitor
> ifconfig eth7 up
> ifconfig eth7 down
> iwconfig eth7 mode managed
> <associate as normal>
> 
> At this point you are associated but TX does not work. This is because
> the eth7 hard_start_xmit is still ieee80211_monitor_start_xmit.
> 
> Fix this by unsetting the hard_start_xmit handler in ieee80211_if_reinit. It
> will then be reinitialised to the default (ieee80211_subif_start_xmit) in
> ieee80211_if_set_type.
> 
> Signed-off-by: Daniel Drake <dsd@gentoo.org>

Playing with the function pointer is a awkward way to do this.  Shouldn't
the state management flags be used instead (dormant, running, stop/wake)...
I am concerned about races and dereferencing the NULL ptr.

-- 
Stephen Hemminger <shemminger@linux-foundation.org>

^ permalink raw reply

* Re: Blackfin Ethernet MAC driver compile error
From: Bryan Wu @ 2007-10-04 16:31 UTC (permalink / raw)
  To: Kalle Pokki; +Cc: bryan.wu, linux-kernel, netdev
In-Reply-To: <a425f86c0710040726q27aeb354vbbcb68bd2fed2b76@mail.gmail.com>

On Thu, 2007-10-04 at 22:26 +0800, Kalle Pokki wrote:
> On 10/4/07, Bryan Wu <bryan.wu@analog.com> wrote: 
> > Sorry for missing the pinmux patches. 
> > After Linus's git-pull, it should be fixed in the latest Linus
> mainline 
> > git tree.
> 
> Thanks, it is working now. I was also glad to see the binfmt_flat 
> patch going in.

Yeah, thanks Linus to accept the patches 
> 
> Do you plan to get the PHY abstraction layer patches for the Blackfin 
> EMAC included in the upcoming merge window?

Currently, it is in Jeff's netdev-2.6.git tree. IMO, Jeff will send it
to Linus when merge window open.

Regards
-Bryan Wu
> 

^ permalink raw reply

* [BUGZILLA] network wireless bugs
From: Stephen Hemminger @ 2007-10-04 16:46 UTC (permalink / raw)
  To: netdev
In-Reply-To: <20071004094426.5321af0e@freepuppy.rosehill>

13 bugs found.
ID 	Assignee 	Status 	Resolution 	Version 	Summary
4186 	linville@tuxdriver.com 	ASSI 		2.6.9 	(wireless airo) Aironet 340 PCMCIA does not support WPA
6834 	linville@tuxdriver.com 	ASSI 		2.6.17-rc6 	wpa_supplicant does not work if wifi device is part of a ...
7051 	linville@tuxdriver.com 	ASSI 		2.6.18-rc4 	prism54 does not respect carrier
7682 	Larry.Finger@lwfinger.net 	ASSI 		2.6.19.1 	bcm43xx: iwlist scan: "no scan results" with 2.6.19.1
7752 	kune@deine-taler.de 	ASSI 		2.6.20-rc2-g747... 	drivers/net/wireless/zd1211rw/zd_chip.c:1461 ASSERT r >= ...
7946 	yi.zhu@intel.com 	NEW 		2.6.19.2 	ipw2200 driver + wpa_supplicant (wpa-psk) = fail to send ...
8447 	dsd@gentoo.org 	NEW 		2.6.21.1 686 	zd1211rw does not bring ethX up on some hardware setups
8930 	linville@tuxdriver.com 	ASSI 		2.6.23-rc3 	duplicate forward declaration of void hostap_80211_rx in ...
8934 	drivers_network-wireless@ke... 	REOP 		2.6.22.5 	System freeze when restarting network connection with Bro...
8972 	dsd@gentoo.org 	NEW 		2.6.23-rc4 	zd1211 device is no longer configured
9012 	drivers_network-wireless@ke... 	NEW 		2.6.23-rc6 	RTL8187 - Losing essid
9033 	drivers_network-wireless@ke... 	NEW 		2.6.22.6 	bcm43xx: MAC suspend failed and can't find any network
9072 	drivers_network-wireless@ke... 	NEW 		2.16.20.1 	rmmod zd1211rw causes assertion failure in net/sched/sch_...

^ 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