Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 2/3] net: tulip: use DEFINE_PCI_DEVICE_TABLE
From: Grant Grundler @ 2013-10-22  3:37 UTC (permalink / raw)
  To: Jingoo Han
  Cc: David S. Miller, open list:TULIP NETWORK DRI..., Grant Grundler
In-Reply-To: <000f01ceced2$dde772b0$99b65810$%han@samsung.com>

On Mon, Oct 21, 2013 at 8:00 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> This macro is used to create a struct pci_device_id array.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

LGTM.

Acked-by: Grant Grundler <grundler@parisc-linux.org>

> ---
>  drivers/net/ethernet/dec/tulip/de4x5.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
> index 263b92c..c05b66d 100644
> --- a/drivers/net/ethernet/dec/tulip/de4x5.c
> +++ b/drivers/net/ethernet/dec/tulip/de4x5.c
> @@ -2328,7 +2328,7 @@ static void de4x5_pci_remove(struct pci_dev *pdev)
>         pci_disable_device (pdev);
>  }
>
> -static struct pci_device_id de4x5_pci_tbl[] = {
> +static DEFINE_PCI_DEVICE_TABLE(de4x5_pci_tbl) = {
>          { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP,
>            PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
>          { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_PLUS,
> --
> 1.7.10.4
>
>

^ permalink raw reply

* [PATCH] igb: Add EEPROM IO stubs for iNVM
From: Marek Vasut @ 2013-10-22  3:22 UTC (permalink / raw)
  To: netdev
  Cc: e1000-devel, Marek Vasut, Carolyn Wyborny, Aaron Brown,
	Jeff Kirsher, David S. Miller

Add stub functions for EEPROM operations in case where the i210 is
used without external EEPROM. The EEPROM operations must not be set
to NULL, since otherwise we will get a backtrace when attempting the
command below. Once such place to trigger this is from igb_ethtool.c
igb_set_eeprom(), where hw->nvm.ops.write() is called without first
checking if .write() is valid . By grepping through the code, there
are more such occasions which assume .write() to be always valid.
Thus, instead of poluting the code with checks, add stubs. I believe
it'd be prefferable to possibly even implement those functions, but
my knowledge of the adapter is still limited and as far as I understand,
the iNVM is programmable only once.

Command:

$ ethtool -E eth0 magic 0x157b8086 offset 6 value 0x1b

Backtrace:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = be7ac000
[00000000] *pgd=4e6a6831, *pte=00000000, *ppte=00000000
Internal error: Oops: 80000007 [#1] SMP ARM
CPU: 2 PID: 59 Comm: ethtool Not tainted 3.12.0-rc6+ #8
task: bf8f3600 ti: be73c000 task.ti: be73c000
PC is at 0x0
LR is at igb_set_eeprom+0x27c/0x3b4
pc : [<00000000>]    lr : [<803bc780>]    psr: 20000013
sp : be73dd80  ip : 00000000  fp : be73ddf4
r10: 00000001  r9 : 00000003  r8 : be6d6000
r7 : bfa64a38  r6 : be6d7000  r5 : bfa64000  r4 : be73de20
r3 : be6d6000  r2 : 00000001  r1 : 00000003  r0 : bfa64a38
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 4e7ac04a  DAC: 00000015
Process ethtool (pid: 59, stack limit = 0xbe73c240)
Stack: (0xbe73dd80 to 0xbe73e000)
dd80: 803c7e2c 803c8554 00000000 00000000 00000000 803c827c 00000004 00000000
dda0: 00000000 00000000 00010800 00080008 00000008 be73ddc0 800d1a34 8054db6c
ddc0: be6d6000 00000003 00ad97c8 00000001 be73c000 bfa64000 be6d7000 80584d58
dde0: be73de20 00ad97d8 be73de7c be73ddf8 80465e00 803bc510 be73de14 be6d7000
de00: e4114bb3 00000000 be73de6c 0000000c 8055048c 80076b5c 00000002 00000000
de20: 0000000c 157b8086 00000006 00000001 8094cac0 be73c000 00000000 00000000
de40: be73de7c 00008946 8094cac0 7e8cfcf4 be73de98 00008946 8094cac0 7e8cfcf4
de60: be73de98 be73c000 00000000 00000000 be73dee4 be73de80 80474f54 804656ac
de80: 000000a8 00000200 be73dec4 be73de98 80077c7c 80076b5c 30687465 00000000
dea0: 00000000 00000000 00ad97c8 00000000 00000000 00000000 be73c000 00008946
dec0: fffffdfd 7e8cfcf4 7e8cfcf4 7e8cfcf4 bf18c020 00000000 be73df04 be73dee8
dee0: 80449c18 80474ac8 80449b94 00008946 be6b0600 00000003 be73df74 be73df08
df00: 800e6d10 80449ba0 be6b0600 00030002 be6b5f40 be6b5f40 be73df3c be73df28
df20: 80554b2c 802b03e8 be6b5f6c be6b5f00 be73df5c be73c000 8000ea44 be73c000
df40: 8000eab0 bf8f3600 00000001 00008946 00000003 00000000 7e8cfcf4 be6b0600
df60: be73c000 00000000 be73dfa4 be73df78 800e72ac 800e6c98 be73df94 00000000
df80: 80076b64 0002bd0c 00000000 0002bcc8 00000036 8000ebe4 00000000 be73dfa8
dfa0: 8000ea20 800e7278 0002bd0c 00000000 00000003 00008946 7e8cfcf4 7e8cfcf4
dfc0: 0002bd0c 00000000 0002bcc8 00000036 00000000 00000000 00000000 7e8cfb84
dfe0: 7e8cfe65 7e8cfb78 0001201c 0004535c 20000010 00000003 00000000 00000000
Backtrace:
[<803bc504>] (igb_set_eeprom+0x0/0x3b4) from [<80465e00>] (dev_ethtool+0x760/0x1f68)
[<804656a0>] (dev_ethtool+0x0/0x1f68) from [<80474f54>] (dev_ioctl+0x498/0x86c)
[<80474abc>] (dev_ioctl+0x0/0x86c) from [<80449c18>] (sock_ioctl+0x84/0x258)
[<80449b94>] (sock_ioctl+0x0/0x258) from [<800e6d10>] (do_vfs_ioctl+0x84/0x5e0)
 r6:00000003 r5:be6b0600 r4:00008946 r3:80449b94
[<800e6c8c>] (do_vfs_ioctl+0x0/0x5e0) from [<800e72ac>] (SyS_ioctl+0x40/0x68)
[<800e726c>] (SyS_ioctl+0x0/0x68) from [<8000ea20>] (ret_fast_syscall+0x0/0x48)
 r8:8000ebe4 r7:00000036 r6:0002bcc8 r5:00000000 r4:0002bd0c
Code: bad PC value
---[ end trace 59379e9bf8fc8437 ]---

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
Cc: Aaron Brown <aaron.f.brown@intel.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: David S. Miller <davem@davemloft.net>
---
 drivers/net/ethernet/intel/igb/e1000_i210.c | 46 +++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e1000_i210.c
index 0c03933..e4492fd 100644
--- a/drivers/net/ethernet/intel/igb/e1000_i210.c
+++ b/drivers/net/ethernet/intel/igb/e1000_i210.c
@@ -455,6 +455,46 @@ static s32 igb_read_invm_i210(struct e1000_hw *hw, u16 offset,
 }
 
 /**
+ *  igb_write_invm_i210 - Write invm stub function for I210/I211
+ *  @hw: pointer to the HW structure
+ *  @offset: offset within the iNVM to be written to
+ *  @words: number of words to write
+ *  @data: 16 bit word(s) to be written to the iNVM
+ *
+ *  This is just a stub for unimplemented function.
+ **/
+static s32 igb_write_invm_i210(struct e1000_hw *hw, u16 offset, u16 words,
+			       u16 *data)
+{
+	/* Unimplemented. */
+	return E1000_ERR_NVM;
+}
+
+/**
+ *  igb_validate_invm_checksum_i210 - Validate EEPROM checksum
+ *  @hw: pointer to the HW structure
+ *
+ *  This is just a stub for unimplemented function.
+ **/
+s32 igb_validate_invm_checksum_i210(struct e1000_hw *hw)
+{
+	/* Unimplemented. */
+	return E1000_ERR_NVM;
+}
+
+/**
+ *  igb_update_invm_checksum_i210 - Update EEPROM checksum
+ *  @hw: pointer to the HW structure
+ *
+ *  This is just a stub for unimplemented function.
+ **/
+s32 igb_update_invm_checksum_i210(struct e1000_hw *hw)
+{
+	/* Unimplemented. */
+	return E1000_ERR_NVM;
+}
+
+/**
  *  igb_read_invm_version - Reads iNVM version and image type
  *  @hw: pointer to the HW structure
  *  @invm_ver: version structure for the version read
@@ -829,9 +869,9 @@ s32 igb_init_nvm_params_i210(struct e1000_hw *hw)
 	} else {
 		hw->nvm.type = e1000_nvm_invm;
 		nvm->ops.read     = igb_read_invm_i210;
-		nvm->ops.write    = NULL;
-		nvm->ops.validate = NULL;
-		nvm->ops.update   = NULL;
+		nvm->ops.write    = igb_write_invm_i210;
+		nvm->ops.validate = igb_validate_invm_checksum_i210;
+		nvm->ops.update   = igb_update_invm_checksum_i210;
 	}
 	return ret_val;
 }
-- 
1.8.4.rc3

^ permalink raw reply related

* [PATCH V2] staging: r8188eu: Set device type to wlan
From: Larry Finger @ 2013-10-22  3:15 UTC (permalink / raw)
  To: gregkh; +Cc: netdev, devel, Larry Finger, Stable

The latest version of NetworkManager does not recognize the device as wireless
without this change.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>a [3.12+]
---
 drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index da9f0d5..17659bb 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -707,6 +707,10 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
 	return 0;
 }
 
+static const struct device_type wlan_type = {
+	.name = "wlan",
+};
+
 struct net_device *rtw_init_netdev(struct adapter *old_padapter)
 {
 	struct adapter *padapter;
@@ -722,6 +726,7 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
 	if (!pnetdev)
 		return NULL;
 
+	pnetdev->dev.type = &wlan_type;
 	padapter = rtw_netdev_priv(pnetdev);
 	padapter->pnetdev = pnetdev;
 	DBG_88E("register rtw_netdev_ops to netdev_ops\n");
-- 
1.8.4

^ permalink raw reply related

* Re: [PATCH] Revert "bridge: only expire the mdb entry when query is received"
From: Cong Wang @ 2013-10-22  3:02 UTC (permalink / raw)
  To: Linus Lüssing
  Cc: Stephen Hemminger, Linux Kernel Network Developers, bridge,
	David S. Miller, LKML
In-Reply-To: <1382223537-10844-1-git-send-email-linus.luessing@web.de>

On Sat, Oct 19, 2013 at 3:58 PM, Linus Lüssing <linus.luessing@web.de> wrote:
> While this commit was a good attempt to fix issues occuring when no
> multicast querier is present, this commit still has two more issues:
>
> 1) There are cases where mdb entries do not expire even if there is a
> querier present. The bridge will unnecessarily continue flooding
> multicast packets on the according ports.
>
> 2) Never removing an mdb entry could be exploited for a Denial of
> Service by an attacker on the local link, slowly, but steadily eating up
> all memory.
>

I raised the first issue too when I sent the patch, but Herbert said
it is not a problem. So, I will leave this to Herbert to decide.

For me, your patch makes sense.

Thanks.

^ permalink raw reply

* [PATCH 3/3] net: ksz884x: use DEFINE_PCI_DEVICE_TABLE
From: Jingoo Han @ 2013-10-22  3:01 UTC (permalink / raw)
  To: 'David S. Miller'
  Cc: netdev, 'Lennert Buytenhek', 'Jingoo Han'
In-Reply-To: <000e01ceced2$a9e5d970$fdb18c50$%han@samsung.com>

This macro is used to create a struct pci_device_id array.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/net/ethernet/micrel/ksz884x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index 6462dc5..ddd252a 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -7225,7 +7225,7 @@ static int pcidev_suspend(struct pci_dev *pdev, pm_message_t state)
 
 static char pcidev_name[] = "ksz884xp";
 
-static struct pci_device_id pcidev_table[] = {
+static DEFINE_PCI_DEVICE_TABLE(pcidev_table) = {
 	{ PCI_VENDOR_ID_MICREL_KS, 0x8841,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
 	{ PCI_VENDOR_ID_MICREL_KS, 0x8842,
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 2/3] net: tulip: use DEFINE_PCI_DEVICE_TABLE
From: Jingoo Han @ 2013-10-22  3:00 UTC (permalink / raw)
  To: 'David S. Miller'
  Cc: netdev, 'Grant Grundler', 'Jingoo Han'
In-Reply-To: <000e01ceced2$a9e5d970$fdb18c50$%han@samsung.com>

This macro is used to create a struct pci_device_id array.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/net/ethernet/dec/tulip/de4x5.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
index 263b92c..c05b66d 100644
--- a/drivers/net/ethernet/dec/tulip/de4x5.c
+++ b/drivers/net/ethernet/dec/tulip/de4x5.c
@@ -2328,7 +2328,7 @@ static void de4x5_pci_remove(struct pci_dev *pdev)
 	pci_disable_device (pdev);
 }
 
-static struct pci_device_id de4x5_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(de4x5_pci_tbl) = {
         { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP,
           PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
         { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_PLUS,
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 1/3] net: cxgb4vf: use DEFINE_PCI_DEVICE_TABLE
From: Jingoo Han @ 2013-10-22  2:59 UTC (permalink / raw)
  To: 'David S. Miller'
  Cc: netdev, 'Casey Leedom', 'Jingoo Han'

This macro is used to create a struct pci_device_id array.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 43bb012..5f90ec5 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2905,7 +2905,7 @@ static void cxgb4vf_pci_shutdown(struct pci_dev *pdev)
 #define CH_DEVICE(devid, idx) \
 	{ PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, PCI_ANY_ID, 0, 0, idx }
 
-static struct pci_device_id cxgb4vf_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(cxgb4vf_pci_tbl) = {
 	CH_DEVICE(0xb000, 0),	/* PE10K FPGA */
 	CH_DEVICE(0x4800, 0),	/* T440-dbg */
 	CH_DEVICE(0x4801, 0),	/* T420-cr */
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH] packet: Deliver VLAN TPID to userspace
From: Atzm Watanabe @ 2013-10-22  2:56 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Stephen Hemminger, netdev
In-Reply-To: <1382347494.25689.8.camel@deadeye.wl.decadent.org.uk>

At Mon, 21 Oct 2013 10:24:54 +0100,
Ben Hutchings wrote:
> 
> On Sat, 2013-10-19 at 15:19 +0900, Atzm Watanabe wrote:
> > At Fri, 18 Oct 2013 10:56:55 -0700,
> > Stephen Hemminger wrote:
> > > 
> > > On Sat, 19 Oct 2013 02:08:11 +0900
> > > Atzm Watanabe <atzm@stratosphere.co.jp> wrote:
> > > 
> > > > diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
> > > > index dbf0666..6e36e0a 100644
> > > > --- a/include/uapi/linux/if_packet.h
> > > > +++ b/include/uapi/linux/if_packet.h
> > > > @@ -83,7 +83,7 @@ struct tpacket_auxdata {
> > > >  	__u16		tp_mac;
> > > >  	__u16		tp_net;
> > > >  	__u16		tp_vlan_tci;
> > > > -	__u16		tp_padding;
> > > > +	__u16		tp_vlan_tpid;
> > > >  };
> > > >  
> > > >  /* Rx ring - header status */
> > > > @@ -132,12 +132,13 @@ struct tpacket2_hdr {
> > > >  	__u32		tp_sec;
> > > >  	__u32		tp_nsec;
> > > >  	__u16		tp_vlan_tci;
> > > > -	__u16		tp_padding;
> > > > +	__u16		tp_vlan_tpid;
> > > >  };
> > > >  
> > > >  struct tpacket_hdr_variant1 {
> > > >  	__u32	tp_rxhash;
> > > >  	__u32	tp_vlan_tci;
> > > > +	__u32	tp_vlan_tpid;
> > > >  };
> > > 
> > > The last change will break ABI to userspace applications.
> > > You can reuse padding elements; but you can't increase (or shrink)
> > > an existing structure.
> > 
> > Thank you for pointing.
> > But I have two questions:
> > 
> >   - The patch that increases existing structures was posted and
> >     accepted in the past (e.g 393e52e33c6c26ec7db290dab803bac1bed962d4
> >     "packet: deliver VLAN TCI to userspace").
> >     What is the difference between them and my patch?
> 
> struct tpacket_auxdata is allowed to grow as it will be written/read
> using the cmsg API where the length of each structure is explicit at
> run-time.
> 
> >   - I tested using tools/testing/selftests/net/psock_tpacket.c built
> >     before applying my patch, and all test cases were passed.
> >     Also I tested by the code that was listed in
> >     Documentation/networking/packet_mmap.txt "AF_PACKET TPACKET_V3
> >     example".  It seems that problem was not caused.
> >     What situation causes the problem that you assumed?
> 
> Yes, it looks like it would be safe to grow struct tpacket3_hdr too, as
> the length is also explicit at run-time.

Thank you for the reply.  That's same as my thought!
I'll repost the patch with such additional comments.


> (And TPACKET{1,2,3}_HDRLEN should be removed from
> include/uapi/linux/if_packet.h, as they are not relevant to userland.)

Hmm...  I think TPACKET{,2,3}_HDRLEN should not be removed without
careful considerations.  Because some userspace programs (e.g libpcap)
are using them in order to check mmap ability of the kernel...


Thanks again!

^ permalink raw reply

* Re: [PATCH] davinci_emac.c: Fix IFF_ALLMULTI setup
From: Prabhakar Lad @ 2013-10-22  2:34 UTC (permalink / raw)
  To: Mariusz Ceier
  Cc: David S. Miller, Mugunthan V N, Jingoo Han, Jiri Pirko, netdev,
	LKML
In-Reply-To: <1382377504-24688-1-git-send-email-mceier+kernel@gmail.com>

Hi Mariusz,

On Mon, Oct 21, 2013 at 11:15 PM, Mariusz Ceier <mceier+kernel@gmail.com> wrote:
> When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't,
> emac_dev_mcast_set should only enable RX of multicasts and reset
> MACHASH registers.
>
> It does this, but afterwards it either sets up multicast MACs
> filtering or disables RX of multicasts and resets MACHASH registers
> again, rendering IFF_ALLMULTI flag useless.
>
> This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and
> disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.
>
> Tested with kernel 2.6.37.
>
It would have been better if you would have tested this on the latest kernel.
Anyway David has pulled this patch in his tree.

Regards,
--Prabhakar Lad

^ permalink raw reply

* Re: [PATCH net-next 0/5] bonding: patchset for rcu use in bonding
From: Ding Tianhong @ 2013-10-22  2:16 UTC (permalink / raw)
  To: Veaceslav Falico
  Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller,
	Nikolay Aleksandrov, Netdev
In-Reply-To: <20131021132136.GE692@redhat.com>

On 2013/10/21 21:21, Veaceslav Falico wrote:
> On Mon, Oct 21, 2013 at 02:41:44PM +0200, Veaceslav Falico wrote:
>> On Mon, Oct 21, 2013 at 08:32:11PM +0800, Ding Tianhong wrote:
>>> On 2013/10/21 17:35, Veaceslav Falico wrote:
>>>> On Mon, Oct 21, 2013 at 05:27:51PM +0800, Ding Tianhong wrote:
>>>>> On 2013/10/21 17:13, Veaceslav Falico wrote:
>>>>>> On Mon, Oct 21, 2013 at 04:58:36PM +0800, Ding Tianhong wrote:
>>>>>>> Hi:
>>>>>>>
>>>>>>> The Patch Set will remove the invalid lock for bond work queue and replace it
>>>>>>> with rtnl lock, as read lock for bond could not protect slave list any more.
>>>>>>
>>>>>> rtnl lock is a lot more expensive than bond lock, and not only for bond,
>>>>>> but for all the networking stack.
>>>>>>
>>>>>> Why is the bond->lock invalid? It correctly protects slaves from being
>>>>>> modified concurrently.
>>>>>>
>>>>>> I don't see the point in this patchset.
>>>>>>
>>>>>
>>>>> yes, rtnl lock is a big lock, but I think bond->lock could not protect
>>>>> bond_for_each_slave any more, am I miss something?
>>>>
>>>> Why can't it protect bond_for_each_slave()?
>>>>
>>>
>>> bond_master_upper_dev_link() and bond_upper_dev_unlink() was only in rtnl lock,
>>> bond_for_each_slave may changed while loop in bond read lock, but it sees that
>>> nothing serious will happen yet.
>>> Maybe I miss something.
>>
>> Even if it is unsafe to use bond_for_each_slave() while holding bond->lock
>> - it means that we must protect the list by locking the
>> bond_upper_dev_(un)link() via bond->lock, but not by removing bond->lock
>> from everywhere where it is now. And I'm not that sure if it's safe or not.
> 
> I've quickly looked over the code - yes, theoretically we could race
> between bond_for_each_slave() that is not rtnl-protected and
> bond_upper_dev_(un)link().
> 
> Your patchset, also, doesn't 'replace' bond->lock with rtnl_lock(), cause
> everywhere the rtnl_lock() is already present, it just moves it around,
> while removing the bond->lock.
> 
> The commit message is wrong and says actually nothing why is it done, how
> is it done, why it's safe to do so and what do we get in the end. For every
> patch, and the cover letter is also not an exception.
> 

It is my fault, too lazy to describe the detail for the patch and occurs so many
missmatch, I'll fix it later.

> I'd suggest you either:
> 
> 1) add bond->lock around bond_upper_dev_(un)link() (GFP_ATOMIC might be needed).
> 

bond_upper_dev_(un)link() will call call_netdevice_notifiers(), it is not safe to call it
in read lock, call_netdevice_notifiers() may sleep or schedule, and sometimes
call_netdevice_notifiers() will read bond lock again.

> or
> 
> 2) add ASSERT_RTNL() to bond_for_each_slave() macro, catch all the offenders
> and remove the bond->lock from them. Also, I'm not that sure that it's safe
> to do so - cause one of the slaves (not the slave list) might change, and
> we might have race conditions there.
> 

yes, it is not a good idea, as your meaning, it is a big cost, but monitor is a slow path,
I think the cost is acceptable,whatever we should find a better way.

> or
> 
> 3) move bond_for_each_slave() to bond_for_each_slave_rcu() where appropriate.
> 
> And in any case write specific commit messages - bonding's code is really
> old and full of locks that were placed for some reason (and the reason
> might have gone away long ago, too), so it's really hard to say if the
> change is safe or not.

above all, the 3) is the wise idea, rtnl or rcu, every one is enough for 
bond_for_each_slave().
> 
> I'd personally go for either 3) (preferred), or 1).
> 
> Sorry, I'm a bit tired of going in-depth on your patches. Start either
> doing patches with commit messages that *prove* me that you're right (I'll,
> obviously, verify it - but at least I'll know what you're doing, and won't
> have to figure it out from code), or I'll start explicitly NAKing them.
> 
> Sorry again, but I don't really have time for that. I didn't have time to
> review your last patchset (RCUifying the remaining transmit path), and now
> I can understand nothing from their commit description, except that you've
> changed bond_for_each_slave() to bond_for_each_slave_rcu() and bond->lock
> to rcu_read_lock(). I'm not saying that they're wrong, just that they're
> really hard to understand.
> 
> So, please, start writing commit messages.
> 


>>
>>>
>>> Ding
>>>
>>>
>>>>>
>>>>> Ding
>>>>>
>>>>>>>
>>>>>>> Ding Tianhong (5):
>>>>>>> bonding: remove bond read lock for bond_mii_monitor()
>>>>>>> bonding: remove bond read lock for bond_alb_monitor()
>>>>>>> bonding: remove bond read lock for bond_loadbalance_arp_mon()
>>>>>>> bonding: remove bond read lock for bond_activebackup_arp_mon()
>>>>>>> bonding: remove bond read lock for bond_3ad_state_machine_handler()
>>>>>>>
>>>>>>> drivers/net/bonding/bond_3ad.c  |   9 ++--
>>>>>>> drivers/net/bonding/bond_alb.c  |  20 ++------
>>>>>>> drivers/net/bonding/bond_main.c | 100 +++++++++++++---------------------------
>>>>>>> 3 files changed, 40 insertions(+), 89 deletions(-)
>>>>>>>
>>>>>>> -- 
>>>>>>> 1.8.2.1
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> .
>>>>
>>>
>>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> .
> 

^ permalink raw reply

* [PATCH 1/1] [PATCH] ax88179_178a: Add VID:DID for Samsung USB Ethernet Adapter
From: freddy @ 2013-10-22  2:12 UTC (permalink / raw)
  To: davem, linux-usb, linux-kernel, netdev, allan, louis; +Cc: Freddy Xin

From: Freddy Xin <freddy@asix.com.tw>

Add VID:DID for Samsung USB Ethernet Adapter.

Signed-off-by: Freddy Xin <freddy@asix.com.tw>
---
 drivers/net/usb/ax88179_178a.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index 3569293..3d166ae 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1406,6 +1406,19 @@ static const struct driver_info sitecom_info = {
 	.tx_fixup = ax88179_tx_fixup,
 };
 
+static const struct driver_info samsung_info = {
+	.description = "Samsung USB Ethernet Adapter",
+	.bind = ax88179_bind,
+	.unbind = ax88179_unbind,
+	.status = ax88179_status,
+	.link_reset = ax88179_link_reset,
+	.reset = ax88179_reset,
+	.stop = ax88179_stop,
+	.flags = FLAG_ETHER | FLAG_FRAMING_AX,
+	.rx_fixup = ax88179_rx_fixup,
+	.tx_fixup = ax88179_tx_fixup,
+};
+
 static const struct usb_device_id products[] = {
 {
 	/* ASIX AX88179 10/100/1000 */
@@ -1418,7 +1431,11 @@ static const struct usb_device_id products[] = {
 }, {
 	/* Sitecom USB 3.0 to Gigabit Adapter */
 	USB_DEVICE(0x0df6, 0x0072),
-	.driver_info = (unsigned long) &sitecom_info,
+	.driver_info = (unsigned long)&sitecom_info,
+}, {
+	/* Samsung USB Ethernet Adapter */
+	USB_DEVICE(0x04e8, 0xa100),
+	.driver_info = (unsigned long)&samsung_info,
 },
 	{ },
 };
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 1/1] [PATCH resubmit] ax88179_178a: Correct the RX error definition in RX header
From: freddy @ 2013-10-22  1:47 UTC (permalink / raw)
  To: davem, linux-usb, linux-kernel, netdev, allan, louis; +Cc: Freddy Xin

From: Freddy Xin <freddy@asix.com.tw>

Correct the definition of AX_RXHDR_CRC_ERR and
AX_RXHDR_DROP_ERR. They are BIT29 and BIT31 in pkt_hdr
seperately.

Signed-off-by: Freddy Xin <freddy@asix.com.tw>
---
 drivers/net/usb/ax88179_178a.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index 3569293..3bcd0d9 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -36,8 +36,8 @@
 #define AX_RXHDR_L4_TYPE_TCP			16
 #define AX_RXHDR_L3CSUM_ERR			2
 #define AX_RXHDR_L4CSUM_ERR			1
-#define AX_RXHDR_CRC_ERR			((u32)BIT(31))
-#define AX_RXHDR_DROP_ERR			((u32)BIT(30))
+#define AX_RXHDR_CRC_ERR			((u32)BIT(29))
+#define AX_RXHDR_DROP_ERR			((u32)BIT(31))
 #define AX_ACCESS_MAC				0x01
 #define AX_ACCESS_PHY				0x02
 #define AX_ACCESS_EEPROM			0x04
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH 1/2] fq_codel: keep dropped statistic around
From: Dave Taht @ 2013-10-22  1:43 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, codel
In-Reply-To: <CAL4Wiio0YThCbT8j92HVn1CmmdvKD=GT30ZtMf=ZvmAj+ZM7Yg@mail.gmail.com>

On Mon, Oct 21, 2013 at 06:27:11PM -0700, Eric Dumazet wrote:
> On Oct 21, 2013 6:20 PM, "Dave Taht" <dave.taht@bufferbloat.net> wrote:
> >
> > Having more accurate dropped information in this qdisc is useful.
> >
> > Signed-off-by: Dave Taht <dave.taht@bufferbloat.net>
> > ---
> >  net/sched/sch_fq_codel.c |    1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
> > index 5578628..437bc95 100644
> > --- a/net/sched/sch_fq_codel.c
> > +++ b/net/sched/sch_fq_codel.c
> > @@ -193,7 +193,6 @@ static int fq_codel_enqueue(struct sk_buff *skb,
> struct Qdisc *sch)
> >                 list_add_tail(&flow->flowchain, &q->new_flows);
> >                 q->new_flow_count++;
> >                 flow->deficit = q->quantum;
> > -               flow->dropped = 0;
> >         }
> >         if (++sch->q.qlen <= sch->limit)
> >                 return NET_XMIT_SUCCESS;
> > --
> > 1.7.9.5
> I am travelling to Edinburgh, so will be short.

Wish I could have made it.

> Since fqcodel recycles a slot, we need to clear this counter. 

I prefer to think of it as a per "slot dropped counter" and to
have it retain the total number of drops in that slot since
qdisc initialization.

> We do no know
> if slot is reused by previous flow or a new flow hashing to same bucket.

There could also in this case be several flows hashing to the same bucket
and dropping packets. 

In most cases with the current zero-ing of "drop", polling "tc -s class" 
yields an unrevealing drop statistic of "0" for many workloads against
multiple streams at lower bandwidths.

with it not getting zeroed, as per this patch, clear patterns show over 
many seconds as queues empty, get filled by bursts, and get drops. 

This patch has been in openwrt and cerowrt since feburary.

^ permalink raw reply

* Re: [PATCH 1/2] fq_codel: keep dropped statistic around
From: Eric Dumazet @ 2013-10-22  1:27 UTC (permalink / raw)
  To: Dave Taht; +Cc: netdev, codel
In-Reply-To: <1382404797-17239-2-git-send-email-dave.taht@bufferbloat.net>


[-- Attachment #1.1: Type: text/plain, Size: 1031 bytes --]

On Oct 21, 2013 6:20 PM, "Dave Taht" <dave.taht@bufferbloat.net> wrote:
>
> Having more accurate dropped information in this qdisc is useful.
>
> Signed-off-by: Dave Taht <dave.taht@bufferbloat.net>
> ---
>  net/sched/sch_fq_codel.c |    1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
> index 5578628..437bc95 100644
> --- a/net/sched/sch_fq_codel.c
> +++ b/net/sched/sch_fq_codel.c
> @@ -193,7 +193,6 @@ static int fq_codel_enqueue(struct sk_buff *skb,
struct Qdisc *sch)
>                 list_add_tail(&flow->flowchain, &q->new_flows);
>                 q->new_flow_count++;
>                 flow->deficit = q->quantum;
> -               flow->dropped = 0;
>         }
>         if (++sch->q.qlen <= sch->limit)
>                 return NET_XMIT_SUCCESS;
> --
> 1.7.9.5
I am travelling to Edinburgh, so will be short.

Since fqcodel recycles a slot, we need to clear this counter. We do no know
if slot is reused by previous flow or a new flow hashing to same bucket.

[-- Attachment #1.2: Type: text/html, Size: 1411 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Codel mailing list
Codel@lists.bufferbloat.net
https://lists.bufferbloat.net/listinfo/codel

^ permalink raw reply

* [PATCH 2/2] codel: eliminate maxpacket as an inner bound
From: Dave Taht @ 2013-10-22  1:19 UTC (permalink / raw)
  To: netdev, codel; +Cc: Dave Taht
In-Reply-To: <1382404797-17239-1-git-send-email-dave.taht@bufferbloat.net>

As there is always at least one packet in the device driver or
rate limiter, the maxpacket bound (an artifact of the ns2 code)
is unneeded.

Also: in the case of TSO/GSO/GRO, it can scale well above
(to 64k) what codel's designers intended.

Someday the maxpacket variable could be eliminated entirely,
but for now it is a useful indicator of "oops, I didn't turn
off tso/gso/gro somewhere".

Signed-off-by: Dave Taht <dave.taht@bufferbloat.net>
---
 include/net/codel.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/codel.h b/include/net/codel.h
index 389cf62..319a296 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -225,7 +225,7 @@ static bool codel_should_drop(const struct sk_buff *skb,
 		stats->maxpacket = qdisc_pkt_len(skb);
 
 	if (codel_time_before(vars->ldelay, params->target) ||
-	    sch->qstats.backlog <= stats->maxpacket) {
+	    sch->qstats.backlog <= 0) {
 		/* went below - stay below for at least interval */
 		vars->first_above_time = 0;
 		return false;
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 1/2] fq_codel: keep dropped statistic around
From: Dave Taht @ 2013-10-22  1:19 UTC (permalink / raw)
  To: netdev, codel; +Cc: Dave Taht
In-Reply-To: <1382404797-17239-1-git-send-email-dave.taht@bufferbloat.net>

Having more accurate dropped information in this qdisc is useful.

Signed-off-by: Dave Taht <dave.taht@bufferbloat.net>
---
 net/sched/sch_fq_codel.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 5578628..437bc95 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -193,7 +193,6 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		list_add_tail(&flow->flowchain, &q->new_flows);
 		q->new_flow_count++;
 		flow->deficit = q->quantum;
-		flow->dropped = 0;
 	}
 	if (++sch->q.qlen <= sch->limit)
 		return NET_XMIT_SUCCESS;
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 0/2] net-next codel enhancements
From: Dave Taht @ 2013-10-22  1:19 UTC (permalink / raw)
  To: netdev, codel

These two patches have been extensively tested in openwrt
and cerowrt. Losing the fq_codel drop statistic as a bug.

Checking for a maxpacket size in the qdisc was somewhat 
correct for ns2 but not for Linux as all the current 
subsystems below htb/hfsc/adsl/bql buffer packets.

IMHO both of these patches are candidates for stable. 

^ permalink raw reply

* BUG: scheduling while atomic dev_set_promiscuity->__dev_notify_flags
From: Alexei Starovoitov @ 2013-10-22  1:04 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: netdev

Hi Nicolas,

after commit 991fb3f74c "dev: always advertise rx_flags changes via netlink"
I'm seeing 'sleeping in atomic' bug.

Steps to reproduce:
ip tuntap add dev tap1 mode tap
ifconfig tap1 up
tcpdump -nei tap1
and in different terminal:
ip tuntap del dev tap1 mode tap

[  271.627994] device tap1 left promiscuous mode
[  271.639897] BUG: sleeping function called from invalid context at
mm/slub.c:940
[  271.664491] in_atomic(): 1, irqs_disabled(): 0, pid: 3394, name: ip
[  271.677525] INFO: lockdep is turned off.
[  271.690503] CPU: 0 PID: 3394 Comm: ip Tainted: G        W    3.12.0-rc3+ #73
[  271.703996] Hardware name: System manufacturer System Product
Name/P8Z77 WS, BIOS 3007 07/26/2012
[  271.731254]  ffffffff81a58506 ffff8807f0d57a58 ffffffff817544e5
ffff88082fa0f428
[  271.760261]  ffff8808071f5f40 ffff8807f0d57a88 ffffffff8108bad1
ffffffff81110ff8
[  271.790683]  0000000000000010 00000000000000d0 00000000000000d0
ffff8807f0d57af8
[  271.822332] Call Trace:
[  271.838234]  [<ffffffff817544e5>] dump_stack+0x55/0x76
[  271.854446]  [<ffffffff8108bad1>] __might_sleep+0x181/0x240
[  271.870836]  [<ffffffff81110ff8>] ? rcu_irq_exit+0x68/0xb0
[  271.887076]  [<ffffffff811a80be>] kmem_cache_alloc_node+0x4e/0x2a0
[  271.903368]  [<ffffffff810b4ddc>] ? vprintk_emit+0x1dc/0x5a0
[  271.919716]  [<ffffffff81614d67>] ? __alloc_skb+0x57/0x2a0
[  271.936088]  [<ffffffff810b4de0>] ? vprintk_emit+0x1e0/0x5a0
[  271.952504]  [<ffffffff81614d67>] __alloc_skb+0x57/0x2a0
[  271.968902]  [<ffffffff8163a0b2>] rtmsg_ifinfo+0x52/0x100
[  271.985302]  [<ffffffff8162ac6d>] __dev_notify_flags+0xad/0xc0
[  272.001642]  [<ffffffff8162ad0c>] __dev_set_promiscuity+0x8c/0x1c0
[  272.017917]  [<ffffffff81731ea5>] ? packet_notifier+0x5/0x380
[  272.033961]  [<ffffffff8162b109>] dev_set_promiscuity+0x29/0x50
[  272.049855]  [<ffffffff8172e937>] packet_dev_mc+0x87/0xc0
[  272.065494]  [<ffffffff81732052>] packet_notifier+0x1b2/0x380
[  272.080915]  [<ffffffff81731ea5>] ? packet_notifier+0x5/0x380
[  272.096009]  [<ffffffff81761c66>] notifier_call_chain+0x66/0x150
[  272.110803]  [<ffffffff8108503e>] __raw_notifier_call_chain+0xe/0x10
[  272.125468]  [<ffffffff81085056>] raw_notifier_call_chain+0x16/0x20
[  272.139984]  [<ffffffff81620190>] call_netdevice_notifiers_info+0x40/0x70
[  272.154523]  [<ffffffff816201d6>] call_netdevice_notifiers+0x16/0x20
[  272.168552]  [<ffffffff816224c5>] rollback_registered_many+0x145/0x240
[  272.182263]  [<ffffffff81622641>] rollback_registered+0x31/0x40
[  272.195369]  [<ffffffff816229c8>] unregister_netdevice_queue+0x58/0x90
[  272.208230]  [<ffffffff81547ca0>] __tun_detach+0x140/0x340
[  272.220686]  [<ffffffff81547ed6>] tun_chr_close+0x36/0x60

packet_notifier() does rcu_read_lock() before calling into packet_dev_mc() .

Not sure how to fix it cleanly, other than disabling a notify here.
Any suggestion?

Thanks
Alexei

^ permalink raw reply

* [PATCH] 3c59x: fix incorrect use of spin_lock_bh in interrupts
From: Mikulas Patocka @ 2013-10-21 23:53 UTC (permalink / raw)
  To: Steffen Klassert, David S. Miller; +Cc: netdev

The functions mdio_read and mdio_write may be called from interrupt
context. Consequently, we must use spin_lock_irqsave instead of
spin_lock_bh.

This patch should be backported to stable kernels.

This patch fixes the following warning.

eth0: Host error, FIFO diagnostic register 8000.
eth0: PCI bus error, bus status 80000020
------------[ cut here ]------------
WARNING: at kernel/softirq.c:159 local_bh_enable+0x68/0x90()
Hardware name: Latitude C600
Modules linked in: ipv6 freq_table speedstep_lib parport_pc parport 8250
serial_core apm 8139too bitrev crc32 snd_maestro3 snd_ac97_codec ac97_bus
snd_pcm_oss snd_mixer_oss snd_pcm uhci_hcd microcode
snd_timer snd_page_alloc rtc_cmos ide_cd_mod intel_agp pcspkr usbcore
psmouse snd cdrom intel_gtt soundcore i2c_piix4 3c59x agpgart mii
yenta_socket i2c_core pcmcia_core pcmcia_rsrc usb_common unix
Pid: 1134, comm: ifconfig Tainted: G        W    3.4.66 #2
Call Trace:
[<c101ff38>] ? warn_slowpath_common+0x78/0xb0
[<c1024f58>] ? local_bh_enable+0x68/0x90
[<c1024f58>] ? local_bh_enable+0x68/0x90
[<c101ff89>] ? warn_slowpath_null+0x19/0x20
[<c1024f58>] ? local_bh_enable+0x68/0x90
[<d895a1eb>] ? mdio_read+0x11b/0x160 [3c59x]
[<d895a9d6>] ? vortex_up+0x166/0x6c0 [3c59x]
[<d89590f5>] ? issue_and_wait+0x35/0xd0 [3c59x]
[<d895b2ca>] ? vortex_down+0xda/0x170 [3c59x]
[<d895b72e>] ? vortex_error+0x39e/0x3d0 [3c59x]
[<c1183097>] ? serio_interrupt+0x47/0xa0
[<d895c481>] ? boomerang_interrupt+0x241/0x340 [3c59x]
[<c105db7d>] ? handle_irq_event_percpu+0x2d/0x140
[<c105fd20>] ? cond_unmask_irq+0x40/0x40
[<c105dcc6>] ? handle_irq_event+0x36/0x60
[<c105fd73>] ? handle_level_irq+0x53/0xa0
<IRQ>  [<c1003a8a>] ? do_IRQ+0x3a/0xa0
[<c1210929>] ? common_interrupt+0x29/0x30
[<c105007b>] ? futex_lock_pi.isra.22+0x23b/0x300
[<c105eb26>] ? __setup_irq+0x1d6/0x410
[<d895c240>] ? rx_oom_timer+0x50/0x50 [3c59x]
[<c105ee12>] ? request_threaded_irq+0xb2/0x150
[<d895afc9>] ? vortex_open+0x39/0x1f0 [3c59x]
[<c11a8ec3>] ? __dev_open+0x83/0xe0
[<c11a9139>] ? __dev_change_flags+0x89/0x170
[<c11a78df>] ? dev_get_by_name_rcu+0x4f/0x70
[<c11a92bb>] ? dev_change_flags+0x1b/0x60
[<c11f301e>] ? devinet_ioctl+0x55e/0x6f0
[<c11a9acf>] ? dev_ioctl+0x35f/0x5a0
[<c11944b4>] ? sock_ioctl+0x54/0x260
[<c1087443>] ? handle_mm_fault+0x123/0x180
[<c1194460>] ? sock_fasync+0x90/0x90
[<c10b00c1>] ? do_vfs_ioctl+0x81/0x5e0
[<c10197f1>] ? do_page_fault+0x161/0x420
[<c109e5b7>] ? fd_install+0x47/0x80
[<c10add76>] ? user_path_at+0x16/0x20
[<c109f0ae>] ? sys_faccessat+0x11e/0x1c0
[<c10b064e>] ? sys_ioctl+0x2e/0x60
[<c1210410>] ? sysenter_do_call+0x12/0x26
---[ end trace 5d85da266ec9ff9b ]---

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 drivers/net/ethernet/3com/3c59x.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux-3.4.66/drivers/net/ethernet/3com/3c59x.c
===================================================================
--- linux-3.4.66.orig/drivers/net/ethernet/3com/3c59x.c	2013-10-22 01:34:44.000000000 +0200
+++ linux-3.4.66/drivers/net/ethernet/3com/3c59x.c	2013-10-22 01:35:37.000000000 +0200
@@ -3126,8 +3126,9 @@ static int mdio_read(struct net_device *
 	struct vortex_private *vp = netdev_priv(dev);
 	int read_cmd = (0xf6 << 10) | (phy_id << 5) | location;
 	unsigned int retval = 0;
+	unsigned long flags;
 
-	spin_lock_bh(&vp->mii_lock);
+	spin_lock_irqsave(&vp->mii_lock, flags);
 
 	if (mii_preamble_required)
 		mdio_sync(vp, 32);
@@ -3153,7 +3154,7 @@ static int mdio_read(struct net_device *
 		mdio_delay(vp);
 	}
 
-	spin_unlock_bh(&vp->mii_lock);
+	spin_unlock_irqrestore(&vp->mii_lock, flags);
 
 	return retval & 0x20000 ? 0xffff : retval>>1 & 0xffff;
 }
@@ -3163,8 +3164,9 @@ static void mdio_write(struct net_device
 	struct vortex_private *vp = netdev_priv(dev);
 	int write_cmd = 0x50020000 | (phy_id << 23) | (location << 18) | value;
 	int i;
+	unsigned long flags;
 
-	spin_lock_bh(&vp->mii_lock);
+	spin_lock_irqsave(&vp->mii_lock, flags);
 
 	if (mii_preamble_required)
 		mdio_sync(vp, 32);
@@ -3187,7 +3189,7 @@ static void mdio_write(struct net_device
 		mdio_delay(vp);
 	}
 
-	spin_unlock_bh(&vp->mii_lock);
+	spin_unlock_irqrestore(&vp->mii_lock, flags);
 }
 
 /* ACPI: Advanced Configuration and Power Interface. */

^ permalink raw reply

* Re: [BUG] 3.12.0-rcX IPv6 panic
From: Bob Tracy @ 2013-10-21 23:40 UTC (permalink / raw)
  To: linux-kernel, netdev
In-Reply-To: <20131021155252.GA24158@order.stressinduktion.org>

On Mon, Oct 21, 2013 at 05:52:52PM +0200, Hannes Frederic Sowa wrote:
> On Mon, Oct 21, 2013 at 08:18:46AM -0500, Bob Tracy wrote:
> > Actually, a regression: the 3.11 kernel is rock-solid stable on my
> > Alpha.
> > 
> > Beginning with 3.12.0-rc1, I can reliably trigger a kernel panic by
> > executing the gogo6.net "gw6c" IPv6 client program.  If the networking
> > layer is active, an "Oops" will eventually (within a day) occur regardless
> > of whether I attempt to run "gw6c".  3.12.0-rcX is stable as long as I
> > leave networking completely disabled.  The error has persisted up through
> > -rc6.  Apologies for not mentioning this earlier, but the state of my
> > PWS-433au has been questionable, and I wanted to make sure I had a
> > legitimate bug sighting.
> > 
> > I'll have to transcribe the panic backtrace by hand: nothing makes it
> > into any of the system logs :-(.  I *can* recall that every backtrace
> > I've seen thus far has included one of the skb_copy() variants near the
> > top of the list (first or second function).
> 
> Try to capture the panic via serial console. Otherwise a picture
> would give us a first hint. Please watch out for lines like
> skb_(over|under)_panic.

I'll get a screen capture of some kind for you within the next day or
so.

> gw6c is a tunnel client? Can you post ip -6 tunnel ls?

Assuming you meant "show [NAME]" (no "ls" option for the tunnel object),
that yields the following with "gw6c" running on a 3.11.0 kernel:

smirkin:~# ip -6 tunnel show sit1
sit1: any/ipv6 remote 4056:5874:: local 4500:0:0:4000:4029:: encaplimit 0 hoplimit 0 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)

I'm running the gw6c client in gateway mode: the Alpha is my IPv6
gateway/firewall.

--Bob

^ permalink raw reply

* [PATCH] ixgbe: Reduce memory consumption with larger page sizes
From: Anton Blanchard @ 2013-10-21 23:37 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: netdev, benh


The ixgbe driver allocates pages for its receive rings. It currently
uses 512 pages, regardless of page size. During receive handling it
adds the unused part of the page back into the rx ring, avoiding the
need for a new allocation.

On a ppc64 box with 64 threads and 64kB pages, we end up with
512 entries * 64 rx queues * 64kB = 2GB memory used. Even more of a
concern is that we use up 2GB of IOMMU space in order to map all this
memory.

The driver makes a number of decisions based on if PAGE_SIZE is less
than 8kB, so use this as the breakpoint and only allocate 128 entries
on 8kB or larger page sizes.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Jeff: The breakpoint and the ring size I chose was pretty arbitrary,
feel free to adjust as you see fit. Our main concern is we get that 2GB
consumption down to something more reasonable :)

Index: b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
===================================================================
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -67,7 +67,11 @@
 #define IXGBE_MAX_TXD			   4096
 #define IXGBE_MIN_TXD			     64
 
+#if (PAGE_SIZE < 8192)
 #define IXGBE_DEFAULT_RXD		    512
+#else
+#define IXGBE_DEFAULT_RXD		    128
+#endif
 #define IXGBE_MAX_RXD			   4096
 #define IXGBE_MIN_RXD			     64
 

^ permalink raw reply

* Re: [PATCH net 1/2] sit: allow to use rtnl ops on fb tunnel
From: Willem de Bruijn @ 2013-10-21 23:30 UTC (permalink / raw)
  To: nicolas.dichtel
  Cc: David Miller, netdev, steffen.klassert, pshelar, gregkh, stable
In-Reply-To: <524BC816.1000702@6wind.com>

On Wed, Oct 2, 2013 at 3:15 AM, Nicolas Dichtel
<nicolas.dichtel@6wind.com> wrote:
> Le 01/10/2013 18:59, David Miller a écrit :
>
>> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>> Date: Tue,  1 Oct 2013 18:04:59 +0200
>>
>>> rtnl ops where introduced by ba3e3f50a0e5 ("sit: advertise tunnel param
>>> via
>>> rtnl"), but I forget to assign rtnl ops to fb tunnels.
>>>
>>> Now that it is done, we must remove the explicit call to
>>> unregister_netdevice_queue(), because  the fallback tunnel is added to
>>> the queue
>>> in sit_destroy_tunnels() when checking rtnl_link_ops of all netdevices
>>> (this
>>> is valid since commit 5e6700b3bf98 ("sit: add support of x-netns")).
>>>
>>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>>
>>
>> Applied and queued up for -stable.
>>
>> But I imagine since the x-netns changes aren't in various -stable
>> branches this will need to be adjusted a bit?
>
> Yes, it's what I've tried to say in the commit log ;-)
>
> In fact, before the x-netns changes, we must keep the
> unregister_netdevice_queue() line.

In 3.11 linux-stable, this patch was merged between 3.11.4 and 3.11.5
in commit 3783100, after the x-netns changes in commit 5e6700b3bf, but
the unregister_netdevice_queue was kept.

I think that caused the following bug. In 3.11.6, a simple `modprobe
sit && rmmod sit` hits the BUG at net/core/dev.c:5039:

  BUG_ON(dev->reg_state != NETREG_REGISTERED);

The device is actually NETREG_RELEASED at one point because the device
is now unregistered twice. The issue goes away by porting the
remainder of the original commit: the one liner that removes the call
to unregister_netdevice_queue.

+++ b/net/ipv6/sit.c
@@ -1708,7 +1708,6 @@ static void __net_exit sit_exit_net(struct net *net)

        sit_destroy_tunnels(sitn, &list);
-       unregister_netdevice_queue(sitn->fb_tunnel_dev, &list);
        unregister_netdevice_many(&list);

If correct, let me know if I should send a proper one-line patch
against 3.11.y. Since I haven't looked at this code before, I found it
safer to report the issue first.

5e6700b3bf was not applied to 3.10 stable, so that branch is not affected.

^ permalink raw reply

* Re: [PATCH net] tcp: initialize passive-side sk_pacing_rate after 3WHS
From: David Miller @ 2013-10-21 22:58 UTC (permalink / raw)
  To: eric.dumazet; +Cc: ncardwell, netdev, edumazet, ycheng
In-Reply-To: <1382387794.3284.87.camel@edumazet-glaptop.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 21 Oct 2013 13:36:34 -0700

> On Mon, 2013-10-21 at 15:40 -0400, Neal Cardwell wrote:
>> For passive TCP connections, upon receiving the ACK that completes the
>> 3WHS, make sure we set our pacing rate after we get our first RTT
>> sample.
> 
>> Signed-off-by: Neal Cardwell <ncardwell@google.com>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Yuchung Cheng <ycheng@google.com>
>> ---
>>  net/ipv4/tcp_input.c | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
>> index 53974c7..a16b01b 100644
>> --- a/net/ipv4/tcp_input.c
>> +++ b/net/ipv4/tcp_input.c
>> @@ -5712,6 +5712,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
>>  		} else
>>  			tcp_init_metrics(sk);
>>  
>> +		tcp_update_pacing_rate(sk);
>> +
>>  		/* Prevent spurious tcp_cwnd_restart() on first data packet */
>>  		tp->lsndtime = tcp_time_stamp;
>>  
> 
> Seems good to me, thanks !
> 
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied, thanks everyone.

^ permalink raw reply

* Re: [PATCH] mac802154: correct a typo in ieee802154_alloc_device() prototype
From: David Miller @ 2013-10-21 22:58 UTC (permalink / raw)
  To: alexandre.belloni; +Cc: alex.bluesman.smirnov, netdev, linux-kernel
In-Reply-To: <1382375398-17428-1-git-send-email-alexandre.belloni@free-electrons.com>

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Date: Mon, 21 Oct 2013 19:09:58 +0200

> This has no other impact than a cosmetic one.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Applied.

^ permalink raw reply

* Re: [PATCH] davinci_emac.c: Fix IFF_ALLMULTI setup
From: David Miller @ 2013-10-21 22:57 UTC (permalink / raw)
  To: mceier+kernel
  Cc: mugunthanvnm, prabhakar.csengg, jg1.han, jiri, netdev,
	linux-kernel
In-Reply-To: <1382377504-24688-1-git-send-email-mceier+kernel@gmail.com>

From: Mariusz Ceier <mceier+kernel@gmail.com>
Date: Mon, 21 Oct 2013 19:45:04 +0200

> When IFF_ALLMULTI flag is set on interface and IFF_PROMISC isn't,
> emac_dev_mcast_set should only enable RX of multicasts and reset
> MACHASH registers.
> 
> It does this, but afterwards it either sets up multicast MACs
> filtering or disables RX of multicasts and resets MACHASH registers
> again, rendering IFF_ALLMULTI flag useless.
> 
> This patch fixes emac_dev_mcast_set, so that multicast MACs filtering and
> disabling of RX of multicasts are skipped when IFF_ALLMULTI flag is set.
> 
> Tested with kernel 2.6.37.
> 
> Signed-off-by: Mariusz Ceier <mceier+kernel@gmail.com>

Applied and queued up for -stable, thanks.

^ 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