Re: IFF_PROMISC again

2007-05-26 Thread Martín Ferrari

Hi Ben,

On 5/22/07, Ben Greear [EMAIL PROTECTED] wrote:


 PACKET_(ADD|REMOVE)_MEMBERSHIP, I need to query the real device state.



I have the same problem.  I think you can tell by looking at bit 0x100
in /sys/class/net/[ethX]/flags

Not exactly fun to use, but it seems to work.


Wow, I searched for this a lot! It could be all I need, although it
doesn't seem very robust to look at the bitmap driectly, is it?

Maybe it would be cleaner to add an promiscuity file to that structure?

--
Martín Ferrari
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: IFF_PROMISC again

2007-05-26 Thread Martín Ferrari

Hi David,

On 5/22/07, David Miller [EMAIL PROTECTED] wrote:


 Anyone know the reasoning for masking out the PROMISC flag
 in dev_get_flags() ?

Because promiscuous status is a counter, not a binary
on-off state.

You can't expect to just clear it and expect all the
other promiscuous users to just go away and be ok
with the device leaving promiscuous mode.


Yes, this is fully understood.


Since you can't sanely set it, we don't provide it
either.


I think it's cleaner how is done now, but the needed information is
hidden, not having a proper way of querying the counter or the real
(binary) promiscuous state is a problem for userspace. Do you think
the patch I suggested is not a good idea?

Do you think there is a acceptable way of exporting that info to
userspace? (as I just said to Ben, the /sys/.../flags file doesn't
seem a very clean way of checking it).

--
Martín Ferrari
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][NET_SCHED] Update htb rate when stats are polled.

2007-05-26 Thread Patrick McHardy
Ranjit Manomohan wrote:
 Currently the HTB rate for a class is update very slowly (once
 every 16 seconds). This patch updates the rate whenever the stats
 are requested from user space. This enables more accurate rate
 monitoring.
 
 +/* Update packet/byte rate for a class. */
 +static void calc_rate(struct htb_class *cl)
 +{
 +unsigned long now = jiffies;
 +if (time_after(now, (cl-rate_est_when + HZ))) {
 +unsigned int elapsed_secs =
 +(now - cl-rate_est_when)/HZ;
 +cl-sum_bytes /= elapsed_secs;
 +cl-sum_packets /= elapsed_secs;
 +RT_GEN (cl-sum_bytes,cl-rate_bytes);
 +RT_GEN (cl-sum_packets,cl-rate_packets);
 +cl-rate_est_when = now;
 +} else if time_before(now, cl-rate_est_when)
 +cl-rate_est_when = now; /* Wraparound */
 +}


We have a generic rate estimator, I think we should convert HTB over
to use it and then maybe add this feature to the generic estimator.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/9]: tcp-2.6 patchset

2007-05-26 Thread Ilpo Järvinen
Hi,

Here are some changes to TCP I've been baking. Before doing this
patchset, I rebased tcp-2.6 branch to the current net-2.6 (goes
almost cleanly) because there are some depencies to the TCP work in
there.

I booted these today and no very obvious problems showed up (OOPSes,
BUG()s, reported scoreboard leaks, etc.) while I did some transfers
with varying sysctl settings: SACK/FACK on/off and FRTO enabled).
However, no in depth analysis on behavior has been made.

The last patch is highly experimental (and incomplete), it should
NOT be applied yet. I suspect that there are at least off-by-MSS
things in it.

I'm asking for your comments.


Dave, you could consider applying other than the last one if they
seem ok to you too (you'll need to rebase your tcp-2.6 in that case
first to apply cleanly those that touch tcp_sync_left_out :-)).

-- 
 i.

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/9] [TCP] FRTO: remove unnecessary fackets/sacked_out recounting

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

F-RTO does not touch SACKED_ACKED bits at all, so there is no
need to recount them in tcp_enter_frto_loss. After removal of
the else branch, nested ifs can be combined.

This must also reset sacked_out when SACK is not in use as TCP
could have received some duplicate ACKs prior RTO. To achieve
that in a sane manner, tcp_reset_reno_sack was re-placed by the
previous patch.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |   23 +++
 1 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 925a26f..4dab5d7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1479,17 +1479,15 @@ static void tcp_enter_frto_loss(struct sock *sk, int 
allowed_segments, int flag)
 {
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
-   int cnt = 0;
 
-   tp-sacked_out = 0;
tp-lost_out = 0;
-   tp-fackets_out = 0;
tp-retrans_out = 0;
+   if (IsReno(tp))
+   tcp_reset_reno_sack(tp);
 
tcp_for_write_queue(skb, sk) {
if (skb == tcp_send_head(sk))
break;
-   cnt += tcp_skb_pcount(skb);
/*
 * Count the retransmission made on RTO correctly (only when
 * waiting for the first ACK and did not get it)...
@@ -1501,19 +1499,12 @@ static void tcp_enter_frto_loss(struct sock *sk, int 
allowed_segments, int flag)
} else {
TCP_SKB_CB(skb)-sacked = 
~(TCPCB_LOST|TCPCB_SACKED_RETRANS);
}
-   if (!(TCP_SKB_CB(skb)-sackedTCPCB_SACKED_ACKED)) {
 
-   /* Do not mark those segments lost that were
-* forward transmitted after RTO
-*/
-   if (!after(TCP_SKB_CB(skb)-end_seq,
-  tp-frto_highmark)) {
-   TCP_SKB_CB(skb)-sacked |= TCPCB_LOST;
-   tp-lost_out += tcp_skb_pcount(skb);
-   }
-   } else {
-   tp-sacked_out += tcp_skb_pcount(skb);
-   tp-fackets_out = cnt;
+   /* Don't lost mark skbs that were fwd transmitted after RTO */
+   if (!(TCP_SKB_CB(skb)-sackedTCPCB_SACKED_ACKED) 
+   !after(TCP_SKB_CB(skb)-end_seq, tp-frto_highmark)) {
+   TCP_SKB_CB(skb)-sacked |= TCPCB_LOST;
+   tp-lost_out += tcp_skb_pcount(skb);
}
}
tcp_sync_left_out(tp);
-- 
1.5.0.6

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/9] [TCP]: Tighten tcp_sock's belt, drop left_out

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

It is easily calculable when needed and user are not that many
after all.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 include/linux/tcp.h  |1 -
 include/net/tcp.h|4 ++--
 net/ipv4/tcp_input.c |   11 ++-
 net/ipv4/tcp_minisocks.c |1 -
 net/ipv4/tcp_output.c|   12 +++-
 5 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 728321f..63e04f4 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -305,7 +305,6 @@ struct tcp_sock {
u32 rtt_seq;/* sequence number to update rttvar */
 
u32 packets_out;/* Packets which are in flight*/
-   u32 left_out;   /* Packets which leaved network */
u32 retrans_out;/* Retransmitted packets out*/
 /*
  *  Options received (usually on last packet, some only on SYN packets).
diff --git a/include/net/tcp.h b/include/net/tcp.h
index dd58cf2..5d866a4 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -716,7 +716,8 @@ static inline void tcp_ca_event(struct sock *sk, const enum 
tcp_ca_event event)
  */
 static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp)
 {
-   return (tp-packets_out - tp-left_out + tp-retrans_out);
+   return tp-packets_out - (tp-sacked_out + tp-lost_out) +
+   tp-retrans_out;
 }
 
 /* If cwnd  ssthresh, we may raise ssthresh to be half-way to cwnd.
@@ -738,7 +739,6 @@ static inline void tcp_sync_left_out(struct tcp_sock *tp)
 {
BUG_ON(tp-rx_opt.sack_ok 
   (tp-sacked_out + tp-lost_out  tp-packets_out));
-   tp-left_out = tp-sacked_out + tp-lost_out;
 }
 
 extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 4dab5d7..c17e077 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1301,8 +1301,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb,
}
}
 
-   tp-left_out = tp-sacked_out + tp-lost_out;
-
if ((state.reord  tp-fackets_out)  icsk-icsk_ca_state != 
TCP_CA_Loss 
(!tp-frto_highmark || after(tp-snd_una, tp-frto_highmark)))
tcp_update_reordering(sk, ((tp-fackets_out + 1) - 
state.reord), 0);
@@ -1363,7 +1361,6 @@ static void tcp_remove_reno_sacks(struct sock *sk, int 
acked)
 static inline void tcp_reset_reno_sack(struct tcp_sock *tp)
 {
tp-sacked_out = 0;
-   tp-left_out = tp-lost_out;
 }
 
 int tcp_use_frto(struct sock *sk)
@@ -1526,7 +1523,6 @@ static void tcp_enter_frto_loss(struct sock *sk, int 
allowed_segments, int flag)
 
 void tcp_clear_retrans(struct tcp_sock *tp)
 {
-   tp-left_out = 0;
tp-retrans_out = 0;
 
tp-fackets_out = 0;
@@ -2023,7 +2019,7 @@ static void DBGUNDO(struct sock *sk, const char *msg)
printk(KERN_DEBUG Undo %s %u.%u.%u.%u/%u c%u l%u ss%u/%u p%u\n,
   msg,
   NIPQUAD(inet-daddr), ntohs(inet-dport),
-  tp-snd_cwnd, tp-left_out,
+  tp-snd_cwnd, tp-sacked_out + tp-lost_out,
   tp-snd_ssthresh, tp-prior_ssthresh,
   tp-packets_out);
 }
@@ -2152,7 +2148,6 @@ static int tcp_try_undo_loss(struct sock *sk)
 
DBGUNDO(sk, partial loss);
tp-lost_out = 0;
-   tp-left_out = tp-sacked_out;
tcp_undo_cwr(sk, 1);
NET_INC_STATS_BH(LINUX_MIB_TCPLOSSUNDO);
inet_csk(sk)-icsk_retransmits = 0;
@@ -2176,8 +2171,6 @@ static void tcp_try_to_open(struct sock *sk, int flag)
 {
struct tcp_sock *tp = tcp_sk(sk);
 
-   tp-left_out = tp-sacked_out;
-
if (tp-retrans_out == 0)
tp-retrans_stamp = 0;
 
@@ -2187,7 +2180,7 @@ static void tcp_try_to_open(struct sock *sk, int flag)
if (inet_csk(sk)-icsk_ca_state != TCP_CA_CWR) {
int state = TCP_CA_Open;
 
-   if (tp-left_out || tp-retrans_out || tp-undo_marker)
+   if (tp-sacked_out || tp-retrans_out || tp-undo_marker)
state = TCP_CA_Disorder;
 
if (inet_csk(sk)-icsk_ca_state != state) {
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 42588eb..598ddec 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -399,7 +399,6 @@ struct sock *tcp_create_openreq_child(struct sock *sk, 
struct request_sock *req,
newicsk-icsk_rto = TCP_TIMEOUT_INIT;
 
newtp-packets_out = 0;
-   newtp-left_out = 0;
newtp-retrans_out = 0;
newtp-sacked_out = 0;
newtp-fackets_out = 0;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 8891775..d67fb3d 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -682,10 +682,8 @@ int tcp_fragment(struct sock *sk, struct sk_buff 

[PATCH 1/9] [TCP]: Move Reno SACKed_out counter functions earlier

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |   98 --
 1 files changed, 47 insertions(+), 51 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index cb81e31..925a26f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1319,6 +1319,53 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb,
 /* F-RTO can only be used if TCP has never retransmitted anything other than
  * head (SACK enhanced variant from Appendix B of RFC4138 is more robust here)
  */
+static void tcp_check_reno_reordering(struct sock *sk, const int addend)
+{
+   struct tcp_sock *tp = tcp_sk(sk);
+   u32 holes;
+
+   holes = max(tp-lost_out, 1U);
+   holes = min(holes, tp-packets_out);
+
+   if ((tp-sacked_out + holes)  tp-packets_out) {
+   tp-sacked_out = tp-packets_out - holes;
+   tcp_update_reordering(sk, tp-packets_out + addend, 0);
+   }
+}
+
+/* Emulate SACKs for SACKless connection: account for a new dupack. */
+
+static void tcp_add_reno_sack(struct sock *sk)
+{
+   struct tcp_sock *tp = tcp_sk(sk);
+   tp-sacked_out++;
+   tcp_check_reno_reordering(sk, 0);
+   tcp_sync_left_out(tp);
+}
+
+/* Account for ACK, ACKing some data in Reno Recovery phase. */
+
+static void tcp_remove_reno_sacks(struct sock *sk, int acked)
+{
+   struct tcp_sock *tp = tcp_sk(sk);
+
+   if (acked  0) {
+   /* One ACK acked hole. The rest eat duplicate ACKs. */
+   if (acked-1 = tp-sacked_out)
+   tp-sacked_out = 0;
+   else
+   tp-sacked_out -= acked-1;
+   }
+   tcp_check_reno_reordering(sk, acked);
+   tcp_sync_left_out(tp);
+}
+
+static inline void tcp_reset_reno_sack(struct tcp_sock *tp)
+{
+   tp-sacked_out = 0;
+   tp-left_out = tp-lost_out;
+}
+
 int tcp_use_frto(struct sock *sk)
 {
const struct tcp_sock *tp = tcp_sk(sk);
@@ -1734,57 +1781,6 @@ static int tcp_time_to_recover(struct sock *sk)
return 0;
 }
 
-/* If we receive more dupacks than we expected counting segments
- * in assumption of absent reordering, interpret this as reordering.
- * The only another reason could be bug in receiver TCP.
- */
-static void tcp_check_reno_reordering(struct sock *sk, const int addend)
-{
-   struct tcp_sock *tp = tcp_sk(sk);
-   u32 holes;
-
-   holes = max(tp-lost_out, 1U);
-   holes = min(holes, tp-packets_out);
-
-   if ((tp-sacked_out + holes)  tp-packets_out) {
-   tp-sacked_out = tp-packets_out - holes;
-   tcp_update_reordering(sk, tp-packets_out + addend, 0);
-   }
-}
-
-/* Emulate SACKs for SACKless connection: account for a new dupack. */
-
-static void tcp_add_reno_sack(struct sock *sk)
-{
-   struct tcp_sock *tp = tcp_sk(sk);
-   tp-sacked_out++;
-   tcp_check_reno_reordering(sk, 0);
-   tcp_sync_left_out(tp);
-}
-
-/* Account for ACK, ACKing some data in Reno Recovery phase. */
-
-static void tcp_remove_reno_sacks(struct sock *sk, int acked)
-{
-   struct tcp_sock *tp = tcp_sk(sk);
-
-   if (acked  0) {
-   /* One ACK acked hole. The rest eat duplicate ACKs. */
-   if (acked-1 = tp-sacked_out)
-   tp-sacked_out = 0;
-   else
-   tp-sacked_out -= acked-1;
-   }
-   tcp_check_reno_reordering(sk, acked);
-   tcp_sync_left_out(tp);
-}
-
-static inline void tcp_reset_reno_sack(struct tcp_sock *tp)
-{
-   tp-sacked_out = 0;
-   tp-left_out = tp-lost_out;
-}
-
 /* RFC: This is from the original, I doubt that this is necessary at all:
  * clear xmit_retrans hint if seq of this skb is beyond hint. How could we
  * retransmitted past LOST markings in the first place? I'm not fully sure
-- 
1.5.0.6

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/9] [TCP]: Access to highest_sack obsoletes forward_cnt_hint

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

In addition, added a reference about the purpose of the loop.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 include/linux/tcp.h   |1 -
 net/ipv4/tcp_output.c |   23 +--
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 63e04f4..1ce9fd4 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -343,7 +343,6 @@ struct tcp_sock {
 
int fastpath_cnt_hint;
int retransmit_cnt_hint;
-   int forward_cnt_hint;
 
u16 advmss; /* Advertised MSS   */
u16 prior_ssthresh; /* ssthresh saved at recovery start */
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index d67fb3d..f33e25b 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1931,33 +1931,28 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
 * and retransmission... Both ways have their merits...
 *
 * For now we do not retransmit anything, while we have some new
-* segments to send.
+* segments to send. In the other cases, follow rule 3 for
+* NextSeg() specified in RFC3517.
 */
 
if (tcp_may_send_now(sk))
return;
 
-   if (tp-forward_skb_hint) {
+   /* If nothing is SACKed, highest_sack in the loop won't be valid */
+   if (!tp-sacked_out)
+   return;
+
+   if (tp-forward_skb_hint)
skb = tp-forward_skb_hint;
-   packet_cnt = tp-forward_cnt_hint;
-   } else{
+   else
skb = tcp_write_queue_head(sk);
-   packet_cnt = 0;
-   }
 
tcp_for_write_queue_from(skb, sk) {
if (skb == tcp_send_head(sk))
break;
-   tp-forward_cnt_hint = packet_cnt;
tp-forward_skb_hint = skb;
 
-   /* Similar to the retransmit loop above we
-* can pretend that the retransmitted SKB
-* we send out here will be composed of one
-* real MSS sized packet because tcp_retransmit_skb()
-* will fragment it if necessary.
-*/
-   if (++packet_cnt  tp-fackets_out)
+   if (after(TCP_SKB_CB(skb)-seq, tp-highest_sack))
break;
 
if (tcp_packets_in_flight(tp) = tp-snd_cwnd)
-- 
1.5.0.6

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/9] [TCP]: Move code from tcp_ecn.h to tcp*.c and tcp.h remove it

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

No other users exist for tcp_ecn.h. Very few things remain in
tcp.h, for most TCP ECN functions callers reside within a
single .c file and can be placed there.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 include/net/tcp.h|   14 -
 include/net/tcp_ecn.h|  130 --
 net/ipv4/tcp_input.c |   50 ++
 net/ipv4/tcp_minisocks.c |6 ++
 net/ipv4/tcp_output.c|   50 ++
 5 files changed, 118 insertions(+), 132 deletions(-)
 delete mode 100644 include/net/tcp_ecn.h

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 5d866a4..6f88d13 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -39,6 +39,7 @@
 #include net/snmp.h
 #include net/ip.h
 #include net/tcp_states.h
+#include net/inet_ecn.h
 
 #include linux/seq_file.h
 
@@ -324,6 +325,17 @@ static inline void tcp_clear_options(struct 
tcp_options_received *rx_opt)
rx_opt-tstamp_ok = rx_opt-sack_ok = rx_opt-wscale_ok = 
rx_opt-snd_wscale = 0;
 }
 
+#defineTCP_ECN_OK  1
+#defineTCP_ECN_QUEUE_CWR   2
+#defineTCP_ECN_DEMAND_CWR  4
+
+static __inline__ void
+TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th)
+{
+   if (sysctl_tcp_ecn  th-ece  th-cwr)
+   inet_rsk(req)-ecn_ok = 1;
+}
+
 enum tcp_tw_status
 {
TCP_TW_SUCCESS = 0,
@@ -567,8 +579,6 @@ struct tcp_skb_cb {
 
 #define TCP_SKB_CB(__skb)  ((struct tcp_skb_cb *)((__skb)-cb[0]))
 
-#include net/tcp_ecn.h
-
 /* Due to TSO, an SKB can be composed of multiple actual
  * packets.  To keep these tracked properly, we use this.
  */
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h
deleted file mode 100644
index 89eb3e0..000
--- a/include/net/tcp_ecn.h
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef _NET_TCP_ECN_H_
-#define _NET_TCP_ECN_H_ 1
-
-#include net/inet_ecn.h
-#include net/request_sock.h
-
-#define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH))
-
-#defineTCP_ECN_OK  1
-#define TCP_ECN_QUEUE_CWR  2
-#define TCP_ECN_DEMAND_CWR 4
-
-static inline void TCP_ECN_queue_cwr(struct tcp_sock *tp)
-{
-   if (tp-ecn_flagsTCP_ECN_OK)
-   tp-ecn_flags |= TCP_ECN_QUEUE_CWR;
-}
-
-
-/* Output functions */
-
-static inline void TCP_ECN_send_synack(struct tcp_sock *tp,
-  struct sk_buff *skb)
-{
-   TCP_SKB_CB(skb)-flags = ~TCPCB_FLAG_CWR;
-   if (!(tp-ecn_flagsTCP_ECN_OK))
-   TCP_SKB_CB(skb)-flags = ~TCPCB_FLAG_ECE;
-}
-
-static inline void TCP_ECN_send_syn(struct sock *sk, struct sk_buff *skb)
-{
-   struct tcp_sock *tp = tcp_sk(sk);
-
-   tp-ecn_flags = 0;
-   if (sysctl_tcp_ecn) {
-   TCP_SKB_CB(skb)-flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR;
-   tp-ecn_flags = TCP_ECN_OK;
-   }
-}
-
-static __inline__ void
-TCP_ECN_make_synack(struct request_sock *req, struct tcphdr *th)
-{
-   if (inet_rsk(req)-ecn_ok)
-   th-ece = 1;
-}
-
-static inline void TCP_ECN_send(struct sock *sk, struct sk_buff *skb,
-   int tcp_header_len)
-{
-   struct tcp_sock *tp = tcp_sk(sk);
-
-   if (tp-ecn_flags  TCP_ECN_OK) {
-   /* Not-retransmitted data segment: set ECT and inject CWR. */
-   if (skb-len != tcp_header_len 
-   !before(TCP_SKB_CB(skb)-seq, tp-snd_nxt)) {
-   INET_ECN_xmit(sk);
-   if (tp-ecn_flagsTCP_ECN_QUEUE_CWR) {
-   tp-ecn_flags = ~TCP_ECN_QUEUE_CWR;
-   tcp_hdr(skb)-cwr = 1;
-   skb_shinfo(skb)-gso_type |= SKB_GSO_TCP_ECN;
-   }
-   } else {
-   /* ACK or retransmitted segment: clear ECT|CE */
-   INET_ECN_dontxmit(sk);
-   }
-   if (tp-ecn_flags  TCP_ECN_DEMAND_CWR)
-   tcp_hdr(skb)-ece = 1;
-   }
-}
-
-/* Input functions */
-
-static inline void TCP_ECN_accept_cwr(struct tcp_sock *tp, struct sk_buff *skb)
-{
-   if (tcp_hdr(skb)-cwr)
-   tp-ecn_flags = ~TCP_ECN_DEMAND_CWR;
-}
-
-static inline void TCP_ECN_withdraw_cwr(struct tcp_sock *tp)
-{
-   tp-ecn_flags = ~TCP_ECN_DEMAND_CWR;
-}
-
-static inline void TCP_ECN_check_ce(struct tcp_sock *tp, struct sk_buff *skb)
-{
-   if (tp-ecn_flagsTCP_ECN_OK) {
-   if (INET_ECN_is_ce(TCP_SKB_CB(skb)-flags))
-   tp-ecn_flags |= TCP_ECN_DEMAND_CWR;
-   /* Funny extension: if ECT is not set on a segment,
-* it is surely retransmit. It is not in ECN RFC,
-* but Linux follows this rule. */
-   else if (INET_ECN_is_not_ect((TCP_SKB_CB(skb)-flags)))
-   tcp_enter_quickack_mode((struct sock *)tp);
-   }
-}
-
-static inline void 

[PATCH 6/9] [TCP]: Reorganize lost marking code

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

The indentation started to get scary, so I reorganized code so
that some trivial ifs are in tcp_update_scoreboard and the main
loops remain in tcp_update_scoreboard_fack.

It's much easier to view the actual changes with git-diff -w
than from the messy looking (default) diff.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |  156 +-
 1 files changed, 78 insertions(+), 78 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 452a3b0..fbce87f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1866,7 +1866,6 @@ static void tcp_mark_head_lost_single(struct sock *sk)
before(tp-snd_una, tp-high_seq)) {
TCP_SKB_CB(skb)-sacked |= TCPCB_LOST;
tp-lost_out += tcp_skb_pcount(skb);
-   tcp_sync_left_out(tp);
}
 }
 
@@ -1905,99 +1904,84 @@ static void tcp_mark_head_lost_single(struct sock *sk)
  * Key difference here is that FACK uses both SACK blocks and holes while
  * RFC3517 is using only SACK blocks when counting for reordering.
  */
-static void tcp_update_scoreboard_fack(struct sock *sk, u32 entry_seq,
-  int fast_rexmit)
+struct sk_buff *tcp_update_scoreboard_fack(struct sock *sk, u32 entry_seq,
+  int fast_rexmit)
 {
struct tcp_sock *tp = tcp_sk(sk);
/* Beware: timedout_continue might be pointing to sk_write_queue */
struct sk_buff *timedout_continue = NULL;
struct sk_buff *skb;
-
-   if (!tp-sacked_out) {
-   if (IsFack(tp) || fast_rexmit) {
-   tcp_mark_head_lost_single(sk);
-   skb = tcp_write_queue_head(sk);
-   timedout_continue = tcp_write_queue_next(sk, skb);
-   }
-
+   unsigned int holes_seen = 0;
+
+   skb = tcp_write_queue_find(sk, entry_seq);
+   /* If this ever becomes expensive, it can be delayed */
+   timedout_continue = tcp_write_queue_next(sk, skb);
+   if (entry_seq != tp-highest_sack) {
+   /* Not interested in the last SACKed one we got */
+   /* RFC: find_below could help here too */
+   skb = tcp_write_queue_prev(sk, skb);
+   if (IsFack(tp)  tcp_skb_timedout(sk, skb) 
+   (tp-fackets_out  tp-packets_out)) {
+   timedout_continue = tcp_write_queue_find(sk, 
tp-highest_sack);
+   timedout_continue = tcp_write_queue_next(sk, 
timedout_continue);
+   } else
+   timedout_continue = NULL;
} else {
-   unsigned int holes_seen = 0;
-
-   skb = tcp_write_queue_find(sk, entry_seq);
-   /* If this ever becomes expensive, it can be delayed */
-   timedout_continue = tcp_write_queue_next(sk, skb);
-   if (entry_seq != tp-highest_sack) {
-   /* Not interested in the last SACKed one we got */
-   /* RFC: find_below could help here too */
-   skb = tcp_write_queue_prev(sk, skb);
-   if (IsFack(tp)  tcp_skb_timedout(sk, skb) 
-   (tp-fackets_out  tp-packets_out)) {
-   timedout_continue = tcp_write_queue_find(sk, 
tp-highest_sack);
-   timedout_continue = tcp_write_queue_next(sk, 
timedout_continue);
-   } else
-   timedout_continue = NULL;
-   } else {
-   unsigned int reord_count = IsFack(tp) ? 0 : 1;
-
-   /* Phase I: Search until TCP can mark */
-   tcp_for_write_queue_backwards_from(skb, sk) {
-   if ((tp-fackets_out = tp-sacked_out +
-   tp-lost_out +
-   holes_seen) ||
-   (TCP_SKB_CB(skb)-sacked  TCPCB_LOST))
-   goto backwards_walk_done;
-
-   if (IsFack(tp)  tcp_skb_timedout(sk, skb))
-   break;
-   else
-   timedout_continue = NULL;
-
-   if (IsFack(tp) ||
-   (TCP_SKB_CB(skb)-sacked  
TCPCB_SACKED_ACKED))
-   reord_count += tcp_skb_pcount(skb);
-   if (reord_count  tp-reordering) {
-   if (after(TCP_SKB_CB(skb)-seq, 
tp-high_seq)) {
-   /* RFC: should we have 
find_below? */
-   skb = tcp_write_queue_find(sk, 

[PATCH 7/9] [TCP]: Correct fastpath entrypoint below high_seq

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

In addition, implemented find_below using minus one. Some
reorganization was necessary to make code efficient again.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 net/ipv4/tcp_input.c |   31 +--
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index fbce87f..8c1e38a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1913,22 +1913,33 @@ struct sk_buff *tcp_update_scoreboard_fack(struct sock 
*sk, u32 entry_seq,
struct sk_buff *skb;
unsigned int holes_seen = 0;
 
-   skb = tcp_write_queue_find(sk, entry_seq);
-   /* If this ever becomes expensive, it can be delayed */
-   timedout_continue = tcp_write_queue_next(sk, skb);
if (entry_seq != tp-highest_sack) {
-   /* Not interested in the last SACKed one we got */
-   /* RFC: find_below could help here too */
-   skb = tcp_write_queue_prev(sk, skb);
+   /* Look for skb below min_seq(entry_seq, tp-high_seq) */
+   if (!after(entry_seq, tp-high_seq)) {
+   skb = tcp_write_queue_find(sk, entry_seq - 1);
+   } else {
+   BUG_ON(tp-snd_una == tp-high_seq);
+   skb = tcp_write_queue_find(sk, tp-high_seq - 1);
+   }
+
+   timedout_continue = NULL;
if (IsFack(tp)  tcp_skb_timedout(sk, skb) 
(tp-fackets_out  tp-packets_out)) {
-   timedout_continue = tcp_write_queue_find(sk, 
tp-highest_sack);
-   timedout_continue = tcp_write_queue_next(sk, 
timedout_continue);
-   } else
-   timedout_continue = NULL;
+   timedout_continue = tcp_write_queue_next(sk, skb);
+   if (!after(entry_seq, tp-high_seq)) {
+   /* Use latest SACK info in skipping past skbs */
+   timedout_continue = tcp_write_queue_find(sk, 
tp-highest_sack);
+   timedout_continue = tcp_write_queue_next(sk, 
timedout_continue);
+   }
+   }
+
} else {
unsigned int reord_count = IsFack(tp) ? 0 : 1;
 
+   skb = tcp_write_queue_find(sk, entry_seq);
+   /* If this ever becomes expensive, it can be delayed */
+   timedout_continue = tcp_write_queue_next(sk, skb);
+
/* Phase I: Search until TCP can mark */
tcp_for_write_queue_backwards_from(skb, sk) {
if ((tp-fackets_out = tp-sacked_out + tp-lost_out +
-- 
1.5.0.6

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/9] [TCP]: Reduce sacked_out with reno when purging write_queue

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

Previously TCP had a transitional state during which reno
counted segments that are already below the current window into
sacked_out, which is now prevented. Re-try now unconditional
S+L catching (I wonder if we could get that BUG_ON place
pinpointed more exactly in oops because now inlining makes it
lose its original context as they always seem to be in
tcp_ack, #define helps?).

Beware, this change is not a trivial one and might have some
unexpected side-effects under obscure conditions since state
tracking is to happen much later on and the reno sack counting
was highly depending on the current state.

This approach conservatively calls just remove_sack and leaves
reset_sack() calls alone. The best solution to the whole problem
would be to first calculate the new sacked_out fully (this patch
does not move reno_sack_reset calls from original sites and thus
does not implement this). However, that would require very
invasive change to fastretrans_alert (perhaps even slicing it to
two halves). Alternatively, all callers of tcp_packets_in_flight
(i.e., users that depend on sacked_out) should be postponed
until the new sacked_out has been calculated but it isn't any
simpler alternative.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 include/net/tcp.h|3 +--
 net/ipv4/tcp_input.c |   19 +++
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 6f88d13..5255d51 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -747,8 +747,7 @@ static inline __u32 tcp_current_ssthresh(const struct sock 
*sk)
 
 static inline void tcp_sync_left_out(struct tcp_sock *tp)
 {
-   BUG_ON(tp-rx_opt.sack_ok 
-  (tp-sacked_out + tp-lost_out  tp-packets_out));
+   BUG_ON(tp-sacked_out + tp-lost_out  tp-packets_out);
 }
 
 extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8c1e38a..9c12c90 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2295,7 +2295,7 @@ static void tcp_mtup_probe_success(struct sock *sk, 
struct sk_buff *skb)
  */
 static void
 tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
- int prior_packets, int flag, u32 mark_lost_entry_seq)
+ int pkts_acked, int flag, u32 mark_lost_entry_seq)
 {
struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
@@ -2380,12 +2380,8 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
if (prior_snd_una == tp-snd_una) {
if (IsReno(tp)  is_dupack)
tcp_add_reno_sack(sk);
-   } else {
-   int acked = prior_packets - tp-packets_out;
-   if (IsReno(tp))
-   tcp_remove_reno_sacks(sk, acked);
-   is_dupack = tcp_try_undo_partial(sk, acked);
-   }
+   } else
+   is_dupack = tcp_try_undo_partial(sk, pkts_acked);
break;
case TCP_CA_Loss:
if (flagFLAG_DATA_ACKED)
@@ -2602,6 +2598,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 
*seq_rtt_p)
struct sk_buff *skb;
__u32 now = tcp_time_stamp;
int acked = 0;
+   int prior_packets = tp-packets_out;
__s32 seq_rtt = -1;
u32 pkts_acked = 0;
ktime_t last_ackt = ktime_set(0,0);
@@ -2682,6 +2679,11 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 
*seq_rtt_p)
tcp_ack_update_rtt(sk, acked, seq_rtt);
tcp_ack_packets_out(sk);
 
+   if (IsReno(tp)) {
+   int acked = prior_packets - tp-packets_out;
+   tcp_remove_reno_sacks(sk, acked);
+   }
+
if (ca_ops-pkts_acked)
ca_ops-pkts_acked(sk, pkts_acked, last_ackt);
}
@@ -3017,7 +3019,8 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, 
int flag)
if ((flag  FLAG_DATA_ACKED)  !frto_cwnd 
tcp_may_raise_cwnd(sk, flag))
tcp_cong_avoid(sk, ack,  seq_rtt, prior_in_flight, 0);
-   tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag,
+   tcp_fastretrans_alert(sk, prior_snd_una,
+ prior_packets - tp-packets_out, flag,
  mark_lost_entry_seq);
} else {
if ((flag  FLAG_DATA_ACKED)  !frto_cwnd)
-- 
1.5.0.6

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 9/9] [RFC] [TCP]: Kill tp-fackets_out (tcp_sock diet program)

2007-05-26 Thread Ilpo Järvinen
From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= [EMAIL PROTECTED]

The replacement fastpath uses arithmetics to find out fackets_out
(or a necessary subset of it) when the sizes are less than MSS
off from MSS*packets_out. Slowpath walks through the write queue.

Saves some space in tcp_sock. Both fackets_out and SACK
processing fack count hint can be removed right away. However,
this also enables further improvements to SACK processing since
strict ordering constraints due to fack counting are removed,
e.g., the highest_sack might be useful replacement for the skb
hint (we should measure this at some real server, e.g., by adding
mib counts or so to see how often highest_sack and fastpath skb
hint really point to a different thing; I suspect that's being
really marginal proportion if that ever occurs).

Negative side:
- Sending many data segments with SACK blocks (bi-dir flow and
losses at the same round-trip for both directions) can cause TCP
to need slow path.
- No-Nagler will take a great hit but that's what they're
asking for...

Unsolved issues:
- MSS shrinkage must be handled without failure in arithmetics.
Either run tcp_fragment for every too large skb (which is not
going to be a safe alternative since allocs can fail) or somehow
force slow path (so far I haven't found a solution that would
consume less than u32 seqno in tcp_sock)!
- ...A number of potential off by one (or by MSS in this case)
places haven't yet been triple checked...

Enhancement ideas:
- It might be possible to extend fastpath by checking if snd_sml
is below / above highest_sack (could allow to up 2*MSS off case
using fast path)...

All in all, very scary patch. Please do not apply. This is not
yet completely thought one.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
 include/linux/tcp.h  |2 -
 include/net/tcp.h|1 +
 net/ipv4/tcp.c   |2 +-
 net/ipv4/tcp_input.c |  216 +-
 net/ipv4/tcp_minisocks.c |1 -
 net/ipv4/tcp_output.c|   22 ++
 6 files changed, 162 insertions(+), 82 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 1ce9fd4..d4ecb1f 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -341,14 +341,12 @@ struct tcp_sock {
struct sk_buff *forward_skb_hint;
struct sk_buff *fastpath_skb_hint;
 
-   int fastpath_cnt_hint;
int retransmit_cnt_hint;
 
u16 advmss; /* Advertised MSS   */
u16 prior_ssthresh; /* ssthresh saved at recovery start */
u32 lost_out;   /* Lost packets */
u32 sacked_out; /* SACK'd packets   */
-   u32 fackets_out;/* FACK'd packets   */
u32 high_seq;   /* snd_nxt at onset of congestion   */
 
u32 retrans_stamp;  /* Timestamp of the last retransmit,
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 5255d51..f96a466 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -359,6 +359,7 @@ extern int  tcp_use_frto(struct sock *sk);
 extern voidtcp_enter_frto(struct sock *sk);
 extern voidtcp_enter_loss(struct sock *sk, int how);
 extern voidtcp_clear_retrans(struct tcp_sock *tp);
+extern int tcp_calc_fackets_out(struct sock *sk);
 extern voidtcp_update_metrics(struct sock *sk);
 
 extern voidtcp_close(struct sock *sk, 
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index bd4c295..3f9a021 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2020,7 +2020,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
info-tcpi_sacked = tp-sacked_out;
info-tcpi_lost = tp-lost_out;
info-tcpi_retrans = tp-retrans_out;
-   info-tcpi_fackets = tp-fackets_out;
+   info-tcpi_fackets = tcp_calc_fackets_out(sk);
 
info-tcpi_last_data_sent = jiffies_to_msecs(now - tp-lsndtime);
info-tcpi_last_data_recv = jiffies_to_msecs(now - 
icsk-icsk_ack.lrcvtime);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9c12c90..02cb546 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -913,6 +913,82 @@ reset:
}
 }
 
+static u32 tcp_expected_fullsized(struct sock *sk)
+{
+   struct tcp_sock *tp = tcp_sk(sk);
+   struct inet_connection_sock *icsk = inet_csk(sk);
+   u32 expected_size;
+
+   expected_size = tp-packets_out * tp-mss_cache;
+   if (icsk-icsk_mtup.probe_size)
+   expected_size += icsk-icsk_mtup.probe_size - tp-mss_cache;
+
+   return expected_size;
+}
+
+static u32 tcp_missing_from_fullsized(struct sock *sk)
+{
+   struct tcp_sock *tp = tcp_sk(sk);
+
+   return tcp_expected_fullsized(sk) - (tp-snd_nxt - tp-snd_una);
+}
+
+/* Returns 1 if less than MSS bytes are missing (off from fullsized
+ * segments). Under such conditions, 

[PATCH] Avoid switch on long long in s2io driver

2007-05-26 Thread Andreas Schwab
A switch on long long causes gcc to generate a reference to __ucmpdi2 on
ppc32.  Avoid that by casting to int, since the value is only a small
integer anyway.

Signed-off-by: Andreas Schwab [EMAIL PROTECTED]

---
 drivers/net/s2io.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.22-rc1/drivers/net/s2io.c
===
--- linux-2.6.22-rc1.orig/drivers/net/s2io.c2007-05-13 11:03:28.0 
+0200
+++ linux-2.6.22-rc1/drivers/net/s2io.c 2007-05-13 12:52:49.0 +0200
@@ -2898,7 +2898,7 @@ static void tx_intr_handler(struct fifo_
 
/* update t_code statistics */
err = 48;
-   switch(err) {
+   switch((int)err) {
case 2:
nic-mac_control.stats_info-sw_stat.
tx_buf_abort_cnt++;
@@ -6825,7 +6825,7 @@ static int rx_osm_handler(struct ring_in
sp-mac_control.stats_info-sw_stat.parity_err_cnt++;
}
err = 48;
-   switch(err) {
+   switch((int)err) {
case 1:
sp-mac_control.stats_info-sw_stat.
rx_parity_err_cnt++;

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][NET_SCHED] Update htb rate when stats are polled.

2007-05-26 Thread Patrick McHardy
Patrick McHardy wrote:
 Ranjit Manomohan wrote:
 
Currently the HTB rate for a class is update very slowly (once
every 16 seconds). This patch updates the rate whenever the stats
are requested from user space. This enables more accurate rate
monitoring.

+/* Update packet/byte rate for a class. */
[..]
 
 We have a generic rate estimator, I think we should convert HTB over
 to use it and then maybe add this feature to the generic estimator.


You can use this patch as a base. It needs a bit more work
(for example the CONFIG_NET_SCHED_ESTIMATOR ifdefs are
unnecessary, but I've added them to remind me to clean this
up in all schedulers), but it works well enough for testing.

Actually .. do you still need your changes with this patch?
You can now replace the default estimator by one with a
shorter interval.

[NET_SCHED]: sch_htb: use generic estimator

Remove the internal rate estimator and use the generic one.

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]

---
commit add81ec9b23f1fbe973093d5999a3d70e9d4c48b
tree d5d119cceed54f14c39cbe6bc75c270a3e89f316
parent b208cb31ea86bc6296e5b08e53bc765c81306286
author Patrick McHardy [EMAIL PROTECTED] Sat, 26 May 2007 14:52:02 +0200
committer Patrick McHardy [EMAIL PROTECTED] Sat, 26 May 2007 14:52:02 +0200

 net/sched/sch_htb.c |   91 +--
 1 files changed, 30 insertions(+), 61 deletions(-)

diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 035788c..b29ff8f 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -69,8 +69,6 @@
 */
 
 #define HTB_HSIZE 16   /* classid hash size */
-#define HTB_EWMAC 2/* rate average over HTB_EWMAC*HTB_HSIZE sec */
-#define HTB_RATECM 1   /* whether to use rate computer */
 #define HTB_HYSTERESIS 1   /* whether to use mode hysteresis for speedup */
 #define HTB_VER 0x30011/* major must be matched with number 
suplied by TC as version */
 
@@ -95,12 +93,6 @@ struct htb_class {
struct tc_htb_xstats xstats;/* our special stats */
int refcnt; /* usage count of this class */
 
-#ifdef HTB_RATECM
-   /* rate measurement counters */
-   unsigned long rate_bytes, sum_bytes;
-   unsigned long rate_packets, sum_packets;
-#endif
-
/* topology */
int level;  /* our level (see above) */
struct htb_class *parent;   /* parent class */
@@ -194,10 +186,6 @@ struct htb_sched {
int rate2quantum;   /* quant = rate / rate2quantum */
psched_time_t now;  /* cached dequeue time */
struct qdisc_watchdog watchdog;
-#ifdef HTB_RATECM
-   struct timer_list rttim;/* rate computer timer */
-   int recmp_bucket;   /* which hash bucket to recompute next */
-#endif
 
/* non shaped skbs; let them go directly thru */
struct sk_buff_head direct_queue;
@@ -677,34 +665,6 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc 
*sch)
return NET_XMIT_SUCCESS;
 }
 
-#ifdef HTB_RATECM
-#define RT_GEN(D,R) R+=D-(R/HTB_EWMAC);D=0
-static void htb_rate_timer(unsigned long arg)
-{
-   struct Qdisc *sch = (struct Qdisc *)arg;
-   struct htb_sched *q = qdisc_priv(sch);
-   struct hlist_node *p;
-   struct htb_class *cl;
-
-
-   /* lock queue so that we can muck with it */
-   spin_lock_bh(sch-dev-queue_lock);
-
-   q-rttim.expires = jiffies + HZ;
-   add_timer(q-rttim);
-
-   /* scan and recompute one bucket at time */
-   if (++q-recmp_bucket = HTB_HSIZE)
-   q-recmp_bucket = 0;
-
-   hlist_for_each_entry(cl,p, q-hash + q-recmp_bucket, hlist) {
-   RT_GEN(cl-sum_bytes, cl-rate_bytes);
-   RT_GEN(cl-sum_packets, cl-rate_packets);
-   }
-   spin_unlock_bh(sch-dev-queue_lock);
-}
-#endif
-
 /**
  * htb_charge_class - charges amount bytes to leaf and ancestors
  *
@@ -750,11 +710,6 @@ static void htb_charge_class(struct htb_sched *q, struct 
htb_class *cl,
if (cl-cmode != HTB_CAN_SEND)
htb_add_to_wait_tree(q, cl, diff);
}
-#ifdef HTB_RATECM
-   /* update rate counters */
-   cl-sum_bytes += bytes;
-   cl-sum_packets++;
-#endif
 
/* update byte stats except for leaves which are already 
updated */
if (cl-level) {
@@ -1095,13 +1050,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr 
*opt)
if (q-direct_qlen  2) /* some devices have zero tx_queue_len */
q-direct_qlen = 2;
 
-#ifdef HTB_RATECM
-   init_timer(q-rttim);
-   q-rttim.function = htb_rate_timer;
-   q-rttim.data = (unsigned long)sch;
-   q-rttim.expires = jiffies + HZ;
-   add_timer(q-rttim);
-#endif
if ((q-rate2quantum = gopt-rate2quantum)  1)
q-rate2quantum = 1;
q-defcls = gopt-defcls;
@@ -1175,18 +1123,15 @@ htb_dump_class_stats(struct Qdisc *sch, 

Re: b44: regression in 2.6.22

2007-05-26 Thread Michael Buesch
On Saturday 26 May 2007 02:24:31 Stephen Hemminger wrote:
 Something is broken with the b44 driver in 2.6.22-rc1 or later. Now bisecting.
 The performance (with iperf) for receiving is normally 94Mbits or more.
 But something happened that dropped performance to less than 1Mbit,
 probably corrupted packets.
 
 There is nothing obvious in the commit log for drivers/net/b44.c, so it
 probably is something more general.
 
 
 Looking at the code in b44_rx(), I see a couple unrelated of bugs:
 1. In the small packet case it recycles the skb before copying data out... 
Not good if new data arrives overwriting existing data.
 
 2. Macros like RX_PKT_BUF_SZ that depend on local variables are evil!!

Very interesting!
2.6.22 doesn't include ssb, does it?

Adding CCs to make reporters of another bugreport aware of this.

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Avoid switch on long long in s2io driver

2007-05-26 Thread Michael Buesch
On Saturday 26 May 2007 10:58:15 Andreas Schwab wrote:
 A switch on long long causes gcc to generate a reference to __ucmpdi2 on
 ppc32.  Avoid that by casting to int, since the value is only a small
 integer anyway.
 
 Signed-off-by: Andreas Schwab [EMAIL PROTECTED]
 
 ---
  drivers/net/s2io.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 Index: linux-2.6.22-rc1/drivers/net/s2io.c
 ===
 --- linux-2.6.22-rc1.orig/drivers/net/s2io.c  2007-05-13 11:03:28.0 
 +0200
 +++ linux-2.6.22-rc1/drivers/net/s2io.c   2007-05-13 12:52:49.0 
 +0200
 @@ -2898,7 +2898,7 @@ static void tx_intr_handler(struct fifo_
  
   /* update t_code statistics */
   err = 48;
 - switch(err) {
 + switch((int)err) {

Hm, maybe add a comment, too?
This cast looks redundant at the first look and someone
who doesn't understand it might submit a patch to remove it again.

   case 2:
   nic-mac_control.stats_info-sw_stat.
   tx_buf_abort_cnt++;
 @@ -6825,7 +6825,7 @@ static int rx_osm_handler(struct ring_in
   sp-mac_control.stats_info-sw_stat.parity_err_cnt++;
   }
   err = 48;
 - switch(err) {
 + switch((int)err) {
   case 1:
   sp-mac_control.stats_info-sw_stat.
   rx_parity_err_cnt++;
 
 Andreas.
 



-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


resend [PATCH 2/5 2.6.21] L2TP: Changes to existing ppp and socket kernel headers for L2TP

2007-05-26 Thread James Chapman
Add struct sockaddr_pppol2tp to carry L2TP-specific address
information for the PPPoX (PPPoL2TP) socket. Unfortunately we can't
use the union inside struct sockaddr_pppox because the L2TP-specific
data is larger than the current size of the union and we must preserve
the size of struct sockaddr_pppox for binary compatibility.

Also add a PPPIOCGL2TPSTATS ioctl to allow userspace to obtain
L2TP counters and state from the kernel.

Signed-off-by: James Chapman [EMAIL PROTECTED]

Index: linux-2.6.21/include/linux/if_ppp.h
===
--- linux-2.6.21.orig/include/linux/if_ppp.h
+++ linux-2.6.21/include/linux/if_ppp.h
@@ -110,6 +110,21 @@ struct ifpppcstatsreq {
struct ppp_comp_stats stats;
 };
 
+/* For PPPIOCGL2TPSTATS */
+struct pppol2tp_ioc_stats {
+   __u16   tunnel_id;  /* redundant */
+   __u16   session_id; /* if zero, get tunnel stats */
+   __u32   using_ipsec:1;  /* valid only for session_id == 0 */
+   __u64   tx_packets;
+   __u64   tx_bytes;
+   __u64   tx_errors;
+   __u64   rx_packets;
+   __u64   rx_bytes;
+   __u64   rx_seq_discards;
+   __u64   rx_oos_packets;
+   __u64   rx_errors;
+};
+
 #define ifr__name   b.ifr_ifrn.ifrn_name
 #define stats_ptr   b.ifr_ifru.ifru_data
 
@@ -146,6 +161,7 @@ struct ifpppcstatsreq {
 #define PPPIOCDISCONN  _IO('t', 57)/* disconnect channel */
 #define PPPIOCATTCHAN  _IOW('t', 56, int)  /* attach to ppp channel */
 #define PPPIOCGCHAN_IOR('t', 55, int)  /* get ppp channel number */
+#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
 
 #define SIOCGPPPSTATS   (SIOCDEVPRIVATE + 0)
 #define SIOCGPPPVER (SIOCDEVPRIVATE + 1)   /* NEVER change this!! */
Index: linux-2.6.21/include/linux/if_pppox.h
===
--- linux-2.6.21.orig/include/linux/if_pppox.h
+++ linux-2.6.21/include/linux/if_pppox.h
@@ -27,6 +27,7 @@
 #include asm/semaphore.h
 #include linux/ppp_channel.h
 #endif /* __KERNEL__ */
+#include linux/if_pppol2tp.h
 
 /* For user-space programs to pick up these definitions
  * which they wouldn't get otherwise without defining __KERNEL__
@@ -50,8 +51,9 @@ struct pppoe_addr{ 
  * Protocols supported by AF_PPPOX 
  */ 
 #define PX_PROTO_OE0 /* Currently just PPPoE */
-#define PX_MAX_PROTO   1   
- 
+#define PX_PROTO_OL2TP 1 /* Now L2TP also */
+#define PX_MAX_PROTO   2
+
 struct sockaddr_pppox { 
sa_family_t sa_family;/* address family, AF_PPPOX */ 
unsigned intsa_protocol;  /* protocol identifier */ 
@@ -60,6 +62,16 @@ struct sockaddr_pppox { 
}sa_addr; 
 }__attribute__ ((packed)); 
 
+/* The use of the above union isn't viable because the size of this
+ * struct must stay fixed over time -- applications use sizeof(struct
+ * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
+ * type instead.
+ */
+struct sockaddr_pppol2tp {
+   sa_family_t sa_family;  /* address family, AF_PPPOX */
+   unsigned intsa_protocol;/* protocol identifier */
+   struct pppol2tp_addr pppol2tp;
+}__attribute__ ((packed));
 
 /*
  *
Index: linux-2.6.21/include/linux/socket.h
===
--- linux-2.6.21.orig/include/linux/socket.h
+++ linux-2.6.21/include/linux/socket.h
@@ -284,6 +284,7 @@ struct ucred {
 #define SOL_DCCP   269
 #define SOL_NETLINK270
 #define SOL_TIPC   271
+#define SOL_PPPOL2TP   272
 
 /* IPX options */
 #define IPX_TYPE   1
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


resend [PATCH 5/5 2.6.21] L2TP: Add PPPoL2TP in-kernel documentation

2007-05-26 Thread James Chapman
Signed-off-by: James Chapman [EMAIL PROTECTED]

Index: linux-2.6.21/Documentation/networking/l2tp.txt
===
--- /dev/null
+++ linux-2.6.21/Documentation/networking/l2tp.txt
@@ -0,0 +1,167 @@
+This brief document describes how to use the kernel's PPPoL2TP driver
+to provide L2TP functionality. L2TP is a protocol that tunnels one or
+more PPP sessions over a UDP tunnel. It is commonly used for VPNs
+(L2TP/IPSec) and by ISPs to tunnel subscriber PPP sessions over an IP
+network infrastructure.
+
+Design
+==
+
+The PPPoL2TP driver, drivers/net/pppol2tp.c, provides a mechanism by
+which PPP frames carried through an L2TP session are passed through
+the kernel's PPP subsystem. The standard PPP daemon, pppd, handles all
+PPP interaction with the peer. PPP network interfaces are created for
+each local PPP endpoint.
+
+The L2TP protocol http://www.faqs.org/rfcs/rfc2661.html defines L2TP
+control and data frames. L2TP control frames carry messages between
+L2TP clients/servers and are used to setup / teardown tunnels and
+sessions. An L2TP client or server is implemented in userspace and
+will use a regular UDP socket per tunnel. L2TP data frames carry PPP
+frames, which may be PPP control or PPP data. The kernel's PPP
+subsystem arranges for PPP control frames to be delivered to pppd,
+while data frames are forwarded as usual.
+
+Each tunnel and session within a tunnel is assigned a unique tunnel_id
+and session_id. These ids are carried in the L2TP header of every
+control and data packet. The pppol2tp driver uses them to lookup
+internal tunnel and/or session contexts. Zero tunnel / session ids are
+treated specially - zero ids are never assigned to tunnels or sessions
+in the network. In the driver, the tunnel context keeps a pointer to
+the tunnel UDP socket. The session context keeps a pointer to the
+PPPoL2TP socket, as well as other data that lets the driver interface
+to the kernel PPP subsystem.
+
+Note that the pppol2tp kernel driver handles only L2TP data frames;
+L2TP control frames are simply passed up to userspace in the UDP
+tunnel socket. The kernel handles all datapath aspects of the
+protocol, including data packet resequencing (if enabled).
+
+There are a number of requirements on the userspace L2TP daemon in
+order to use the pppol2tp driver.
+
+1. Use a UDP socket per tunnel.
+
+2. Create a single PPPoL2TP socket per tunnel. This is used only for
+   for communicating with the driver but must remain open while the
+   tunnel is active. The driver marks the tunnel socket as an L2TP UDP
+   encapsulation socket, which hooks up the UDP receive path via
+   usp_encap_rcv() in net/ipv4/udp.c. PPP data frames are never passed
+   in this special PPPoX socket.
+
+3. Create a PPPoL2TP socket per L2TP session. This is typically done
+   by starting pppd with the pppol2tp plugin and appropriate
+   arguments. A PPPoL2TP tunnel management socket (Step 2) must be
+   created before the first PPPoL2TP session socket is created.
+
+When creating PPPoL2TP sockets, the application provides information
+to the driver about the socket in a socket connect() call. Source and
+destination tunnel and session ids are provided, as well as the file
+descriptor of a UDP socket. See struct pppol2tp_addr in
+include/linux/if_ppp.h. Note that zero tunnel / session ids are
+treated specially. When creating the per-tunnel PPPoL2TP management
+socket in Step 2 above, zero source and destination session ids are
+specified, which tells the driver to prepare the supplied UDP file
+descriptor for use as an L2TP tunnel socket.
+
+Userspace may control behavior of the tunnel or session using
+setsockopt and ioctl on the PPPoX socket. The following socket
+options are supported:-
+
+DEBUG - bitmask of debug message categories. See below.
+SENDSEQ   - 0 = don't send packets with sequence numbers
+1 = send packets with sequence numbers
+RECVSEQ   - 0 = receive packet sequence numbers are optional
+1 = drop receive packets without sequence numbers
+LNSMODE   - 0 = act as LAC.
+1 = act as LNS.
+REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
+
+Only the DEBUG option is supported by the special tunnel management
+PPPoX socket.
+
+In addition to the standard PPP ioctls, a PPPIOCGL2TPSTATS is provided
+to retrieve tunnel and session statistics from the kernel using the
+PPPoX socket of the required tunnel or session.
+
+Debugging
+=
+
+The driver supports a flexible debug scheme where kernel trace
+messages may be optionally enabled per tunnel and per session. Care is
+needed when debugging a live system since the messages are not
+rate-limited and a busy system could be swamped. Userspace uses
+setsockopt on the PPPoX socket to set a debug mask.
+
+The following debug mask bits are available:
+
+PPPOL2TP_MSG_DEBUGverbose debug (if compiled in)
+PPPOL2TP_MSG_CONTROL  userspace - kernel interface

resend [PATCH 4/5 2.6.21] L2TP: Add PPPoL2TP maintainer

2007-05-26 Thread James Chapman
Signed-off-by: James Chapman [EMAIL PROTECTED]

Index: linux-2.6.21/MAINTAINERS
===
--- linux-2.6.21.orig/MAINTAINERS
+++ linux-2.6.21/MAINTAINERS
@@ -2700,6 +2700,11 @@ P:   Michal Ostrowski
 M: [EMAIL PROTECTED]
 S: Maintained
 
+PPP OVER L2TP
+P: James Chapman
+M: [EMAIL PROTECTED]
+S: Maintained
+
 PREEMPTIBLE KERNEL
 P: Robert Love
 M: [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


resend [PATCH 1/5 2.6.21] UDP: Introduce UDP encapsulation type for L2TP

2007-05-26 Thread James Chapman
This patch adds a new UDP_ENCAP_L2TPINUDP encapsulation type for UDP
sockets. When a UDP socket's encap_type is UDP_ENCAP_L2TPINUDP, the
skb is delivered to a function pointed to by udp_encap_l2tp_rcv. If
the skb isn't wanted by L2TP, it returns 0, which causes it to be
passed through to UDP. A funcptr is used for udp_encap_l2tp_rcv to 
allow L2TP to be implemented as a kernel module.

Previously, the only user of UDP encap sockets was ESP, so when
CONFIG_XFRM was not defined, some of the encap code was compiled 
out. This patch changes that. As a result, udp_encap_rcv() will
now do a little more work when CONFIG_XFRM is not defined. 

Signed-off-by: James Chapman [EMAIL PROTECTED]

---
There are some magic numbers returned by udp_encap_rcv() that
should perhaps now be made #defines. I chose not to do so in
this patch.

Index: linux-2.6.21/include/linux/udp.h
===
--- linux-2.6.21.orig/include/linux/udp.h
+++ linux-2.6.21/include/linux/udp.h
@@ -33,6 +33,7 @@ struct udphdr {
 /* UDP encapsulation types */
 #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
 #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
+#define UDP_ENCAP_L2TPINUDP3 /* rfc2661 */
 
 #ifdef __KERNEL__
 #include linux/types.h
@@ -69,6 +70,8 @@ static inline struct udp_sock *udp_sk(co
 }
 #define IS_UDPLITE(__sk) (udp_sk(__sk)-pcflag)
 
+extern int (*udp_encap_l2tp_rcv)(struct sock *sk, struct sk_buff *skb);
+
 #endif
 
 #endif /* _LINUX_UDP_H */
Index: linux-2.6.21/net/ipv4/udp.c
===
--- linux-2.6.21.orig/net/ipv4/udp.c
+++ linux-2.6.21/net/ipv4/udp.c
@@ -70,6 +70,7 @@
  * Alexey Kuznetsov:   allow both IPv4 and IPv6 sockets to bind
  * a single port at the same time.
  * Derek Atkins [EMAIL PROTECTED]: Add Encapulation Support
+ * James Chapman   :   Add L2TP encapsulation type.
  *
  *
  * This program is free software; you can redistribute it and/or
@@ -112,6 +113,12 @@ DEFINE_SNMP_STAT(struct udp_mib, udp_sta
 struct hlist_head udp_hash[UDP_HTABLE_SIZE];
 DEFINE_RWLOCK(udp_hash_lock);
 
+/* For use by L2TP protocol code (encap_type==UDP_ENCAP_L2TPINUDP).
+ * Using function pointers allows L2TP to be implemented as a
+ * module.
+ */
+int (*udp_encap_l2tp_rcv)(struct sock *sk, struct sk_buff *skb);
+
 static int udp_port_rover;
 
 static inline int __udp_lib_lport_inuse(__u16 num, struct hlist_head 
udptable[])
@@ -919,12 +926,10 @@ int udp_disconnect(struct sock *sk, int 
  * 1  if the the UDP system should process it
  * 0  if we should drop this packet
  * -1 if it should get processed by xfrm4_rcv_encap
+ * -2 if it should get processed by l2tp
  */
 static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
 {
-#ifndef CONFIG_XFRM
-   return 1;
-#else
struct udp_sock *up = udp_sk(sk);
struct udphdr *uh;
struct iphdr *iph;
@@ -979,8 +984,14 @@ static int udp_encap_rcv(struct sock * s
/* Must be an IKE packet.. pass it through */
return 1;
break;
+   case UDP_ENCAP_L2TPINUDP:
+   /* Let caller know to send this to l2tp */
+   return -2;
}
 
+#ifndef CONFIG_XFRM
+   return 1;
+#else
/* At this point we are sure that this is an ESPinUDP packet,
 * so we need to remove 'len' bytes from the packet (the UDP
 * header and optional ESP marker bytes) and then modify the
@@ -1050,12 +1061,25 @@ int udp_queue_rcv_skb(struct sock * sk, 
kfree_skb(skb);
return 0;
}
-   if (ret  0) {
+   if (ret == -1) {
/* process the ESP packet */
ret = xfrm4_rcv_encap(skb, up-encap_type);
UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS, up-pcflag);
return -ret;
}
+   if (ret == -2) {
+   /* process the L2TP packet */
+   if (udp_encap_l2tp_rcv != NULL) {
+   ret = (*udp_encap_l2tp_rcv)(sk, skb);
+   if (ret = 0) {
+   UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS, 
up-pcflag);
+   return ret;
+   }
+
+   /* FALLTHROUGH -- pass up as UDP packet */
+   }
+   }
+
/* FALLTHROUGH -- it's a UDP Packet */
}
 
@@ -1336,6 +1360,7 @@ int udp_lib_setsockopt(struct sock *sk, 
case 0:
case UDP_ENCAP_ESPINUDP:
case UDP_ENCAP_ESPINUDP_NON_IKE:
+   case UDP_ENCAP_L2TPINUDP:
up-encap_type = val;
  

[PCNET32] Lock solid with netconsole

2007-05-26 Thread Emmanuel Fusté
Hello,

Just to let you know that I swap my pcnet32 with a via-rhine
and I no longer experienced hard machine lock after loading
netconsole.

Regards,
Emmanuel.

 Hello,
 While trying to obtain scsi log to debug a driver problem, I
 tried to use netconsole on an old smp system with a 10Mbits
 pcnet32 ethernet device.
 But few seconds after enabling netconsole, before launching my
 scsi test, but after a few console activity the computer
 freeze hard.
 Is it a know or expected problem ? (2.6.21 kernel, pcnet32:
 PCnet/PCI 79C970) Have you some solutions or patch to try ?
 Will get back my soldering iron to do a serial cable for now.
 
 Thanks,
 Emmanuel.
 
  Hi Emmanuel,
  
  Emmanuel Fusté wrote:
   Hello,
   
   After one year of rest, I resurrect my old computer,
install a
   2.6.21 kernel and updated my Debian distro.
   
   Tree things to repport:
   
   First, a cosmetic thing: I have two scsi sync devices
and two
   async devices. For the first ones, domain validation return
   the negociated speed and mode. For the second ones, domain
   validation return nothing. I expect it is just a 'missing
   feature' but that all went ok. I am right ?
   
   scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER,
Rev 7.0
   Adaptec 2940 Ultra2 SCSI adapter
   aic7890/91: Ultra2 Wide Channel A, SCSI Id=7,
 32/253 SCBs
   
   scsi 0:0:0:0: Direct-Access IBM  DMVS18V   
 02B0
   PQ: 0 ANSI: 3
   scsi0:A:0:0: Tagged Queuing enabled.  Depth 8 
target0:0:0: Beginning Domain Validation
target0:0:0: wide asynchronous
target0:0:0: FAST-40 WIDE SCSI 80.0 MB/s ST (25ns,
offset 31)
target0:0:0: Domain Validation skipping write tests
target0:0:0: Ending Domain Validation
   scsi 0:0:3:0: CD-ROMYAMAHA   CRW6416S  
  1.0d
   PQ: 0 ANSI: 2
target0:0:3: Beginning Domain Validation
target0:0:3: FAST-10 SCSI 10.0 MB/s ST (100 ns,offset 15)
target0:0:3: Domain Validation skipping write tests
target0:0:3: Ending Domain Validation
   scsi 0:0:4:0: CD-ROMTOSHIBA  CD-ROM
XM-3501TA 1875
   PQ: 0 ANSI: 2
target0:0:4: Beginning Domain Validation
target0:0:4: Domain Validation skipping write tests
target0:0:4: Ending Domain Validation
   scsi 0:0:6:0: Sequential-Access WANGTEK  5525ES SCSI
REV7 0W 
PQ: 0 ANSI: 1
target0:0:6: Beginning Domain Validation
target0:0:6: Ending Domain Validation
   
  Hmm. Have to have a look at it. It should at least report
 the result ...
  
   Secondly, It seems that something is doing weird things with
   my old CD-ROM reader (XM-3501TA). At some point in time (not
   really regular), I get this in my logs:
   May 23 00:45:44 rafale kernel: (scsi0:A:4:0): No or
incomplete
   CDB sent to device.
   May 23 00:45:44 rafale kernel: (scsi0:A:4:0): Protocol
   violation in Message-in phase.  Attempting to abort.
   May 23 00:45:44 rafale kernel: (scsi0:A:4:0): Abort
 Message Sent
   May 23 00:45:44 rafale kernel: (scsi0:A:4:0): SCB 11 - Abort
   Completed.
   And sometimes (but seem related to problems with my cable):
   May 23 04:32:49 rafale kernel: (scsi0:A:4:0): parity error
   detected in Status phase. SEQADDR(0xad) SCSIRATE(0x0)
   May 23 05:13:03 rafale kernel: (scsi0:A:4:0): parity error
   detected in Status phase. SEQADDR(0xac) SCSIRATE(0x0)
   
  Yes, this looks like a cable probrlem.
  
   There is no scsi bus freeze, and the device work perfectly
   without generating other errors. DV problem ? Bad hal daemon
   interaction ? Defect in the driver trigged by bad hal daemon
   behavior ? 
   
  Ach, yes, it could at least be triggered by hal. Not all
 devices like to
  be polled by hal, especially if they're in a middle of an
 operation.
  CD-RW eg. Kay claimed to have it solved, but I still end up
 disabling
  hal :-)
  
   Last thing, a now two years problem:
   cdrwtools -d /dev/sr0 -q still instantly crash the
   scsibus/cdwriter and the driver never recover.
   I did not have a new log because of the complete bus crash.
   Have you new ideas about this problem ??
  No, not yet. But it looks as if I finally got some time to
 look deeper
  in this problem.
  Bugzilla's still assigned to me, to it's a constant
 remainder that
  something's amiss ...
  
   I will try:
   - to get a log on a usb key
   - to port patch from Bugzilla Bug 5921 to current
kernel. With
   the previous ones, the driver recover. (but i was
experiencing
   FS corruption but it seems it was not related).
   - to identify exactly what cdrwtools send to the
kernel/driver
   which cause the crash.
  What you should do here is:
  
  - hook up a serial cable and re-route console messages to that
  - Switch off syslog (as this might block if the SCSI bus
frozen)
  - Enable scsi debugging (Error, Timeout, Scan, and Midlayer is
  sufficient) and start cdrwtools.
  - Send me the log from the serial console.
  
  This will give me at least a starting point what's going
wrong.
  
  Thanks for your patience.
  
  Cheers,
  
  

Re: [PCNET32] Lock solid with netconsole

2007-05-26 Thread Francois Romieu
Emmanuel Fusté [EMAIL PROTECTED] :
[...]
 Just to let you know that I swap my pcnet32 with a via-rhine
 and I no longer experienced hard machine lock after loading
 netconsole.

Any difference if you disable the debug messages in the pcnet32
driver and you apply the patch below ?

diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 9c171a7..be4513f 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -2556,11 +2556,12 @@ pcnet32_interrupt(int irq, void *dev_id)
unsigned long ioaddr;
u16 csr0;
int boguscnt = max_interrupt_work;
+   unsigned long flags;
 
ioaddr = dev-base_addr;
lp = netdev_priv(dev);
 
-   spin_lock(lp-lock);
+   spin_lock_irqsave(lp-lock, flags);
 
csr0 = lp-a.read_csr(ioaddr, CSR0);
while ((csr0  0x8f00)  --boguscnt = 0) {
@@ -2632,7 +2633,7 @@ pcnet32_interrupt(int irq, void *dev_id)
printk(KERN_DEBUG %s: exiting interrupt, csr0=%#4.4x.\n,
   dev-name, lp-a.read_csr(ioaddr, CSR0));
 
-   spin_unlock(lp-lock);
+   spin_unlock_irqrestore(lp-lock, flags);
 
return IRQ_HANDLED;
 }
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2.6.22 0/7] cxgb3 - bug fixes

2007-05-26 Thread Divy Le Ray

Hi Jeff,

I'm submitting a set of bug fixes for inclusion in 2.6.22.
The patches are built against Linus'git tree.

Here is a brief description:
- Fix page management in the SGE code,
- Fix netpoll handler,
- Fix link status detection for direct XAUI adapters,
- Update FW to 4.1 and proceed to subsequent HW tuning,
- Work around potential hang on MTU change,
- Fix MAC watchdog,
- Allow microcode update without a power cycle.

Cheers,
Divy
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] cxgb3 - Fix SGE page management

2007-05-26 Thread divy
From: Divy Le Ray [EMAIL PROTECTED]

Streamline page management on RX.
Fix dma mappings.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/adapter.h |   38 ++--
 drivers/net/cxgb3/sge.c |  425 ++-
 2 files changed, 233 insertions(+), 230 deletions(-)

diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index 80c3d8f..ab72563 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -71,27 +71,29 @@ enum {  /* adapter flags */
QUEUES_BOUND = (1  3),
 };
 
+struct fl_pg_chunk {
+   struct page *page;
+   void *va;
+   unsigned int offset;
+};
+
 struct rx_desc;
 struct rx_sw_desc;
 
-struct sge_fl_page {
-   struct skb_frag_struct frag;
-   unsigned char *va;
-};
-
-struct sge_fl {/* SGE per free-buffer list state */
-   unsigned int buf_size;  /* size of each Rx buffer */
-   unsigned int credits;   /* # of available Rx buffers */
-   unsigned int size;  /* capacity of free list */
-   unsigned int cidx;  /* consumer index */
-   unsigned int pidx;  /* producer index */
-   unsigned int gen;   /* free list generation */
-   unsigned int cntxt_id;  /* SGE context id for the free list */
-   struct sge_fl_page page;
-   struct rx_desc *desc;   /* address of HW Rx descriptor ring */
-   struct rx_sw_desc *sdesc;   /* address of SW Rx descriptor ring */
-   dma_addr_t phys_addr;   /* physical address of HW ring start */
-   unsigned long empty;/* # of times queue ran out of buffers */
+struct sge_fl { /* SGE per free-buffer list state */
+   unsigned int buf_size;  /* size of each Rx buffer */
+   unsigned int credits;   /* # of available Rx buffers */
+   unsigned int size;  /* capacity of free list */
+   unsigned int cidx;  /* consumer index */
+   unsigned int pidx;  /* producer index */
+   unsigned int gen;   /* free list generation */
+   struct fl_pg_chunk pg_chunk;/* page chunk cache */
+   unsigned int use_pages; /* whether FL uses pages or sk_buffs */
+   struct rx_desc *desc;   /* address of HW Rx descriptor ring */
+   struct rx_sw_desc *sdesc;   /* address of SW Rx descriptor ring */
+   dma_addr_t   phys_addr; /* physical address of HW ring start */
+   unsigned int cntxt_id;  /* SGE context id for the free list */
+   unsigned long empty;/* # of times queue ran out of buffers */
unsigned long alloc_failed; /* # of times buffer allocation failed */
 };
 
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 3666586..8dd5b1e 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -46,23 +46,16 @@
 
 #define SGE_RX_SM_BUF_SIZE 1536
 
-/*
- * If USE_RX_PAGE is defined, the small freelist populated with (partial)
- * pages instead of skbs. Pages are carved up into RX_PAGE_SIZE chunks (must
- * be a multiple of the host page size).
- */
-#define USE_RX_PAGE
-#define RX_PAGE_SIZE 2048
-
-/*
- * skb freelist packets are copied into a new skb (and the freelist one is 
- * reused) if their len is = 
- */
 #define SGE_RX_COPY_THRES  256
+#define SGE_RX_PULL_LEN128
 
 /*
- * Minimum number of freelist entries before we start dropping TUNNEL frames.
+ * Page chunk size for FL0 buffers if FL0 is to be populated with page chunks.
+ * It must be a divisor of PAGE_SIZE.  If set to 0 FL0 will use sk_buffs
+ * directly.
  */
+#define FL0_PG_CHUNK_SIZE  2048
+
 #define SGE_RX_DROP_THRES 16
 
 /*
@@ -100,12 +93,12 @@ struct tx_sw_desc {/* SW state per Tx
struct sk_buff *skb;
 };
 
-struct rx_sw_desc {/* SW state per Rx descriptor */
+struct rx_sw_desc {/* SW state per Rx descriptor */
union {
struct sk_buff *skb;
-   struct sge_fl_page page;
-   } t;
-DECLARE_PCI_UNMAP_ADDR(dma_addr);
+   struct fl_pg_chunk pg_chunk;
+   };
+   DECLARE_PCI_UNMAP_ADDR(dma_addr);
 };
 
 struct rsp_desc {  /* response queue descriptor */
@@ -351,27 +344,26 @@ static void free_rx_bufs(struct pci_dev
 
pci_unmap_single(pdev, pci_unmap_addr(d, dma_addr),
 q-buf_size, PCI_DMA_FROMDEVICE);
-
-   if (q-buf_size != RX_PAGE_SIZE) {
-   kfree_skb(d-t.skb);
-   d-t.skb = NULL;
+   if (q-use_pages) {
+   put_page(d-pg_chunk.page);
+   d-pg_chunk.page = NULL;
} else {
-   if (d-t.page.frag.page)
-   put_page(d-t.page.frag.page);
-   d-t.page.frag.page = NULL;
+   kfree_skb(d-skb);
+   d-skb = NULL;
}
   

[PATCH 2/7] cxgb3 - fix netpoll hanlder

2007-05-26 Thread divy
From: Divy Le Ray [EMAIL PROTECTED]

Fix netpoll handler to work with line interrupt, msi and msi-x.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/cxgb3_main.c |   12 +---
 drivers/net/cxgb3/sge.c|1 -
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 67b4b21..e0ef724 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2076,10 +2076,16 @@ static void vlan_rx_kill_vid(struct net_
 static void cxgb_netpoll(struct net_device *dev)
 {
struct adapter *adapter = dev-priv;
-   struct sge_qset *qs = dev2qset(dev);
+   struct port_info *pi = netdev_priv(dev);
+   int qidx;
 
-   t3_intr_handler(adapter, qs-rspq.polling) (adapter-pdev-irq,
-   adapter);
+   for (qidx = pi-first_qset; qidx  pi-first_qset + pi-nqsets; qidx++) 
{
+   struct sge_qset *qs = adapter-sge.qs[qidx];
+   
+   t3_intr_handler(adapter, qs-rspq.polling) (0, 
+   (adapter-flags  USING_MSIX) ?
+   (void *)qs : (void *)adapter);
+   }
 }
 #endif
 
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 8dd5b1e..a2cfd68 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -2228,7 +2228,6 @@ irqreturn_t t3_sge_intr_msix_napi(int ir
struct sge_rspq *q = qs-rspq;
 
spin_lock(q-lock);
-   BUG_ON(napi_is_scheduled(qs-netdev));
 
if (handle_responses(adap, q)  0)
q-unhandled_irqs++;
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] cxgb3 - Fix direct XAUI support

2007-05-26 Thread divy
From: Divy Le Ray [EMAIL PROTECTED]

Check all lanes for link status on direct XAUI cards.
Don't assume that direct XAUI always uses XGMAC 1.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/ael1002.c |   10 --
 drivers/net/cxgb3/regs.h|2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/cxgb3/ael1002.c b/drivers/net/cxgb3/ael1002.c
index 73a41e6..ee140e6 100644
--- a/drivers/net/cxgb3/ael1002.c
+++ b/drivers/net/cxgb3/ael1002.c
@@ -219,7 +219,13 @@ static int xaui_direct_get_link_status(s
unsigned int status;
 
status = t3_read_reg(phy-adapter,
-XGM_REG(A_XGM_SERDES_STAT0, phy-addr));
+XGM_REG(A_XGM_SERDES_STAT0, phy-addr)) |
+   t3_read_reg(phy-adapter,
+   XGM_REG(A_XGM_SERDES_STAT1, phy-addr)) |
+   t3_read_reg(phy-adapter,
+   XGM_REG(A_XGM_SERDES_STAT2, phy-addr)) |
+   t3_read_reg(phy-adapter,
+   XGM_REG(A_XGM_SERDES_STAT3, phy-addr));
*link_ok = !(status  F_LOWSIG0);
}
if (speed)
@@ -247,5 +253,5 @@ static struct cphy_ops xaui_direct_ops =
 void t3_xaui_direct_phy_prep(struct cphy *phy, struct adapter *adapter,
 int phy_addr, const struct mdio_ops *mdio_ops)
 {
-   cphy_init(phy, adapter, 1, xaui_direct_ops, mdio_ops);
+   cphy_init(phy, adapter, phy_addr, xaui_direct_ops, mdio_ops);
 }
diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index e5a5534..bf9d6be 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -2128,6 +2128,8 @@
 #define F_RESETPLL01V_RESETPLL01(1U)
 
 #define A_XGM_SERDES_STAT0 0x8f0
+#define A_XGM_SERDES_STAT1 0x8f4
+#define A_XGM_SERDES_STAT2 0x8f8
 
 #define S_LOWSIG00
 #define V_LOWSIG0(x) ((x)  S_LOWSIG0)
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] cxgb3 - Update FW to 4.1

2007-05-26 Thread divy
From: Divy Le Ray [EMAIL PROTECTED]

Bump FW version to 4.1.
Modify chip tuning in consequence.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/regs.h|4 
 drivers/net/cxgb3/t3_hw.c   |   42 +++---
 drivers/net/cxgb3/version.h |2 +-
 3 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index bf9d6be..2c47d4a 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -1160,6 +1160,8 @@
 
 #define A_TP_MOD_CHANNEL_WEIGHT 0x434
 
+#define A_TP_MOD_RATE_LIMIT 0x438
+
 #define A_TP_PIO_ADDR 0x440
 
 #define A_TP_PIO_DATA 0x444
@@ -1214,6 +1216,8 @@
 #define G_TXDROPCNTCH0RCVD(x) (((x)  S_TXDROPCNTCH0RCVD)  \
   M_TXDROPCNTCH0RCVD)
 
+#define A_TP_PROXY_FLOW_CNTL 0x4b0
+
 #define A_ULPRX_CTL 0x500
 
 #define S_ROUND_ROBIN4
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index fb485d0..9e3591d 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -921,7 +921,7 @@ static int t3_flash_erase_sectors(struct
 /*
  * t3_load_fw - download firmware
  * @adapter: the adapter
- * @fw_data: the firrware image to write
+ * @fw_data: the firmware image to write
  * @size: image size
  *
  * Write the supplied firmware image to the card's serial flash.
@@ -2362,7 +2362,7 @@ static void tp_config(struct adapter *ad
 F_TCPCHECKSUMOFFLOAD | V_IPTTL(64));
t3_write_reg(adap, A_TP_TCP_OPTIONS, V_MTUDEFAULT(576) |
 F_MTUENABLE | V_WINDOWSCALEMODE(1) |
-V_TIMESTAMPSMODE(1) | V_SACKMODE(1) | V_SACKRX(1));
+V_TIMESTAMPSMODE(0) | V_SACKMODE(1) | V_SACKRX(1));
t3_write_reg(adap, A_TP_DACK_CONFIG, V_AUTOSTATE3(1) |
 V_AUTOSTATE2(1) | V_AUTOSTATE1(0) |
 V_BYTETHRESHOLD(16384) | V_MSSTHRESHOLD(2) |
@@ -2371,16 +2371,18 @@ static void tp_config(struct adapter *ad
 F_IPV6ENABLE | F_NICMODE);
t3_write_reg(adap, A_TP_TX_RESOURCE_LIMIT, 0x18141814);
t3_write_reg(adap, A_TP_PARA_REG4, 0x5050105);
-   t3_set_reg_field(adap, A_TP_PARA_REG6,
-adap-params.rev  0 ? F_ENABLEESND : F_T3A_ENABLEESND,
-0);
+   t3_set_reg_field(adap, A_TP_PARA_REG6, 0,
+adap-params.rev  0 ? F_ENABLEESND :
+F_T3A_ENABLEESND);
 
t3_set_reg_field(adap, A_TP_PC_CONFIG,
-F_ENABLEEPCMDAFULL | F_ENABLEOCSPIFULL,
-F_TXDEFERENABLE | F_HEARBEATDACK | F_TXCONGESTIONMODE |
-F_RXCONGESTIONMODE);
+F_ENABLEEPCMDAFULL,
+F_ENABLEOCSPIFULL |F_TXDEFERENABLE | F_HEARBEATDACK |
+F_TXCONGESTIONMODE | F_RXCONGESTIONMODE);
t3_set_reg_field(adap, A_TP_PC_CONFIG2, F_CHDRAFULL, 0);
-
+   t3_write_reg(adap, A_TP_PROXY_FLOW_CNTL, 1080);
+   t3_write_reg(adap, A_TP_PROXY_FLOW_CNTL, 1000);
+   
if (adap-params.rev  0) {
tp_wr_indirect(adap, A_TP_EGRESS_CONFIG, F_REWRITEFORCETOSIZE);
t3_set_reg_field(adap, A_TP_PARA_REG3, F_TXPACEAUTO,
@@ -2390,9 +2392,10 @@ static void tp_config(struct adapter *ad
} else
t3_set_reg_field(adap, A_TP_PARA_REG3, 0, F_TXPACEFIXED);
 
-   t3_write_reg(adap, A_TP_TX_MOD_QUEUE_WEIGHT1, 0x12121212);
-   t3_write_reg(adap, A_TP_TX_MOD_QUEUE_WEIGHT0, 0x12121212);
-   t3_write_reg(adap, A_TP_MOD_CHANNEL_WEIGHT, 0x1212);
+   t3_write_reg(adap, A_TP_TX_MOD_QUEUE_WEIGHT1, 0);
+   t3_write_reg(adap, A_TP_TX_MOD_QUEUE_WEIGHT0, 0);
+   t3_write_reg(adap, A_TP_MOD_CHANNEL_WEIGHT, 0);
+   t3_write_reg(adap, A_TP_MOD_RATE_LIMIT, 0xf220);
 }
 
 /* Desired TP timer resolution in usec */
@@ -2468,6 +2471,7 @@ int t3_tp_set_coalescing_size(struct ada
val |= F_RXCOALESCEENABLE;
if (psh)
val |= F_RXCOALESCEPSHEN;
+   size = min(MAX_RX_COALESCING_LEN, size);
t3_write_reg(adap, A_TP_PARA_REG2, V_RXCOALESCESIZE(size) |
 V_MAXRXDATA(MAX_RX_COALESCING_LEN));
}
@@ -2496,11 +2500,11 @@ static void __devinit init_mtus(unsigned
 * it can accomodate max size TCP/IP headers when SACK and timestamps
 * are enabled and still have at least 8 bytes of payload.
 */
-   mtus[0] = 88;
-   mtus[1] = 256;
-   mtus[2] = 512;
-   mtus[3] = 576;
-   mtus[4] = 808;
+   mtus[1] = 88;
+   mtus[1] = 88;
+   mtus[2] = 256;
+   mtus[3] = 512;
+   mtus[4] = 576;
mtus[5] = 1024;
mtus[6] = 1280;
mtus[7] = 1492;
@@ -2802,7 +2806,7 @@ static void init_hw_for_avail_ports(stru
t3_set_reg_field(adap, A_ULPTX_CONFIG, F_CFG_RR_ARB, 0);

[PATCH 5/7] cxgb3 - Stop mac RX when changing MTU

2007-05-26 Thread divy
From: Divy Le Ray [EMAIL PROTECTED]

Rx traffic needs to be halted when the MTU is changed
to avoid a potential chip hang.
Reset/restore MAC filters around a MTU change.
Also fix the pause frames high materwark setting.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/regs.h  |4 +++
 drivers/net/cxgb3/xgmac.c |   67 -
 2 files changed, 70 insertions(+), 1 deletions(-)

diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index 2c47d4a..02f8731 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -1886,6 +1886,10 @@
 #define V_COPYALLFRAMES(x) ((x)  S_COPYALLFRAMES)
 #define F_COPYALLFRAMESV_COPYALLFRAMES(1U)
 
+#define S_DISBCAST1
+#define V_DISBCAST(x) ((x)  S_DISBCAST)
+#define F_DISBCASTV_DISBCAST(1U)
+
 #define A_XGM_RX_HASH_LOW 0x814
 
 #define A_XGM_RX_HASH_HIGH 0x818
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index a506792..16cadba 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -231,6 +231,28 @@ int t3_mac_set_num_ucast(struct cmac *ma
return 0;
 }
 
+static void disable_exact_filters(struct cmac *mac)
+{
+   unsigned int i, reg = mac-offset + A_XGM_RX_EXACT_MATCH_LOW_1;
+
+   for (i = 0; i  EXACT_ADDR_FILTERS; i++, reg += 8) {
+   u32 v = t3_read_reg(mac-adapter, reg);
+   t3_write_reg(mac-adapter, reg, v);
+   }
+   t3_read_reg(mac-adapter, A_XGM_RX_EXACT_MATCH_LOW_1);  /* flush */
+}
+
+static void enable_exact_filters(struct cmac *mac)
+{
+   unsigned int i, reg = mac-offset + A_XGM_RX_EXACT_MATCH_HIGH_1;
+
+   for (i = 0; i  EXACT_ADDR_FILTERS; i++, reg += 8) {
+   u32 v = t3_read_reg(mac-adapter, reg);
+   t3_write_reg(mac-adapter, reg, v);
+   }
+   t3_read_reg(mac-adapter, A_XGM_RX_EXACT_MATCH_LOW_1);  /* flush */
+}
+
 /* Calculate the RX hash filter index of an Ethernet address */
 static int hash_hw_addr(const u8 * addr)
 {
@@ -281,6 +303,14 @@ int t3_mac_set_rx_mode(struct cmac *mac,
return 0;
 }
 
+static int rx_fifo_hwm(int mtu)
+{
+   int hwm;
+
+   hwm = max(MAC_RXFIFO_SIZE - 3 * mtu, (MAC_RXFIFO_SIZE * 38) / 100);
+   return min(hwm, MAC_RXFIFO_SIZE - 8192);
+}
+
 int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu)
 {
int hwm, lwm;
@@ -306,11 +336,38 @@ int t3_mac_set_mtu(struct cmac *mac, uns
lwm = min(3 * (int)mtu, MAC_RXFIFO_SIZE / 4);
 
v = t3_read_reg(adap, A_XGM_RXFIFO_CFG + mac-offset);
+   if (adap-params.rev == T3_REV_B2 
+   (t3_read_reg(adap, A_XGM_RX_CTRL + mac-offset)  F_RXEN)) {
+   disable_exact_filters(mac);
+   t3_set_reg_field(adap, A_XGM_RXFIFO_CFG + mac-offset,
+F_ENHASHMCAST | F_COPYALLFRAMES, F_DISBCAST);
+
+   /* drain rx FIFO */
+   if (t3_wait_op_done(adap,
+   A_XGM_RX_MAX_PKT_SIZE_ERR_CNT +
+   mac-offset,
+   1  31, 1, 20, 5)) {
+   t3_write_reg(adap, A_XGM_RXFIFO_CFG + mac-offset, v);
+   enable_exact_filters(mac);
+   return -EIO;
+   }
+   t3_write_reg(adap, A_XGM_RX_MAX_PKT_SIZE + mac-offset, mtu);
+   enable_exact_filters(mac);
+   } else
+   t3_write_reg(adap, A_XGM_RX_MAX_PKT_SIZE + mac-offset, mtu);
+
+   /*
+* Adjust the PAUSE frame watermarks.  We always set the LWM, and the
+* HWM only if flow-control is enabled.
+*/
+   hwm = rx_fifo_hwm(mtu);
+   lwm = min(3 * (int)mtu, MAC_RXFIFO_SIZE / 4);
v = ~V_RXFIFOPAUSELWM(M_RXFIFOPAUSELWM);
v |= V_RXFIFOPAUSELWM(lwm / 8);
if (G_RXFIFOPAUSEHWM(v))
v = (v  ~V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM)) |
V_RXFIFOPAUSEHWM(hwm / 8);
+
t3_write_reg(adap, A_XGM_RXFIFO_CFG + mac-offset, v);
 
/* Adjust the TX FIFO threshold based on the MTU */
@@ -329,7 +386,6 @@ int t3_mac_set_mtu(struct cmac *mac, uns
 (hwm - lwm) * 4 / 8);
t3_write_reg(adap, A_XGM_TX_PAUSE_QUANTA + mac-offset,
 MAC_RXFIFO_SIZE * 4 * 8 / 512);
-
return 0;
 }
 
@@ -357,6 +413,15 @@ int t3_mac_set_speed_duplex_fc(struct cm
 V_PORTSPEED(M_PORTSPEED), val);
}
 
+   val = t3_read_reg(adap, A_XGM_RXFIFO_CFG + oft);
+   val = ~V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM);
+   if (fc  PAUSE_TX)
+   val |= V_RXFIFOPAUSEHWM(rx_fifo_hwm(
+   t3_read_reg(adap,
+   A_XGM_RX_MAX_PKT_SIZE
+   + oft)) / 8);
+   t3_write_reg(adap, A_XGM_RXFIFO_CFG + oft, val);
+
t3_set_reg_field(adap, A_XGM_TX_CFG + oft, 

[PATCH 6/7] cxgb3 - MAC watchdog update

2007-05-26 Thread divy
From: Divy Le Ray [EMAIL PROTECTED]

Fix variables initialization and usage in the MAC watchdog.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/xgmac.c |   31 +--
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index 16cadba..b261be1 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -501,6 +501,10 @@ int t3b2_mac_watchdog_task(struct cmac *
unsigned int rx_xcnt;
int status;
 
+   status = 0;
+   tx_xcnt = 1;/* By default tx_xcnt is making progress */
+   tx_tcnt = mac-tx_tcnt; /* If tx_mcnt is progressing ignore tx_tcnt */
+   rx_xcnt = 1;/* By default rx_xcnt is making progress */
if (tx_mcnt == mac-tx_mcnt) {
tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
A_XGM_TX_SPI4_SOP_EOP_CNT +
@@ -511,37 +515,44 @@ int t3b2_mac_watchdog_task(struct cmac *
tx_tcnt = (G_TXDROPCNTCH0RCVD(t3_read_reg(adap,
  A_TP_PIO_DATA)));
} else {
-   mac-toggle_cnt = 0;
-   return 0;
+   goto rxcheck;
}
} else {
mac-toggle_cnt = 0;
-   return 0;
+   goto rxcheck;
}
 
if (((tx_tcnt != mac-tx_tcnt) 
 (tx_xcnt == 0)  (mac-tx_xcnt == 0)) ||
((mac-tx_mcnt == tx_mcnt) 
 (tx_xcnt != 0)  (mac-tx_xcnt != 0))) {
-   if (mac-toggle_cnt  4)
+   if (mac-toggle_cnt  4) {
status = 2;
-   else 
+   goto out;
+   } else {
status = 1;
+   goto out;
+   }
} else {
mac-toggle_cnt = 0;
-   return 0;
+   goto rxcheck;
}
 
+rxcheck:
if (rx_mcnt != mac-rx_mcnt)
rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
A_XGM_RX_SPI4_SOP_EOP_CNT +
mac-offset)));
-   else 
-   return 0;
+   else
+   goto out;
 
-   if (mac-rx_mcnt != s-rx_frames  rx_xcnt == 0  mac-rx_xcnt == 0) 
+   if (mac-rx_mcnt != s-rx_frames  rx_xcnt == 0 
+   mac-rx_xcnt == 0) {
status = 2;
-   
+   goto out;
+   }
+
+out:
mac-tx_tcnt = tx_tcnt;
mac-tx_xcnt = tx_xcnt;
mac-tx_mcnt = s-tx_frames;
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] cxgb3 - TP SRAM update

2007-05-26 Thread divy
From: Divy Le Ray [EMAIL PROTECTED]

The chip executes microcode present in internal RAM, 
whose content is loaded from EEPROM on power cycle. 
This patch allows an update of the microcode through PIO
without forcing a power cycle.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/common.h |   28 +
 drivers/net/cxgb3/cxgb3_main.c |   43 
 drivers/net/cxgb3/regs.h   |7 +++
 drivers/net/cxgb3/t3_hw.c  |   85 
 4 files changed, 163 insertions(+), 0 deletions(-)

diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index 8d13796..1637800 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -101,6 +101,7 @@ enum {
TCB_SIZE = 128, /* TCB size */
NMTUS = 16, /* size of MTU table */
NCCTRL_WIN = 32,/* # of congestion control windows */
+   PROTO_SRAM_LINES = 128, /* size of TP sram */
 };
 
 #define MAX_RX_COALESCING_LEN 16224U
@@ -124,6 +125,30 @@ enum { /* adapter 
interrupt-maintaine
 };
 
 enum {
+   TP_VERSION_MAJOR= 1,
+   TP_VERSION_MINOR= 0,
+   TP_VERSION_MICRO= 44
+};
+
+#define S_TP_VERSION_MAJOR 16
+#define M_TP_VERSION_MAJOR 0xFF
+#define V_TP_VERSION_MAJOR(x)  ((x)  S_TP_VERSION_MAJOR)
+#define G_TP_VERSION_MAJOR(x)  \
+   (((x)  S_TP_VERSION_MAJOR)  M_TP_VERSION_MAJOR)
+
+#define S_TP_VERSION_MINOR 8
+#define M_TP_VERSION_MINOR 0xFF
+#define V_TP_VERSION_MINOR(x)  ((x)  S_TP_VERSION_MINOR)
+#define G_TP_VERSION_MINOR(x)  \
+   (((x)  S_TP_VERSION_MINOR)  M_TP_VERSION_MINOR)
+
+#define S_TP_VERSION_MICRO 0
+#define M_TP_VERSION_MICRO 0xFF
+#define V_TP_VERSION_MICRO(x)  ((x)  S_TP_VERSION_MICRO)
+#define G_TP_VERSION_MICRO(x)  \
+   (((x)  S_TP_VERSION_MICRO)  M_TP_VERSION_MICRO)
+
+enum {
SGE_QSETS = 8,  /* # of SGE Tx/Rx/RspQ sets */
SGE_RXQ_PER_SET = 2,/* # of Rx queues per set */
SGE_TXQ_PER_SET = 3 /* # of Tx queues per set */
@@ -654,6 +679,9 @@ const struct adapter_info *t3_get_adapte
 int t3_seeprom_read(struct adapter *adapter, u32 addr, u32 *data);
 int t3_seeprom_write(struct adapter *adapter, u32 addr, u32 data);
 int t3_seeprom_wp(struct adapter *adapter, int enable);
+int t3_check_tpsram_version(struct adapter *adapter);
+int t3_check_tpsram(struct adapter *adapter, u8 *tp_ram, unsigned int size);
+int t3_set_proto_sram(struct adapter *adap, u8 *data);
 int t3_read_flash(struct adapter *adapter, unsigned int addr,
  unsigned int nwords, u32 *data, int byte_oriented);
 int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size);
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index e0ef724..70ba719 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2089,6 +2089,42 @@ static void cxgb_netpoll(struct net_devi
 }
 #endif
 
+#define TPSRAM_NAME t3%c_protocol_sram-%d.%d.%d.bin
+int update_tpsram(struct adapter *adap)
+{
+   const struct firmware *tpsram;
+   char buf[64];
+   struct device *dev = adap-pdev-dev;
+   int ret;
+   char rev;
+   
+   rev = adap-params.rev == T3_REV_B2 ? 'b' : 'a';
+
+   snprintf(buf, sizeof(buf), TPSRAM_NAME, rev,
+TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
+
+   ret = request_firmware(tpsram, buf, dev);
+   if (ret  0) {
+   dev_err(dev, could not load TP SRAM: unable to load %s\n,
+   buf);
+   return ret;
+   }
+   
+   ret = t3_check_tpsram(adap, tpsram-data, tpsram-size);
+   if (ret)
+   goto release_tpsram;
+
+   ret = t3_set_proto_sram(adap, tpsram-data);
+   if (ret)
+   dev_err(dev, loading protocol SRAM failed\n);
+
+release_tpsram:
+   release_firmware(tpsram);
+   
+   return ret;
+}
+
+
 /*
  * Periodic accumulation of MAC statistics.
  */
@@ -2439,6 +2475,13 @@ static int __devinit init_one(struct pci
goto out_free_dev;
}
 
+   err = t3_check_tpsram_version(adapter);
+   if (err == -EINVAL)
+   err = update_tpsram(adapter);
+
+   if (err)
+   goto out_free_dev;
+   
/*
 * The card is now ready to go.  If any errors occur during device
 * registration we do not fail the whole card but rather proceed only
diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index 02f8731..aa80313 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -1218,6 +1218,13 @@
 
 #define A_TP_PROXY_FLOW_CNTL 0x4b0
 
+#define A_TP_EMBED_OP_FIELD0 0x4e8
+#define A_TP_EMBED_OP_FIELD1 0x4ec
+#define A_TP_EMBED_OP_FIELD2 0x4f0
+#define 

Re: [PATCH 4/7] cxgb3 - Update FW to 4.1

2007-05-26 Thread Michael Buesch
On Sunday 27 May 2007 01:00:04 [EMAIL PROTECTED] wrote:
 From: Divy Le Ray [EMAIL PROTECTED]
 
 Bump FW version to 4.1.
 Modify chip tuning in consequence.
 
 Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
 ---

 @@ -2496,11 +2500,11 @@ static void __devinit init_mtus(unsigned
* it can accomodate max size TCP/IP headers when SACK and timestamps
* are enabled and still have at least 8 bytes of payload.
*/
 - mtus[0] = 88;
 - mtus[1] = 256;
 - mtus[2] = 512;
 - mtus[3] = 576;
 - mtus[4] = 808;
 + mtus[1] = 88;
 + mtus[1] = 88;

looks like a typo.

 + mtus[2] = 256;
 + mtus[3] = 512;
 + mtus[4] = 576;
   mtus[5] = 1024;
   mtus[6] = 1280;
   mtus[7] = 1492;

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/7] cxgb3 - Update FW to 4.1

2007-05-26 Thread Divy Le Ray

Michael Buesch wrote:

On Sunday 27 May 2007 01:00:04 [EMAIL PROTECTED] wrote:
  

From: Divy Le Ray [EMAIL PROTECTED]

Bump FW version to 4.1.
Modify chip tuning in consequence.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---



  

@@ -2496,11 +2500,11 @@ static void __devinit init_mtus(unsigned
 * it can accomodate max size TCP/IP headers when SACK and timestamps
 * are enabled and still have at least 8 bytes of payload.
 */
-   mtus[0] = 88;
-   mtus[1] = 256;
-   mtus[2] = 512;
-   mtus[3] = 576;
-   mtus[4] = 808;
+   mtus[1] = 88;
+   mtus[1] = 88;



looks like a typo.
  


Good catch. The intent was to set mtu[0] and mtu[1] to 88.
I'll resubmit this patch.
Thanks!

Divy
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7 RESEND] cxgb3 - Update FW to 4.1

2007-05-26 Thread divy
From: Divy Le Ray [EMAIL PROTECTED]

Bump FW version to 4.1.
Modify chip tuning in consequence.

Signed-off-by: Divy Le Ray [EMAIL PROTECTED]
---

 drivers/net/cxgb3/regs.h|4 
 drivers/net/cxgb3/t3_hw.c   |   40 ++--
 drivers/net/cxgb3/version.h |2 +-
 3 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index bf9d6be..2c47d4a 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -1160,6 +1160,8 @@
 
 #define A_TP_MOD_CHANNEL_WEIGHT 0x434
 
+#define A_TP_MOD_RATE_LIMIT 0x438
+
 #define A_TP_PIO_ADDR 0x440
 
 #define A_TP_PIO_DATA 0x444
@@ -1214,6 +1216,8 @@
 #define G_TXDROPCNTCH0RCVD(x) (((x)  S_TXDROPCNTCH0RCVD)  \
   M_TXDROPCNTCH0RCVD)
 
+#define A_TP_PROXY_FLOW_CNTL 0x4b0
+
 #define A_ULPRX_CTL 0x500
 
 #define S_ROUND_ROBIN4
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index fb485d0..4929ac9 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -921,7 +921,7 @@ static int t3_flash_erase_sectors(struct
 /*
  * t3_load_fw - download firmware
  * @adapter: the adapter
- * @fw_data: the firrware image to write
+ * @fw_data: the firmware image to write
  * @size: image size
  *
  * Write the supplied firmware image to the card's serial flash.
@@ -2362,7 +2362,7 @@ static void tp_config(struct adapter *ad
 F_TCPCHECKSUMOFFLOAD | V_IPTTL(64));
t3_write_reg(adap, A_TP_TCP_OPTIONS, V_MTUDEFAULT(576) |
 F_MTUENABLE | V_WINDOWSCALEMODE(1) |
-V_TIMESTAMPSMODE(1) | V_SACKMODE(1) | V_SACKRX(1));
+V_TIMESTAMPSMODE(0) | V_SACKMODE(1) | V_SACKRX(1));
t3_write_reg(adap, A_TP_DACK_CONFIG, V_AUTOSTATE3(1) |
 V_AUTOSTATE2(1) | V_AUTOSTATE1(0) |
 V_BYTETHRESHOLD(16384) | V_MSSTHRESHOLD(2) |
@@ -2371,16 +2371,18 @@ static void tp_config(struct adapter *ad
 F_IPV6ENABLE | F_NICMODE);
t3_write_reg(adap, A_TP_TX_RESOURCE_LIMIT, 0x18141814);
t3_write_reg(adap, A_TP_PARA_REG4, 0x5050105);
-   t3_set_reg_field(adap, A_TP_PARA_REG6,
-adap-params.rev  0 ? F_ENABLEESND : F_T3A_ENABLEESND,
-0);
+   t3_set_reg_field(adap, A_TP_PARA_REG6, 0,
+adap-params.rev  0 ? F_ENABLEESND :
+F_T3A_ENABLEESND);
 
t3_set_reg_field(adap, A_TP_PC_CONFIG,
-F_ENABLEEPCMDAFULL | F_ENABLEOCSPIFULL,
-F_TXDEFERENABLE | F_HEARBEATDACK | F_TXCONGESTIONMODE |
-F_RXCONGESTIONMODE);
+F_ENABLEEPCMDAFULL,
+F_ENABLEOCSPIFULL |F_TXDEFERENABLE | F_HEARBEATDACK |
+F_TXCONGESTIONMODE | F_RXCONGESTIONMODE);
t3_set_reg_field(adap, A_TP_PC_CONFIG2, F_CHDRAFULL, 0);
-
+   t3_write_reg(adap, A_TP_PROXY_FLOW_CNTL, 1080);
+   t3_write_reg(adap, A_TP_PROXY_FLOW_CNTL, 1000);
+   
if (adap-params.rev  0) {
tp_wr_indirect(adap, A_TP_EGRESS_CONFIG, F_REWRITEFORCETOSIZE);
t3_set_reg_field(adap, A_TP_PARA_REG3, F_TXPACEAUTO,
@@ -2390,9 +2392,10 @@ static void tp_config(struct adapter *ad
} else
t3_set_reg_field(adap, A_TP_PARA_REG3, 0, F_TXPACEFIXED);
 
-   t3_write_reg(adap, A_TP_TX_MOD_QUEUE_WEIGHT1, 0x12121212);
-   t3_write_reg(adap, A_TP_TX_MOD_QUEUE_WEIGHT0, 0x12121212);
-   t3_write_reg(adap, A_TP_MOD_CHANNEL_WEIGHT, 0x1212);
+   t3_write_reg(adap, A_TP_TX_MOD_QUEUE_WEIGHT1, 0);
+   t3_write_reg(adap, A_TP_TX_MOD_QUEUE_WEIGHT0, 0);
+   t3_write_reg(adap, A_TP_MOD_CHANNEL_WEIGHT, 0);
+   t3_write_reg(adap, A_TP_MOD_RATE_LIMIT, 0xf220);
 }
 
 /* Desired TP timer resolution in usec */
@@ -2468,6 +2471,7 @@ int t3_tp_set_coalescing_size(struct ada
val |= F_RXCOALESCEENABLE;
if (psh)
val |= F_RXCOALESCEPSHEN;
+   size = min(MAX_RX_COALESCING_LEN, size);
t3_write_reg(adap, A_TP_PARA_REG2, V_RXCOALESCESIZE(size) |
 V_MAXRXDATA(MAX_RX_COALESCING_LEN));
}
@@ -2497,10 +2501,10 @@ static void __devinit init_mtus(unsigned
 * are enabled and still have at least 8 bytes of payload.
 */
mtus[0] = 88;
-   mtus[1] = 256;
-   mtus[2] = 512;
-   mtus[3] = 576;
-   mtus[4] = 808;
+   mtus[1] = 88;
+   mtus[2] = 256;
+   mtus[3] = 512;
+   mtus[4] = 576;
mtus[5] = 1024;
mtus[6] = 1280;
mtus[7] = 1492;
@@ -2802,7 +2806,7 @@ static void init_hw_for_avail_ports(stru
t3_set_reg_field(adap, A_ULPTX_CONFIG, F_CFG_RR_ARB, 0);
t3_write_reg(adap, A_MPS_CFG, F_TPRXPORTEN | F_TPTXPORT0EN |
 

forcedeth: Reside in 100Mbit Kconfig but also supports 1000Mbit cards

2007-05-26 Thread Stefan Schmidt
Hello.

I just needed some to tƣme to find out that the forcedeth driver I
need for my dual-port 1000Mbit card on a asus M2N-SLI deluce mainboard
resides in the 100Mbit category.

Is there a special reason for example 10/100Mbit only cards that work
with forcedeth? If all cards are 1000Mbit I would just move the
Kconfig entry over.

What would be the best way to deal with this if there are some
10/100Mbit cards which use the same driver as 1000Mbit cards?

regards
Stefan Schmidt
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/9]: tcp-2.6 patchset

2007-05-26 Thread David Miller
From: Ilpo_Järvinen [EMAIL PROTECTED]
Date: Sat, 26 May 2007 11:35:53 +0300

 Dave, you could consider applying other than the last one if they
 seem ok to you too (you'll need to rebase your tcp-2.6 in that case
 first to apply cleanly those that touch tcp_sync_left_out :-)).

Absolutely, I'll do the quick rebase of tcp-2.6 and review +
applying of your patches (except the last one) over the weekend.

Thanks!
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: forcedeth: Reside in 100Mbit Kconfig but also supports 1000Mbit cards

2007-05-26 Thread Randy Dunlap
On Sun, 27 May 2007 01:07:50 +0200 Stefan Schmidt wrote:

 Hello.
 
 I just needed some to tƣme to find out that the forcedeth driver I
 need for my dual-port 1000Mbit card on a asus M2N-SLI deluce mainboard
 resides in the 100Mbit category.
 
 Is there a special reason for example 10/100Mbit only cards that work
 with forcedeth? If all cards are 1000Mbit I would just move the
 Kconfig entry over.
 
 What would be the best way to deal with this if there are some
 10/100Mbit cards which use the same driver as 1000Mbit cards?

There has been some mention of dropping the 10/100 and 1000
categories and just merging all of them together.
Makes sense to me.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Kill trailing whitespaces in drivers/net/Kconfig

2007-05-26 Thread Stefan Schmidt
Kill all trailing whitespaces in drivers/net/Kconfig.

Signed-off-by: Stefan Schmidt [EMAIL PROTECTED]
---
 drivers/net/Kconfig |   48 
 1 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 30fd479..d8675f1 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -883,12 +883,12 @@ config SMC911X
help
  This is a driver for SMSC's LAN911x series of Ethernet chipsets
  including the new LAN9115, LAN9116, LAN9117, and LAN9118.
- Say Y if you want it compiled into the kernel, 
+ Say Y if you want it compiled into the kernel,
  and read the Ethernet-HOWTO, available from
  http://www.linuxdoc.org/docs.html#howto.
 
- This driver is also available as a module. The module will be 
- called smc911x.  If you want to compile it as a module, say M 
+ This driver is also available as a module. The module will be
+ called smc911x.  If you want to compile it as a module, say M
  here and read file:Documentation/kbuild/modules.txt
 
 config NET_VENDOR_RACAL
@@ -1221,7 +1221,7 @@ config IBM_EMAC_RX_SKB_HEADROOM
  will always reserve at least 2 bytes to make IP header
  aligned, so usually there is no need to add any additional
  headroom.
- 
+
  If unsure, set to 0.
 
 config IBM_EMAC_PHY_RX_CLK_FIX
@@ -1229,10 +1229,10 @@ config IBM_EMAC_PHY_RX_CLK_FIX
depends on IBM_EMAC  (405EP || 440GX || 440EP || 440GR)
help
  Enable this if EMAC attached to a PHY which doesn't generate
- RX clock if there is no link, if this is the case, you will 
+ RX clock if there is no link, if this is the case, you will
  see TX disable timeout or RX disable timeout in the system
  log.
- 
+
  If unsure, say N.
 
 config IBM_EMAC_DEBUG
@@ -1249,7 +1249,7 @@ config IBM_EMAC_RGMII
bool
depends on IBM_EMAC  440GX
default y
-   
+
 config IBM_EMAC_TAH
bool
depends on IBM_EMAC  440GX
@@ -1482,9 +1482,9 @@ config E100
select MII
---help---
  This driver supports Intel(R) PRO/100 family of adapters.
- To verify that your adapter is supported, find the board ID number 
- on the adapter. Look for a label that has a barcode and a number 
- in the format 123456-001 (six digits hyphen three digits). 
+ To verify that your adapter is supported, find the board ID number
+ on the adapter. Look for a label that has a barcode and a number
+ in the format 123456-001 (six digits hyphen three digits).
 
  Use the above information and the Adapter  Driver ID Guide at:
 
@@ -1496,7 +1496,7 @@ config E100
 
  http://appsr.intel.com/scripts-df/support_intel.asp
 
- More specific information on configuring the driver is in 
+ More specific information on configuring the driver is in
  file:Documentation/networking/e100.txt.
 
  To compile this driver as a module, choose M here and read
@@ -1950,7 +1950,7 @@ config E1000
depends on PCI
---help---
  This driver supports Intel(R) PRO/1000 gigabit ethernet family of
- adapters.  For more information on how to identify your adapter, go 
+ adapters.  For more information on how to identify your adapter, go
  to the Adapter  Driver ID Guide at:
 
  http://support.intel.com/support/network/adapter/pro100/21397.htm
@@ -1960,7 +1960,7 @@ config E1000
 
  http://support.intel.com
 
- More specific information on configuring the driver is in 
+ More specific information on configuring the driver is in
  file:Documentation/networking/e1000.txt.
 
  To compile this driver as a module, choose M here and read
@@ -2074,7 +2074,7 @@ config R8169_VLAN
---help---
  Say Y here for the r8169 driver to support the functions required
  by the kernel 802.1Q code.
- 
+
  If in doubt, say Y.
 
 config SIS190
@@ -2100,7 +2100,7 @@ config SKGE
  and related Gigabit Ethernet adapters. It is a new smaller driver
  with better performance and more complete ethtool support.
 
- It does not support the link failover and network management 
+ It does not support the link failover and network management
  features that portable vendor supplied sk98lin driver does.
 
  This driver supports adapters based on the original Yukon chipset:
@@ -2201,16 +2201,16 @@ config SK98LIN
- SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
- SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)
- SMC EZ Card 1000 (SMC9452TXV.2)
- 
+
  The adapters support Jumbo Frames.
  The dual link adapters support link-failover and dual port 

Re: forcedeth: Reside in 100Mbit Kconfig but also supports 1000Mbit cards

2007-05-26 Thread Stefan Schmidt
Hello.

On Sat, 2007-05-26 at 17:29, Randy Dunlap wrote:
 On Sun, 27 May 2007 01:07:50 +0200 Stefan Schmidt wrote:
 
  
  What would be the best way to deal with this if there are some
  10/100Mbit cards which use the same driver as 1000Mbit cards?
 
 There has been some mention of dropping the 10/100 and 1000
 categories and just merging all of them together.
 Makes sense to me.

I still like the partition by speed. It makes it a lot easier to find
the right driver in the bunch of available ones. A solution like a
Kconfig entry symlink for driver which needs to support cards in two
or more categories would be my favorite.

regards
Stefan Schmidt
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html