Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] e1000e:  MSI interrupt test failed, using legacy interrupt
From: Ben Hutchings @ 2012-04-27  1:40 UTC (permalink / raw)
  To: prasanna.panchamukhi
  Cc: netdev, bruce.w.allan, jesse.brandeburg, e1000-devel, gospo,
	sassmann
In-Reply-To: <1335485150-2765-1-git-send-email-prasanna.panchamukhi@riverbed.com>

On Thu, 2012-04-26 at 17:05 -0700, prasanna.panchamukhi@riverbed.com
wrote:
> From: Prasanna S. Panchamukhi <ppanchamukhi@riverbed.com>
> 
> Following logs where seen on Systems with multiple NICs & ports,
> while using MSI interrupts as shown below:
[...]
> This patch changes the IRQ tests to use polling loops starting with a
> delay of 1 tick and doubling that if necessary up to a maximum total
> delay of approximately 1 second.
[...]

I don't think you entirely understood my point.  This exponential
back-off was the best I could come up with for a self-test
(ethtool -t) where we have to answer the question 'are interrupts
working' in a reasonable time, and the user can decide for themselves
whether this was a false negative.

If you want a definite answer in order to make an automatic decision
about interrupt modes, there really is no valid time limit.  I think the
proper way to do interrupt mode selection in an in-tree driver is to
rely on no-MSI quirks for chipsets and devices in the PCI core.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply

* [PATCH net-next 1/3] be2net: Ignore status of some ioctls during driver load
From: Ajit Khaparde @ 2012-04-27  1:42 UTC (permalink / raw)
  To: davem; +Cc: netdev


Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index c9f757c..c8f7b3a 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2704,24 +2704,15 @@ static int be_setup(struct be_adapter *adapter)
 
 	be_cmd_get_fw_ver(adapter, adapter->fw_ver, NULL);
 
-	status = be_vid_config(adapter, false, 0);
-	if (status)
-		goto err;
+	be_vid_config(adapter, false, 0);
 
 	be_set_rx_mode(adapter->netdev);
 
-	status = be_cmd_get_flow_control(adapter, &tx_fc, &rx_fc);
-	/* For Lancer: It is legal for this cmd to fail on VF */
-	if (status && (be_physfn(adapter) || !lancer_chip(adapter)))
-		goto err;
+	be_cmd_get_flow_control(adapter, &tx_fc, &rx_fc);
 
-	if (rx_fc != adapter->rx_fc || tx_fc != adapter->tx_fc) {
-		status = be_cmd_set_flow_control(adapter, adapter->tx_fc,
+	if (rx_fc != adapter->rx_fc || tx_fc != adapter->tx_fc)
+		be_cmd_set_flow_control(adapter, adapter->tx_fc,
 					adapter->rx_fc);
-		/* For Lancer: It is legal for this cmd to fail on VF */
-		if (status && (be_physfn(adapter) || !lancer_chip(adapter)))
-			goto err;
-	}
 
 	pcie_set_readrq(adapter->pdev, 4096);
 
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH net-next 0/3] be2net: Patch series
From: Ajit Khaparde @ 2012-04-27  1:42 UTC (permalink / raw)
  To: davem; +Cc: netdev

Series of 3 patches against net-next
Please apply.

Thanks
-Ajit

[1/3] be2net: Ignore status of some ioctls during driver load
[2/3] be2net: fix speed displayed by ethtool on certain SKUs
[3/3] be2net: update the driver version

^ permalink raw reply

* [PATCH net-next 2/3] be2net: fix speed displayed by ethtool on certain SKUs
From: Ajit Khaparde @ 2012-04-27  1:42 UTC (permalink / raw)
  To: davem; +Cc: netdev

logical speed returned by link_status_query needs to be multiplied by 10.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_ethtool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index 0c6f06e..7b06f35 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -557,7 +557,7 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
 			if (!status)
 				be_link_status_update(adapter, link_status);
 			if (link_speed)
-				et_speed = link_speed;
+				et_speed = link_speed * 10;
 			else
 				et_speed = convert_to_et_speed(port_speed);
 		} else {
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH net-next 3/3] be2net: update the driver version
From: Ajit Khaparde @ 2012-04-27  1:42 UTC (permalink / raw)
  To: davem; +Cc: netdev

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 4bc18ef..c3ee910 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -33,7 +33,7 @@
 
 #include "be_hw.h"
 
-#define DRV_VER			"4.2.116u"
+#define DRV_VER			"4.2.220u"
 #define DRV_NAME		"be2net"
 #define BE_NAME			"ServerEngines BladeEngine2 10Gbps NIC"
 #define BE3_NAME		"ServerEngines BladeEngine3 10Gbps NIC"
-- 
1.7.5.4

^ permalink raw reply related

* linux-next: manual merge of the net-next tree with the net tree
From: Stephen Rothwell @ 2012-04-27  2:02 UTC (permalink / raw)
  To: David Miller, netdev; +Cc: linux-next, linux-kernel, Jeff Kirsher, Bruce Allan

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

Hi all,

Today's linux-next merge of the net-next tree got a conflict in
drivers/net/ethernet/intel/e1000e/param.c between commit 727c356f4d79
("e1000e: Fix default interrupt throttle rate not set in NIC HW") from
the net tree and commit 6ad651456e3c ("e1000e: cleanup remaining strings
split across multiple lines") from the net-next tree.

The former included the change from the latter, so I used that.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

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

^ permalink raw reply

* Re: [PATCH 2/2] ss: implement -M option to get all memory information
From: Shan Wei @ 2012-04-27  2:04 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: xemul, NetDev
In-Reply-To: <20120425104128.4d6e13e1@nehalam.linuxnetplumber.net>

Stephen Hemminger said, at 2012/4/26 1:41:

>>  "   -m, --memory        show socket memory usage\n"
>> +"   -M, --skmem         show socket memory information.\n"
>> +"                       this option which will replace -m, is valid since Linux 3.3.\n"
> 
> Please don't add reference to kernel version.
> Why does this need to be a new option? Maybe just do the right thing
> if present in the netlink response?


Actually, I'm ok for your suggestion that using a existing option(-m) to
export all memory information. But with a new option is better for us.

Maybe some people use latest iproute source with under kernel 3.3.0, some don't.
-m option will take different user experience, specially for UDP socket.
Currently -m option has no effect on UDP socket which i will submit another patch
to export memory information for. new option, fresh experience.

(Exporting out memory information will help us to analysis dropped packets 
which recorded in RcvbufErrors and SndbufErrors.)
 

 

^ permalink raw reply

* [PATCH net-next] net: doc: merge /proc/sys/net/core/* documents into one place
From: Shan Wei @ 2012-04-27  2:52 UTC (permalink / raw)
  To: David Miller; +Cc: NetDev

From: Shan Wei <davidshan@tencent.com>

All parameter descriptions in /proc/sys/net/core/* now is separated
two places. So, merge them into Documentation/sysctl/net.txt.


Signed-off-by: Shan Wei <davidshan@tencent.com>
---
 Documentation/networking/ip-sysctl.txt |    5 +----
 Documentation/sysctl/net.txt           |    7 +++++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index bd80ba5..9b569a2 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1484,11 +1484,8 @@ addr_scope_policy - INTEGER
 
 
 /proc/sys/net/core/*
-dev_weight - INTEGER
-	The maximum number of packets that kernel can handle on a NAPI
-	interrupt, it's a Per-CPU variable.
+	Please see: Documentation/sysctl/net.txt for descriptions of these entries.
 
-	Default: 64
 
 /proc/sys/net/unix/*
 max_dgram_qlen - INTEGER
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt
index 3201a70..98335b7 100644
--- a/Documentation/sysctl/net.txt
+++ b/Documentation/sysctl/net.txt
@@ -43,6 +43,13 @@ Values :
 	1 - enable the JIT
 	2 - enable the JIT and ask the compiler to emit traces on kernel log.
 
+dev_weight
+--------------
+
+The maximum number of packets that kernel can handle on a NAPI interrupt,
+it's a Per-CPU variable.
+Default: 64
+
 rmem_default
 ------------
 
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH] isdn/eicon: use standard __init,__exit function markup
From: David Miller @ 2012-04-27  4:04 UTC (permalink / raw)
  To: hartleys; +Cc: linux-kernel, netdev, mac, isdn
In-Reply-To: <201204241556.03516.hartleys@visionengravers.com>

From: H Hartley Sweeten <hartleys@visionengravers.com>
Date: Tue, 24 Apr 2012 15:56:03 -0700

> Remove the custom DIVA_{INIT,EXIT}_FUNCTION defines and use
> the standard __init,__exit markup.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Applied.

^ permalink raw reply

* Re: [PATCH] crush: include header for global symbols
From: David Miller @ 2012-04-27  4:04 UTC (permalink / raw)
  To: hartleys; +Cc: linux-kernel, netdev, ceph-devel, sage
In-Reply-To: <201204241738.38280.hartleys@visionengravers.com>

From: H Hartley Sweeten <hartleys@visionengravers.com>
Date: Tue, 24 Apr 2012 17:38:37 -0700

> Include the header to pickup the definitions of the global symbols.
> 
> Quiets the following sparse warnings:
> 
> warning: symbol 'crush_find_rule' was not declared. Should it be static?
> warning: symbol 'crush_do_rule' was not declared. Should it be static?
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 0/3] qlcnic: Bug fixes
From: David Miller @ 2012-04-27  4:04 UTC (permalink / raw)
  To: anirban.chakraborty; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1335472292-24335-4-git-send-email-anirban.chakraborty@qlogic.com>

From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Date: Thu, 26 Apr 2012 13:31:32 -0700

> Please apply to net-next.

All applied.

^ permalink raw reply

* Re: [PATCH] NET: smsc-ircc2: mark non-experimental
From: David Miller @ 2012-04-27  4:04 UTC (permalink / raw)
  To: linus.walleij; +Cc: netdev, linus.walleij
In-Reply-To: <1335477067-26994-1-git-send-email-linus.walleij@stericsson.com>

From: Linus Walleij <linus.walleij@stericsson.com>
Date: Thu, 26 Apr 2012 23:51:07 +0200

> From: Linus Walleij <linus.walleij@linaro.org>
> 
> This has been used by me and others for ages, let's stop calling it
> experimental.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 0/3] be2net: Patch series
From: David Miller @ 2012-04-27  4:04 UTC (permalink / raw)
  To: ajit.khaparde; +Cc: netdev
In-Reply-To: <20120427014223.GA698@akhaparde-VBox>

From: Ajit Khaparde <ajit.khaparde@Emulex.Com>
Date: Thu, 26 Apr 2012 20:42:23 -0500

> Series of 3 patches against net-next
> Please apply.

All applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] ipv6: RTAX_FEATURE_ALLFRAG causes inefficient TCP segment sizing
From: David Miller @ 2012-04-27  4:03 UTC (permalink / raw)
  To: eric.dumazet; +Cc: tore, netdev, maze, therbert
In-Reply-To: <1335289058.5205.165.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 24 Apr 2012 19:37:38 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> Quoting Tore Anderson from :
> https://bugzilla.kernel.org/show_bug.cgi?id=42572
> 
> When RTAX_FEATURE_ALLFRAG is set on a route, the effective TCP segment
> size does not take into account the size of the IPv6 Fragmentation
> header that needs to be included in outbound packets, causing every
> transmitted TCP segment to be fragmented across two IPv6 packets, the
> latter of which will only contain 8 bytes of actual payload.
> 
> RTAX_FEATURE_ALLFRAG is typically set on a route in response to
> receving a ICMPv6 Packet Too Big message indicating a Path MTU of less
> than 1280 bytes. 1280 bytes is the minimum IPv6 MTU, however ICMPv6
> PTBs with MTU < 1280 are still valid, in particular when an IPv6
> packet is sent to an IPv4 destination through a stateless translator.
> Any ICMPv4 Need To Fragment packets originated from the IPv4 part of
> the path will be translated to ICMPv6 PTB which may then indicate an
> MTU of less than 1280.
> 
> The Linux kernel refuses to reduce the effective MTU to anything below
> 1280 bytes, instead it sets it to exactly 1280 bytes, and
> RTAX_FEATURE_ALLFRAG is also set. However, the TCP segment size appears
> to be set to 1240 bytes (1280 Path MTU - 40 bytes of IPv6 header),
> instead of 1232 (additionally taking into account the 8 bytes required
> by the IPv6 Fragmentation extension header).
> 
> This in turn results in rather inefficient transmission, as every 
> transmitted TCP segment now is split in two fragments containing
> 1232+8 bytes of payload.
> 
> After this patch, all the outgoing packets that includes a
> Fragmentation header all are "atomic" or "non-fragmented" fragments,
> i.e., they both have Offset=0 and More Fragments=0.
> 
> With help from David S. Miller
> 
> Reported-by: Tore Anderson <tore@fud.no>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Maciej Żenczykowski <maze@google.com>
> Cc: Tom Herbert <therbert@google.com>
> Tested-by: Tore Anderson <tore@fud.no>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] bonding: bond_update_speed_duplex() can return void since no callers check its return
From: David Miller @ 2012-04-27  4:04 UTC (permalink / raw)
  To: rick.jones2, raj; +Cc: netdev, fubar
In-Reply-To: <20120426212030.269072900341@tardy>

From: raj@tardy.cup.hp.com (Rick Jones)
Date: Thu, 26 Apr 2012 14:20:30 -0700 (PDT)

> From: Rick Jones <rick.jones2@hp.com>
> 
> As none of the callers of bond_update_speed_duplex (need to) check its
> return value, there is little point in it returning anything.
> 
> Signed-off-by: Rick Jones <rick.jones2@hp.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: doc: merge /proc/sys/net/core/* documents into one place
From: David Miller @ 2012-04-27  4:07 UTC (permalink / raw)
  To: shanwei88; +Cc: netdev
In-Reply-To: <4F9A0A04.7090703@gmail.com>

From: Shan Wei <shanwei88@gmail.com>
Date: Fri, 27 Apr 2012 10:52:52 +0800

> From: Shan Wei <davidshan@tencent.com>
> 
> All parameter descriptions in /proc/sys/net/core/* now is separated
> two places. So, merge them into Documentation/sysctl/net.txt.
> 
> Signed-off-by: Shan Wei <davidshan@tencent.com>

I'll apply this, thanks.

^ permalink raw reply

* [PATCH net-next] net: cleanups in sock_setsockopt()
From: Eric Dumazet @ 2012-04-27  5:41 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

Use min()/max() macros, reformat two comments, use !!test_bit() to
match !!sock_flag()

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/core/sock.c |   42 +++++++++++++++---------------------------
 1 file changed, 15 insertions(+), 27 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 0431aaf..a6dc4a8 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -577,23 +577,15 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
 		break;
 	case SO_SNDBUF:
 		/* Don't error on this BSD doesn't and if you think
-		   about it this is right. Otherwise apps have to
-		   play 'guess the biggest size' games. RCVBUF/SNDBUF
-		   are treated in BSD as hints */
-
-		if (val > sysctl_wmem_max)
-			val = sysctl_wmem_max;
+		 * about it this is right. Otherwise apps have to
+		 * play 'guess the biggest size' games. RCVBUF/SNDBUF
+		 * are treated in BSD as hints
+		 */
+		val = min(val, sysctl_wmem_max);
 set_sndbuf:
 		sk->sk_userlocks |= SOCK_SNDBUF_LOCK;
-		if ((val * 2) < SOCK_MIN_SNDBUF)
-			sk->sk_sndbuf = SOCK_MIN_SNDBUF;
-		else
-			sk->sk_sndbuf = val * 2;
-
-		/*
-		 *	Wake up sending tasks if we
-		 *	upped the value.
-		 */
+		sk->sk_sndbuf = max(val * 2, SOCK_MIN_SNDBUF);
+		/* Wake up sending tasks if we upped the value. */
 		sk->sk_write_space(sk);
 		break;
 
@@ -606,12 +598,11 @@ set_sndbuf:
 
 	case SO_RCVBUF:
 		/* Don't error on this BSD doesn't and if you think
-		   about it this is right. Otherwise apps have to
-		   play 'guess the biggest size' games. RCVBUF/SNDBUF
-		   are treated in BSD as hints */
-
-		if (val > sysctl_rmem_max)
-			val = sysctl_rmem_max;
+		 * about it this is right. Otherwise apps have to
+		 * play 'guess the biggest size' games. RCVBUF/SNDBUF
+		 * are treated in BSD as hints
+		 */
+		val = min(val, sysctl_rmem_max);
 set_rcvbuf:
 		sk->sk_userlocks |= SOCK_RCVBUF_LOCK;
 		/*
@@ -629,10 +620,7 @@ set_rcvbuf:
 		 * returning the value we actually used in getsockopt
 		 * is the most desirable behavior.
 		 */
-		if ((val * 2) < SOCK_MIN_RCVBUF)
-			sk->sk_rcvbuf = SOCK_MIN_RCVBUF;
-		else
-			sk->sk_rcvbuf = val * 2;
+		sk->sk_rcvbuf = max(val * 2, SOCK_MIN_RCVBUF);
 		break;
 
 	case SO_RCVBUFFORCE:
@@ -975,7 +963,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 		break;
 
 	case SO_PASSCRED:
-		v.val = test_bit(SOCK_PASSCRED, &sock->flags) ? 1 : 0;
+		v.val = !!test_bit(SOCK_PASSCRED, &sock->flags);
 		break;
 
 	case SO_PEERCRED:
@@ -1010,7 +998,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 		break;
 
 	case SO_PASSSEC:
-		v.val = test_bit(SOCK_PASSSEC, &sock->flags) ? 1 : 0;
+		v.val = !!test_bit(SOCK_PASSSEC, &sock->flags);
 		break;
 
 	case SO_PEERSEC:

^ permalink raw reply related

* Re: [PATCH net-next] net: cleanups in sock_setsockopt()
From: David Miller @ 2012-04-27  5:48 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1335505319.2775.72.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 27 Apr 2012 07:41:59 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> Use min()/max() macros, reformat two comments, use !!test_bit() to
> match !!sock_flag()
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Introduces warnings:

net/core/sock.c: In function ‘sock_setsockopt’:
net/core/sock.c:584:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
net/core/sock.c:605:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
net/core/sock.c:623:19: warning: comparison of distinct pointer types lacks a cast [enabled by default]

and that makes sense since int is signed and __u32 is not.

Your compiler didn't spit that out too?

^ permalink raw reply

* Re: [PATCH net-next] net: cleanups in sock_setsockopt()
From: Eric Dumazet @ 2012-04-27  6:02 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20120427.014848.764959411706970704.davem@davemloft.net>

On Fri, 2012-04-27 at 01:48 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Fri, 27 Apr 2012 07:41:59 +0200
> 
> > From: Eric Dumazet <edumazet@google.com>
> > 
> > Use min()/max() macros, reformat two comments, use !!test_bit() to
> > match !!sock_flag()
> > 
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> 
> Introduces warnings:
> 
> net/core/sock.c: In function ‘sock_setsockopt’:
> net/core/sock.c:584:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> net/core/sock.c:605:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> net/core/sock.c:623:19: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> 
> and that makes sense since int is signed and __u32 is not.
> 
> Your compiler didn't spit that out too?

Hmm... I wonder how I missed these...

I'll fix this, thanks

^ permalink raw reply

* [PATCH v2 net-next] net: cleanups in sock_setsockopt()
From: Eric Dumazet @ 2012-04-27  6:07 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

Use min_t()/max_t() macros, reformat two comments, use !!test_bit() to
match !!sock_flag()

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/core/sock.c |   42 +++++++++++++++---------------------------
 1 file changed, 15 insertions(+), 27 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 0431aaf..10605d2 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -577,23 +577,15 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
 		break;
 	case SO_SNDBUF:
 		/* Don't error on this BSD doesn't and if you think
-		   about it this is right. Otherwise apps have to
-		   play 'guess the biggest size' games. RCVBUF/SNDBUF
-		   are treated in BSD as hints */
-
-		if (val > sysctl_wmem_max)
-			val = sysctl_wmem_max;
+		 * about it this is right. Otherwise apps have to
+		 * play 'guess the biggest size' games. RCVBUF/SNDBUF
+		 * are treated in BSD as hints
+		 */
+		val = min_t(u32, val, sysctl_wmem_max);
 set_sndbuf:
 		sk->sk_userlocks |= SOCK_SNDBUF_LOCK;
-		if ((val * 2) < SOCK_MIN_SNDBUF)
-			sk->sk_sndbuf = SOCK_MIN_SNDBUF;
-		else
-			sk->sk_sndbuf = val * 2;
-
-		/*
-		 *	Wake up sending tasks if we
-		 *	upped the value.
-		 */
+		sk->sk_sndbuf = max_t(u32, val * 2, SOCK_MIN_SNDBUF);
+		/* Wake up sending tasks if we upped the value. */
 		sk->sk_write_space(sk);
 		break;
 
@@ -606,12 +598,11 @@ set_sndbuf:
 
 	case SO_RCVBUF:
 		/* Don't error on this BSD doesn't and if you think
-		   about it this is right. Otherwise apps have to
-		   play 'guess the biggest size' games. RCVBUF/SNDBUF
-		   are treated in BSD as hints */
-
-		if (val > sysctl_rmem_max)
-			val = sysctl_rmem_max;
+		 * about it this is right. Otherwise apps have to
+		 * play 'guess the biggest size' games. RCVBUF/SNDBUF
+		 * are treated in BSD as hints
+		 */
+		val = min_t(u32, val, sysctl_rmem_max);
 set_rcvbuf:
 		sk->sk_userlocks |= SOCK_RCVBUF_LOCK;
 		/*
@@ -629,10 +620,7 @@ set_rcvbuf:
 		 * returning the value we actually used in getsockopt
 		 * is the most desirable behavior.
 		 */
-		if ((val * 2) < SOCK_MIN_RCVBUF)
-			sk->sk_rcvbuf = SOCK_MIN_RCVBUF;
-		else
-			sk->sk_rcvbuf = val * 2;
+		sk->sk_rcvbuf = max_t(u32, val * 2, SOCK_MIN_RCVBUF);
 		break;
 
 	case SO_RCVBUFFORCE:
@@ -975,7 +963,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 		break;
 
 	case SO_PASSCRED:
-		v.val = test_bit(SOCK_PASSCRED, &sock->flags) ? 1 : 0;
+		v.val = !!test_bit(SOCK_PASSCRED, &sock->flags);
 		break;
 
 	case SO_PEERCRED:
@@ -1010,7 +998,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 		break;
 
 	case SO_PASSSEC:
-		v.val = test_bit(SOCK_PASSSEC, &sock->flags) ? 1 : 0;
+		v.val = !!test_bit(SOCK_PASSSEC, &sock->flags);
 		break;
 
 	case SO_PEERSEC:

^ permalink raw reply related

* Re: [PATCH v2 net-next] net: cleanups in sock_setsockopt()
From: David Miller @ 2012-04-27  6:14 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1335506879.2775.77.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 27 Apr 2012 08:07:59 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> Use min_t()/max_t() macros, reformat two comments, use !!test_bit() to
> match !!sock_flag()
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Much better, applied.

^ permalink raw reply

* RE: [PATCH net-next 3/5] be2net: Fix to apply duplex value as unknown when link is down.
From: Somnath.Kotur @ 2012-04-27  6:42 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev
In-Reply-To: <1335461076.2712.20.camel@bwh-desktop.uk.solarflarecom.com>

 > I don't see any problem with reporting full-duplex all the time if you don't
> support any half-duplex link modes.  But we don't yet have consistency
> between drivers in speed/duplex reporting while the link is down, so I won't
> insist that that is the right thing to do.
> 
> However you should use DUPLEX_UNKNOWN rather than -1.
> 
> Ben.

Yes, Agreed. Thank you for your review/suggestion.

Will make the change and re-post.

-Som.

> --
> Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer;
> that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* RE: [PATCH net-next 2/5] be2net: Fix to allow setting of debug levels in the firmware.
From: Somnath.Kotur @ 2012-04-27  6:46 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev
In-Reply-To: <1335461388.2712.25.camel@bwh-desktop.uk.solarflarecom.com>

> > This operation is intended for controlling logging by the driver, and the flags
> are defined in <linux/netdevice.h>.  (Not exported to userland yet, but
> ethtool knows their names.)
> 
> If your firmware supports some kind of logging then it may be reasonable to
> have this control both driver and firmware, but not *just* the firmware.
Thanks for your comments Ben.

Currently the driver logs only a very few critical errors/warnings; so we felt it might be an overkill to 
define driver log levels.
On the other hand, the F/W has extensive logging and tracing facility and the ethtool 'msglevel' option seemed 
like a reasonable method for controlling the logging level.

> 
> You should also implement the get_msglevel operation at the same time.

Yes you are correct. We will implement the get_msglevel and re-post the patch.
> 
> Ben.
> 

Thanks
Som

^ permalink raw reply

* [PATCH net-next 1/2] drivers/net/oki-semi: Remove the definition of PCH_GBE_ETH_ALEN
From: roy.qing.li @ 2012-04-27  7:01 UTC (permalink / raw)
  To: netdev

From: RongQing.Li <roy.qing.li@gmail.com>

PCH_GBE_ETH_ALEN is equal to ETH_ALEN, so we can replace it with
ETH_ALEN.

If they are not equal, it must be a bug, since this is ethernet,
and the address has been already stored to mc_addr_list as ETH_ALEN
bytes when call pch_gbe_mac_mc_addr_list_update.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
---
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 89c6bcf..835e3bb 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -79,7 +79,6 @@ const char pch_driver_version[] = DRV_VERSION;
 #define	PCH_GBE_PAUSE_PKT4_VALUE    0x01000888
 #define	PCH_GBE_PAUSE_PKT5_VALUE    0x0000FFFF
 
-#define PCH_GBE_ETH_ALEN            6
 
 /* This defines the bits that are set in the Interrupt Mask
  * Set/Read Register.  Each bit is documented below:
@@ -519,7 +518,7 @@ static void pch_gbe_mac_mc_addr_list_update(struct pch_gbe_hw *hw,
 		if (mc_addr_count) {
 			pch_gbe_mac_mar_set(hw, mc_addr_list, i);
 			mc_addr_count--;
-			mc_addr_list += PCH_GBE_ETH_ALEN;
+			mc_addr_list += ETH_ALEN;
 		} else {
 			/* Clear MAC address mask */
 			adrmask = ioread32(&hw->reg->ADDR_MASK);
-- 
1.7.1

^ permalink raw reply related

* [PATCH net-next 2/2] drivers/net/oki-semi: Donot recompute IP header checksum
From: roy.qing.li @ 2012-04-27  7:01 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1335510073-14018-1-git-send-email-roy.qing.li@gmail.com>

From: RongQing.Li <roy.qing.li@gmail.com>

If I understand correct, NETIF_F_IP_CSUM only means the hardware 
will compute the TCP/UDP checksum, IP checksum is always computed 
in software

So as a workround of hardware unable to compute small packages 
checksum, do not need to compute IP header checksum.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
---
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 835e3bb..107f41a 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1240,8 +1240,6 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
 		if (skb->protocol == htons(ETH_P_IP)) {
 			struct iphdr *iph = ip_hdr(skb);
 			unsigned int offset;
-			iph->check = 0;
-			iph->check = ip_fast_csum((u8 *) iph, iph->ihl);
 			offset = skb_transport_offset(skb);
 			if (iph->protocol == IPPROTO_TCP) {
 				skb->csum = 0;
-- 
1.7.1

^ permalink raw reply related


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