Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v2] tipc: failed transmissions should return error
From: erik.hugne @ 2014-02-19  7:37 UTC (permalink / raw)
  To: netdev
  Cc: tipc-discussion, ying.xue, paul.gortmaker, jon.maloy, maloy,
	Erik Hugne

From: Erik Hugne <erik.hugne@ericsson.com>

When a message could not be sent out because the destination node
or link could not be found, the full message size is returned from
sendmsg() as if it had been sent successfully. An application will
then get a false indication that it's making forward progress. This
problem has existed since the initial commit in 2.6.16.

We change this to return -ENETUNREACH if the message cannot be
delivered due to the destination node/link being unavailable. We
also get rid of the redundant tipc_reject_msg call since freeing
the buffer and doing a tipc_port_iovec_reject accomplishes exactly
the same thing.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
---
v2: Respin on top of 247f0f3c3176c55b46cb9a20011d3d6757634815 
tipc: align tipc function names with common naming practice in the network

 net/tipc/link.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index e4f233d..e998dba 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1020,12 +1020,9 @@ exit:
 	read_unlock_bh(&tipc_net_lock);
 
 	/* Couldn't find a link to the destination node */
-	if (buf)
-		return tipc_reject_msg(buf, TIPC_ERR_NO_NODE);
-	if (res >= 0)
-		return tipc_port_iovec_reject(sender, hdr, msg_sect, len,
-					      TIPC_ERR_NO_NODE);
-	return res;
+	kfree_skb(buf);
+	tipc_port_iovec_reject(sender, hdr, msg_sect, len, TIPC_ERR_NO_NODE);
+	return -ENETUNREACH;
 }
 
 /*
@@ -1163,8 +1160,9 @@ error:
 	} else {
 reject:
 		kfree_skb_list(buf_chain);
-		return tipc_port_iovec_reject(sender, hdr, msg_sect,
-					      len, TIPC_ERR_NO_NODE);
+		tipc_port_iovec_reject(sender, hdr, msg_sect, len,
+				       TIPC_ERR_NO_NODE);
+		return -ENETUNREACH;
 	}
 
 	/* Append chain of fragments to send queue & send them */
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH net] veth: Fix vlan_features so as to be able to use stacked vlan interfaces
From: Toshiaki Makita @ 2014-02-19  5:22 UTC (permalink / raw)
  To: fbl; +Cc: David S . Miller, netdev
In-Reply-To: <20140219041357.GB2491@localhost.localdomain>

(2014/02/19 13:13), Flavio Leitner wrote:
> On Tue, Feb 18, 2014 at 09:20:08PM +0900, Toshiaki Makita wrote:
>> Even if we create a stacked vlan interface such as veth0.10.20, it sends
>> single tagged frames (tagged with only vid 10).
>> Because vlan_features of a veth interface has the
>> NETIF_F_HW_VLAN_[CTAG/STAG]_TX bits, veth0.10 also has that feature, so
>> dev_hard_start_xmit(veth0.10) doesn't call __vlan_put_tag() and
>> vlan_dev_hard_start_xmit(veth0.10) overwrites vlan_tci.
>> This prevents us from using a combination of 802.1ad and 802.1Q
>> in containers, etc.
>>
>> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>> ---
>>  drivers/net/veth.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
>> index 2ec2041..5b37437 100644
>> --- a/drivers/net/veth.c
>> +++ b/drivers/net/veth.c
>> @@ -285,7 +285,8 @@ static void veth_setup(struct net_device *dev)
>>  	dev->ethtool_ops = &veth_ethtool_ops;
>>  	dev->features |= NETIF_F_LLTX;
>>  	dev->features |= VETH_FEATURES;
>> -	dev->vlan_features = dev->features;
>> +	dev->vlan_features = dev->features &
>> +			     ~(NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX);
>>  	dev->destructor = veth_dev_free;
>>  
>>  	dev->hw_features = VETH_FEATURES;
>> -- 
>> 1.8.1.2
>>
> 
> Why that isn't a problem with another software device?
> Although this patch might fix the issue, it seems to me that
> the middle devices shouldn't use the same feature flags.
> I mean, vlan.20 should add the header, then vlan.10 should
> offload the tag to veth.  Otherwise, for any vlan on top of
> veth there will be an unneeded memmove().

In this case with this patch, vlan_dev_hard_start_xmit(veth0.10.20) set
vlan_tci, dev_hard_start_xmit(veth0.10) put it into skb->data, and
vlan_dev_hard_start_xmit(veth0.10) set vlan_tci again.
dev_hard_start_xmit(veth0) doesn't put it into skb->data because veth0
has NETIF_F_HW_VLAN_*TAG_TX feature.

Similarly, in not stacked vlan case, for example if veth0.10 has no vlan
intarface on it, vlan_dev_hard_start_xmit(veth0.10) set vlan_tci and
dev_hard_start_xmit(veth0) doesn't put it into skb->data.
There will be no unnecessary memmove().

Although I haven't looked over all, other drivers don't seem to have
NETIF_F_HW_VLAN_*TAG_TX in vlan_features (at least, bridge, vxlan,
e1000e, and bnx2x don't).

Thanks,
Toshiaki Makita

^ permalink raw reply

* [PATCH] atm: solos-pci: make solos_bh() as static
From: Daeseok Youn @ 2014-02-19  5:13 UTC (permalink / raw)
  To: chas; +Cc: linux-atm-general, netdev, linux-kernel

>From 6297aabeff748777b520cc0ee835af0a3ddc79e2 Mon Sep 17 00:00:00 2001
From: Daeseok Youn <daeseok.youn@gmail.com>
Date: Wed, 19 Feb 2014 10:49:12 +0900
Subject: [PATCH] atm: solos-pci: make solos_bh() as static

sparse says:

drivers/atm/solos-pci.c:763:6: warning:
 symbol 'solos_bh' was not declared. Should it be static?

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/atm/solos-pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index e3fb496..943cf0d 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -760,7 +760,7 @@ static irqreturn_t solos_irq(int irq, void *dev_id)
 	return IRQ_RETVAL(handled);
 }
 
-void solos_bh(unsigned long card_arg)
+static void solos_bh(unsigned long card_arg)
 {
 	struct solos_card *card = (void *)card_arg;
 	uint32_t card_flags;
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH] atm: nicstar: use NULL instead of 0 for pointer
From: Daeseok Youn @ 2014-02-19  5:12 UTC (permalink / raw)
  To: chas; +Cc: linux-atm-general, netdev, linux-kernel

>From c320d2ea1ed51c88255c33a50c74fa3598ab7be6 Mon Sep 17 00:00:00 2001
From: Daeseok Youn <daeseok.youn@gmail.com>
Date: Wed, 19 Feb 2014 10:10:11 +0900
Subject: [PATCH] atm: nicstar: use NULL instead of 0 for pointer

sparse says:

drivers/atm/nicstar.c:642:27: warning:
 Using plain integer as NULL pointer
drivers/atm/nicstar.c:644:27:
 warning: Using plain integer as NULL pointer
drivers/atm/nicstar.c:982:51:
 warning: Using plain integer as NULL pointer
drivers/atm/nicstar.c:996:51:
 warning: Using plain integer as NULL pointer

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/atm/nicstar.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 9587e95..13ed54c 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -639,9 +639,9 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
 	card->hbnr.init = NUM_HB;
 	card->hbnr.max = MAX_HB;
 
-	card->sm_handle = 0x00000000;
+	card->sm_handle = NULL;
 	card->sm_addr = 0x00000000;
-	card->lg_handle = 0x00000000;
+	card->lg_handle = NULL;
 	card->lg_addr = 0x00000000;
 
 	card->efbie = 1;	/* To prevent push_rxbufs from enabling the interrupt */
@@ -979,7 +979,7 @@ static void push_rxbufs(ns_dev * card, struct sk_buff *skb)
 				addr2 = card->sm_addr;
 				handle2 = card->sm_handle;
 				card->sm_addr = 0x00000000;
-				card->sm_handle = 0x00000000;
+				card->sm_handle = NULL;
 			} else {	/* (!sm_addr) */
 
 				card->sm_addr = addr1;
@@ -993,7 +993,7 @@ static void push_rxbufs(ns_dev * card, struct sk_buff *skb)
 				addr2 = card->lg_addr;
 				handle2 = card->lg_handle;
 				card->lg_addr = 0x00000000;
-				card->lg_handle = 0x00000000;
+				card->lg_handle = NULL;
 			} else {	/* (!lg_addr) */
 
 				card->lg_addr = addr1;
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH] atm: ambassador: use NULL instead of 0 for pointer
From: Daeseok Youn @ 2014-02-19  5:11 UTC (permalink / raw)
  To: chas; +Cc: linux-atm-general, netdev, linux-kernel

>From 932e928d53b1e588dc17019e7f9fa7a61b8b7468 Mon Sep 17 00:00:00 2001
From: Daeseok Youn <daeseok.youn@gmail.com>
Date: Wed, 19 Feb 2014 10:35:41 +0900
Subject: [PATCH] atm: ambassador: use NULL instead of 0 for pointer

sparse says:

drivers/atm/ambassador.c:1928:24: warning:
 Using plain integer as NULL pointer

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/atm/ambassador.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 62a7607..f1a9198 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -1925,7 +1925,7 @@ static int ucode_init(loader_block *lb, amb_dev *dev)
   const struct firmware *fw;
   unsigned long start_address;
   const struct ihex_binrec *rec;
-  const char *errmsg = 0;
+  const char *errmsg = NULL;
   int res;
 
   res = request_ihex_firmware(&fw, "atmsar11.fw", &dev->pci_dev->dev);
-- 
1.7.9.5
---

^ permalink raw reply related

* Re: [PATCH net-next 1/2] pcnet32: fix reallocation error
From: Don Fry @ 2014-02-19  4:58 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: davem, netdev
In-Reply-To: <201402182129.BDD57369.FVOQHFOFtJSLOM@I-love.SAKURA.ne.jp>

-----Original Message-----
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Subject: Re: [PATCH net-next 1/2] pcnet32: fix reallocation error
Date: Tue, 18 Feb 2014 21:29:00 +0900

>Don Fry wrote:
>> pcnet32_realloc_rx_ring() only worked on the first log2 number of
>> entries in the receive ring instead of the all the entries.
>> Replaced "1 << size" with more descriptive variable.
>
>>  	/* first copy the current receive buffers */
>> -	overlap = min(size, lp->rx_ring_size);
>> +	overlap = min(entries, lp->rx_ring_size);
>
>>  	/* now allocate any new buffers needed */
>> -	for (; new < size; new++) {
>> +	for (; new < entries; new++) {
>>
>Until this fix, lp->rx_skbuff[size...(1<<size)-1] were not allocated by
>netdev_alloc_skb() and lp->rx_ring_dma_addr[size...(1<<size)-1] were not mapped
>by pci_map_single(), right?
>
>Since lp->rx_ring_size was set to (1<<size), wasn't there possibility that
>something bad happens by accessing lp->rx_skbuff[] and lp->rx_ring_dma_addr[]
>up to (1<<size)-1 ? (In other words, don't we want to backport this fix?)
>

I looked into this when testing.  If the device is operational
(netif_running) when the ring is resized, it will do pcnet32_restart and
make sure all rx buffers are full.  If the device is not operational it
will leave the ring partially full until it is opened and then the ring
is filled via pcnet32_init_ring().  Another thing that could happen
while it is down is that a selftest is done (offline) which also calls
pcnet32_restart and makes sure the ring is full.  I could not find a
case that would cause a problem.  No-one has reported this in the last 8
years so it does not look like backporting this fix is needed, in my
opinion.

^ permalink raw reply

* Re: WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:264 dev_watchdog+0x276/0x280()
From: poma @ 2014-02-19  4:37 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: Stanislaw Gruszka, Mailing-List fedora-kernel, Josh Boyer,
	Linux Kernel list, Jamal Hadi Salim, Justin M. Forbes,
	Alexey Kuznetsov, Intel Corporation
In-Reply-To: <530332B7.10909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 18.02.2014 11:15, poma wrote:
> 
> Ahoy!
> 
> Debugging S3 aka suspend produces 'WARNINGS':
> 
> Steps to Reproduce:
> # echo core > /sys/power/pm_test
> # cat /sys/power/pm_test
> none [core] processors platform devices freezer
> # echo mem > /sys/power/state
> Results:
> - dmesg-3.14.0-0.rc3.git0.1.fc21.x86_64+debug-pm_test-core.diff
>   https://bugzilla.redhat.com/attachment.cgi?id=864436
> 
> Steps to Reproduce:
> # echo processors > /sys/power/pm_test
> # cat /sys/power/pm_test
> none core [processors] platform devices freezer
> # echo mem > /sys/power/state
> Results:
> - dmesg-3.14.0-0.rc3.git0.1.fc21.x86_64+debug-pm_test-processors.diff
>   https://bugzilla.redhat.com/attachment.cgi?id=864438
> 
> Steps to Reproduce:
> # echo platform > /sys/power/pm_test
> # cat /sys/power/pm_test
> none core processors [platform] devices freezer
> # echo mem > /sys/power/state
> Results:
> - dmesg-3.14.0-0.rc3.git0.1.fc21.x86_64+debug-pm_test-platform.diff
>   https://bugzilla.redhat.com/attachment.cgi?id=864439
> 
> RHBZ 1010764:
> "[abrt] NETDEV WATCHDOG: em1 (e1000e): transmit queue 0 timed out"
> https://bugzilla.redhat.com/show_bug.cgi?id=1010764
> 
> Tested with Rawhide 'kernel-debug-3.14.0-0.rc3.git0.1.fc21.x86_64'
> http://koji.fedoraproject.org/koji/buildinfo?buildID=498711

A comparison of 'RealTek RTL-8169 GE' & 'SysKonnect GE'

Debugging S3 - core:
# echo core > /sys/power/pm_test
# echo mem > /sys/power/state
  RTL8169:
- dmesg-3.14.0-0.rc3.git2.1.fc21.x86_64-r8169-pm_test-core.diff
  https://bugzilla.redhat.com/attachment.cgi?id=864959
  SKGE:
- dmesg-3.14.0-0.rc3.git2.1.fc21.x86_64-skge-pm_test-core.diff
  https://bugzilla.redhat.com/attachment.cgi?id=864960

Debugging S3 - processors:
# echo processors > /sys/power/pm_test
# echo mem > /sys/power/state
  RTL8169:
- dmesg-3.14.0-0.rc3.git2.1.fc21.x86_64-r8169-pm_test-processors.diff
  https://bugzilla.redhat.com/attachment.cgi?id=864961
  SKGE:
- dmesg-3.14.0-0.rc3.git2.1.fc21.x86_64-skge-pm_test-processors.diff
  https://bugzilla.redhat.com/attachment.cgi?id=864962

Debugging S3 - platform:
# echo platform > /sys/power/pm_test
# echo mem > /sys/power/state
  RTL8169:
- dmesg-3.14.0-0.rc3.git2.1.fc21.x86_64-r8169-pm_test-platform.diff
  https://bugzilla.redhat.com/attachment.cgi?id=864963
  SKGE:
- dmesg-3.14.0-0.rc3.git2.1.fc21.x86_64-skge-pm_test-platform.diff
  https://bugzilla.redhat.com/attachment.cgi?id=864964

RHBZ
https://bugzilla.redhat.com/show_bug.cgi?id=1010764

Tested with Rawhide ' kernel-3.14.0-0.rc3.git2.1.fc21.x86_64'
http://koji.fedoraproject.org/koji/buildinfo?buildID=499061


poma

_______________________________________________
kernel mailing list
kernel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/kernel

^ permalink raw reply

* Re: [PATCH net] veth: Fix vlan_features so as to be able to use stacked vlan interfaces
From: Flavio Leitner @ 2014-02-19  4:13 UTC (permalink / raw)
  To: Toshiaki Makita; +Cc: David S . Miller, netdev
In-Reply-To: <1392726009-8083-1-git-send-email-makita.toshiaki@lab.ntt.co.jp>

On Tue, Feb 18, 2014 at 09:20:08PM +0900, Toshiaki Makita wrote:
> Even if we create a stacked vlan interface such as veth0.10.20, it sends
> single tagged frames (tagged with only vid 10).
> Because vlan_features of a veth interface has the
> NETIF_F_HW_VLAN_[CTAG/STAG]_TX bits, veth0.10 also has that feature, so
> dev_hard_start_xmit(veth0.10) doesn't call __vlan_put_tag() and
> vlan_dev_hard_start_xmit(veth0.10) overwrites vlan_tci.
> This prevents us from using a combination of 802.1ad and 802.1Q
> in containers, etc.
> 
> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> ---
>  drivers/net/veth.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 2ec2041..5b37437 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -285,7 +285,8 @@ static void veth_setup(struct net_device *dev)
>  	dev->ethtool_ops = &veth_ethtool_ops;
>  	dev->features |= NETIF_F_LLTX;
>  	dev->features |= VETH_FEATURES;
> -	dev->vlan_features = dev->features;
> +	dev->vlan_features = dev->features &
> +			     ~(NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX);
>  	dev->destructor = veth_dev_free;
>  
>  	dev->hw_features = VETH_FEATURES;
> -- 
> 1.8.1.2
> 

Why that isn't a problem with another software device?
Although this patch might fix the issue, it seems to me that
the middle devices shouldn't use the same feature flags.
I mean, vlan.20 should add the header, then vlan.10 should
offload the tag to veth.  Otherwise, for any vlan on top of
veth there will be an unneeded memmove().

fbl

^ permalink raw reply

* RE: [PATCH net-next 12/14] r8152: replace netif_rx withnetif_receive_skb
From: hayeswang @ 2014-02-19  3:01 UTC (permalink / raw)
  To: 'Francois Romieu'; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <20140218232850.GB13394@electric-eye.fr.zoreil.com>

 Francois Romieu [mailto:romieu@fr.zoreil.com] 
> Sent: Wednesday, February 19, 2014 7:29 AM
> To: Hayes Wang
> Cc: netdev@vger.kernel.org; nic_swsd@realtek.com; 
> linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org
> Subject: Re: [PATCH net-next 12/14] r8152: replace netif_rx 
> withnetif_receive_skb
> 
> Hayes Wang <hayeswang@realtek.com> :
> > Replace netif_rx with netif_receive_skb to avoid disabling irq frequently
> > for increasing the efficiency.
> 
> read_bulk_callback is issued in irq context. It could thus use plain
> spin_lock / spin_unlock instead of the irq disabling version.

The rx_bottom() is called in tasklet, so I just think I could use
netif_receive_skb directly. The netif_rx seems to queue the packet,
and local_irq_disable() would be called before dequeuing the skb.
 
Best Regards,
Hayes

^ permalink raw reply

* RE: [PATCH net-next 07/14] r8152: combine PHY reset with set_speed
From: hayeswang @ 2014-02-19  2:41 UTC (permalink / raw)
  To: 'Florian Fainelli'
  Cc: 'netdev', nic_swsd, linux-kernel, 'linux-usb'
In-Reply-To: <201402190209.s1J29EVG032292@rtits1.realtek.com>

 Florian Fainelli [mailto:f.fainelli@gmail.com] 
> Sent: Wednesday, February 19, 2014 1:19 AM
> To: Hayes Wang
> Cc: netdev; nic_swsd@realtek.com; 
> linux-kernel@vger.kernel.org; linux-usb
> Subject: Re: [PATCH net-next 07/14] r8152: combine PHY reset 
> with set_speed
[...]
> > +static void rtl_phy_reset(struct r8152 *tp)
> > +{
> > +       u16 data;
> > +       int i;
> > +
> > +       clear_bit(PHY_RESET, &tp->flags);
> > +
> > +       data = r8152_mdio_read(tp, MII_BMCR);
> > +
> > +       /* don't reset again before the previous one complete */
> > +       if (data & BMCR_RESET)
> > +               return;
> > +
> > +       data |= BMCR_RESET;
> > +       r8152_mdio_write(tp, MII_BMCR, data);
> > +
> > +       for (i = 0; i < 50; i++) {
> > +               msleep(20);
> > +               if ((r8152_mdio_read(tp, MII_BMCR) & 
> BMCR_RESET) == 0)
> > +                       break;
> > +       }
> > +}
> 
> If you implemented libphy in the driver you would not have to
> duplicate that and you could use "phy_init_hw()" or
> genphy_soft_reset() to perform the BMCR-based software reset.

Thanks for you suggestion. I would study about those.
 
Best Regards,
Hayes

^ permalink raw reply

* Re: [PATCH net-next] bonding: Fix RTNL: assertion failed at net/core/rtnetlink.c for 802.3ad mode
From: Ding Tianhong @ 2014-02-19  2:26 UTC (permalink / raw)
  To: Jay Vosburgh
  Cc: Andy Gospodarek, Veaceslav Falico, Cong Wang, Thomas Glanzmann,
	Jiri Pirko, David S. Miller, Eric Dumazet, Scott Feldman, Netdev
In-Reply-To: <16121.1392765526@death.nxdomain>

On 2014/2/19 7:18, Jay Vosburgh wrote:
> Ding Tianhong <dingtianhong@huawei.com> wrote:
> 
>> The problem was introduced by the commit 1d3ee88ae0d
>> (bonding: add netlink attributes to slave link dev).
>> The bond_set_active_slave() and bond_set_backup_slave()
>> will use rtmsg_ifinfo to send slave's states, so these
>> two functions should be called in RTNL.
>>
>> In 802.3ad mode, acquiring RTNL for the __enable_port and
>> __disable_port cases is difficult, as those calls generally
>> already hold the state machine lock, and cannot unconditionally
>> call rtnl_lock because either they already hold RTNL (for calls
>> via bond_3ad_unbind_slave) or due to the potential for deadlock
>> with bond_3ad_adapter_speed_changed, bond_3ad_adapter_duplex_changed,
>> bond_3ad_link_change, or bond_3ad_update_lacp_rate.  All four of
>> those are called with RTNL held, and acquire the state machine lock
>> second.  The calling contexts for __enable_port and __disable_port
>> already hold the state machine lock, and may or may not need RTNL.
>>
>> According to the Jay's opinion, I don't think it is a problem that
>> the slave don't send notify message synchronously when the status
>> changed, normally the state machine is running every 100 ms, send
>> the notify message at the end of the state machine if the slave's
>> state changed should be better.
>>
>> I fix the problem through these steps:
>>
>> 1). add a new function bond_set_slave_state() which could change
>>    the slave's state and call rtmsg_ifinfo() according to the input
>>    parameters called notify.
>>
>> 2). Add a new slave parameter which called should_notify, if the slave's state
>>    changed and don't notify yet, the parameter will be set to 1, and then if
>>    the slave's state changed again, the param will be set to 0, it indicate that
>>    the slave's state has been restored, no need to notify any one.
>>
>> 3). the __enable_port and __disable_port should not call rtmsg_ifinfo
>>    in the state machine lock, any change in the state of slave could
>>    set a flag in the slave, it will indicated that an rtmsg_ifinfo
>>    should be called at the end of the state machine.
>>
>> Cc: Jay Vosburgh <fubar@us.ibm.com>
>> Cc: Veaceslav Falico <vfalico@redhat.com>
>> Cc: Andy Gospodarek <andy@greyhouse.net>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>> ---
>> drivers/net/bonding/bond_3ad.c  | 22 ++++++++++++++++++++--
>> drivers/net/bonding/bond_main.c | 30 +++++++++++++++---------------
>> drivers/net/bonding/bonding.h   | 31 ++++++++++++++++++++++++++-----
>> 3 files changed, 61 insertions(+), 22 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>> index e9edd84..c450d04 100644
>> --- a/drivers/net/bonding/bond_3ad.c
>> +++ b/drivers/net/bonding/bond_3ad.c
>> @@ -181,7 +181,7 @@ static inline int __agg_has_partner(struct aggregator *agg)
>>  */
>> static inline void __disable_port(struct port *port)
>> {
>> -	bond_set_slave_inactive_flags(port->slave);
>> +	bond_set_slave_inactive_flags(port->slave, false);
>> }
>>
>> /**
>> @@ -193,7 +193,7 @@ static inline void __enable_port(struct port *port)
>> 	struct slave *slave = port->slave;
>>
>> 	if ((slave->link == BOND_LINK_UP) && IS_UP(slave->dev))
>> -		bond_set_slave_active_flags(slave);
>> +		bond_set_slave_active_flags(slave, false);
>> }
>>
>> /**
>> @@ -2065,6 +2065,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
>> 	struct list_head *iter;
>> 	struct slave *slave;
>> 	struct port *port;
>> +	int slave_should_notify = 0;
>>
>> 	read_lock(&bond->lock);
>> 	rcu_read_lock();
>> @@ -2122,8 +2123,25 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
>> 	}
>>
>> re_arm:
>> +	bond_for_each_slave_rcu(bond, slave, iter) {
>> +		if (slave->should_notify) {
>> +			slave_should_notify = 1;
>> +			break;
>> +		}
>> +	}
>> 	rcu_read_unlock();
>> 	read_unlock(&bond->lock);
>> +
>> +	if (slave_should_notify && rtnl_trylock()) {
>> +		bond_for_each_slave(bond, slave, iter) {
>> +			if (slave->should_notify) {
>> +				rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0,
>> +					     GFP_KERNEL);
>> +				slave->should_notify = 0;
>> +			}
>> +		}
>> +		rtnl_unlock();
>> +	}
>> 	queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks);
>> }
>>
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index 3bce855..1c14e64 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -829,21 +829,21 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
>> 	if (bond_is_lb(bond)) {
>> 		bond_alb_handle_active_change(bond, new_active);
>> 		if (old_active)
>> -			bond_set_slave_inactive_flags(old_active);
>> +			bond_set_slave_inactive_flags(old_active, true);
>> 		if (new_active)
>> -			bond_set_slave_active_flags(new_active);
>> +			bond_set_slave_active_flags(new_active, true);
>> 	} else {
>> 		rcu_assign_pointer(bond->curr_active_slave, new_active);
>> 	}
>>
>> 	if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) {
>> 		if (old_active)
>> -			bond_set_slave_inactive_flags(old_active);
>> +			bond_set_slave_inactive_flags(old_active, true);
>>
>> 		if (new_active) {
>> 			bool should_notify_peers = false;
>>
>> -			bond_set_slave_active_flags(new_active);
>> +			bond_set_slave_active_flags(new_active, true);
>>
>> 			if (bond->params.fail_over_mac)
>> 				bond_do_fail_over_mac(bond, new_active,
>> @@ -1462,14 +1462,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
>>
>> 	switch (bond->params.mode) {
>> 	case BOND_MODE_ACTIVEBACKUP:
>> -		bond_set_slave_inactive_flags(new_slave);
>> +		bond_set_slave_inactive_flags(new_slave, true);
>> 		break;
>> 	case BOND_MODE_8023AD:
>> 		/* in 802.3ad mode, the internal mechanism
>> 		 * will activate the slaves in the selected
>> 		 * aggregator
>> 		 */
>> -		bond_set_slave_inactive_flags(new_slave);
>> +		bond_set_slave_inactive_flags(new_slave, true);
>> 		/* if this is the first slave */
>> 		if (!prev_slave) {
>> 			SLAVE_AD_INFO(new_slave).id = 1;
>> @@ -1487,7 +1487,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
>> 	case BOND_MODE_TLB:
>> 	case BOND_MODE_ALB:
>> 		bond_set_active_slave(new_slave);
>> -		bond_set_slave_inactive_flags(new_slave);
>> +		bond_set_slave_inactive_flags(new_slave, true);
>> 		break;
>> 	default:
>> 		pr_debug("This slave is always active in trunk mode\n");
>> @@ -2009,7 +2009,7 @@ static void bond_miimon_commit(struct bonding *bond)
>>
>> 			if (bond->params.mode == BOND_MODE_ACTIVEBACKUP ||
>> 			    bond->params.mode == BOND_MODE_8023AD)
>> -				bond_set_slave_inactive_flags(slave);
>> +				bond_set_slave_inactive_flags(slave, true);
>>
>> 			pr_info("%s: link status definitely down for interface %s, disabling it\n",
>> 				bond->dev->name, slave->dev->name);
>> @@ -2555,7 +2555,7 @@ static void bond_ab_arp_commit(struct bonding *bond)
>> 				slave->link = BOND_LINK_UP;
>> 				if (bond->current_arp_slave) {
>> 					bond_set_slave_inactive_flags(
>> -						bond->current_arp_slave);
>> +						bond->current_arp_slave, true);
>> 					bond->current_arp_slave = NULL;
>> 				}
>>
>> @@ -2575,7 +2575,7 @@ static void bond_ab_arp_commit(struct bonding *bond)
>> 				slave->link_failure_count++;
>>
>> 			slave->link = BOND_LINK_DOWN;
>> -			bond_set_slave_inactive_flags(slave);
>> +			bond_set_slave_inactive_flags(slave, true);
>>
>> 			pr_info("%s: link status definitely down for interface %s, disabling it\n",
>> 				bond->dev->name, slave->dev->name);
>> @@ -2650,7 +2650,7 @@ static bool bond_ab_arp_probe(struct bonding *bond)
>> 		}
>> 	}
>>
>> -	bond_set_slave_inactive_flags(curr_arp_slave);
>> +	bond_set_slave_inactive_flags(curr_arp_slave, true);
> 
> 	This...
> 
>> 	bond_for_each_slave(bond, slave, iter) {
>> 		if (!found && !before && IS_UP(slave->dev))
>> @@ -2670,7 +2670,7 @@ static bool bond_ab_arp_probe(struct bonding *bond)
>> 			if (slave->link_failure_count < UINT_MAX)
>> 				slave->link_failure_count++;
>>
>> -			bond_set_slave_inactive_flags(slave);
>> +			bond_set_slave_inactive_flags(slave, true);
> 
> 	[ but not this one ]
> 
>> 			pr_info("%s: backup interface %s is now down\n",
>> 				bond->dev->name, slave->dev->name);
>> @@ -2688,7 +2688,7 @@ static bool bond_ab_arp_probe(struct bonding *bond)
>> 	}
>>
>> 	new_slave->link = BOND_LINK_BACK;
>> -	bond_set_slave_active_flags(new_slave);
>> +	bond_set_slave_active_flags(new_slave, true);
> 
> 	and this should arguably never send an rtmsg_ifinfo
> notification.
> 
> 	My presumption is that the notification is to indicate that the
> interface has actually changed state in a meaningful way, but these
> calls are internal settings of the flags to allow the ARP monitor to
> search for a slave to become active when there are no active slaves
> (according to ARP monitor).  The flag setting to active or backup is to
> permit the ARP monitor's response logic to do the right thing when
> deciding if the test slave (current_arp_slave) is up or not.
> 
> 	What will happen here is that, for as long as all slaves are
> down, each cycle through the curr_arp_slave will shift to the next slave
> in the list, the flags will be adjusted for the previous and now-current
> arp slaves, and a pass of the ARP monitor will complete (send ARPs, next
> time through, check for any replies).
> 
> 	As the patch is written, while all slaves are down this will
> generate an rtmsg_ifinfo call for each of two slaves during each pass of
> the ARP monitor, until such time that any slave becomes active.
> 
> 	I haven't heard back from anybody about what the rtmsg_ifinfo
> notifications are used for, so I'm not 100% sure this is incorrect.  It
> doesn't seem like a proper usage, though, since the slave is not
> actually transitioning to an "up" or "down" state that is usable.
> 
> 	The way the code is written in the patch, "false" doesn't mean
> "never notify," it means "notify later," which isn't quite what I had
> meant.
> 
> 	I may be concerned about nothing here, and the extra
> notifications may be harmless.  In the absence of feedback, we could
> apply the patch as-is and if there are issues, fix them later.
> 
Hi, Joe:

I totally agree with you, but this patch is fix for 802.3ad warning message in original idea,
I found the monitors facing the same problem, but I think it would be better to fix them later,
I will review monitor for every mode and fix them, do you agree with me, otherwise I will fix
them in this big patch? 

Regards
Ding

> 	-J
> 
> 
>> 	bond_arp_send_all(bond, new_slave);
>> 	new_slave->jiffies = jiffies;
>> 	rcu_assign_pointer(bond->current_arp_slave, new_slave);
>> @@ -3035,9 +3035,9 @@ static int bond_open(struct net_device *bond_dev)
>> 		bond_for_each_slave(bond, slave, iter) {
>> 			if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP)
>> 				&& (slave != bond->curr_active_slave)) {
>> -				bond_set_slave_inactive_flags(slave);
>> +				bond_set_slave_inactive_flags(slave, true);
>> 			} else {
>> -				bond_set_slave_active_flags(slave);
>> +				bond_set_slave_active_flags(slave, true);
>> 			}
>> 		}
>> 		read_unlock(&bond->curr_slave_lock);
>> diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
>> index 86ccfb9..1f51a5f 100644
>> --- a/drivers/net/bonding/bonding.h
>> +++ b/drivers/net/bonding/bonding.h
>> @@ -195,7 +195,8 @@ struct slave {
>> 	s8     new_link;
>> 	u8     backup:1,   /* indicates backup slave. Value corresponds with
>> 			      BOND_STATE_ACTIVE and BOND_STATE_BACKUP */
>> -	       inactive:1; /* indicates inactive slave */
>> +	       inactive:1, /* indicates inactive slave */
>> +	       should_notify:1; /* indicateds whether the state changed */
>> 	u8     duplex;
>> 	u32    original_mtu;
>> 	u32    link_failure_count;
>> @@ -303,6 +304,24 @@ static inline void bond_set_backup_slave(struct slave *slave)
>> 	}
>> }
>>
>> +static inline void bond_set_slave_state(struct slave *slave,
>> +					int slave_state, bool notify)
>> +{
>> +	if (slave->backup == slave_state)
>> +		return;
>> +
>> +	slave->backup = slave_state;
>> +	if (notify) {
>> +		rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_KERNEL);
>> +		slave->should_notify = 0;
>> +	} else {
>> +		if (slave->should_notify)
>> +			slave->should_notify = 0;
>> +		else
>> +			slave->should_notify = 1;
>> +	}
>> +}
>> +
>> static inline void bond_slave_state_change(struct bonding *bond)
>> {
>> 	struct list_head *iter;
>> @@ -394,17 +413,19 @@ static inline void bond_netpoll_send_skb(const struct slave *slave,
>> }
>> #endif
>>
>> -static inline void bond_set_slave_inactive_flags(struct slave *slave)
>> +static inline void bond_set_slave_inactive_flags(struct slave *slave,
>> +						 bool notify)
>> {
>> 	if (!bond_is_lb(slave->bond))
>> -		bond_set_backup_slave(slave);
>> +		bond_set_slave_state(slave, BOND_STATE_BACKUP, notify);
>> 	if (!slave->bond->params.all_slaves_active)
>> 		slave->inactive = 1;
>> }
>>
>> -static inline void bond_set_slave_active_flags(struct slave *slave)
>> +static inline void bond_set_slave_active_flags(struct slave *slave,
>> +					       bool notify)
>> {
>> -	bond_set_active_slave(slave);
>> +	bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify);
>> 	slave->inactive = 0;
>> }
>>
>> -- 
>> 1.8.0
>>
>>
> 
> ---
> 	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
> 
> 
> .
> 

^ permalink raw reply

* Re: [PATCH net-next] bonding: Fix RTNL: assertion failed at net/core/rtnetlink.c for 802.3ad mode
From: Ding Tianhong @ 2014-02-19  2:13 UTC (permalink / raw)
  To: David Miller
  Cc: fubar, andy, vfalico, cwang, thomas, jiri, edumazet, sfeldma,
	netdev
In-Reply-To: <20140218.173812.1179657046277970562.davem@davemloft.net>

On 2014/2/19 6:38, David Miller wrote:
> From: Ding Tianhong <dingtianhong@huawei.com>
> Date: Tue, 18 Feb 2014 19:25:06 +0800
> 
>> The problem was introduced by the commit 1d3ee88ae0d
>> (bonding: add netlink attributes to slave link dev).
>> The bond_set_active_slave() and bond_set_backup_slave()
>> will use rtmsg_ifinfo to send slave's states, so these
>> two functions should be called in RTNL.
>>
>> In 802.3ad mode, acquiring RTNL for the __enable_port and
>> __disable_port cases is difficult, as those calls generally
>> already hold the state machine lock, and cannot unconditionally
>> call rtnl_lock because either they already hold RTNL (for calls
>> via bond_3ad_unbind_slave) or due to the potential for deadlock
>> with bond_3ad_adapter_speed_changed, bond_3ad_adapter_duplex_changed,
>> bond_3ad_link_change, or bond_3ad_update_lacp_rate.  All four of
>> those are called with RTNL held, and acquire the state machine lock
>> second.  The calling contexts for __enable_port and __disable_port
>> already hold the state machine lock, and may or may not need RTNL.
>>
>> According to the Jay's opinion, I don't think it is a problem that
>> the slave don't send notify message synchronously when the status
>> changed, normally the state machine is running every 100 ms, send
>> the notify message at the end of the state machine if the slave's
>> state changed should be better.
>>
>> I fix the problem through these steps:
>>
>> 1). add a new function bond_set_slave_state() which could change
>>     the slave's state and call rtmsg_ifinfo() according to the input
>>     parameters called notify.
>>
>> 2). Add a new slave parameter which called should_notify, if the slave's state
>>     changed and don't notify yet, the parameter will be set to 1, and then if
>>     the slave's state changed again, the param will be set to 0, it indicate that
>>     the slave's state has been restored, no need to notify any one.
>>
>> 3). the __enable_port and __disable_port should not call rtmsg_ifinfo
>>     in the state machine lock, any change in the state of slave could
>>     set a flag in the slave, it will indicated that an rtmsg_ifinfo
>>     should be called at the end of the state machine.
>>
>> Cc: Jay Vosburgh <fubar@us.ibm.com>
>> Cc: Veaceslav Falico <vfalico@redhat.com>
>> Cc: Andy Gospodarek <andy@greyhouse.net>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> 
> This seems more appropriately targetted at 'net' since it's a real
> bug fix, do you agree?
> 
> .
> 
Agree.

Ding

^ permalink raw reply

* Re: Fw:[Bug 70471] xfrm policy node will double unlink.
From: Xianpeng Zhao @ 2014-02-19  2:07 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: netdev, alan
In-Reply-To: <20140218083737.GB32371@secunet.com>

Hi Steffen,

      This problem is happened when running stress test; Very little chance can get this case.

      As you say, add a long time sleep in function xfrm_policy_bysel_ctx between __xfrm_policy_unlink and 
xfrm_policy_kill, will reproduce this issue manually. 

      About my patch, I am not sure it is OK, because after it patched, the issue had reproduced once, but after some days test recently, have not reproduced again. 

      But I can make sure when __xfrm_policy_unlink find the node had been removed, return NULL instead of delete again will fix this problem.

      What's your suggestions?

------------------
Best Regards
Xianpeng

------------------ Original ------------------
From:  "Steffen Klassert";<steffen.klassert@secunet.com>;
Date:  Tue, Feb 18, 2014 04:37 PM
To:  "Xianpeng Zhao"<673321875@qq.com>; 
Cc:  "netdev"<netdev@vger.kernel.org>; "alan"<alan@lxorguk.ukuu.org.uk>; 
Subject:  Re: Fw:[Bug 70471] xfrm policy node will double unlink.



On Tue, Feb 18, 2014 at 10:55:57AM +0800, Xianpeng Zhao wrote:
> Hi Group,
>      I found a problem about xfrm policy.
> 
>      In corner case, xfrm policy node will be double unlinked from the list.
> 
>     The scenario like this:
>     In thread context, After removed the node from list, before remove the xfrm policy expire timer. At this point, a timer interrupt come, and call the run_timer_softirq to execute the xfrm_policy_timer to remove the expired policy node; because this policy node had already removed from list. this remove will cause the node double unlinked.

Good catch!

I wonder why I've never seen this. Do you have a reproducer for this bug?

Looks like it is sufficient to reinitialize the bydst hlist in
__xfrm_policy_unlink(). Then hlist_unhashed() will notice that
this policy is not linked.

Does the patch below help?


diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 121399d..225f439 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1156,7 +1156,7 @@ static struct xfrm_policy *__xfrm_policy_unlink(struct xfrm_policy *pol,
 	if (hlist_unhashed(&pol->bydst))
 		return NULL;
 
-	hlist_del(&pol->bydst);
+	hlist_del_init(&pol->bydst);
 	hlist_del(&pol->byidx);
 	list_del(&pol->walk.all);
 	net->xfrm.policy_count[dir]--;
.

^ permalink raw reply related

* Re: [PATCH] net: ethernet: remove unneeded dependency of mvneta and update help text
From: Jisheng Zhang @ 2014-02-19  2:10 UTC (permalink / raw)
  To: Thomas Petazzoni, Jason Cooper
  Cc: Andrew Lunn, netdev@vger.kernel.org, Ezequiel Garcia,
	Gregory Clement, David S. Miller,
	linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth
In-Reply-To: <20140218141303.77c77272@skate>

Dear Thomas,

On Tue, 18 Feb 2014 05:13:03 -0800
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> Dear Jason Cooper,
> 
> On Tue, 18 Feb 2014 07:52:06 -0500, Jason Cooper wrote:
> 
> > > No, I haven't tested all the build scenarios of course. If you feel
> > > that this is too dangerous, I can resend a patch that replaces 'depends
> > > on ARMADA_370_XP' by 'depends on PLAT_ORION'. Would this be OK for you?
> > 
> > I'm fine either way.  I'm definitely a "What's in the box?" kind of guy.
> > But I do like being prepared.
> 
> And it's all in your honour!
> 
> > The real question is: Do you think this IP block will ever be found on
> > anything other than Marvell Armada boards?  If so, stick with this
> > version and build test the crap out of it.  Otherwise, let's save
> > opening the box for another day.
> 
> At this point, I don't expect to see this IP in any other SOCs than
> Marvell Armada EBU, so I'll resend with a "depends on PLAT_ORION", as I

This IP is used in Marvell Berlin SoCs too ;)

But Berlin SoC doesn't have a mbus concept. Currently, we just hack the
mvneta to configure the mbus window.

Thanks,
Jisheng

^ permalink raw reply

* Re: [PATCH net-next 0/3] bonding: More ether_addr_copy and neatenings.
From: Ding Tianhong @ 2014-02-19  1:44 UTC (permalink / raw)
  To: Joe Perches, netdev; +Cc: linux-kernel
In-Reply-To: <cover.1392745013.git.joe@perches.com>

On 2014/2/19 1:42, Joe Perches wrote:
> Joe Perches (3):
>   bonding: More use of ether_addr_copy
>   bonding: Remove unnecessary else
>   bonding: Invert test
> 
>  drivers/net/bonding/bond_3ad.c  | 21 ++++++++++-----------
>  drivers/net/bonding/bond_alb.c  | 17 ++++++++---------
>  drivers/net/bonding/bond_main.c |  6 +++---
>  3 files changed, 21 insertions(+), 23 deletions(-)
> 

Reviewed-by: Ding Tianhong <dingtianhong@huawei.com>

^ permalink raw reply

* Get an online loan at Skye Loan Finance Limited
From: Skye Loan Finance @ 2014-02-18  0:26 UTC (permalink / raw)
  To: anny

You are welcome to Skye Loan Finance Limited is an independent financial institution. 
We have built up an excellent reputation over the years in 
providing various types of loans to thousands of our customers.
We Offer guaranteed loan services of any amount to citizens and non-citizens at 3% interest rate per year. At Skye Loan Finance Limited, we offer easy personal loans, commercial/business loan,car loan,leasing/equipment finance, debt consolidation loan, home loan, for all citizens and non-citizens with either a good or bad credit history. If you are interested in our above loan offer, let Skye Loan Finance Limited, assist you today...
Mrs Tina Weeks
E-mail:skye-loan-finance@slf-online.com or
        customercareskyeloanfinance@gmail.com

^ permalink raw reply

* Re: [PATCH net] igb: Unset IGB_FLAG_HAS_MSIX-flag when falling back to msi-only
From: Brown, Aaron F @ 2014-02-19  0:05 UTC (permalink / raw)
  To: christoph.paasch@uclouvain.be
  Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	Brandeburg, Jesse, davem@davemloft.net
In-Reply-To: <1392766595-14454-1-git-send-email-christoph.paasch@uclouvain.be>

On Wed, 2014-02-19 at 00:36 +0100, Christoph Paasch wrote:
> rior to cd14ef54d25 (igb: Change to use statically allocated array for
> MSIx entries), having msix_entries different from NULL was an
> indicator
> that MSIX is enabled.
> In igb_set_interrupt_capabiliy we may fall back to MSI-only. Prior to
> the above patch msix_entries was set to NULL by
> igb_reset_interrupt_capability.
> 
> However, now we are checking the flag for IGB_FLAG_HAS_MSIX and so the
> stack gets completly confused:
> 
> [   42.659791] ------------[ cut here ]------------
> <snip>

> [   47.892146] handlers:
> [   47.919301] [<ffffffff812fbd7d>] igb_intr
> 
> So, this patch unsets the flag to indicate that we are not using MSIX.
> This patch does exactly this: Unsetting the flag when falling back to
> MSI.
> 
> Fixes: cd14ef54d25b (igb: Change to use statically allocated array for
> MSIx entries)
> Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c | 1 +
>  1 file changed, 1 insertion(+) 

Thanks Christoph, I have added this to our Jeff's internal queue as
well.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
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

* Re: [PATCH net] igb: Fix Null-pointer dereference in igb_reset_q_vector
From: Brown, Aaron F @ 2014-02-18 23:57 UTC (permalink / raw)
  To: christoph.paasch@uclouvain.be
  Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Wyborny, Carolyn,
	netdev@vger.kernel.org, e1000-devel@lists.sourceforge.net,
	davem@davemloft.net
In-Reply-To: <1392728817-21693-1-git-send-email-christoph.paasch@uclouvain.be>

On Tue, 2014-02-18 at 14:06 +0100, Christoph Paasch wrote:
> When igb_set_interrupt_capability() calls
> igb_reset_interrupt_capability() (e.g., because CONFIG_PCI_MSI is unset),
> num_q_vectors has been set but no vector has yet been allocated.
> 
> igb_reset_interrupt_capability() will then call igb_reset_q_vector,
> which assumes that the vector is allocated. As this is not the case, we
> are accessing a NULL-pointer.
> 
> This patch fixes it by checking that q_vector is indeed different from
> NULL.
> 
> Fixes: 02ef6e1d0b0023 (igb: Fix queue allocation method to accommodate changing during runtime)
> Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Thanks Christoph, I have added this to our Jeff's internal queue.


^ permalink raw reply

* RE: [PATCH net] igb: Unset IGB_FLAG_HAS_MSIX-flag when falling back to msi-only
From: Wyborny, Carolyn @ 2014-02-18 23:55 UTC (permalink / raw)
  To: Christoph Paasch, netdev@vger.kernel.org,
	e1000-devel@lists.sourceforge.net
  Cc: David Miller, Kirsher, Jeffrey T, Brandeburg, Jesse
In-Reply-To: <1392766595-14454-1-git-send-email-christoph.paasch@uclouvain.be>

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Christoph Paasch
> Sent: Tuesday, February 18, 2014 3:37 PM
> To: netdev@vger.kernel.org; e1000-devel@lists.sourceforge.net
> Cc: David Miller; Kirsher, Jeffrey T; Brandeburg, Jesse; Wyborny, Carolyn
> Subject: [PATCH net] igb: Unset IGB_FLAG_HAS_MSIX-flag when falling back to
> msi-only
> 
> Prior to cd14ef54d25 (igb: Change to use statically allocated array for MSIx
> entries), having msix_entries different from NULL was an indicator that MSIX is
> enabled.
> In igb_set_interrupt_capabiliy we may fall back to MSI-only. Prior to the above
> patch msix_entries was set to NULL by igb_reset_interrupt_capability.
> 
> However, now we are checking the flag for IGB_FLAG_HAS_MSIX and so the
> stack gets completly confused:
> 
> [   42.659791] ------------[ cut here ]------------
> [   42.715032] WARNING: CPU: 7 PID: 0 at net/sched/sch_generic.c:264
> dev_watchdog+0x15c/0x1fb()
> [   42.848263] NETDEV WATCHDOG: eth0 (igb): transmit queue 0 timed out
> [   42.923253] Modules linked in:
> [   42.959875] CPU: 7 PID: 0 Comm: swapper/7 Not tainted 3.14.0-rc2-mptcp
> #437
> [   43.043184] Hardware name: HP ProLiant DL165 G7, BIOS O37 01/26/2011
> [   43.119215]  0000000000000108 ffff88023fdc3da8 ffffffff81487847
> 0000000000000108
> [   43.208165]  ffff88023fdc3df8 ffff88023fdc3de8 ffffffff81034e7d
> ffff88023fdc3dd8
> [   43.297120]  ffffffff813fff10 ffff880236018000 ffff880236b178c0
> 0000000000000008
> [   43.386071] Call Trace:
> [   43.415303]  <IRQ>  [<ffffffff81487847>] dump_stack+0x49/0x62
> [   43.484174]  [<ffffffff81034e7d>] warn_slowpath_common+0x77/0x91
> [   43.556049]  [<ffffffff813fff10>] ? dev_watchdog+0x15c/0x1fb
> [   43.623759]  [<ffffffff81034f2b>] warn_slowpath_fmt+0x41/0x43
> [   43.692511]  [<ffffffff813fff10>] dev_watchdog+0x15c/0x1fb
> [   43.758141]  [<ffffffff813ffdb4>] ? __netdev_watchdog_up+0x64/0x64
> [   43.832091]  [<ffffffff8103cd04>] call_timer_fn+0x17/0x6f
> [   43.896682]  [<ffffffff8103cebe>] run_timer_softirq+0x162/0x1a2
> [   43.967511]  [<ffffffff81038520>] __do_softirq+0xcd/0x1cc
> [   44.032104]  [<ffffffff81038689>] irq_exit+0x3a/0x48
> [   44.091492]  [<ffffffff81026d43>] smp_apic_timer_interrupt+0x43/0x50
> [   44.167525]  [<ffffffff8148c24a>] apic_timer_interrupt+0x6a/0x70
> [   44.239392]  <EOI>  [<ffffffff8100992c>] ? default_idle+0x6/0x8
> [   44.310343]  [<ffffffff81009b31>] arch_cpu_idle+0x13/0x18
> [   44.374934]  [<ffffffff81066126>] cpu_startup_entry+0xa7/0x101
> [   44.444724]  [<ffffffff81025660>] start_secondary+0x1b2/0x1b7
> [   44.513472] ---[ end trace a5a075fd4e7f854f ]---
> [   44.568753] igb 0000:04:00.0 eth0: Reset adapter
> [   46.206945] random: nonblocking pool is initialized
> [   46.465670] irq 44: nobody cared (try booting with the "irqpoll" option)
> [   46.545862] CPU: 7 PID: 0 Comm: swapper/7 Tainted: G        W    3.14.0-rc2-
> mptcp #437
> [   46.640610] Hardware name: HP ProLiant DL165 G7, BIOS O37 01/26/2011
> [   46.716641]  ffff8802363f8c84 ffff88023fdc3e38 ffffffff81487847
> 00000000a03cdb6d
> [   46.805598]  ffff8802363f8c00 ffff88023fdc3e68 ffffffff81068489
> 0000007f81825400
> [   46.894539]  ffff8802363f8c00 0000000000000000 0000000000000000
> ffff88023fdc3ea8
> [   46.983484] Call Trace:
> [   47.012714]  <IRQ>  [<ffffffff81487847>] dump_stack+0x49/0x62
> [   47.081585]  [<ffffffff81068489>] __report_bad_irq+0x35/0xc1
> [   47.149295]  [<ffffffff81068683>] note_interrupt+0x16e/0x1ea
> [   47.217006]  [<ffffffff8106679e>] handle_irq_event_percpu+0x116/0x12e
> [   47.294075]  [<ffffffff810667e9>] handle_irq_event+0x33/0x4f
> [   47.361787]  [<ffffffff81068c95>] handle_fasteoi_irq+0x83/0xd1
> [   47.431577]  [<ffffffff81003d5b>] handle_irq+0x1f/0x28
> [   47.493047]  [<ffffffff81003567>] do_IRQ+0x4e/0xd4
> [   47.550358]  [<ffffffff8148b06a>] common_interrupt+0x6a/0x6a
> [   47.618066]  <EOI>  [<ffffffff8100992c>] ? default_idle+0x6/0x8
> [   47.689016]  [<ffffffff81009b31>] arch_cpu_idle+0x13/0x18
> [   47.753605]  [<ffffffff81066126>] cpu_startup_entry+0xa7/0x101
> [   47.823397]  [<ffffffff81025660>] start_secondary+0x1b2/0x1b7
> [   47.892146] handlers:
> [   47.919301] [<ffffffff812fbd7d>] igb_intr
> 
> So, this patch unsets the flag to indicate that we are not using MSIX.
> This patch does exactly this: Unsetting the flag when falling back to MSI.
> 
> Fixes: cd14ef54d25b (igb: Change to use statically allocated array for MSIx
> entries)
> Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---

Thanks Christoph for these patches, Aaron will be taking them into our queue as Jeff's coverage.

Carolyn

Carolyn Wyborny 
Linux Development 
Networking Division 
Intel Corporation 

^ permalink raw reply

* [PATCH net] igb: Unset IGB_FLAG_HAS_MSIX-flag when falling back to msi-only
From: Christoph Paasch @ 2014-02-18 23:36 UTC (permalink / raw)
  To: netdev, e1000-devel; +Cc: Jesse Brandeburg, David Miller

Prior to cd14ef54d25 (igb: Change to use statically allocated array for
MSIx entries), having msix_entries different from NULL was an indicator
that MSIX is enabled.
In igb_set_interrupt_capabiliy we may fall back to MSI-only. Prior to
the above patch msix_entries was set to NULL by
igb_reset_interrupt_capability.

However, now we are checking the flag for IGB_FLAG_HAS_MSIX and so the
stack gets completly confused:

[   42.659791] ------------[ cut here ]------------
[   42.715032] WARNING: CPU: 7 PID: 0 at net/sched/sch_generic.c:264 dev_watchdog+0x15c/0x1fb()
[   42.848263] NETDEV WATCHDOG: eth0 (igb): transmit queue 0 timed out
[   42.923253] Modules linked in:
[   42.959875] CPU: 7 PID: 0 Comm: swapper/7 Not tainted 3.14.0-rc2-mptcp #437
[   43.043184] Hardware name: HP ProLiant DL165 G7, BIOS O37 01/26/2011
[   43.119215]  0000000000000108 ffff88023fdc3da8 ffffffff81487847 0000000000000108
[   43.208165]  ffff88023fdc3df8 ffff88023fdc3de8 ffffffff81034e7d ffff88023fdc3dd8
[   43.297120]  ffffffff813fff10 ffff880236018000 ffff880236b178c0 0000000000000008
[   43.386071] Call Trace:
[   43.415303]  <IRQ>  [<ffffffff81487847>] dump_stack+0x49/0x62
[   43.484174]  [<ffffffff81034e7d>] warn_slowpath_common+0x77/0x91
[   43.556049]  [<ffffffff813fff10>] ? dev_watchdog+0x15c/0x1fb
[   43.623759]  [<ffffffff81034f2b>] warn_slowpath_fmt+0x41/0x43
[   43.692511]  [<ffffffff813fff10>] dev_watchdog+0x15c/0x1fb
[   43.758141]  [<ffffffff813ffdb4>] ? __netdev_watchdog_up+0x64/0x64
[   43.832091]  [<ffffffff8103cd04>] call_timer_fn+0x17/0x6f
[   43.896682]  [<ffffffff8103cebe>] run_timer_softirq+0x162/0x1a2
[   43.967511]  [<ffffffff81038520>] __do_softirq+0xcd/0x1cc
[   44.032104]  [<ffffffff81038689>] irq_exit+0x3a/0x48
[   44.091492]  [<ffffffff81026d43>] smp_apic_timer_interrupt+0x43/0x50
[   44.167525]  [<ffffffff8148c24a>] apic_timer_interrupt+0x6a/0x70
[   44.239392]  <EOI>  [<ffffffff8100992c>] ? default_idle+0x6/0x8
[   44.310343]  [<ffffffff81009b31>] arch_cpu_idle+0x13/0x18
[   44.374934]  [<ffffffff81066126>] cpu_startup_entry+0xa7/0x101
[   44.444724]  [<ffffffff81025660>] start_secondary+0x1b2/0x1b7
[   44.513472] ---[ end trace a5a075fd4e7f854f ]---
[   44.568753] igb 0000:04:00.0 eth0: Reset adapter
[   46.206945] random: nonblocking pool is initialized
[   46.465670] irq 44: nobody cared (try booting with the "irqpoll" option)
[   46.545862] CPU: 7 PID: 0 Comm: swapper/7 Tainted: G        W    3.14.0-rc2-mptcp #437
[   46.640610] Hardware name: HP ProLiant DL165 G7, BIOS O37 01/26/2011
[   46.716641]  ffff8802363f8c84 ffff88023fdc3e38 ffffffff81487847 00000000a03cdb6d
[   46.805598]  ffff8802363f8c00 ffff88023fdc3e68 ffffffff81068489 0000007f81825400
[   46.894539]  ffff8802363f8c00 0000000000000000 0000000000000000 ffff88023fdc3ea8
[   46.983484] Call Trace:
[   47.012714]  <IRQ>  [<ffffffff81487847>] dump_stack+0x49/0x62
[   47.081585]  [<ffffffff81068489>] __report_bad_irq+0x35/0xc1
[   47.149295]  [<ffffffff81068683>] note_interrupt+0x16e/0x1ea
[   47.217006]  [<ffffffff8106679e>] handle_irq_event_percpu+0x116/0x12e
[   47.294075]  [<ffffffff810667e9>] handle_irq_event+0x33/0x4f
[   47.361787]  [<ffffffff81068c95>] handle_fasteoi_irq+0x83/0xd1
[   47.431577]  [<ffffffff81003d5b>] handle_irq+0x1f/0x28
[   47.493047]  [<ffffffff81003567>] do_IRQ+0x4e/0xd4
[   47.550358]  [<ffffffff8148b06a>] common_interrupt+0x6a/0x6a
[   47.618066]  <EOI>  [<ffffffff8100992c>] ? default_idle+0x6/0x8
[   47.689016]  [<ffffffff81009b31>] arch_cpu_idle+0x13/0x18
[   47.753605]  [<ffffffff81066126>] cpu_startup_entry+0xa7/0x101
[   47.823397]  [<ffffffff81025660>] start_secondary+0x1b2/0x1b7
[   47.892146] handlers:
[   47.919301] [<ffffffff812fbd7d>] igb_intr

So, this patch unsets the flag to indicate that we are not using MSIX.
This patch does exactly this: Unsetting the flag when falling back to MSI.

Fixes: cd14ef54d25b (igb: Change to use statically allocated array for MSIx entries)
Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 46d31a49f5ea..893b52393b56 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1121,6 +1121,7 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix)
 
 	/* If we can't do MSI-X, try MSI */
 msi_only:
+	adapter->flags &= ~IGB_FLAG_HAS_MSIX;
 #ifdef CONFIG_PCI_IOV
 	/* disable SR-IOV for non MSI-X configurations */
 	if (adapter->vf_data) {
-- 
1.8.3.2


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
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 related

* [GIT] Networking
From: David Miller @ 2014-02-18 23:34 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) kvaser CAN driver has fixed limits of some of it's table, validate that
   we won't exceed those limits at probe time.  Fix from Olivier Sobrie.

2) Fix rtl8192ce disabling interrupts for too long, from Olivier Langlois.

3) Fix botched shift in ath5k driver, from Dan Carpenter.

4) Fix corruption of deferred packets in TIPC, from Erik Hugne.

5) Fix newlink error path in macvlan driver, from Cong Wang.

6) Fix netpoll deadlock in bonding, from Ding Tianhong.

7) Handle GSO packets properly in forwarding path when fragmentation
   is necessary on egress, from Florian Westphal.

8) Fix axienet build errors, from Michal Simek.

9) Fix refcounting of ubufs on tx in vhost net driver, from Michael
   S. Tsirkin.

10) Carrier status isn't set properly in hyperv driver, from Haiyang
    Zhang.

11) Missing pci_disable_device() in tulip_remove_one), from Ingo Molnar.

12) AF_PACKET qdisc bypass mode doesn't adhere to driver provided TX
    queue selection method.  Add a fallback method mechanism to fix
    this bug, from Daniel Borkmann.

13) Fix regression in link local route handling on GRE tunnels, from
    Nicolas Dichtel.

14) Bonding can assign dup aggregator IDs in some sequences of
    configuration, fix by making the allocation counter per-bond
    instead of global.  From Jiri Bohac.

15) sctp_connectx() needs compat translations, from Daniel Borkmann.

16) Fix of_mdio PHY interrupt parsing, from Ben Dooks.

Please pull, thanks a lot!

The following changes since commit 738b52bb9845da183b6ff46a8f685b56a63379d1:

  Merge tag 'microblaze-3.14-rc3' of git://git.monstr.eu/linux-2.6-microblaze (2014-02-11 12:24:35 -0800)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net master

for you to fetch changes up to 22f08ad9721d4d1a92061b60026144627a60d644:

  MAINTAINERS: add entry for the PHY library (2014-02-18 18:13:40 -0500)

----------------------------------------------------------------
Aleksander Morgado (1):
      net: qmi_wwan: add support for Cinterion PXS8 and PHS8

Antonio Quartulli (9):
      batman-adv: fix soft-interface MTU computation
      batman-adv: fix TT-TVLV parsing on OGM reception
      batman-adv: release vlan object after checking the CRC
      batman-adv: properly check pskb_may_pull return value
      batman-adv: avoid potential race condition when adding a new neighbour
      batman-adv: fix TT CRC computation by ensuring byte order
      batman-adv: free skb on TVLV parsing success
      batman-adv: avoid double free when orig_node initialization fails
      batman-adv: fix potential kernel paging error for unicast transmissions

Ben Dooks (1):
      of_mdio: fix phy interrupt passing

Cong Wang (2):
      macvlan: unregister net device when netdev_upper_dev_link() fails
      net: correct error path in rtnl_newlink()

Dan Carpenter (2):
      ath5k: shifting the wrong variable for AR5K_AR5210
      af_packet: remove a stray tab in packet_set_ring()

Daniel Borkmann (4):
      netdevice: add queue selection fallback handler for ndo_select_queue
      netdevice: move netdev_cap_txqueue for shared usage to header
      packet: check for ndo_select_queue during queue selection
      net: sctp: fix sctp_connectx abi for ia32 emulation/compat mode

David S. Miller (3):
      Merge tag 'linux-can-fixes-for-3.14-20140212' of git://gitorious.org/linux-can/linux-can
      Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
      Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless

Duan Jiong (2):
      ipv4: distinguish EHOSTUNREACH from the ENETUNREACH
      ipv4: fix counter in_slow_tot

Emil Goode (2):
      net: asix: add missing flag to struct driver_info
      usbnet: remove generic hard_header_len check

Emmanuel Grumbach (1):
      iwlwifi: disable TX AMPDU by default for iwldvm

Erik Hugne (1):
      tipc: fix message corruption bug for deferred packets

FX Le Bail (1):
      ipv4: ipconfig.c: add parentheses in an if statement

Florian Fainelli (2):
      net: of_mdio: fix of_set_phy_supported after driver probing
      MAINTAINERS: add entry for the PHY library

Florian Westphal (2):
      net: core: introduce netif_skb_dev_features
      net: ip, ipv6: handle gso skbs in forwarding path

Gerrit Renker (1):
      dccp: re-enable debug macro

Haiyang Zhang (1):
      hyperv: Fix the carrier status setting

Heiko Schocher (1):
      drivers: net: cpsw: fix buggy loop condition

Ingo Molnar (1):
      drivers/net: tulip_remove_one needs to call pci_disable_device()

Jan Luebbe (1):
      net: fix macvtap type name in Kconfig

Jingoo Han (1):
      USB2NET: SR9800: use %zu for size_t

Jiri Bohac (1):
      bonding: 802.3ad: make aggregator_identifier bond-private

John W. Linville (2):
      Merge git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem

Liu Junliang (1):
      USB2NET: Fix Default to 'y' for SR9800 Device Driver, setting to 'n'

Matija Glavinic Pecotic (1):
      net: sctp: Fix a_rwnd/rwnd management to reflect real state of the receiver's buffer

Michael S. Tsirkin (2):
      vhost: fix ref cnt checking deadlock
      vhost: fix a theoretical race in device cleanup

Michal Simek (2):
      net: axienet: Fix compilation error
      net: axienet: Fix compilation warnings

Mike Galbraith (1):
      net,bonding: fix bond_options.c direct rwlock.h include

Nicolas Dichtel (1):
      gre: add link local route when local addr is any

Olivier Langlois (2):
      rtlwifi: rtl8192ce: Fix too long disable of IRQs
      rtlwifi: Fix incorrect return from rtl_ps_enable_nic()

Olivier Sobrie (1):
      can: kvaser_usb: check number of channels returned by HW

Paul Gortmaker (1):
      Documentation/networking: delete orphaned 3c505.txt file.

Russell King (1):
      NET: fec: only enable napi if we are successful

Russell King - ARM Linux (1):
      hostap: fix "hostap: proc: Use remove_proc_subtree()"

Simon Wunderlich (1):
      batman-adv: fix potential orig_node reference leak

Srinivas Kandagatla (1):
      net: stmmac:sti: Add STi SOC glue driver.

Stanislaw Gruszka (1):
      rtl8187: fix regression on MIPS without coherent DMA

Stefan Sørensen (1):
      net:phy:dp83640: Move all HW initialization to dp83640_config_init

Thomas Petazzoni (1):
      net: ethernet: update dependency and help text of mvneta

Tommie Gannert (1):
      irtty-sir.c: Do not set_termios() on irtty_close()

Uwe Kleine-König (1):
      net: cpsw: catch of_get_phy_mode failing and propagate error

Vijay Subramanian (1):
      net: sched: Cleanup PIE comments

dingtianhong (1):
      bonding: Fix deadlock in bonding driver when using netpoll

wangweidong (2):
      sctp: fix a missed .data initialization
      sctp: optimize the sctp_sysctl_net_register

 .../devicetree/bindings/net/sti-dwmac.txt          |  58 ++++
 Documentation/networking/3c505.txt                 |  45 ---
 MAINTAINERS                                        |  11 +
 drivers/net/Kconfig                                |   2 +-
 drivers/net/bonding/bond_3ad.c                     |   6 +-
 drivers/net/bonding/bond_3ad.h                     |   1 +
 drivers/net/bonding/bond_main.c                    |   9 +-
 drivers/net/bonding/bond_options.c                 |   2 +-
 drivers/net/can/usb/kvaser_usb.c                   |   2 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c    |   4 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h    |   2 +-
 drivers/net/ethernet/dec/tulip/tulip_core.c        |   1 +
 drivers/net/ethernet/freescale/fec_main.c          |   4 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |   6 +-
 drivers/net/ethernet/lantiq_etop.c                 |   2 +-
 drivers/net/ethernet/marvell/Kconfig               |   6 +-
 drivers/net/ethernet/mellanox/mlx4/en_tx.c         |   4 +-
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h       |   2 +-
 drivers/net/ethernet/stmicro/stmmac/Kconfig        |  11 +
 drivers/net/ethernet/stmicro/stmmac/Makefile       |   1 +
 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c    | 330 +++++++++++++++++++++
 drivers/net/ethernet/stmicro/stmmac/stmmac.h       |   3 +
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   5 +
 drivers/net/ethernet/ti/cpsw.c                     |  11 +-
 drivers/net/ethernet/tile/tilegx.c                 |   2 +-
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c  |  13 +-
 drivers/net/hyperv/netvsc_drv.c                    |  53 +++-
 drivers/net/irda/irtty-sir.c                       |   1 -
 drivers/net/macvlan.c                              |   5 +-
 drivers/net/phy/dp83640.c                          |  13 +-
 drivers/net/team/team.c                            |   2 +-
 drivers/net/tun.c                                  |   2 +-
 drivers/net/usb/Kconfig                            |   1 -
 drivers/net/usb/asix_devices.c                     |   3 +-
 drivers/net/usb/ax88179_178a.c                     |   4 +
 drivers/net/usb/gl620a.c                           |   4 +
 drivers/net/usb/mcs7830.c                          |   5 +-
 drivers/net/usb/net1080.c                          |   4 +
 drivers/net/usb/qmi_wwan.c                         |   9 +-
 drivers/net/usb/rndis_host.c                       |   4 +
 drivers/net/usb/smsc75xx.c                         |   4 +
 drivers/net/usb/smsc95xx.c                         |   4 +
 drivers/net/usb/sr9800.c                           |   6 +-
 drivers/net/usb/usbnet.c                           |  25 +-
 drivers/net/wireless/ath/ath5k/phy.c               |   2 +-
 drivers/net/wireless/hostap/hostap_proc.c          |   2 +-
 drivers/net/wireless/iwlwifi/dvm/mac80211.c        |  22 +-
 drivers/net/wireless/iwlwifi/iwl-drv.c             |   2 +-
 drivers/net/wireless/iwlwifi/iwl-modparams.h       |  11 +-
 drivers/net/wireless/iwlwifi/mvm/mac80211.c        |  22 +-
 drivers/net/wireless/mwifiex/main.c                |   2 +-
 drivers/net/wireless/rtl818x/rtl8187/rtl8187.h     |  10 +-
 drivers/net/wireless/rtlwifi/ps.c                  |   2 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c        |  18 +-
 drivers/of/of_mdio.c                               |  22 +-
 drivers/staging/bcm/Bcmnet.c                       |   2 +-
 drivers/staging/netlogic/xlr_net.c                 |   2 +-
 drivers/staging/rtl8188eu/os_dep/os_intfs.c        |   2 +-
 drivers/vhost/net.c                                |  47 +--
 include/linux/netdevice.h                          |  36 ++-
 include/linux/skbuff.h                             |  17 ++
 include/net/sctp/structs.h                         |  14 +-
 net/batman-adv/bat_iv_ogm.c                        |  30 +-
 net/batman-adv/hard-interface.c                    |  22 +-
 net/batman-adv/originator.c                        |  36 +++
 net/batman-adv/originator.h                        |   4 +
 net/batman-adv/routing.c                           |   4 +-
 net/batman-adv/send.c                              |   9 +-
 net/batman-adv/translation-table.c                 |  23 +-
 net/core/dev.c                                     |  22 +-
 net/core/flow_dissector.c                          |  20 +-
 net/core/rtnetlink.c                               |  19 +-
 net/dccp/ccids/lib/tfrc.c                          |   2 +-
 net/dccp/ccids/lib/tfrc.h                          |   1 +
 net/ipv4/ip_forward.c                              |  71 ++++-
 net/ipv4/ipconfig.c                                |   2 +-
 net/ipv4/route.c                                   |  13 +-
 net/ipv6/addrconf.c                                |   2 +
 net/ipv6/ip6_output.c                              |  17 +-
 net/mac80211/iface.c                               |   6 +-
 net/packet/af_packet.c                             |  26 +-
 net/sched/sch_pie.c                                |  21 +-
 net/sctp/associola.c                               |  82 ++---
 net/sctp/sm_statefuns.c                            |   2 +-
 net/sctp/socket.c                                  |  47 ++-
 net/sctp/sysctl.c                                  |  18 +-
 net/sctp/ulpevent.c                                |   8 +-
 net/tipc/core.h                                    |   1 +
 net/tipc/link.c                                    |   7 +
 89 files changed, 1081 insertions(+), 361 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/sti-dwmac.txt
 delete mode 100644 Documentation/networking/3c505.txt
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c

^ permalink raw reply

* Re: [PATCH net-next 12/14] r8152: replace netif_rx with netif_receive_skb
From: Francois Romieu @ 2014-02-18 23:28 UTC (permalink / raw)
  To: Hayes Wang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1392731351-25502-13-git-send-email-hayeswang@realtek.com>

Hayes Wang <hayeswang@realtek.com> :
> Replace netif_rx with netif_receive_skb to avoid disabling irq frequently
> for increasing the efficiency.

read_bulk_callback is issued in irq context. It could thus use plain
spin_lock / spin_unlock instead of the irq disabling version.

-- 
Ueimor

^ permalink raw reply

* Re: [PATCH net-next] bonding: Fix RTNL: assertion failed at net/core/rtnetlink.c for 802.3ad mode
From: Jay Vosburgh @ 2014-02-18 23:18 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: Andy Gospodarek, Veaceslav Falico, Cong Wang, Thomas Glanzmann,
	Jiri Pirko, David S. Miller, Eric Dumazet, Scott Feldman, Netdev
In-Reply-To: <53034312.1060203@huawei.com>

Ding Tianhong <dingtianhong@huawei.com> wrote:

>The problem was introduced by the commit 1d3ee88ae0d
>(bonding: add netlink attributes to slave link dev).
>The bond_set_active_slave() and bond_set_backup_slave()
>will use rtmsg_ifinfo to send slave's states, so these
>two functions should be called in RTNL.
>
>In 802.3ad mode, acquiring RTNL for the __enable_port and
>__disable_port cases is difficult, as those calls generally
>already hold the state machine lock, and cannot unconditionally
>call rtnl_lock because either they already hold RTNL (for calls
>via bond_3ad_unbind_slave) or due to the potential for deadlock
>with bond_3ad_adapter_speed_changed, bond_3ad_adapter_duplex_changed,
>bond_3ad_link_change, or bond_3ad_update_lacp_rate.  All four of
>those are called with RTNL held, and acquire the state machine lock
>second.  The calling contexts for __enable_port and __disable_port
>already hold the state machine lock, and may or may not need RTNL.
>
>According to the Jay's opinion, I don't think it is a problem that
>the slave don't send notify message synchronously when the status
>changed, normally the state machine is running every 100 ms, send
>the notify message at the end of the state machine if the slave's
>state changed should be better.
>
>I fix the problem through these steps:
>
>1). add a new function bond_set_slave_state() which could change
>    the slave's state and call rtmsg_ifinfo() according to the input
>    parameters called notify.
>
>2). Add a new slave parameter which called should_notify, if the slave's state
>    changed and don't notify yet, the parameter will be set to 1, and then if
>    the slave's state changed again, the param will be set to 0, it indicate that
>    the slave's state has been restored, no need to notify any one.
>
>3). the __enable_port and __disable_port should not call rtmsg_ifinfo
>    in the state machine lock, any change in the state of slave could
>    set a flag in the slave, it will indicated that an rtmsg_ifinfo
>    should be called at the end of the state machine.
>
>Cc: Jay Vosburgh <fubar@us.ibm.com>
>Cc: Veaceslav Falico <vfalico@redhat.com>
>Cc: Andy Gospodarek <andy@greyhouse.net>
>Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>---
> drivers/net/bonding/bond_3ad.c  | 22 ++++++++++++++++++++--
> drivers/net/bonding/bond_main.c | 30 +++++++++++++++---------------
> drivers/net/bonding/bonding.h   | 31 ++++++++++++++++++++++++++-----
> 3 files changed, 61 insertions(+), 22 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index e9edd84..c450d04 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -181,7 +181,7 @@ static inline int __agg_has_partner(struct aggregator *agg)
>  */
> static inline void __disable_port(struct port *port)
> {
>-	bond_set_slave_inactive_flags(port->slave);
>+	bond_set_slave_inactive_flags(port->slave, false);
> }
>
> /**
>@@ -193,7 +193,7 @@ static inline void __enable_port(struct port *port)
> 	struct slave *slave = port->slave;
>
> 	if ((slave->link == BOND_LINK_UP) && IS_UP(slave->dev))
>-		bond_set_slave_active_flags(slave);
>+		bond_set_slave_active_flags(slave, false);
> }
>
> /**
>@@ -2065,6 +2065,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
> 	struct list_head *iter;
> 	struct slave *slave;
> 	struct port *port;
>+	int slave_should_notify = 0;
>
> 	read_lock(&bond->lock);
> 	rcu_read_lock();
>@@ -2122,8 +2123,25 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
> 	}
>
> re_arm:
>+	bond_for_each_slave_rcu(bond, slave, iter) {
>+		if (slave->should_notify) {
>+			slave_should_notify = 1;
>+			break;
>+		}
>+	}
> 	rcu_read_unlock();
> 	read_unlock(&bond->lock);
>+
>+	if (slave_should_notify && rtnl_trylock()) {
>+		bond_for_each_slave(bond, slave, iter) {
>+			if (slave->should_notify) {
>+				rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0,
>+					     GFP_KERNEL);
>+				slave->should_notify = 0;
>+			}
>+		}
>+		rtnl_unlock();
>+	}
> 	queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks);
> }
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 3bce855..1c14e64 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -829,21 +829,21 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
> 	if (bond_is_lb(bond)) {
> 		bond_alb_handle_active_change(bond, new_active);
> 		if (old_active)
>-			bond_set_slave_inactive_flags(old_active);
>+			bond_set_slave_inactive_flags(old_active, true);
> 		if (new_active)
>-			bond_set_slave_active_flags(new_active);
>+			bond_set_slave_active_flags(new_active, true);
> 	} else {
> 		rcu_assign_pointer(bond->curr_active_slave, new_active);
> 	}
>
> 	if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) {
> 		if (old_active)
>-			bond_set_slave_inactive_flags(old_active);
>+			bond_set_slave_inactive_flags(old_active, true);
>
> 		if (new_active) {
> 			bool should_notify_peers = false;
>
>-			bond_set_slave_active_flags(new_active);
>+			bond_set_slave_active_flags(new_active, true);
>
> 			if (bond->params.fail_over_mac)
> 				bond_do_fail_over_mac(bond, new_active,
>@@ -1462,14 +1462,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
>
> 	switch (bond->params.mode) {
> 	case BOND_MODE_ACTIVEBACKUP:
>-		bond_set_slave_inactive_flags(new_slave);
>+		bond_set_slave_inactive_flags(new_slave, true);
> 		break;
> 	case BOND_MODE_8023AD:
> 		/* in 802.3ad mode, the internal mechanism
> 		 * will activate the slaves in the selected
> 		 * aggregator
> 		 */
>-		bond_set_slave_inactive_flags(new_slave);
>+		bond_set_slave_inactive_flags(new_slave, true);
> 		/* if this is the first slave */
> 		if (!prev_slave) {
> 			SLAVE_AD_INFO(new_slave).id = 1;
>@@ -1487,7 +1487,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
> 	case BOND_MODE_TLB:
> 	case BOND_MODE_ALB:
> 		bond_set_active_slave(new_slave);
>-		bond_set_slave_inactive_flags(new_slave);
>+		bond_set_slave_inactive_flags(new_slave, true);
> 		break;
> 	default:
> 		pr_debug("This slave is always active in trunk mode\n");
>@@ -2009,7 +2009,7 @@ static void bond_miimon_commit(struct bonding *bond)
>
> 			if (bond->params.mode == BOND_MODE_ACTIVEBACKUP ||
> 			    bond->params.mode == BOND_MODE_8023AD)
>-				bond_set_slave_inactive_flags(slave);
>+				bond_set_slave_inactive_flags(slave, true);
>
> 			pr_info("%s: link status definitely down for interface %s, disabling it\n",
> 				bond->dev->name, slave->dev->name);
>@@ -2555,7 +2555,7 @@ static void bond_ab_arp_commit(struct bonding *bond)
> 				slave->link = BOND_LINK_UP;
> 				if (bond->current_arp_slave) {
> 					bond_set_slave_inactive_flags(
>-						bond->current_arp_slave);
>+						bond->current_arp_slave, true);
> 					bond->current_arp_slave = NULL;
> 				}
>
>@@ -2575,7 +2575,7 @@ static void bond_ab_arp_commit(struct bonding *bond)
> 				slave->link_failure_count++;
>
> 			slave->link = BOND_LINK_DOWN;
>-			bond_set_slave_inactive_flags(slave);
>+			bond_set_slave_inactive_flags(slave, true);
>
> 			pr_info("%s: link status definitely down for interface %s, disabling it\n",
> 				bond->dev->name, slave->dev->name);
>@@ -2650,7 +2650,7 @@ static bool bond_ab_arp_probe(struct bonding *bond)
> 		}
> 	}
>
>-	bond_set_slave_inactive_flags(curr_arp_slave);
>+	bond_set_slave_inactive_flags(curr_arp_slave, true);

	This...

> 	bond_for_each_slave(bond, slave, iter) {
> 		if (!found && !before && IS_UP(slave->dev))
>@@ -2670,7 +2670,7 @@ static bool bond_ab_arp_probe(struct bonding *bond)
> 			if (slave->link_failure_count < UINT_MAX)
> 				slave->link_failure_count++;
>
>-			bond_set_slave_inactive_flags(slave);
>+			bond_set_slave_inactive_flags(slave, true);

	[ but not this one ]

> 			pr_info("%s: backup interface %s is now down\n",
> 				bond->dev->name, slave->dev->name);
>@@ -2688,7 +2688,7 @@ static bool bond_ab_arp_probe(struct bonding *bond)
> 	}
>
> 	new_slave->link = BOND_LINK_BACK;
>-	bond_set_slave_active_flags(new_slave);
>+	bond_set_slave_active_flags(new_slave, true);

	and this should arguably never send an rtmsg_ifinfo
notification.

	My presumption is that the notification is to indicate that the
interface has actually changed state in a meaningful way, but these
calls are internal settings of the flags to allow the ARP monitor to
search for a slave to become active when there are no active slaves
(according to ARP monitor).  The flag setting to active or backup is to
permit the ARP monitor's response logic to do the right thing when
deciding if the test slave (current_arp_slave) is up or not.

	What will happen here is that, for as long as all slaves are
down, each cycle through the curr_arp_slave will shift to the next slave
in the list, the flags will be adjusted for the previous and now-current
arp slaves, and a pass of the ARP monitor will complete (send ARPs, next
time through, check for any replies).

	As the patch is written, while all slaves are down this will
generate an rtmsg_ifinfo call for each of two slaves during each pass of
the ARP monitor, until such time that any slave becomes active.

	I haven't heard back from anybody about what the rtmsg_ifinfo
notifications are used for, so I'm not 100% sure this is incorrect.  It
doesn't seem like a proper usage, though, since the slave is not
actually transitioning to an "up" or "down" state that is usable.

	The way the code is written in the patch, "false" doesn't mean
"never notify," it means "notify later," which isn't quite what I had
meant.

	I may be concerned about nothing here, and the extra
notifications may be harmless.  In the absence of feedback, we could
apply the patch as-is and if there are issues, fix them later.

	-J


> 	bond_arp_send_all(bond, new_slave);
> 	new_slave->jiffies = jiffies;
> 	rcu_assign_pointer(bond->current_arp_slave, new_slave);
>@@ -3035,9 +3035,9 @@ static int bond_open(struct net_device *bond_dev)
> 		bond_for_each_slave(bond, slave, iter) {
> 			if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP)
> 				&& (slave != bond->curr_active_slave)) {
>-				bond_set_slave_inactive_flags(slave);
>+				bond_set_slave_inactive_flags(slave, true);
> 			} else {
>-				bond_set_slave_active_flags(slave);
>+				bond_set_slave_active_flags(slave, true);
> 			}
> 		}
> 		read_unlock(&bond->curr_slave_lock);
>diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
>index 86ccfb9..1f51a5f 100644
>--- a/drivers/net/bonding/bonding.h
>+++ b/drivers/net/bonding/bonding.h
>@@ -195,7 +195,8 @@ struct slave {
> 	s8     new_link;
> 	u8     backup:1,   /* indicates backup slave. Value corresponds with
> 			      BOND_STATE_ACTIVE and BOND_STATE_BACKUP */
>-	       inactive:1; /* indicates inactive slave */
>+	       inactive:1, /* indicates inactive slave */
>+	       should_notify:1; /* indicateds whether the state changed */
> 	u8     duplex;
> 	u32    original_mtu;
> 	u32    link_failure_count;
>@@ -303,6 +304,24 @@ static inline void bond_set_backup_slave(struct slave *slave)
> 	}
> }
>
>+static inline void bond_set_slave_state(struct slave *slave,
>+					int slave_state, bool notify)
>+{
>+	if (slave->backup == slave_state)
>+		return;
>+
>+	slave->backup = slave_state;
>+	if (notify) {
>+		rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_KERNEL);
>+		slave->should_notify = 0;
>+	} else {
>+		if (slave->should_notify)
>+			slave->should_notify = 0;
>+		else
>+			slave->should_notify = 1;
>+	}
>+}
>+
> static inline void bond_slave_state_change(struct bonding *bond)
> {
> 	struct list_head *iter;
>@@ -394,17 +413,19 @@ static inline void bond_netpoll_send_skb(const struct slave *slave,
> }
> #endif
>
>-static inline void bond_set_slave_inactive_flags(struct slave *slave)
>+static inline void bond_set_slave_inactive_flags(struct slave *slave,
>+						 bool notify)
> {
> 	if (!bond_is_lb(slave->bond))
>-		bond_set_backup_slave(slave);
>+		bond_set_slave_state(slave, BOND_STATE_BACKUP, notify);
> 	if (!slave->bond->params.all_slaves_active)
> 		slave->inactive = 1;
> }
>
>-static inline void bond_set_slave_active_flags(struct slave *slave)
>+static inline void bond_set_slave_active_flags(struct slave *slave,
>+					       bool notify)
> {
>-	bond_set_active_slave(slave);
>+	bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify);
> 	slave->inactive = 0;
> }
>
>-- 
>1.8.0
>
>

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

^ permalink raw reply

* Re: [patch net-next] rtnl: make ifla_policy static
From: David Miller @ 2014-02-18 23:16 UTC (permalink / raw)
  To: jiri; +Cc: netdev, kaber, xiyou.wangcong, stephen, vyasevic, jbenc
In-Reply-To: <1392753198-9437-1-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Tue, 18 Feb 2014 20:53:18 +0100

> The only place this is used outside rtnetlink.c is veth. So provide
> wrapper function for this usage.
> 
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] openvswitch: Use ether_addr_copy
From: David Miller @ 2014-02-18 23:15 UTC (permalink / raw)
  To: joe-6d6DIl74uiNBDgjK7y7TUQ
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <fee7d53a1cfdec0aec7ea35a1f2f4b5e66766ee3.1392750899.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>

From: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Date: Tue, 18 Feb 2014 11:15:45 -0800

> It's slightly smaller/faster for some architectures.
> 
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>

I'll let Jesse take this via his tree, thanks Joe.

^ 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