Netdev List
 help / color / mirror / Atom feed
* Re: [net-next-2.6 PATCH 5/5] be2net: remove BUG_ON() when be2net runs out of mccq wrbs
From: David Miller @ 2009-11-23 18:46 UTC (permalink / raw)
  To: sathyap; +Cc: netdev
In-Reply-To: <20091123080245.GA7836@serverengines.com>

From: Sathya Perla <sathyap@serverengines.com>
Date: Mon, 23 Nov 2009 13:32:45 +0530

> The driver can run out of mccq wrbs when completions don't arrive
> due to an unresponsive card. This must not hit a BUG_ON(); instead
> log a msg and return an error.
> 
> Signed-off-by: Sathya Perla <sathyap@serverengines.com>

Applied.

^ permalink raw reply

* Re: [net-next-2.6 PATCH 4/5] be2net: Fix cleanup path in be_probe()
From: David Miller @ 2009-11-23 18:45 UTC (permalink / raw)
  To: sathyap; +Cc: netdev
In-Reply-To: <20091123080226.GA7812@serverengines.com>

From: Sathya Perla <sathyap@serverengines.com>
Date: Mon, 23 Nov 2009 13:32:26 +0530

> Disabling msix was missing when probe fails after enabling msix.
> 
> Signed-off-by: Sathya Perla <sathyap@serverengines.com>

Applied.

^ permalink raw reply

* Re: [net-next-2.6 PATCH 3/5] be2net: Issue fw_init/clean cmds to fw
From: David Miller @ 2009-11-23 18:45 UTC (permalink / raw)
  To: sathyap; +Cc: netdev
In-Reply-To: <20091123080203.GA7778@serverengines.com>

From: Sathya Perla <sathyap@serverengines.com>
Date: Mon, 23 Nov 2009 13:32:03 +0530

> These cmds are issued to the fw in probe/resume and remove/suspend
> paths to help fw execute some initialization and cleanup code.
> 
> This change needed the be_hw_up() code to be refactored as be_get_config().
> 
> Signed-off-by: Sathya Perla <sathyap@serverengines.com>

Applied.

^ permalink raw reply

* Re: [net-next-2.6 PATCH 2/5] be2net: Fix rx_drops_no_fragments stat being incorrectly indexed
From: David Miller @ 2009-11-23 18:45 UTC (permalink / raw)
  To: sathyap; +Cc: netdev
In-Reply-To: <20091123080131.GA7754@serverengines.com>

From: Sathya Perla <sathyap@serverengines.com>
Date: Mon, 23 Nov 2009 13:31:31 +0530

> 
> Signed-off-by: Sathya Perla <sathyap@serverengines.com>

Applied.

^ permalink raw reply

* Re: [net-next-2.6 PATCH 1/5] be2net: support configuration of 64 multicast addresses instead of 32
From: David Miller @ 2009-11-23 18:45 UTC (permalink / raw)
  To: sathyap; +Cc: netdev
In-Reply-To: <20091123080110.GA7726@serverengines.com>

From: Sathya Perla <sathyap@serverengines.com>
Date: Mon, 23 Nov 2009 13:31:10 +0530

> To send upto 64 addresses in the multicast-set cmd, the non-embeeded cmd format
> that provides for a bigger buffer is used instead of an embedded format.
> 
> Signed-off-by: Sathya Perla <sathyap@serverengines.com>

Applied.

^ permalink raw reply

* Re: ixgbe question
From: robert @ 2009-11-23 20:54 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: robert, Jesper Dangaard Brouer, Peter P Waskiewicz Jr,
	Linux Netdev List
In-Reply-To: <4B0ABF6D.9000103@gmail.com>


Eric Dumazet writes:

 > slone_skb set to 1, this changes nothing but slows down pktgen (obviously)

 > All RX processing of 16 RX queues done by CPU 1 only.


 Well just pulled net-next-2.6 and ran with both 82598 and 82599 boards and 
 pkt load gets distributed among the cpu-cores. 


 Something mysterious or very obvious...
 
 You can even try the script it's a sort of Internet Link traffic emulation
 well you have to set up your routing.


 Cheers
					--ro

 


#! /bin/sh

#modprobe pktgen

function pgset() {
    local result

    echo $1 > $PGDEV

    result=`cat $PGDEV | fgrep "Result: OK:"`
    if [ "$result" = "" ]; then
         cat $PGDEV | fgrep Result:
    fi
}

function pg() {
    echo inject > $PGDEV
    cat $PGDEV
}

# Config Start Here -----------------------------------------------------------

remove_all()
{
 # thread config
 PGDEV=/proc/net/pktgen/kpktgend_0
 pgset "rem_device_all" 

 PGDEV=/proc/net/pktgen/kpktgend_1
 pgset "rem_device_all" 

 PGDEV=/proc/net/pktgen/kpktgend_2
 pgset "rem_device_all" 

 PGDEV=/proc/net/pktgen/kpktgend_3
 pgset "rem_device_all" 

 PGDEV=/proc/net/pktgen/kpktgend_4
 pgset "rem_device_all" 

 PGDEV=/proc/net/pktgen/kpktgend_5
 pgset "rem_device_all" 

 PGDEV=/proc/net/pktgen/kpktgend_6
 pgset "rem_device_all" 

 PGDEV=/proc/net/pktgen/kpktgend_7
 pgset "rem_device_all" 
}

remove_all

 PGDEV=/proc/net/pktgen/kpktgend_0
 pgset "add_device eth2@0" 

 PGDEV=/proc/net/pktgen/kpktgend_1
 pgset "add_device eth2@1" 

 PGDEV=/proc/net/pktgen/kpktgend_2
 pgset "add_device eth2@2" 

 PGDEV=/proc/net/pktgen/kpktgend_3
 pgset "add_device eth2@3" 


# device config
#
# Sending a mix of pkt sizes of 64, 576 and 1500
#

CLONE_SKB="clone_skb 1"
PKT_SIZE="pkt_size 60"
COUNT="count 000000"
DELAY="delay 0000"
#MAC="00:21:28:08:40:EE"
#MAC="00:21:28:08:40:EF"
#MAC="00:1B:21:17:C1:CD"
MAC="00:14:4F:DA:8C:66"
#MAC="00:14:4F:6B:CD:E8"


PGDEV=/proc/net/pktgen/eth2@0
echo "Configuring $PGDEV"
pgset "$COUNT"
pgset "$CLONE_SKB"
pgset "pkt_size 1496"
pgset "$DELAY"
pgset "flag QUEUE_MAP_CPU"
pgset "flag IPDST_RND" 
pgset "flag FLOW_SEQ" 
pgset "dst_min 11.0.0.0" 
pgset "dst_max 11.255.255.255" 
pgset "flows 2048" 
pgset "flowlen 30" 
pgset  "dst_mac $MAC"

PGDEV=/proc/net/pktgen/eth2@1
echo "Configuring $PGDEV"
pgset "$COUNT"
pgset "$CLONE_SKB"
pgset "pkt_size 576"
pgset "$DELAY"
pgset "flag QUEUE_MAP_CPU"
pgset "flag IPDST_RND" 
pgset "flag FLOW_SEQ" 
pgset "dst_min 11.0.0.0" 
pgset "dst_max 11.255.255.255" 
pgset "flows 2048" 
pgset "flowlen 30" 
pgset  "dst_mac $MAC"

PGDEV=/proc/net/pktgen/eth2@2
echo "Configuring $PGDEV"
pgset "$COUNT"
pgset "$CLONE_SKB"
pgset "$DELAY"
pgset "pkt_size 60"
pgset "flag QUEUE_MAP_CPU"
pgset "flag IPDST_RND" 
pgset "flag FLOW_SEQ" 
pgset "dst_min 11.0.0.0" 
pgset "dst_max 11.255.255.255" 
pgset "flows 2048" 
pgset "flowlen 30" 
pgset  "dst_mac $MAC"

PGDEV=/proc/net/pktgen/eth2@3
echo "Configuring $PGDEV"
pgset "$COUNT"
pgset "$CLONE_SKB"
pgset "pkt_size 1496"
pgset "$DELAY"
pgset "flag QUEUE_MAP_CPU"
pgset "flag IPDST_RND" 
pgset "flag FLOW_SEQ" 
pgset "dst_min 11.0.0.0" 
pgset "dst_max 11.255.255.255" 
pgset "flows 2048" 
pgset "flowlen 30" 
pgset  "dst_mac $MAC"

# Time to run
PGDEV=/proc/net/pktgen/pgctrl

echo "Running... ctrl^C to stop"
pgset "start" 
echo "Done"

grep pps /proc/net/pktgen/*

^ permalink raw reply

* Re: [net-next-2.6 PATCH] net/ipv4: Move && and || to end of previous line
From: David Miller @ 2009-11-23 18:41 UTC (permalink / raw)
  To: joe; +Cc: william.allen.simpson, netdev
In-Reply-To: <1259001504.16503.79.camel@Joe-Laptop.home>

From: Joe Perches <joe@perches.com>
Date: Mon, 23 Nov 2009 10:38:24 -0800

> On Mon, 2009-11-23 at 10:31 -0800, David Miller wrote:
>> From: Joe Perches <joe@perches.com>
>> > Compiled tested only:
>> Joe, please provide a signoff so I can apply this.
> 
> Sorry, forgot.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Applied, thanks Joe.

^ permalink raw reply

* Re: [PATCH] pktgen: Fix device name compares
From: David Miller @ 2009-11-23 18:39 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, robert.olsson
In-Reply-To: <4B0A75A5.8000106@gmail.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 23 Nov 2009 12:44:37 +0100

> Commit e6fce5b916cd7f7f7 (pktgen: multiqueue etc.) tried to relax
> the pktgen restriction of one device per kernel thread, adding a '@'
> tag to device names.
> 
> Problem is we dont perform check on full pktgen device name.
 ...
> Solution to this problem is to use a odevname field (includes @ tag and suffix),
> instead of using netdevice name.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks Eric.

^ permalink raw reply

* Re: [net-next-2.6 PATCH] net/ipv4: Move && and || to end of previous line
From: Joe Perches @ 2009-11-23 18:38 UTC (permalink / raw)
  To: David Miller; +Cc: william.allen.simpson, netdev
In-Reply-To: <20091123.103158.32535206.davem@davemloft.net>

On Mon, 2009-11-23 at 10:31 -0800, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> > Compiled tested only:
> Joe, please provide a signoff so I can apply this.

Sorry, forgot.

Signed-off-by: Joe Perches <joe@perches.com>



^ permalink raw reply

* Re: [PATCH 2/2] stmmac: do not fail when the timer cannot be used.
From: David Miller @ 2009-11-23 18:38 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev
In-Reply-To: <1258966796-6602-1-git-send-email-peppe.cavallaro@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon, 23 Nov 2009 09:59:56 +0100

> If the external timer cannot be used the driver
> will continue to work without mitigation.
> 
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Also applied to net-2.6

^ permalink raw reply

* Re: [PATCH 1/2] stmmac: fixed a compilation error when use the external timer
From: David Miller @ 2009-11-23 18:38 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev
In-Reply-To: <1258966721-6567-1-git-send-email-peppe.cavallaro@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon, 23 Nov 2009 09:58:40 +0100

> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied to net-2.6

^ permalink raw reply

* Re: [net-next-2.6 PATCH] net/ipv4: Move && and || to end of previous line
From: David Miller @ 2009-11-23 18:31 UTC (permalink / raw)
  To: joe; +Cc: william.allen.simpson, netdev
In-Reply-To: <1259000895.16503.77.camel@Joe-Laptop.home>

From: Joe Perches <joe@perches.com>
Date: Mon, 23 Nov 2009 10:28:15 -0800

> On Sun, 2009-11-22 at 16:31 -0800, David Miller wrote:
>> It should be of the form:
>> 	if (x &&
>> 	    y)
>> 
>> or:
>> 	if (x && y)
>> 
>> Fix patches, rather than complaints, for existing cases where things
>> do not follow this pattern are certainly welcome.
> 
> Also collapsed some multiple tabs to single space.
> 
> Compiled tested only:

Joe, please provide a signoff so I can apply this.

Thanks.

^ permalink raw reply

* [net-next-2.6 PATCH] net/ipv4: Move && and || to end of previous line
From: Joe Perches @ 2009-11-23 18:28 UTC (permalink / raw)
  To: David Miller; +Cc: william.allen.simpson, netdev
In-Reply-To: <20091122.163112.80105623.davem@davemloft.net>

On Sun, 2009-11-22 at 16:31 -0800, David Miller wrote:
> It should be of the form:
> 	if (x &&
> 	    y)
> 
> or:
> 	if (x && y)
> 
> Fix patches, rather than complaints, for existing cases where things
> do not follow this pattern are certainly welcome.

Also collapsed some multiple tabs to single space.

Compiled tested only:

 net/ipv4/inet_lro.c   |   36 ++++++++++++++++++------------------
 net/ipv4/ip_output.c  |    6 ++++--
 net/ipv4/ipconfig.c   |   13 ++++++-------
 net/ipv4/route.c      |   19 ++++++++++---------
 net/ipv4/tcp_htcp.c   |   10 +++++-----
 net/ipv4/tcp_input.c  |    4 ++--
 net/ipv4/tcp_lp.c     |    4 ++--
 net/ipv4/tcp_output.c |    4 ++--
 net/ipv4/tcp_probe.c  |    4 ++--
 net/ipv4/tcp_veno.c   |    5 ++---
 net/ipv4/tcp_yeah.c   |    4 ++--
 net/ipv4/udp.c        |   36 ++++++++++++++++++------------------
 12 files changed, 73 insertions(+), 72 deletions(-)

diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index 6a667da..47038cb 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -64,15 +64,15 @@ static int lro_tcp_ip_check(struct iphdr *iph, struct tcphdr *tcph,
 	if (iph->ihl != IPH_LEN_WO_OPTIONS)
 		return -1;
 
-	if (tcph->cwr || tcph->ece || tcph->urg || !tcph->ack
-	    || tcph->rst || tcph->syn || tcph->fin)
+	if (tcph->cwr || tcph->ece || tcph->urg || !tcph->ack ||
+	    tcph->rst || tcph->syn || tcph->fin)
 		return -1;
 
 	if (INET_ECN_is_ce(ipv4_get_dsfield(iph)))
 		return -1;
 
-	if (tcph->doff != TCPH_LEN_WO_OPTIONS
-	    && tcph->doff != TCPH_LEN_W_TIMESTAMP)
+	if (tcph->doff != TCPH_LEN_WO_OPTIONS &&
+	    tcph->doff != TCPH_LEN_W_TIMESTAMP)
 		return -1;
 
 	/* check tcp options (only timestamp allowed) */
@@ -262,10 +262,10 @@ static int lro_check_tcp_conn(struct net_lro_desc *lro_desc,
 			      struct iphdr *iph,
 			      struct tcphdr *tcph)
 {
-	if ((lro_desc->iph->saddr != iph->saddr)
-	    || (lro_desc->iph->daddr != iph->daddr)
-	    || (lro_desc->tcph->source != tcph->source)
-	    || (lro_desc->tcph->dest != tcph->dest))
+	if ((lro_desc->iph->saddr != iph->saddr) ||
+	    (lro_desc->iph->daddr != iph->daddr) ||
+	    (lro_desc->tcph->source != tcph->source) ||
+	    (lro_desc->tcph->dest != tcph->dest))
 		return -1;
 	return 0;
 }
@@ -339,9 +339,9 @@ static int __lro_proc_skb(struct net_lro_mgr *lro_mgr, struct sk_buff *skb,
 	u64 flags;
 	int vlan_hdr_len = 0;
 
-	if (!lro_mgr->get_skb_header
-	    || lro_mgr->get_skb_header(skb, (void *)&iph, (void *)&tcph,
-				       &flags, priv))
+	if (!lro_mgr->get_skb_header ||
+	    lro_mgr->get_skb_header(skb, (void *)&iph, (void *)&tcph,
+				    &flags, priv))
 		goto out;
 
 	if (!(flags & LRO_IPV4) || !(flags & LRO_TCP))
@@ -351,8 +351,8 @@ static int __lro_proc_skb(struct net_lro_mgr *lro_mgr, struct sk_buff *skb,
 	if (!lro_desc)
 		goto out;
 
-	if ((skb->protocol == htons(ETH_P_8021Q))
-	    && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
+	if ((skb->protocol == htons(ETH_P_8021Q)) &&
+	    !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
 		vlan_hdr_len = VLAN_HLEN;
 
 	if (!lro_desc->active) { /* start new lro session */
@@ -446,9 +446,9 @@ static struct sk_buff *__lro_proc_segment(struct net_lro_mgr *lro_mgr,
 	int hdr_len = LRO_MAX_PG_HLEN;
 	int vlan_hdr_len = 0;
 
-	if (!lro_mgr->get_frag_header
-	    || lro_mgr->get_frag_header(frags, (void *)&mac_hdr, (void *)&iph,
-					(void *)&tcph, &flags, priv)) {
+	if (!lro_mgr->get_frag_header ||
+	    lro_mgr->get_frag_header(frags, (void *)&mac_hdr, (void *)&iph,
+				     (void *)&tcph, &flags, priv)) {
 		mac_hdr = page_address(frags->page) + frags->page_offset;
 		goto out1;
 	}
@@ -472,8 +472,8 @@ static struct sk_buff *__lro_proc_segment(struct net_lro_mgr *lro_mgr,
 		if (!skb)
 			goto out;
 
-		if ((skb->protocol == htons(ETH_P_8021Q))
-		    && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
+		if ((skb->protocol == htons(ETH_P_8021Q)) &&
+		    !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
 			vlan_hdr_len = VLAN_HLEN;
 
 		iph = (void *)(skb->data + vlan_hdr_len);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 322b408..b78e615 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -264,9 +264,11 @@ int ip_mc_output(struct sk_buff *skb)
 
 		   This check is duplicated in ip_mr_input at the moment.
 		 */
-		    && ((rt->rt_flags&RTCF_LOCAL) || !(IPCB(skb)->flags&IPSKB_FORWARDED))
+		    &&
+		    ((rt->rt_flags & RTCF_LOCAL) ||
+		     !(IPCB(skb)->flags & IPSKB_FORWARDED))
 #endif
-		) {
+		   ) {
 			struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
 			if (newskb)
 				NF_HOOK(PF_INET, NF_INET_POST_ROUTING, newskb,
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index f8d04c2..4e08b7f 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1172,10 +1172,9 @@ static int __init ic_dynamic(void)
 			schedule_timeout_uninterruptible(1);
 #ifdef IPCONFIG_DHCP
 		/* DHCP isn't done until we get a DHCPACK. */
-		if ((ic_got_reply & IC_BOOTP)
-		    && (ic_proto_enabled & IC_USE_DHCP)
-		    && ic_dhcp_msgtype != DHCPACK)
-		{
+		if ((ic_got_reply & IC_BOOTP) &&
+		    (ic_proto_enabled & IC_USE_DHCP) &&
+		    ic_dhcp_msgtype != DHCPACK) {
 			ic_got_reply = 0;
 			printk(",");
 			continue;
@@ -1344,9 +1343,9 @@ static int __init ip_auto_config(void)
 	 */
 	if (ic_myaddr == NONE ||
 #ifdef CONFIG_ROOT_NFS
-	    (root_server_addr == NONE
-	     && ic_servaddr == NONE
-	     && ROOT_DEV == Root_NFS) ||
+	    (root_server_addr == NONE &&
+	     ic_servaddr == NONE &&
+	     ROOT_DEV == Root_NFS) ||
 #endif
 	    ic_first_dev->next) {
 #ifdef IPCONFIG_DYNAMIC
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 4284cee..7547944 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1346,9 +1346,9 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
 		return;
 
 	net = dev_net(dev);
-	if (new_gw == old_gw || !IN_DEV_RX_REDIRECTS(in_dev)
-	    || ipv4_is_multicast(new_gw) || ipv4_is_lbcast(new_gw)
-	    || ipv4_is_zeronet(new_gw))
+	if (new_gw == old_gw || !IN_DEV_RX_REDIRECTS(in_dev) ||
+	    ipv4_is_multicast(new_gw) || ipv4_is_lbcast(new_gw) ||
+	    ipv4_is_zeronet(new_gw))
 		goto reject_redirect;
 
 	if (!rt_caching(net))
@@ -2311,10 +2311,11 @@ skip_cache:
 				ip_hdr(skb)->protocol);
 			if (our
 #ifdef CONFIG_IP_MROUTE
-			    || (!ipv4_is_local_multicast(daddr) &&
-				IN_DEV_MFORWARD(in_dev))
+				||
+			    (!ipv4_is_local_multicast(daddr) &&
+			     IN_DEV_MFORWARD(in_dev))
 #endif
-			    ) {
+			   ) {
 				rcu_read_unlock();
 				return ip_route_input_mc(skb, daddr, saddr,
 							 tos, dev, our);
@@ -2511,9 +2512,9 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
 		      of another iface. --ANK
 		 */
 
-		if (oldflp->oif == 0
-		    && (ipv4_is_multicast(oldflp->fl4_dst) ||
-			oldflp->fl4_dst == htonl(0xFFFFFFFF))) {
+		if (oldflp->oif == 0 &&
+		    (ipv4_is_multicast(oldflp->fl4_dst) ||
+		     oldflp->fl4_dst == htonl(0xFFFFFFFF))) {
 			/* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
 			dev_out = ip_dev_find(net, oldflp->fl4_src);
 			if (dev_out == NULL)
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c
index 26d5c7f..7c94a49 100644
--- a/net/ipv4/tcp_htcp.c
+++ b/net/ipv4/tcp_htcp.c
@@ -92,8 +92,8 @@ static inline void measure_rtt(struct sock *sk, u32 srtt)
 	if (icsk->icsk_ca_state == TCP_CA_Open) {
 		if (ca->maxRTT < ca->minRTT)
 			ca->maxRTT = ca->minRTT;
-		if (ca->maxRTT < srtt
-		    && srtt <= ca->maxRTT + msecs_to_jiffies(20))
+		if (ca->maxRTT < srtt &&
+		    srtt <= ca->maxRTT + msecs_to_jiffies(20))
 			ca->maxRTT = srtt;
 	}
 }
@@ -123,9 +123,9 @@ static void measure_achieved_throughput(struct sock *sk, u32 pkts_acked, s32 rtt
 
 	ca->packetcount += pkts_acked;
 
-	if (ca->packetcount >= tp->snd_cwnd - (ca->alpha >> 7 ? : 1)
-	    && now - ca->lasttime >= ca->minRTT
-	    && ca->minRTT > 0) {
+	if (ca->packetcount >= tp->snd_cwnd - (ca->alpha >> 7 ? : 1) &&
+	    now - ca->lasttime >= ca->minRTT &&
+	    ca->minRTT > 0) {
 		__u32 cur_Bi = ca->packetcount * HZ / (now - ca->lasttime);
 
 		if (htcp_ccount(ca) <= 3) {
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index cc306ac..be166e0 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4852,11 +4852,11 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible)
 	struct tcp_sock *tp = tcp_sk(sk);
 
 	    /* More than one full frame received... */
-	if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss
+	if (((tp->rcv_nxt - tp->rcv_wup) > inet_csk(sk)->icsk_ack.rcv_mss &&
 	     /* ... and right edge of window advances far enough.
 	      * (tcp_recvmsg() will send ACK otherwise). Or...
 	      */
-	     && __tcp_select_window(sk) >= tp->rcv_wnd) ||
+	     __tcp_select_window(sk) >= tp->rcv_wnd) ||
 	    /* We ACK each frame or... */
 	    tcp_in_quickack_mode(sk) ||
 	    /* We have out of order data. */
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c
index ce3c41f..de87037 100644
--- a/net/ipv4/tcp_lp.c
+++ b/net/ipv4/tcp_lp.c
@@ -143,8 +143,8 @@ static u32 tcp_lp_remote_hz_estimator(struct sock *sk)
 		goto out;
 
 	/* we can't calc remote HZ with no different!! */
-	if (tp->rx_opt.rcv_tsval == lp->remote_ref_time
-	    || tp->rx_opt.rcv_tsecr == lp->local_ref_time)
+	if (tp->rx_opt.rcv_tsval == lp->remote_ref_time ||
+	    tp->rx_opt.rcv_tsecr == lp->local_ref_time)
 		goto out;
 
 	m = HZ * (tp->rx_opt.rcv_tsval -
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 616c686..875bc6d 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1923,8 +1923,8 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
 	 * case, when window is shrunk to zero. In this case
 	 * our retransmit serves as a zero window probe.
 	 */
-	if (!before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(tp))
-	    && TCP_SKB_CB(skb)->seq != tp->snd_una)
+	if (!before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(tp)) &&
+	    TCP_SKB_CB(skb)->seq != tp->snd_una)
 		return -EAGAIN;
 
 	if (skb->len > cur_mss) {
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 7a3cc2f..bb110c5 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -95,8 +95,8 @@ static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 
 	/* Only update if port matches */
 	if ((port == 0 || ntohs(inet->inet_dport) == port ||
-	     ntohs(inet->inet_sport) == port)
-	    && (full || tp->snd_cwnd != tcp_probe.lastcwnd)) {
+	     ntohs(inet->inet_sport) == port) &&
+	    (full || tp->snd_cwnd != tcp_probe.lastcwnd)) {
 
 		spin_lock(&tcp_probe.lock);
 		/* If log fills, just silently drop */
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index e9bbff7..b612acf 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -165,9 +165,8 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
 				 * every other rtt.
 				 */
 				if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
-					if (veno->inc
-					    && tp->snd_cwnd <
-					    tp->snd_cwnd_clamp) {
+					if (veno->inc &&
+					    tp->snd_cwnd < tp->snd_cwnd_clamp) {
 						tp->snd_cwnd++;
 						veno->inc = 0;
 					} else
diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c
index 66b6821..a0f2403 100644
--- a/net/ipv4/tcp_yeah.c
+++ b/net/ipv4/tcp_yeah.c
@@ -157,8 +157,8 @@ static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
 
 			if (queue > TCP_YEAH_ALPHA ||
 			    rtt - yeah->vegas.baseRTT > (yeah->vegas.baseRTT / TCP_YEAH_PHY)) {
-				if (queue > TCP_YEAH_ALPHA
-				    && tp->snd_cwnd > yeah->reno_count) {
+				if (queue > TCP_YEAH_ALPHA &&
+				    tp->snd_cwnd > yeah->reno_count) {
 					u32 reduction = min(queue / TCP_YEAH_GAMMA ,
 							    tp->snd_cwnd >> TCP_YEAH_EPSILON);
 
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 1eaf575..1f95348 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -136,12 +136,12 @@ static int udp_lib_lport_inuse(struct net *net, __u16 num,
 	struct hlist_nulls_node *node;
 
 	sk_nulls_for_each(sk2, node, &hslot->head)
-		if (net_eq(sock_net(sk2), net)			&&
-		    sk2 != sk					&&
+		if (net_eq(sock_net(sk2), net) &&
+		    sk2 != sk &&
 		    (bitmap || udp_sk(sk2)->udp_port_hash == num) &&
-		    (!sk2->sk_reuse || !sk->sk_reuse)		&&
-		    (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if
-			|| sk2->sk_bound_dev_if == sk->sk_bound_dev_if) &&
+		    (!sk2->sk_reuse || !sk->sk_reuse) &&
+		    (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if ||
+		     sk2->sk_bound_dev_if == sk->sk_bound_dev_if) &&
 		    (*saddr_comp)(sk, sk2)) {
 			if (bitmap)
 				__set_bit(udp_sk(sk2)->udp_port_hash >> log,
@@ -168,12 +168,12 @@ static int udp_lib_lport_inuse2(struct net *net, __u16 num,
 
 	spin_lock(&hslot2->lock);
 	udp_portaddr_for_each_entry(sk2, node, &hslot2->head)
-		if (net_eq(sock_net(sk2), net)			&&
-		    sk2 != sk					&&
-		    (udp_sk(sk2)->udp_port_hash == num)		&&
-		    (!sk2->sk_reuse || !sk->sk_reuse)		&&
-		    (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if
-			|| sk2->sk_bound_dev_if == sk->sk_bound_dev_if) &&
+		if (net_eq(sock_net(sk2), net) &&
+		    sk2 != sk &&
+		    (udp_sk(sk2)->udp_port_hash == num) &&
+		    (!sk2->sk_reuse || !sk->sk_reuse) &&
+		    (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if ||
+		     sk2->sk_bound_dev_if == sk->sk_bound_dev_if) &&
 		    (*saddr_comp)(sk, sk2)) {
 			res = 1;
 			break;
@@ -545,13 +545,13 @@ static inline struct sock *udp_v4_mcast_next(struct net *net, struct sock *sk,
 	sk_nulls_for_each_from(s, node) {
 		struct inet_sock *inet = inet_sk(s);
 
-		if (!net_eq(sock_net(s), net)				||
-		    udp_sk(s)->udp_port_hash != hnum			||
-		    (inet->inet_daddr && inet->inet_daddr != rmt_addr)	||
-		    (inet->inet_dport != rmt_port && inet->inet_dport)	||
-		    (inet->inet_rcv_saddr	&&
-		     inet->inet_rcv_saddr != loc_addr)			||
-		    ipv6_only_sock(s)					||
+		if (!net_eq(sock_net(s), net) ||
+		    udp_sk(s)->udp_port_hash != hnum ||
+		    (inet->inet_daddr && inet->inet_daddr != rmt_addr) ||
+		    (inet->inet_dport != rmt_port && inet->inet_dport) ||
+		    (inet->inet_rcv_saddr &&
+		     inet->inet_rcv_saddr != loc_addr) ||
+		    ipv6_only_sock(s) ||
 		    (s->sk_bound_dev_if && s->sk_bound_dev_if != dif))
 			continue;
 		if (!ip_mc_sf_allow(s, loc_addr, rmt_addr, dif))




^ permalink raw reply related

* Performance of bonding driver with e1000
From: J.A. Magallón @ 2009-11-23 18:06 UTC (permalink / raw)
  To: NetDev

Hi...

I have two boxes which I linked together via 2x gigabit interfaces and a
3Com switch. Each interface is:

02:0a.0 Ethernet controller: Intel Corporation 82541EI Gigabit Ethernet Controller
02:0b.0 Ethernet controller: Intel Corporation 82541EI Gigabit Ethernet Controller

I use the e1000 driver.
The switch is private for them, so there is no more taffic.
Boxes are P4-HT@2.8, 3Gb of RAM.

Both interfaces alone work pretty well (performance measured with iperf):

[  5] local 192.168.1.2 port 5001 connected with 192.168.1.1 port 41252
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.0 sec  1.00 GBytes    860 Mbits/sec

[  4] local 192.168.2.2 port 5001 connected with 192.168.2.1 port 39275
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  1024 MBytes    858 Mbits/sec

I loaded bonding driver with no parameters, and using iperf I get:

[  4] local 192.168.1.2 port 5001 connected with 192.168.1.1 port 41254
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec    741 MBytes    621 Mbits/sec

In the node which receives, two instances of iftop on slave interfaces
show that load is balanced, but none flies higher than about 300 Mb/s.

Any ideas ?
If you guess something and need more info, I will provide it.

TIA

-- 
J.A. Magallon <jamagallon()ono!com>     \               Software is like sex:
                                         \         It's better when it's free
Mandriva Linux release 2010.0 (Cooker) for x86_64
Linux 2.6.29.3-desktop-1mnb (gcc 4.3.2 (GCC) #1 Wed May

^ permalink raw reply

* Re: macvlan: fix gso_max_size setting
From: David Miller @ 2009-11-23 18:10 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <4B0A64E2.8090203@trash.net>

From: Patrick McHardy <kaber@trash.net>
Date: Mon, 23 Nov 2009 11:33:06 +0100

> Fix macvlan gso_max_size setting. Based on net-next-2.6.git.

Pretty serious defect, maybe net-2.6 material?

If someone hits this, it's going to trigger something awful.


^ permalink raw reply

* RE: linux-next: manual merge of the net tree with the net-current tree
From: Amit Salecha @ 2009-11-23 18:09 UTC (permalink / raw)
  To: Stephen Rothwell, David Miller, netdev@vger.kernel.org
  Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20091123120043.24cf5c12.sfr@canb.auug.org.au>

Hi Stephen

 This merge looks ok and I have tested it. 

Thanks
Amit Salecha

-----Original Message-----
From: Stephen Rothwell [mailto:sfr@canb.auug.org.au] 
Sent: Sunday, November 22, 2009 5:01 PM
To: David Miller; netdev@vger.kernel.org
Cc: linux-next@vger.kernel.org; linux-kernel@vger.kernel.org; Amit Salecha
Subject: linux-next: manual merge of the net tree with the net-current tree

Hi all,

Today's linux-next merge of the net tree got a conflict in
drivers/net/netxen/netxen_nic_init.c between commit
5d521fd36de4e61ab16a358df54c5babe153396c ("netxen: fix memory
initialization") from the net-current tree and commit
0be367bd5d10634c0836f57a684432fee935d929 ("netxen: reset sequence
changes") from the net tree.

Just context changes. I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/net/netxen/netxen_nic_init.c
index 8a09043,6ee27a6..0000000
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@@ -544,9 -528,8 +528,10 @@@ int netxen_pinit_from_rom(struct netxen
  				continue;
  			if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */
  				continue;
 +			if ((off & 0x0ff00000) == NETXEN_CRB_DDR_NET)
 +				continue;
- 			if (off == (NETXEN_CRB_PEG_NET_1 + 0x18))
+ 			if (off == (NETXEN_CRB_PEG_NET_1 + 0x18) &&
+ 				!NX_IS_REVISION_P3P(adapter->ahw.revision_id))
  				buf[i].data = 0x1020;
  			/* skip the function enable register */
  			if (off == NETXEN_PCIE_REG(PCIE_SETUP_FUNCTION))

^ permalink raw reply

* RE: [Bug #14252] WARNING: at include/linux/skbuff.h:1382 w/ e1000
From: Tantilov, Emil S @ 2009-11-23 18:02 UTC (permalink / raw)
  To: David Miller, rjw-KKrjLPT3xs0@public.gmane.org
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	skraw-DcQCyzbjH0jQT0dZR+AlfA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20091119.120721.252464351.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

David Miller wrote:
> From: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>
> Date: Tue, 17 Nov 2009 00:01:18 +0100 (CET)
> 
>> This message has been generated automatically as a part of a report
>> of regressions introduced between 2.6.30 and 2.6.31.
>> 
>> The following bug entry is on the current list of known regressions
>> introduced between 2.6.30 and 2.6.31.  Please verify if it still
>> should be listed and let me know (either way).
>> 
>> 
>> Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=14252
>> Subject		: WARNING: at include/linux/skbuff.h:1382 w/ e1000
>> Submitter	: Stephan von Krawczynski <skraw-DcQCyzbjH0jQT0dZR+AlfA@public.gmane.org>
>> Date		: 2009-09-20 11:26 (58 days old)
>> References	: http://marc.info/?l=linux-kernel&m=125344599006033&w=4
> 
> Please CC: netdev when reporting networking problems, thank you.
> 
> Intel folks can you please take a look at this?  Thanks.

I have not been able to reproduce this issue so far. I don't have the exact same HW, but I tested on stock 2.6.31 with 82541 based NIC. More than 3 days now of stress without a problem.

If the reporter can provide some additional information that may be of help:
1. cat /proc/interrupts
2. ethtool -i ethX (where ethX is the interface that is causing the problem
3. lspci -vvv
4. ethtool -e ethX
5. specific settings that may deviate from the default configuration (like MTU)
6. type of traffic that is causing the issue.

Thanks,
Emil--
To unsubscribe from this list: send the line "unsubscribe kernel-testers" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: netfilter: xt_limit: fix invalid return code in limit_mt_check()
From: David Miller @ 2009-11-23 17:53 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel, netdev
In-Reply-To: <4B0A838D.3020907@trash.net>

From: Patrick McHardy <kaber@trash.net>
Date: Mon, 23 Nov 2009 13:43:57 +0100

> This patch fixes an invalid return value in the limit match.
> Please apply or pull from:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git master

Pulled, thanks Patrick.

^ permalink raw reply

* Re: [net-next-2.6 PATCH v7 5/7 RFC] TCPCT part 1e: implement socket option TCP_COOKIE_TRANSACTIONS
From: David Miller @ 2009-11-23 17:49 UTC (permalink / raw)
  To: william.allen.simpson; +Cc: joe, netdev
In-Reply-To: <4B0A6EF3.8040302@gmail.com>

From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Mon, 23 Nov 2009 06:16:03 -0500

> Therefore, it's plain as can be that this is just more jumping through
> arbitrary and capricious hoops that others are not required to follow.

Others, like Eric and Ilpo, don't have to jump through these hoops
because when they submit patches their code doesn't have coding
style issues like your's does.

Trust me, it's not about you, and you're not being picked out
specifically.  These things would be enforced upon anyone.  The only
unique aspect about you is that you seem to respond to these
requirements in the most sour manner possible rather than pleasantly
complying and thus getting your changes added to the tree.

^ permalink raw reply

* Re: [net-next-2.6 PATCH v7 5/7 RFC] TCPCT part 1e: implement socket option TCP_COOKIE_TRANSACTIONS
From: Joe Perches @ 2009-11-23 17:25 UTC (permalink / raw)
  To: William Allen Simpson; +Cc: David Miller, netdev
In-Reply-To: <4B0A6EF3.8040302@gmail.com>

On Mon, 2009-11-23 at 06:16 -0500, William Allen Simpson wrote:
> Therefore, it's plain as can be that this is just more jumping through
> arbitrary and capricious hoops that others are not required to follow.
> At *thousands* of examples, including in the tcp*.c files themselves, it
> really becomes obvious that that may be a personal preference of David,
> but is *not* a tree-wide or even a net-wide coding style.

It seems similar kernel source uses are mostly historic.

Relatively little new code is added with leading || or &&.
There is some in staging/, but it normally gets removed.

> So, I'll try again now, with the assurance that this is the final hoop.

Once more into the breach or men of few words are the best men?
I'll stop typing now...


^ permalink raw reply

* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Peter Zijlstra @ 2009-11-23 17:05 UTC (permalink / raw)
  To: Peter P Waskiewicz Jr
  Cc: Yong Zhang, linux-kernel@vger.kernel.org,
	arjan@linux.jf.intel.com, davem@davemloft.net,
	netdev@vger.kernel.org
In-Reply-To: <1258968980.2697.9.camel@ppwaskie-mobl2>

On Mon, 2009-11-23 at 01:36 -0800, Peter P Waskiewicz Jr wrote:

> This mechanism isn't going to be used by any internal kernel mechanism
> for determining interrupt placement or operation.  It's purely something
> that either a driver can modify, or external script (through /proc),
> that irqbalance will make use of.  If irqbalance isn't running, or the
> current version of irqbalance doesn't support reading node_affinity,
> then it won't affect the system's operation.
> 
> If irqbalance does support it, it'll read whatever the supplied mask is,
> and then will try and balance interrupts within that mask.  It will bail
> if the mask is invalid, or won't apply to the running system, just like
> how putting a bogus mask into smp_affinity is ignored.
> 
> If there's something I'm missing beyond this with the two suggestions
> you've made (I looked into those two parameters and tried to draw
> conclusions), please let me know.

I don't see the point in adding it, if the driver wants to set a node
cpu mask it can already do that using the regular smp affinity settings.

Same for userspace.


^ permalink raw reply

* Re: ixgbe question
From: Eric Dumazet @ 2009-11-23 16:59 UTC (permalink / raw)
  To: robert; +Cc: Jesper Dangaard Brouer, Peter P Waskiewicz Jr, Linux Netdev List
In-Reply-To: <19210.54486.353397.804028@gargle.gargle.HOWL>

robert@herjulf.net a écrit :
> Eric Dumazet writes:
> 
>  > Jesper Dangaard Brouer a écrit :
>  > 
>  > > How is your smp_affinity mask's set?
>  > > 
>  > > grep . /proc/irq/*/fiber1-*/../smp_affinity
>  > 
> 
>  Weird... set clone_skb to 1 to be sure and vary dst or something so 
>  the HW classifier selects different queues and with proper RX affinty. 
>  
>  You should see in /proc/net/softnet_stat something like:
> 
> 012a7bb9 00000000 000000ae 00000000 00000000 00000000 00000000 00000000 00000000
> 01288d4c 00000000 00000049 00000000 00000000 00000000 00000000 00000000 00000000
> 0128fe28 00000000 00000043 00000000 00000000 00000000 00000000 00000000 00000000
> 01295387 00000000 00000047 00000000 00000000 00000000 00000000 00000000 00000000
> 0129a722 00000000 0000004a 00000000 00000000 00000000 00000000 00000000 00000000
> 0128c5e4 00000000 00000046 00000000 00000000 00000000 00000000 00000000 00000000
> 0128f718 00000000 00000043 00000000 00000000 00000000 00000000 00000000 00000000
> 012993e3 00000000 0000004a 00000000 00000000 00000000 00000000 00000000 00000000
> 

slone_skb set to 1, this changes nothing but slows down pktgen (obviously)

Result: OK: 117614452(c117608705+d5746) nsec, 100000000 (60byte,0frags)
  850235pps 408Mb/sec (408112800bps) errors: 0

All RX processing of 16 RX queues done by CPU 1 only.


# cat  /proc/net/softnet_stat  ; sleep 2 ; echo "--------------";cat  /proc/net/softnet_stat
0039f331 00000000 00002e10 00000000 00000000 00000000 00000000 00000000 00000000
03f2ed19 00000000 00037ca2 00000000 00000000 00000000 00000000 00000000 00000000
00000024 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000041 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000028 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0000000b 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
000000c5 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0000010d 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000250 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000498 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000616 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0000012c 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
000000d2 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0000025d 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0000003c 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000127 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
--------------
0039f331 00000000 00002e10 00000000 00000000 00000000 00000000 00000000 00000000
03f66737 00000000 00038015 00000000 00000000 00000000 00000000 00000000 00000000
00000024 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000041 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000028 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0000000b 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
000000c5 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000250 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000499 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000616 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0000012c 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
000000d2 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000263 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0000003c 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000129 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

ethtool -S fiber1  (to show how my trafic is equally distributed to 16 RX queues)

     rx_queue_0_packets: 4867706
     rx_queue_0_bytes: 292062360
     rx_queue_1_packets: 4862472
     rx_queue_1_bytes: 291748320
     rx_queue_2_packets: 4867111
     rx_queue_2_bytes: 292026660
     rx_queue_3_packets: 4859897
     rx_queue_3_bytes: 291593820
     rx_queue_4_packets: 4862267
     rx_queue_4_bytes: 291740814
     rx_queue_5_packets: 4861517
     rx_queue_5_bytes: 291691020
     rx_queue_6_packets: 4862699
     rx_queue_6_bytes: 291761940
     rx_queue_7_packets: 4860523
     rx_queue_7_bytes: 291631380
     rx_queue_8_packets: 4856891
     rx_queue_8_bytes: 291413460
     rx_queue_9_packets: 4868794
     rx_queue_9_bytes: 292127640
     rx_queue_10_packets: 4859099
     rx_queue_10_bytes: 291545940
     rx_queue_11_packets: 4867599
     rx_queue_11_bytes: 292055940
     rx_queue_12_packets: 4861868
     rx_queue_12_bytes: 291713374
     rx_queue_13_packets: 4862655
     rx_queue_13_bytes: 291759300
     rx_queue_14_packets: 4860798
     rx_queue_14_bytes: 291647880
     rx_queue_15_packets: 4860951
     rx_queue_15_bytes: 291657060


perf top -C 1 -E 25
------------------------------------------------------------------------------
   PerfTop:   24419 irqs/sec  kernel:100.0% [100000 cycles],  (all, cpu: 1)
------------------------------------------------------------------------------

             samples    pcnt   kernel function
             _______   _____   _______________

            46234.00 - 24.3% : ixgbe_clean_tx_irq	[ixgbe]
            21134.00 - 11.1% : __slab_free
            17838.00 -  9.4% : _raw_spin_lock
            17086.00 -  9.0% : skb_release_head_state
             9410.00 -  5.0% : ixgbe_clean_rx_irq	[ixgbe]
             8639.00 -  4.5% : kmem_cache_free
             6910.00 -  3.6% : kfree
             5743.00 -  3.0% : __ip_route_output_key
             5321.00 -  2.8% : ip_route_input
             3138.00 -  1.7% : ip_rcv
             2179.00 -  1.1% : kmem_cache_alloc_node
             2002.00 -  1.1% : __kmalloc_node_track_caller
             1907.00 -  1.0% : skb_put
             1807.00 -  1.0% : __xfrm_lookup
             1742.00 -  0.9% : get_partial_node
             1727.00 -  0.9% : csum_partial_copy_generic
             1541.00 -  0.8% : add_partial
             1516.00 -  0.8% : __kfree_skb
             1465.00 -  0.8% : __netdev_alloc_skb
             1420.00 -  0.7% : icmp_send
             1222.00 -  0.6% : dev_gro_receive
             1159.00 -  0.6% : fib_table_lookup
             1155.00 -  0.6% : __phys_addr
             1050.00 -  0.6% : skb_release_data
              982.00 -  0.5% : _raw_spin_unlock


^ permalink raw reply

* [net-next-2.6 PATCH 3/3] ixgbe: Only set/clear VFE in ixgbe_set_rx_mode
From: Jeff Kirsher @ 2009-11-23 16:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, gospo, Mallikarjuna R Chilakala, Peter P Waskiewicz Jr,
	Jeff Kirsher
In-Reply-To: <20091123163145.19706.37720.stgit@localhost.localdomain>

From: Alexander Duyck <alexander.h.duyck@intel.com>

There appears to be a stray setting of the VFE bit when registering vlans.
This should not be done as vlan filtering should be enabled any time the
interface is not in promiscous mode

Signed-off-by:  Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_main.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a3a2a9a..5182b28 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2336,23 +2336,25 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev,
 	 * not in DCB mode.
 	 */
 	ctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_VLNCTRL);
+
+	/* Disable CFI check */
+	ctrl &= ~IXGBE_VLNCTRL_CFIEN;
+
+	/* enable VLAN tag stripping */
 	if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
-		ctrl |= IXGBE_VLNCTRL_VME | IXGBE_VLNCTRL_VFE;
-		ctrl &= ~IXGBE_VLNCTRL_CFIEN;
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl);
+		ctrl |= IXGBE_VLNCTRL_VME;
 	} else if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
-		ctrl |= IXGBE_VLNCTRL_VFE;
-		/* enable VLAN tag insert/strip */
-		ctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_VLNCTRL);
-		ctrl &= ~IXGBE_VLNCTRL_CFIEN;
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl);
 		for (i = 0; i < adapter->num_rx_queues; i++) {
+			u32 ctrl;
 			j = adapter->rx_ring[i].reg_idx;
 			ctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_RXDCTL(j));
 			ctrl |= IXGBE_RXDCTL_VME;
 			IXGBE_WRITE_REG(&adapter->hw, IXGBE_RXDCTL(j), ctrl);
 		}
 	}
+
+	IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl);
+
 	ixgbe_vlan_rx_add_vid(netdev, 0);
 
 	if (!test_bit(__IXGBE_DOWN, &adapter->state))


^ permalink raw reply related

* [net-next-2.6 PATCH 1/3] ixgbe: Modify 82599 HWRSC statistics counters
From: Jeff Kirsher @ 2009-11-23 16:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, gospo, Mallikarjuna R Chilakala, Peter P Waskiewicz Jr,
	Jeff Kirsher

From: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>

Divide 82599 HWRSC counters into aggregated and flushed to count number of
packets getting coalesced per TCP connection.

Signed-off-by:  Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe.h         |    4 +++-
 drivers/net/ixgbe/ixgbe_ethtool.c |    3 ++-
 drivers/net/ixgbe/ixgbe_main.c    |   25 +++++++++++++++++++------
 3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 7eb08a6..76b052f 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -159,6 +159,7 @@ struct ixgbe_ring {
 	struct ixgbe_queue_stats stats;
 	unsigned long reinit_state;
 	u64 rsc_count;			/* stat for coalesced packets */
+	u64 rsc_flush;			/* stats for flushed packets */
 
 	unsigned int size;		/* length in bytes */
 	dma_addr_t dma;			/* phys. address of descriptor ring */
@@ -375,7 +376,8 @@ struct ixgbe_adapter {
 #ifdef IXGBE_FCOE
 	struct ixgbe_fcoe fcoe;
 #endif /* IXGBE_FCOE */
-	u64 rsc_count;
+	u64 rsc_total_count;
+	u64 rsc_total_flush;
 	u32 wol;
 	u16 eeprom_version;
 };
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 74f04e1..84ab4db 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -79,7 +79,8 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
 	{"rx_over_errors", IXGBE_NETDEV_STAT(stats.rx_over_errors)},
 	{"rx_crc_errors", IXGBE_NETDEV_STAT(stats.rx_crc_errors)},
 	{"rx_frame_errors", IXGBE_NETDEV_STAT(stats.rx_frame_errors)},
-	{"hw_rsc_count", IXGBE_STAT(rsc_count)},
+	{"hw_rsc_aggregated", IXGBE_STAT(rsc_total_count)},
+	{"hw_rsc_flushed", IXGBE_STAT(rsc_total_flush)},
 	{"fdir_match", IXGBE_STAT(stats.fdirmatch)},
 	{"fdir_miss", IXGBE_STAT(stats.fdirmiss)},
 	{"rx_fifo_errors", IXGBE_NETDEV_STAT(stats.rx_fifo_errors)},
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index ebcec30..ffd1f16 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -729,12 +729,14 @@ static inline u32 ixgbe_get_rsc_count(union ixgbe_adv_rx_desc *rx_desc)
 /**
  * ixgbe_transform_rsc_queue - change rsc queue into a full packet
  * @skb: pointer to the last skb in the rsc queue
+ * @count: pointer to number of packets coalesced in this context
  *
  * This function changes a queue full of hw rsc buffers into a completed
  * packet.  It uses the ->prev pointers to find the first packet and then
  * turns it into the frag list owner.
  **/
-static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb)
+static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb,
+                                                        u64 *count)
 {
 	unsigned int frag_list_size = 0;
 
@@ -743,6 +745,7 @@ static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb)
 		frag_list_size += skb->len;
 		skb->prev = NULL;
 		skb = prev;
+		*count += 1;
 	}
 
 	skb_shinfo(skb)->frag_list = skb->next;
@@ -845,14 +848,20 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
 			u32 nextp = (staterr & IXGBE_RXDADV_NEXTP_MASK) >>
 				     IXGBE_RXDADV_NEXTP_SHIFT;
 			next_buffer = &rx_ring->rx_buffer_info[nextp];
-			rx_ring->rsc_count += (rsc_count - 1);
 		} else {
 			next_buffer = &rx_ring->rx_buffer_info[i];
 		}
 
 		if (staterr & IXGBE_RXD_STAT_EOP) {
 			if (skb->prev)
-				skb = ixgbe_transform_rsc_queue(skb);
+				skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count));
+			if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
+				if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)
+					rx_ring->rsc_count += skb_shinfo(skb)->nr_frags;
+				else
+					rx_ring->rsc_count++;
+				rx_ring->rsc_flush++;
+			}
 			rx_ring->stats.packets++;
 			rx_ring->stats.bytes += skb->len;
 		} else {
@@ -4474,14 +4483,18 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
 	u64 total_mpc = 0;
 	u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot;
 
-	if (hw->mac.type == ixgbe_mac_82599EB) {
+	if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
 		u64 rsc_count = 0;
+		u64 rsc_flush = 0;
 		for (i = 0; i < 16; i++)
 			adapter->hw_rx_no_dma_resources +=
 			                     IXGBE_READ_REG(hw, IXGBE_QPRDC(i));
-		for (i = 0; i < adapter->num_rx_queues; i++)
+		for (i = 0; i < adapter->num_rx_queues; i++) {
 			rsc_count += adapter->rx_ring[i].rsc_count;
-		adapter->rsc_count = rsc_count;
+			rsc_flush += adapter->rx_ring[i].rsc_flush;
+		}
+		adapter->rsc_total_count = rsc_count;
+		adapter->rsc_total_flush = rsc_flush;
 	}
 
 	adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);


^ permalink raw reply related

* Re: [PATCH 0/7] via-velocity performance fixes
From: Stephen Hemminger @ 2009-11-23 16:27 UTC (permalink / raw)
  To: Simon Kagstrom; +Cc: netdev, davem, davej, romieu
In-Reply-To: <20091123143922.273d13f9@marrow.netinsight.se>

On Mon, 23 Nov 2009 14:39:22 +0100
Simon Kagstrom <simon.kagstrom@netinsight.net> wrote:

> while the VIA driver does
> 
> 	ip_summed = CHECKSUM_NONE;
> 	if (hardware sees that this is an IP packet):
> 		if (hw IP checksum is OK):
> 			if (hw sees that this is a TCP/UDP packet):
> 				if (hw TCP/UDP checksum is NOT OK):
> 					return  # Returning CHECKSUM_NONE
> 				ip_summed = CHECKSUM_UNNECESSARY
> 
> i.e., it will return CHECKSUM_NONE also for non-TCP/UDP IP packets.

That is correct assuming hardware can only checksum TCP/UDP.

-- 

^ permalink raw reply


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