Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] mwl8k: Add 0x2a02 PCI device-id (Marvell 88W8361)
From: Sedat Dilek @ 2012-04-27  9:22 UTC (permalink / raw)
  To: Lennert Buytenhek
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel, stable
In-Reply-To: <20120427091405.GS3157@wantstofly.org>

On Fri, Apr 27, 2012 at 11:14 AM, Lennert Buytenhek
<buytenh@wantstofly.org> wrote:
> On Fri, Apr 27, 2012 at 11:08:31AM +0200, Sedat Dilek wrote:
>
>> User lautriv asked for belkin N-1 WLAN device support on IRC.
>>
>> Further informations from lautriv:
>> * marvell 80W8031, card-id 11ab:2a02
>> * Debian/sid 3.2.x
>>
>> On [1] I found a report by Jim Cromie concerning same PCI device-id:
>>
>> 00:0e.0 Ethernet controller [0200]: Marvell Technology Group Ltd.
>> 88W8361 [TopDog] 802.11n Wireless [11ab:2a02] (rev 03)
>>       Subsystem: Marvell Technology Group Ltd. 88W8361 [TopDog] 802.11n Wireless [11ab:2a02]
>>
>> So, let's add 0x2a02 to PCI device table.
>
> Let's not.  There's no firmware for the 8361 that implements the
> firmware interface currently implemented by the mwl8k driver, so
> this is pretty useless.
>
>
>> [1] http://www.spinics.net/lists/newbies/msg46601.html
>
> From that link:
>
> | I have a card which modprobes, despite a PCI-ID mismatch
> |
> | [...]
> |
> | Given the pci-id mismatch shouldnt this just fail to modprobe ?
>
> No.  That's not a bug -- you are free to load drivers for hardware
> not currently in your system.
>
>
>>  static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
>> +     { PCI_VDEVICE(MARVELL, 0x2a02), .driver_data = MWL8363, },
>>       { PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, },
>
> A 8361 is certainly not a 8363.

Damn, I got confused by all the numbers. More coffee.
Thanks for the clarification. I will inform the user on IRC.
Sorry, for the noise.

Are you planning to or even working on support (for) 8361 devices?

- Sedat -

^ permalink raw reply

* Re: [PATCH] mwl8k: Add 0x2a02 PCI device-id (Marvell 88W8361)
From: Lennert Buytenhek @ 2012-04-27  9:14 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel,
	Sedat Dilek, stable
In-Reply-To: <1335517711-6522-1-git-send-email-sedat.dilek@gmail.com>

On Fri, Apr 27, 2012 at 11:08:31AM +0200, Sedat Dilek wrote:

> User lautriv asked for belkin N-1 WLAN device support on IRC.
> 
> Further informations from lautriv:
> * marvell 80W8031, card-id 11ab:2a02
> * Debian/sid 3.2.x
> 
> On [1] I found a report by Jim Cromie concerning same PCI device-id:
> 
> 00:0e.0 Ethernet controller [0200]: Marvell Technology Group Ltd.
> 88W8361 [TopDog] 802.11n Wireless [11ab:2a02] (rev 03)
> 	Subsystem: Marvell Technology Group Ltd. 88W8361 [TopDog] 802.11n Wireless [11ab:2a02]
> 
> So, let's add 0x2a02 to PCI device table.

Let's not.  There's no firmware for the 8361 that implements the
firmware interface currently implemented by the mwl8k driver, so
this is pretty useless.


> [1] http://www.spinics.net/lists/newbies/msg46601.html

>From that link:

| I have a card which modprobes, despite a PCI-ID mismatch
|
| [...]
|
| Given the pci-id mismatch shouldnt this just fail to modprobe ?

No.  That's not a bug -- you are free to load drivers for hardware
not currently in your system.


>  static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
> +	{ PCI_VDEVICE(MARVELL, 0x2a02), .driver_data = MWL8363, },
>  	{ PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, },

A 8361 is certainly not a 8363.

^ permalink raw reply

* [PATCH] mwl8k: Add 0x2a02 PCI device-id (Marvell 88W8361)
From: Sedat Dilek @ 2012-04-27  9:08 UTC (permalink / raw)
  To: Lennert Buytenhek, John W. Linville,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Sedat Dilek, stable-u79uwXL29TY76Z2rM5mHXA

User lautriv asked for belkin N-1 WLAN device support on IRC.

Further informations from lautriv:
* marvell 80W8031, card-id 11ab:2a02
* Debian/sid 3.2.x

On [1] I found a report by Jim Cromie concerning same PCI device-id:

00:0e.0 Ethernet controller [0200]: Marvell Technology Group Ltd.
88W8361 [TopDog] 802.11n Wireless [11ab:2a02] (rev 03)
	Subsystem: Marvell Technology Group Ltd. 88W8361 [TopDog] 802.11n Wireless [11ab:2a02]

So, let's add 0x2a02 to PCI device table.

[1] http://www.spinics.net/lists/newbies/msg46601.html

Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Sedat Dilek <sedat.dilek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/net/wireless/mwl8k.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index b48674b..16f0a9a 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -5264,6 +5264,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw");
 MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
 
 static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
+	{ PCI_VDEVICE(MARVELL, 0x2a02), .driver_data = MWL8363, },
 	{ PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, },
 	{ PCI_VDEVICE(MARVELL, 0x2a0c), .driver_data = MWL8363, },
 	{ PCI_VDEVICE(MARVELL, 0x2a24), .driver_data = MWL8363, },
-- 
1.7.9.5

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

* Re: [PATCH BUG-FIX] igbvf: fix the bug when initializing the igbvf
From: Jeff Kirsher @ 2012-04-27  9:05 UTC (permalink / raw)
  To: Shan Wei
  Cc: samuelliao, Jesse Brandeburg, bruce.w.allan, carolyn.wyborny,
	donald.c.skidmore, gregory.v.rose, peter.p.waskiewicz.jr,
	alexander.h.duyck, John Ronciak, David Miller, mitch.a.williams,
	jpirko, danny.kukawka, e1000-devel@lists.sourceforge.net, NetDev
In-Reply-To: <4F9A5FBC.1060607@gmail.com>

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

On Fri, 2012-04-27 at 16:58 +0800, Shan Wei wrote:
> 
> From: Samuel Liao <samuelliao@tencent.com>
> 
> 
> Maybe it's a typo, but it cause that igbvf can't be initialized
> successfully.
> Set perm_addr value using valid dev_addr, although which is equal to
> hw.mac.addr.
> 
> 
> Signed-off-by: Samuel Liao <samuelliao@tencent.com>
> Signed-off-by: Shan Wei <davidshan@tencent.com>
> ---
>  drivers/net/ethernet/intel/igbvf/netdev.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-) 

Thanks Samuel, I will add the patch to my queue.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [PATCH BUG-FIX] igbvf: fix the bug when initializing the igbvf
From: Shan Wei @ 2012-04-27  8:58 UTC (permalink / raw)
  To: samuelliao, Jeffrey T Kirsher, Jesse Brandeburg, bruce.w.allan,
	carolyn.wyborny, donald.c.skidmore, gregory.v.rose,
	peter.p.waskiewicz.jr, alexander.h.duyck, John Ronciak,
	David Miller, mitch.a.williams, jpirko, danny.kukawka
  Cc: e1000-devel@lists.sourceforge.net, NetDev

From: Samuel Liao <samuelliao@tencent.com>


Maybe it's a typo, but it cause that igbvf can't be initialized successfully.
Set perm_addr value using valid dev_addr, although which is equal to hw.mac.addr.


Signed-off-by: Samuel Liao <samuelliao@tencent.com>
Signed-off-by: Shan Wei <davidshan@tencent.com>
---
 drivers/net/ethernet/intel/igbvf/netdev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index d61ca2a..8ec74b0 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2731,14 +2731,14 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
 			netdev->addr_len);
 	}
 
-	if (!is_valid_ether_addr(netdev->perm_addr)) {
+	if (!is_valid_ether_addr(netdev->dev_addr)) {
 		dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
 		        netdev->dev_addr);
 		err = -EIO;
 		goto err_hw_init;
 	}
 
-	memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
+	memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
 
 	setup_timer(&adapter->watchdog_timer, &igbvf_watchdog,
 	            (unsigned long) adapter);
-- 
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

* [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

* 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

* 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 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

* [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 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

* 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

* [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: 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

* 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] 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 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: 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] 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] 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] 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

* [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 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

* 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


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