Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net] bnx2x: Fix configuration of doorbell block
From: David Miller @ 2013-09-09 21:07 UTC (permalink / raw)
  To: eric.dumazet; +Cc: ariele, netdev, eilong
In-Reply-To: <1378736236.26319.29.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 09 Sep 2013 07:17:16 -0700

> On Mon, 2013-09-09 at 14:51 +0300, Ariel Elior wrote:
>> As part of VF RSS feature doorbell block was configured not to use dpm, but
>> a small part of configuration was left out, preventing the driver from sending
>> tx messages to the device. This patch adds the missing configuration.
>> 
>> Reported-by: Eric Dumazet <eric.dumazet@gmil.com>
>> Signed-off-by: Ariel Elior <ariele@broadcom.com>
>> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
>> ---
>>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c  |    1 +
>>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c |    3 ---
>>  2 files changed, 1 insertions(+), 3 deletions(-)
> 
> Thanks for fixing this.
> 
> Tested-by: Eric Dumazet <edumazet@google.com>

Applied, thanks.

^ permalink raw reply

* Re: TSQ accounting skb->truesize degrades throughput for large packets
From: Zoltan Kiss @ 2013-09-09 21:41 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Wei Liu, Jonathan Davies, Ian Campbell, netdev, xen-devel
In-Reply-To: <1378574494.26319.14.camel@edumazet-glaptop>

On 07/09/13 18:21, Eric Dumazet wrote:
> On Fri, 2013-09-06 at 10:00 -0700, Eric Dumazet wrote:
>> On Fri, 2013-09-06 at 17:36 +0100, Zoltan Kiss wrote:
>>
>>> So I guess it would be good to revisit the default value of this
>>> setting.
>>
>> If ixgbe requires 3 TSO packets in TX ring to get line rate, you also
>> can tweak dev->gso_max_size from 65535 to 64000.
>
> Another idea would be to no longer use tcp_limit_output_bytes but
>
> max(sk_pacing_rate / 1000, 2*MSS)

I've tried this on a freshly updated upstream, and it solved my problem 
on ixgbe:

-               if (atomic_read(&sk->sk_wmem_alloc) >= 
sysctl_tcp_limit_output_bytes) {
+               if (atomic_read(&sk->sk_wmem_alloc) >= 
max(sk->sk_pacing_rate / 1000, 2 * mss_now) ){

Now I can get proper line rate. Btw. I've tried to decrease 
dev->gso_max_size to 60K or 32K, both was ineffective.

Regards,

Zoli

^ permalink raw reply

* Re: TSQ accounting skb->truesize degrades throughput for large packets
From: Eric Dumazet @ 2013-09-09 21:56 UTC (permalink / raw)
  To: Zoltan Kiss; +Cc: Wei Liu, Jonathan Davies, Ian Campbell, netdev, xen-devel
In-Reply-To: <522E4080.2050802@citrix.com>

On Mon, 2013-09-09 at 22:41 +0100, Zoltan Kiss wrote:
> On 07/09/13 18:21, Eric Dumazet wrote:
> > On Fri, 2013-09-06 at 10:00 -0700, Eric Dumazet wrote:
> >> On Fri, 2013-09-06 at 17:36 +0100, Zoltan Kiss wrote:
> >>
> >>> So I guess it would be good to revisit the default value of this
> >>> setting.
> >>
> >> If ixgbe requires 3 TSO packets in TX ring to get line rate, you also
> >> can tweak dev->gso_max_size from 65535 to 64000.
> >
> > Another idea would be to no longer use tcp_limit_output_bytes but
> >
> > max(sk_pacing_rate / 1000, 2*MSS)
> 
> I've tried this on a freshly updated upstream, and it solved my problem 
> on ixgbe:
> 
> -               if (atomic_read(&sk->sk_wmem_alloc) >= 
> sysctl_tcp_limit_output_bytes) {
> +               if (atomic_read(&sk->sk_wmem_alloc) >= 
> max(sk->sk_pacing_rate / 1000, 2 * mss_now) ){
> 
> Now I can get proper line rate. Btw. I've tried to decrease 
> dev->gso_max_size to 60K or 32K, both was ineffective.

Yeah, my own test was more like the following


diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7c83cb8..07dc77a 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1872,7 +1872,8 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
 		/* TSQ : sk_wmem_alloc accounts skb truesize,
 		 * including skb overhead. But thats OK.
 		 */
-		if (atomic_read(&sk->sk_wmem_alloc) >= sysctl_tcp_limit_output_bytes) {
+		if (atomic_read(&sk->sk_wmem_alloc) >= max(2 * mss_now,
+							   sk->sk_pacing_rate >> 8)) {
 			set_bit(TSQ_THROTTLED, &tp->tsq_flags);
 			break;
 		}


Note that it also seems to make Hystart happier.

I will send patches when all tests are green.

^ permalink raw reply related

* Re: [PATCH net 1/1] r8169: enforce RX_MULTI_EN for the 8168f.
From: Francois Romieu @ 2013-09-09 22:50 UTC (permalink / raw)
  To: hayeswang
  Cc: netdev, 'David Miller', 'David R',
	'Frédéric Leroy', 'nic_swsd'
In-Reply-To: <941AC15120E247718F8B349F9B3B7422@realtek.com.tw>

hayeswang <hayeswang@realtek.com> :
[...]
> I don't have any issue reported about the fetching numbers, so I have no
> idea about why it could fix you problem.

Thanks Hayes.

Frédéric, David (R not M), do your systems include some Marvell SATA controller ?

-- 
Ueimor

^ permalink raw reply

* [PATCH 1/1] net: race condition when removing virtual net_device
From: Francesco Ruggeri @ 2013-09-09 23:15 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jiri Pirko, Alexander Duyck,
	Cong Wang, netdev
  Cc: Francesco Ruggeri

There is a race condition when removing a net_device while its net namespace
is also being removed.
This can result in a crash or other unpredictable behavior.
This is a sample scenario with veth, but the same applies to other virtual
devices such as vlan and macvlan.
veth pair v0-v1 is created, with v0 in namespace ns0 and v1 in ns1.
Process p0 deletes v0. v1 is also unregistered (in veth_dellink), so when p0
gets to netdev_run_todo both v0 and v1 are in net_todo_list, and they have both
been unlisted from their respective namespaces. If all references to v1 have not
already been dropped then netdev_run_todo/netdev_wait_allrefs will call netdev
notifiers for v1, releasing the rtnl lock between calls.
Now process p1 removes namespace ns1. v1 will not prevent this from happening
(in default_device_exit_batch) since it was already unlisted by p0.
Next time p0 invokes the notifiers for v1 any notifiers that use dev_net(v1)
will get a pointer to a namespace that has been or is being removed.
Similar scenarios apply with v1 as a vlan or macvlan interface and v0 as its
real device.
We hit this problem in 3.4 with sequence fib_netdev_event, fib_disable_ip,
rt_cache_flush, rt_cache_invalidate, inetpeer_invalidate_tree. That sequence no
longer applies in later kernels, but unless we can guarantee that no
NETDEV_UNREGISTER or NETDEV_UNREGISTER_FINAL handler accesses a net_device's
dev_net(dev) then there is a vulnerability (this happens for example with
NETDEV_UNREGISTER_FINAL in dst_dev_event/dst_ifdown).
Commit 0115e8e3 later made things better by reducing the chances of this
happening, but the underlying problem still seems to be there.
I would like to get some feedback on this patch.
The idea is to take a reference to the loopback_dev of a net_device's
namespace (which is always the last net_device to be removed when a namespace
is destroyed) when the net_device is unlisted, and release it when the
net_device is disposed of.
To avoid deadlocks in cleanup_net all loopback_devs are queued at the end
of net_todo_list.

Tested on Linux 3.4.

Signed-off-by: Francesco Ruggeri <fruggeri@aristanetworks.com>
---
 net/core/dev.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 26755dd..da2fd78 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -225,10 +225,14 @@ static void list_netdevice(struct net_device *dev)
 }
 
 /* Device list removal
+ * Take a reference to dev_net(dev)->loopback_dev, so dev_net(dev)
+ * will not be freed until we are done with dev.
  * caller must respect a RCU grace period before freeing/reusing dev
  */
 static void unlist_netdevice(struct net_device *dev)
 {
+	struct net_device *loopback_dev = dev_net(dev)->loopback_dev;
+
 	ASSERT_RTNL();
 
 	/* Unlink dev from the device chain */
@@ -238,9 +242,23 @@ static void unlist_netdevice(struct net_device *dev)
 	hlist_del_rcu(&dev->index_hlist);
 	write_unlock_bh(&dev_base_lock);
 
+	if (dev != loopback_dev)
+		dev_hold(loopback_dev);
+
 	dev_base_seq_inc(dev_net(dev));
 }
 
+/**
+ * Called when a net_device that has been previously unlisted from a net
+ * namespace is disposed of.
+ */
+static inline void unlist_netdevice_done(struct net_device *dev)
+{
+	struct net_device *loopback_dev = dev_net(dev)->loopback_dev;
+	if (dev != loopback_dev)
+		dev_put(loopback_dev);
+}
+
 /*
  *	Our notifier list
  */
@@ -5009,10 +5027,17 @@ static int dev_new_index(struct net *net)
 
 /* Delayed registration/unregisteration */
 static LIST_HEAD(net_todo_list);
+static struct list_head *first_loopback_dev = &net_todo_list;
 
 static void net_set_todo(struct net_device *dev)
 {
-	list_add_tail(&dev->todo_list, &net_todo_list);
+	/* All loopback_devs go to end of net_todo_list. */
+	if (dev == dev_net(dev)->loopback_dev) {
+		list_add_tail(&dev->todo_list, &net_todo_list);
+		if (first_loopback_dev == &net_todo_list)
+			first_loopback_dev = &dev->todo_list;
+	} else
+		list_add_tail(&dev->todo_list, first_loopback_dev);
 }
 
 static void rollback_registered_many(struct list_head *head)
@@ -5641,6 +5666,7 @@ void netdev_run_todo(void)
 
 	/* Snapshot list, allow later requests */
 	list_replace_init(&net_todo_list, &list);
+	first_loopback_dev = &net_todo_list;
 
 	__rtnl_unlock();
 
@@ -5670,6 +5696,7 @@ void netdev_run_todo(void)
 		on_each_cpu(flush_backlog, dev, 1);
 
 		netdev_wait_allrefs(dev);
+		unlist_netdevice_done(dev);
 
 		/* paranoia */
 		BUG_ON(netdev_refcnt_read(dev));
@@ -6076,6 +6103,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 	kobject_uevent(&dev->dev.kobj, KOBJ_REMOVE);
 
 	/* Actually switch the network namespace */
+	unlist_netdevice_done(dev);
 	dev_net_set(dev, net);
 
 	/* If there is an ifindex conflict assign a new one */
-- 
1.7.4.4

^ permalink raw reply related

* Re: [PATCH 1/1] net: race condition when removing virtual net_device
From: Stephen Hemminger @ 2013-09-10  0:57 UTC (permalink / raw)
  To: Francesco Ruggeri
  Cc: David S. Miller, Eric Dumazet, Jiri Pirko, Alexander Duyck,
	Cong Wang, netdev
In-Reply-To: <1378768511-27866-1-git-send-email-fruggeri@aristanetworks.com>

On Mon,  9 Sep 2013 16:15:11 -0700
Francesco Ruggeri <fruggeri@aristanetworks.com> wrote:

> There is a race condition when removing a net_device while its net namespace
> is also being removed.
> This can result in a crash or other unpredictable behavior.
> This is a sample scenario with veth, but the same applies to other virtual
> devices such as vlan and macvlan.
> veth pair v0-v1 is created, with v0 in namespace ns0 and v1 in ns1.
> Process p0 deletes v0. v1 is also unregistered (in veth_dellink), so when p0
> gets to netdev_run_todo both v0 and v1 are in net_todo_list, and they have both
> been unlisted from their respective namespaces. If all references to v1 have not
> already been dropped then netdev_run_todo/netdev_wait_allrefs will call netdev
> notifiers for v1, releasing the rtnl lock between calls.
> Now process p1 removes namespace ns1. v1 will not prevent this from happening
> (in default_device_exit_batch) since it was already unlisted by p0.
> Next time p0 invokes the notifiers for v1 any notifiers that use dev_net(v1)
> will get a pointer to a namespace that has been or is being removed.

Namespace's should be ref counted.

^ permalink raw reply

* Re: macvlan: Move skb_clone check closer to call
From: Simon Horman @ 2013-09-10  1:38 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David S. Miller, netdev
In-Reply-To: <20130907022711.GA22613@gondor.apana.org.au>

On Sat, Sep 07, 2013 at 12:27:11PM +1000, Herbert Xu wrote:
> Currently macvlan calls skb_clone in macvlan_broadcast but checks
> for a NULL return in macvlan_broadcast_one instead.  This is
> needlessly confusing and may lead to bugs introduced later.
> 
> This patch moves the error check to where the skb_clone call is.
> 
> The only other caller of macvlan_broadcast_one never passes in a
> NULL value so it doesn't need the check either.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

This seems good to me as macvlan_handle_frame(), which is
the only other caller of macvlan_broadcast_one(), already checks
that skb is non-NULL before calling macvlan_handle_frame().

Reviewed-by: Simon Horman <horms@verge.net.au>

> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index 64dfaa3..9bf46bd 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -118,8 +118,6 @@ static int macvlan_broadcast_one(struct sk_buff *skb,
>  				 const struct ethhdr *eth, bool local)
>  {
>  	struct net_device *dev = vlan->dev;
> -	if (!skb)
> -		return NET_RX_DROP;
>  
>  	if (local)
>  		return vlan->forward(dev, skb);
> @@ -171,9 +169,13 @@ static void macvlan_broadcast(struct sk_buff *skb,
>  			hash = mc_hash(vlan, eth->h_dest);
>  			if (!test_bit(hash, vlan->mc_filter))
>  				continue;
> +
> +			err = NET_RX_DROP;
>  			nskb = skb_clone(skb, GFP_ATOMIC);
> -			err = macvlan_broadcast_one(nskb, vlan, eth,
> -					 mode == MACVLAN_MODE_BRIDGE);
> +			if (likely(nskb))
> +				err = macvlan_broadcast_one(
> +					nskb, vlan, eth,
> +					mode == MACVLAN_MODE_BRIDGE);
>  			macvlan_count_rx(vlan, skb->len + ETH_HLEN,
>  					 err == NET_RX_SUCCESS, 1);
>  		}
> 
> Thanks,
> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> --
> 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

* RE: [PATCH] net: fec: add the initial to set the physical mac address
From: Duan Fugang-B38611 @ 2013-09-10  1:45 UTC (permalink / raw)
  To: Lucas Stach, davem@davemloft.net
  Cc: davem@davemloft.net, netdev@vger.kernel.org,
	bhutchings@solarflare.com, Estevam Fabio-R49496,
	stephen@networkplumber.org, Sascha Hauer
In-Reply-To: <9848F2DB572E5649BA045B288BE08FBE01653FEA@039-SN2MPN1-021.039d.mgd.msft.net>

Hi, David,

Please don't ignore the patch. 

Thanks,
Andy

> -----Original Message-----
> From: Duan Fugang-B38611
> Sent: Friday, August 30, 2013 10:01 AM
> To: Lucas Stach; davem@davemloft.net
> Cc: davem@davemloft.net; netdev@vger.kernel.org; bhutchings@solarflare.com;
> Estevam Fabio-R49496; stephen@networkplumber.org
> Subject: RE: [PATCH] net: fec: add the initial to set the physical mac
> address
> 
> Ping...
> 
> > -----Original Message-----
> > From: netdev-owner@vger.kernel.org
> > [mailto:netdev-owner@vger.kernel.org]
> > On Behalf Of Duan Fugang-B38611
> > Sent: Wednesday, August 28, 2013 10:11 AM
> > To: Lucas Stach
> > Cc: Li Frank-B20596; Zhou Luwei-B45643; davem@davemloft.net;
> > netdev@vger.kernel.org; shawn.guo@linaro.org;
> > bhutchings@solarflare.com; Estevam Fabio-R49496;
> > stephen@networkplumber.org
> > Subject: RE: [PATCH] net: fec: add the initial to set the physical mac
> > address
> >
> > From: Lucas Stach [mailto:l.stach@pengutronix.de]
> > Data: Tuesday, August 27, 2013 10:19 PM
> >
> > > To: Duan Fugang-B38611
> > > Cc: Li Frank-B20596; Zhou Luwei-B45643; davem@davemloft.net;
> > > netdev@vger.kernel.org; shawn.guo@linaro.org;
> > > bhutchings@solarflare.com; Estevam Fabio-R49496;
> > > stephen@networkplumber.org
> > > Subject: Re: [PATCH] net: fec: add the initial to set the physical
> > > mac address
> > >
> > > Am Donnerstag, den 22.08.2013, 19:17 +0800 schrieb Fugang Duan:
> > > > For imx6slx evk platform, the fec driver cannot work since there
> > > > have no valid mac address set in physical mac registers.
> > > >
> > > > For imx serial platform, fec/enet IPs both need the physical MAC
> > > > address initial, otherwise it cannot work.
> > > >
> > > > After acquiring the valid MAC address from devices tree/pfuse/
> > > > kernel command line/random mac address, and then set it to the
> > > > physical MAC address registers.
> > > >
> > > Yeah, we have also seen that we need to set this explicitly. The
> > > strange thing is that I recall this used to work without calling
> > > fec_set_mac_address() explicitly, so either the netdev core was
> > > calling it at some point, or our userspace was. I didn't got around
> > > to investigate this further.
> > Netdev core don't call the function willingly, if only user config MAC
> > address such as call ioctl(sockfd, SIOCSIFHWADDR, ifreq).
> >
> > > So anyway:
> > > Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
> > >
> > > > Signed-off-by: Fugang Duan  <B38611@freescale.com>
> > > > ---
> > > >  drivers/net/ethernet/freescale/fec_main.c |    9 ++++++---
> > > >  1 files changed, 6 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > > > b/drivers/net/ethernet/freescale/fec_main.c
> > > > index 4349a9e..9b5e08c 100644
> > > > --- a/drivers/net/ethernet/freescale/fec_main.c
> > > > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > > > @@ -1867,10 +1867,12 @@ fec_set_mac_address(struct net_device
> > > > *ndev,
> > > void *p)
> > > >  	struct fec_enet_private *fep = netdev_priv(ndev);
> > > >  	struct sockaddr *addr = p;
> > > >
> > > > -	if (!is_valid_ether_addr(addr->sa_data))
> > > > -		return -EADDRNOTAVAIL;
> > > > +	if (p) {
> > > > +		if (!is_valid_ether_addr(addr->sa_data))
> > > > +			return -EADDRNOTAVAIL;
> > > >
> > > > -	memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
> > > > +		memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
> > > > +	}
> > > >
> > > >  	writel(ndev->dev_addr[3] | (ndev->dev_addr[2] << 8) |
> > > >  		(ndev->dev_addr[1] << 16) | (ndev->dev_addr[0] << 24),
> @@ -
> > > 1969,6
> > > > +1971,7 @@ static int fec_enet_init(struct net_device *ndev)
> > > >
> > > >  	/* Get the Ethernet address */
> > > >  	fec_get_mac(ndev);
> > > > +	fec_set_mac_address(ndev, NULL);
> > > >
> > > >  	/* Set receive and transmit descriptor base. */
> > > >  	fep->rx_bd_base = cbd_base;
> > >
> > > --
> > > Pengutronix e.K.                           | Lucas Stach
> > |
> > > Industrial Linux Solutions                 |
> http://www.pengutronix.de/
> > |
> > > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone:
> > > +49-5121-206917-5076
> > |
> > > Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-
> 5555
> > |
> > >
> >
> 

^ permalink raw reply

* RE: [PATCH] net: fec: fix build warning of used uninitialized variable
From: Duan Fugang-B38611 @ 2013-09-10  1:48 UTC (permalink / raw)
  To: davem@davemloft.net
  Cc: netdev@vger.kernel.org, shawn.guo@linaro.org,
	bhutchings@solarflare.com, Estevam Fabio-R49496,
	stephen@networkplumber.org, Li Frank-B20596, Sascha Hauer
In-Reply-To: <1F990F8245A4214A8CC4BFFBD9F790F908B16AA6@039-SN1MPN1-002.039d.mgd.msft.net>

Hi, David,

Please don't ignore the patch too.

Thanks,
Andy

> -----Original Message-----
> From: Duan Fugang-B38611
> Sent: Friday, August 30, 2013 10:48 AM
> To: davem@davemloft.net
> Cc: netdev@vger.kernel.org; shawn.guo@linaro.org;
> bhutchings@solarflare.com; Estevam Fabio-R49496;
> stephen@networkplumber.org; Li Frank-B20596
> Subject: RE: [PATCH] net: fec: fix build warning of used uninitialized
> variable
> 
> Ping...
> 
> > -----Original Message-----
> > From: Li Frank-B20596
> > Sent: Thursday, August 22, 2013 10:16 PM
> > To: Duan Fugang-B38611; Zhou Luwei-B45643; davem@davemloft.net
> > Cc: netdev@vger.kernel.org; shawn.guo@linaro.org;
> > bhutchings@solarflare.com; Estevam Fabio-R49496;
> > stephen@networkplumber.org
> > Subject: RE: [PATCH] net: fec: fix build warning of used uninitialized
> > variable
> >
> > > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > > b/drivers/net/ethernet/freescale/fec_main.c
> > > index 77ea0db..4ea1555 100644
> > > --- a/drivers/net/ethernet/freescale/fec_main.c
> > > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > > @@ -835,7 +835,7 @@ fec_enet_rx(struct net_device *ndev, int budget)
> > >  	int	pkt_received = 0;
> > >  	struct	bufdesc_ex *ebdp = NULL;
> > >  	bool	vlan_packet_rcvd = false;
> > > -	u16	vlan_tag;
> > > +	u16	vlan_tag = 0;
> > >
> > >  #ifdef CONFIG_M532x
> > >  	flush_cache_all();
> >
> > Acked
> >
> > > --
> > > 1.7.1

^ permalink raw reply

* Re: [PATCH 1/1] net: race condition when removing virtual net_device
From: Francesco Ruggeri @ 2013-09-10  2:03 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David S. Miller, Eric Dumazet, Jiri Pirko, Alexander Duyck,
	Cong Wang, netdev
In-Reply-To: <20130909175706.39c1f210@nehalam.linuxnetplumber.net>

On Mon, Sep 9, 2013 at 5:57 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Mon,  9 Sep 2013 16:15:11 -0700
> Francesco Ruggeri <fruggeri@aristanetworks.com> wrote:
>
> > There is a race condition when removing a net_device while its net namespace
> > is also being removed.
> > This can result in a crash or other unpredictable behavior.
> > This is a sample scenario with veth, but the same applies to other virtual
> > devices such as vlan and macvlan.
> > veth pair v0-v1 is created, with v0 in namespace ns0 and v1 in ns1.
> > Process p0 deletes v0. v1 is also unregistered (in veth_dellink), so when p0
> > gets to netdev_run_todo both v0 and v1 are in net_todo_list, and they have both
> > been unlisted from their respective namespaces. If all references to v1 have not
> > already been dropped then netdev_run_todo/netdev_wait_allrefs will call netdev
> > notifiers for v1, releasing the rtnl lock between calls.
> > Now process p1 removes namespace ns1. v1 will not prevent this from happening
> > (in default_device_exit_batch) since it was already unlisted by p0.
> > Next time p0 invokes the notifiers for v1 any notifiers that use dev_net(v1)
> > will get a pointer to a namespace that has been or is being removed.
>
> Namespace's should be ref counted.


Namespaces are refcounted, but rollback_registered_many is also
invoked when a namespace is torn down. That is triggered in put_net
exactly by the namespace refcount dropping to 0, which then triggers
__put_net, cleanup_net, ops_exit_list, default_device_exit_batch and
unregister_netdevice_many. In that case using the namespace refcount
would not prevent the namespace from being deleted, since we already
passed the point (in put_net) where the refcount would have had that
effect. It would probably also not be straightforward to start using
again the namespace refcount in code that started under the premise
that the refcount had dropped to 0.
net_devices in a namespace do not seem to take references to the
namespace that they are in, and as far as I can tell the only thing
that prevents a namespace form being removed from under its
net_devices' feet is default_device_exit or default_device_exit_batch.
But unlist_netdevice creates a window where that logic fails.
In addition to this, in general we can have several instances of
netdev_run_todo running concurrently with any number of net_devices
from any number of net namespaces, possibly cross-referencing each
other. Some of these instances may be in the context of cleanup_net
and some may not.
Taking a refcount on the loopback_dev and making sure the looback_devs
are at the tail of net_todo_list in each of these instances was the
only way I could come up with to address all scenarios, but there may
be better ways to do it.

Thanks,
Francesco

^ permalink raw reply

* wrt. core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()
From: Maciej Żenczykowski @ 2013-09-10  2:14 UTC (permalink / raw)
  To: Linux NetDev, Eric Dumazet, David Miller, Isaku Yamahata, decot

Merged in v3.11-rc1:

commit 06a23fe31ca3992863721f21bdb0307af93da807
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Tue Jul 2 20:30:10 2013 +0900

    core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()

    The dev_forward_skb() assignment of pkt_type should be done
    after the call to eth_type_trans().

    ip-encapsulated packets can be handled by localhost. But skb->pkt_type
    can be PACKET_OTHERHOST when packet comes via veth into ip tunnel device.
    In that case, the packet is dropped by ip_rcv().
    Although this example uses gretap. l2tp-eth also has same issue.
    For l2tp-eth case, add dummy device for ip address and ip l2tp command.

    ...

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1659,6 +1659,12 @@ int dev_forward_skb(struct net_device *dev,
struct sk_buff *skb)
        }
        skb_scrub_packet(skb);
        skb->protocol = eth_type_trans(skb, dev);
+
+       /* eth_type_trans() can set pkt_type.
+        * clear pkt_type _after_ calling eth_type_trans()
+        */
+       skb->pkt_type = PACKET_HOST;
+
        return netif_rx(skb);
 }
 EXPORT_SYMBOL_GPL(dev_forward_skb);

Appears to me to be bogus.

AFAICT, this results in (at least) veth devices effectively ignoring
destination mac addresses,
since eth_type_trans is what sets PACKET_BROADCAST/MULTICAST/HOST/OTHERHOST,
and this makes everything functionally equivalanet to having a dst mac
address equal to the devices mac address.

(might also affect macvlan and L2TP)

- Maciej

^ permalink raw reply

* Help the needy with this cash donation
From: Gillian and Adrian Bayford @ 2013-09-10  2:01 UTC (permalink / raw)





This is to inform you that I and my wife wish to give you a cash
donation of £1,500,000.00 GBP for your generosity to the society, get back
to us for further details.

To know more about us, please check this web page;
http://news.sky.com/story/972395/148-6m-euromillions-jackpot-winners-named

Best regards,
Gillian and Adrian Bayford.

^ permalink raw reply

* Re: [PATCH] pch_gbe: fix unmet direct dependency on PTP_1588_CLOCK_PCH
From: Vladimir Murzin @ 2013-09-10  2:29 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: netdev, davem, ben, jeffrey.t.kirsher, rdunlap, haicheng.lee
In-Reply-To: <522E28E5.5010106@infradead.org>

On Mon, Sep 09, 2013 at 01:00:37PM -0700, Randy Dunlap wrote:
> On 09/09/13 12:28, Vladimir Murzin wrote:
> > While cross-building for PPC.
> > 
> > warning: (PCH_GBE) selects PTP_1588_CLOCK_PCH which has unmet direct
> > dependencies (X86 || COMPILE_TEST)
> > 
> > Both PCH_GBE and PPT_1588_CLOCK_PCH is only compatible with Intel
> > architecture. Add dependency on x86 for PCH_GBE. Keep COMPILE_TEST to allow
> > building on different arches.
> > 
> > Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
> > ---
> >  drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
> > index cb22341..4a935ec 100644
> > --- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
> > +++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
> > @@ -4,7 +4,7 @@
> >  
> >  config PCH_GBE
> >  	tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE"
> > -	depends on PCI
> > +	depends on PCI && (x86 || COMPILE_TEST)
> 
> Has this been tested?
> That should be             X86

Right, it should be X86. It was cross-compile tested which was obviously not
enough. Thanks.

> 
> >  	select MII
> >  	select PTP_1588_CLOCK_PCH
> >  	---help---
> > 
> 
> 
> -- 
> ~Randy

^ permalink raw reply

* [PATCH v2] pch_gbe: fix unmet direct dependency on PTP_1588_CLOCK_PCH
From: Vladimir Murzin @ 2013-09-10  2:33 UTC (permalink / raw)
  To: netdev
  Cc: davem, ben, jeffrey.t.kirsher, rdunlap, haicheng.lee,
	Vladimir Murzin

While cross-building for PPC.

warning: (PCH_GBE) selects PTP_1588_CLOCK_PCH which has unmet direct
dependencies (X86 || COMPILE_TEST)

Both PCH_GBE and PPT_1588_CLOCK_PCH is only compatible with Intel
architecture. Add dependency on x86 for PCH_GBE. Keep COMPILE_TEST to allow
building on different arches.

Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
---
v1->v2:
 - s/x86/X86 (pointed  by Randy)

 drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
index cb22341..4a935ec 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
@@ -4,7 +4,7 @@
 
 config PCH_GBE
 	tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE"
-	depends on PCI
+	depends on PCI && (X86 || COMPILE_TEST)
 	select MII
 	select PTP_1588_CLOCK_PCH
 	---help---
-- 
1.8.1.5

^ permalink raw reply related

* [PATCH] net: fec: fix phy reset operation to let imx6sl evk work
From: Fugang Duan @ 2013-09-10  2:35 UTC (permalink / raw)
  To: shawn.guo, davem; +Cc: netdev, bhutchings, stephen, b20596, s.hauer, b38611

The patch do correct phy reset operation to let imx6sl evk
ethernet work.

Current driver only do phy reset in probe function, which is
not right. Since some phy clock is disabled after module probe,
the phy enter abnormal status, which needs do reset to recovery
the phy. And do ifconfig ethx up/down test, the phy also enter
abnormal status.

The log as:
libphy: 2188000.ethernet:04 - Link is Up - 10/Full
libphy: 2188000.ethernet:04 - Link is Up - 100/Full
libphy: 2188000.ethernet:04 - Link is Down
libphy: 2188000.ethernet:04 - Link is Up - 10/Half
libphy: 2188000.ethernet:04 - Link is Up - 10/Full
libphy: 2188000.ethernet:04 - Link is Up - 100/Full
...

So, do phy reset if ethx up/down or clock enable/disable.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Reviewed-by: Shawn Guo <R65073@freescale.com>
CC: Shawn Guo <R65073@freescale.com>
CC: Li Frank <B20596@freescale.com>
CC: "David S. Miller" <davem@davemloft.net>
---
 drivers/net/ethernet/freescale/fec.h      |    3 +
 drivers/net/ethernet/freescale/fec_main.c |   61 +++++++++++++++++-----------
 2 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 0120217..b33c92d 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -321,6 +321,9 @@ struct fec_enet_private {
 	struct	napi_struct napi;
 	int	csum_flags;
 
+	int	phy_reset_gpio;
+	int     reset_duration;
+
 	struct ptp_clock *ptp_clock;
 	struct ptp_clock_info ptp_caps;
 	unsigned long last_overflow_check;
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 7a87012..5a9ba1d 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -18,7 +18,7 @@
  * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
  * Copyright (c) 2004-2006 Macq Electronique SA.
  *
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
+ * Copyright (C) 2010-2013 Freescale Semiconductor, Inc.
  */
 
 #include <linux/module.h>
@@ -61,6 +61,7 @@
 #include "fec.h"
 
 static void set_multicast_list(struct net_device *ndev);
+static void fec_reset_phy(struct platform_device *pdev);
 
 #if defined(CONFIG_ARM)
 #define FEC_ALIGNMENT	0xf
@@ -1781,6 +1782,10 @@ fec_enet_open(struct net_device *ndev)
 	phy_start(fep->phy_dev);
 	netif_start_queue(ndev);
 	fep->opened = 1;
+
+	/* reset phy */
+	fec_enet_reset_phy(fep->pdev);
+
 	return 0;
 }
 
@@ -2030,43 +2035,52 @@ static int fec_enet_init(struct net_device *ndev)
 	return 0;
 }
 
-#ifdef CONFIG_OF
-static void fec_reset_phy(struct platform_device *pdev)
+static void fec_enet_of_init(struct platform_device *pdev)
 {
-	int err, phy_reset;
-	int msec = 1;
 	struct device_node *np = pdev->dev.of_node;
+	struct net_device *ndev = platform_get_drvdata(pdev);
+	struct fec_enet_private *fep = netdev_priv(ndev);
+	int err;
+
+	/*
+	 * init phy-reset-gpio to one invalid GPIO for no phy
+	 * gpio reset platform
+	 */
+	fep->phy_reset_gpio = -1;
 
 	if (!np)
 		return;
 
-	of_property_read_u32(np, "phy-reset-duration", &msec);
+	of_property_read_u32(np, "phy-reset-duration"
+				&fep->reset_duration);
 	/* A sane reset duration should not be longer than 1s */
-	if (msec > 1000)
-		msec = 1;
+	if ((fep->reset_duration > 1000) || (fep->reset_duration == 0))
+		fep->reset_duration = 1;
 
-	phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
-	if (!gpio_is_valid(phy_reset))
+	fep->phy_reset_gpio = of_get_named_gpio(np, "phy-reset-gpios", 0);
+	if (!gpio_is_valid(fep->phy_reset_gpio))
 		return;
 
-	err = devm_gpio_request_one(&pdev->dev, phy_reset,
-				    GPIOF_OUT_INIT_LOW, "phy-reset");
+	err = devm_gpio_request_one(&pdev->dev, fep->phy_reset_gpio,
+				    GPIOF_OUT_INIT_HIGH, "phy-reset");
 	if (err) {
 		dev_err(&pdev->dev, "failed to get phy-reset-gpios: %d\n", err);
-		return;
+		fep->phy_reset_gpio = -1;
 	}
-	msleep(msec);
-	gpio_set_value(phy_reset, 1);
 }
-#else /* CONFIG_OF */
-static void fec_reset_phy(struct platform_device *pdev)
+
+static void fec_enet_reset_phy(struct platform_device *pdev)
 {
-	/*
-	 * In case of platform probe, the reset has been done
-	 * by machine code.
-	 */
+	struct net_device *ndev = platform_get_drvdata(pdev);
+	struct fec_enet_private *fep = netdev_priv(ndev);
+
+	/* check GPIO valid to avoid kernel print warning when no gpio reset */
+	if (gpio_is_valid(fep->phy_reset_gpio)) {
+		gpio_set_value(fep->phy_reset_gpio, 0);
+		msleep(fep->reset_duration);
+		gpio_set_value(fep->phy_reset_gpio, 1);
+	}
 }
-#endif /* CONFIG_OF */
 
 static int
 fec_probe(struct platform_device *pdev)
@@ -2117,6 +2131,7 @@ fec_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, ndev);
 
+	fec_enet_of_init(pdev);
 	ret = of_get_phy_mode(pdev->dev.of_node);
 	if (ret < 0) {
 		pdata = pdev->dev.platform_data;
@@ -2170,8 +2185,6 @@ fec_probe(struct platform_device *pdev)
 		fep->reg_phy = NULL;
 	}
 
-	fec_reset_phy(pdev);
-
 	if (fep->bufdesc_ex)
 		fec_ptp_init(pdev);
 
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH v2] pch_gbe: fix unmet direct dependency on PTP_1588_CLOCK_PCH
From: Vladimir Murzin @ 2013-09-10  3:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, ben, jeffrey.t.kirsher, rdunlap, haicheng.lee
In-Reply-To: <1378780396-3694-1-git-send-email-murzin.v@gmail.com>

On Tue, Sep 10, 2013 at 04:33:16AM +0200, Vladimir Murzin wrote:
> While cross-building for PPC.
> 
> warning: (PCH_GBE) selects PTP_1588_CLOCK_PCH which has unmet direct
> dependencies (X86 || COMPILE_TEST)
> 
> Both PCH_GBE and PPT_1588_CLOCK_PCH is only compatible with Intel
> architecture. Add dependency on x86 for PCH_GBE. Keep COMPILE_TEST to allow
> building on different arches.
> 
> Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
> ---
> v1->v2:
>  - s/x86/X86 (pointed  by Randy)
> 
>  drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
> index cb22341..4a935ec 100644
> --- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
> +++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
> @@ -4,7 +4,7 @@
>  
>  config PCH_GBE
>  	tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE"
> -	depends on PCI
> +	depends on PCI && (X86 || COMPILE_TEST)
>  	select MII
>  	select PTP_1588_CLOCK_PCH
>  	---help---
> -- 
> 1.8.1.5
> 

Please, ignore it. It's already fixed by f0e6160 "net: pch_gbe depends on
x86".

Sorry for the noise.

Vladimir 

^ permalink raw reply

* [PATCH net-next] net: sk_buff: memset(skb,0) after alloc in skb_clone
From: Govindarajulu Varadarajan @ 2013-09-10  4:48 UTC (permalink / raw)
  To: davem, netdev; +Cc: Govindarajulu Varadarajan

The following patch memset the skb to 0 after alloc. We do this in
__alloc_skb_head, __alloc_skb, build_skb. We are missing this in
skb_clone.

The following call to __skb_clone in skb_clone does not copy all the
members of sk_buff. If we donot clear the skb to 0, we will have some
uninitialized members in new skb.

Signed-off-by: Govindarajulu Varadarajan <govindarajulu90@gmail.com>
---
 net/core/skbuff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index d81cff1..fc78f66 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -891,6 +891,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
 		n = kmem_cache_alloc(skbuff_head_cache, gfp_mask);
 		if (!n)
 			return NULL;
+		memset(n, 0, offsetof(struct sk_buff, tail));
 
 		kmemcheck_annotate_bitfield(n, flags1);
 		kmemcheck_annotate_bitfield(n, flags2);
-- 
1.8.4

^ permalink raw reply related

* Re: [PATCH] net: fec: add the initial to set the physical mac address
From: David Miller @ 2013-09-10  5:07 UTC (permalink / raw)
  To: B38611; +Cc: l.stach, netdev, bhutchings, r49496, stephen, s.hauer
In-Reply-To: <9848F2DB572E5649BA045B288BE08FBE016A7B22@039-SN2MPN1-023.039d.mgd.msft.net>

From: Duan Fugang-B38611 <B38611@freescale.com>
Date: Tue, 10 Sep 2013 01:45:52 +0000

> Please don't ignore the patch. 

Please don't just pray that it's in my queue and I will apply it.

If it's not in my patchwork queue, you need to simply resubmit it.

If it is in my patchwork queue, you need to be patient.

Thank you.

^ permalink raw reply

* RE: [PATCH] net: fec: add the initial to set the physical mac address
From: Duan Fugang-B38611 @ 2013-09-10  5:23 UTC (permalink / raw)
  To: David Miller
  Cc: l.stach@pengutronix.de, netdev@vger.kernel.org,
	bhutchings@solarflare.com, Estevam Fabio-R49496,
	stephen@networkplumber.org, s.hauer@pengutronix.de
In-Reply-To: <20130910.010748.1537386784228501617.davem@davemloft.net>

From: David Miller [mailto:davem@davemloft.net]
Data: Tuesday, September 10, 2013 1:08 PM

> To: Duan Fugang-B38611
> Cc: l.stach@pengutronix.de; netdev@vger.kernel.org;
> bhutchings@solarflare.com; Estevam Fabio-R49496;
> stephen@networkplumber.org; s.hauer@pengutronix.de
> Subject: Re: [PATCH] net: fec: add the initial to set the physical mac
> address
> 
> From: Duan Fugang-B38611 <B38611@freescale.com>
> Date: Tue, 10 Sep 2013 01:45:52 +0000
> 
> > Please don't ignore the patch.
> 
> Please don't just pray that it's in my queue and I will apply it.
> 
> If it's not in my patchwork queue, you need to simply resubmit it.
> 
> If it is in my patchwork queue, you need to be patient.
> 
> Thank you.
> 
Ok, I know, just a notify to avoid forget it because I did ping to you.

Thanks.

^ permalink raw reply

* Re: [PATCH] ethernet/arc/arc_emac: Fix huge delays in large file copies
From: Vineet Gupta @ 2013-09-10  6:27 UTC (permalink / raw)
  To: greg Kroah-Hartman
  Cc: David Miller, netdev, Alexey.Brodkin, linux-kernel, arc-linux-dev,
	stable@vger.kernel.org
In-Reply-To: <20130905.142530.732425484460470485.davem@davemloft.net>

On 09/05/2013 11:55 PM, David Miller wrote:
> From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
> Date: Wed, 4 Sep 2013 17:17:15 +0530
> 
>> copying large files to a NFS mounted host was taking absurdly large
>> time.
>>
>> Turns out that TX BD reclaim had a sublte bug.
>>
>> Loop starts off from @txbd_dirty cursor and stops when it hits a BD
>> still in use by controller. However when it stops it needs to keep the
>> cursor at that very BD to resume scanning in next iteration. However it
>> was erroneously incrementing the cursor, causing the next scan(s) to
>> fail too, unless the BD chain was completely drained out.
>>
>> [ARCLinux]$ ls -l -sh /disk/log.txt
>>  17976 -rw-r--r--    1 root     root       17.5M Sep  /disk/log.txt
>>
>> ========== Before =====================
>> [ARCLinux]$ time cp /disk/log.txt /mnt/.
>> real    31m 7.95s
>> user    0m 0.00s
>> sys     0m 0.10s
>>
>> ========== After =====================
>> [ARCLinux]$ time cp /disk/log.txt /mnt/.
>> real    0m 24.33s
>> user    0m 0.00s
>> sys     0m 0.19s
>>
>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> 
> Applied.
> 

Hi Greg,

This needs a stable backport (3.11).
Mainline commit 27082ee1b92f4d41e78b85

Thx,
-Vineet

^ permalink raw reply

* Re: [PATCH net-next] net: sk_buff: memset(skb,0) after alloc in skb_clone
From: Erik Hugne @ 2013-09-10  6:33 UTC (permalink / raw)
  To: govindarajalu90; +Cc: netdev

Dont think this is necessary. Use GFP_ZERO mask in the skb_clone() call instead.

//E

^ permalink raw reply

* [PATCH 1/1] net: ath9k: Use NULL instead of false
From: Sachin Kamat @ 2013-09-10  6:20 UTC (permalink / raw)
  To: linux-wireless
  Cc: ath9k-devel, netdev, mcgrof, jouni, vthiagar, senthilb, linville,
	sachin.kamat

The function returns a pointer. Hence return NULL instead of false.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/net/wireless/ath/ath9k/dfs_pri_detector.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
index 5ba4b6f..c718fc3 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
@@ -392,7 +392,7 @@ static struct pri_sequence *pri_detector_add_pulse(struct pri_detector *de,
 
 	if (!pseq_handler_create_sequences(de, ts, max_updated_seq)) {
 		pri_detector_reset(de, ts);
-		return false;
+		return NULL;
 	}
 
 	ps = pseq_handler_check_detection(de);
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 1/1] net: cdc-phonet: Staticize usbpn_probe
From: Sachin Kamat @ 2013-09-10  6:30 UTC (permalink / raw)
  To: netdev; +Cc: davem, remi, sachin.kamat

'usbpn_probe' is referenced only in this file. Make it static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/net/usb/cdc-phonet.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 7d78669..8c44f86 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -328,7 +328,8 @@ MODULE_DEVICE_TABLE(usb, usbpn_ids);
 
 static struct usb_driver usbpn_driver;
 
-int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
+static int
+usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
 	static const char ifname[] = "usbpn%d";
 	const struct usb_cdc_union_desc *union_header = NULL;
-- 
1.7.9.5

^ permalink raw reply related

* Re: TSQ accounting skb->truesize degrades throughput for large packets
From: Jason Wang @ 2013-09-10  7:45 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Zoltan Kiss, Wei Liu, Jonathan Davies, Ian Campbell, netdev,
	xen-devel, Michael S. Tsirkin
In-Reply-To: <1378734444.26319.28.camel@edumazet-glaptop>

On 09/09/2013 09:47 PM, Eric Dumazet wrote:
> On Mon, 2013-09-09 at 17:27 +0800, Jason Wang wrote:
>
>> Virtio-net orphan the skb in .ndo_start_xmit() so TSQ can not throttle
>> packets in device accurately, and it also can't do BQL. Does this means
>> TSQ should be disabled for virtio-net?
>>
> If skb are orphaned, there is no way TSQ can work at all.

For example, virtio-net will stop the tx queue when it finds the tx
queue may full and enable the queue when some packets were sent. In this
case, tsq works and throttles the total bytes queued in qdisc. This
usually happen during heavy network load such as two sessions of netperf.
>
> It is already disabled, so why do you want to disable it ?
>
>

We notice a regression, and bisect shows it was introduced by TSQ.

^ permalink raw reply

* [PATCH 1/1] net: bnx2x: Staticize local symbols
From: Sachin Kamat @ 2013-09-10  7:42 UTC (permalink / raw)
  To: netdev; +Cc: davem, eilong, sachin.kamat

Local symbols used only in this file are made static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 2604b62..5ec30cc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2802,7 +2802,7 @@ struct set_vf_state_cookie {
 	u8 state;
 };
 
-void bnx2x_set_vf_state(void *cookie)
+static void bnx2x_set_vf_state(void *cookie)
 {
 	struct set_vf_state_cookie *p = (struct set_vf_state_cookie *)cookie;
 
@@ -3222,7 +3222,8 @@ void bnx2x_disable_sriov(struct bnx2x *bp)
 	pci_disable_sriov(bp->pdev);
 }
 
-int bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, struct bnx2x_virtf **vf,
+static int
+bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, struct bnx2x_virtf **vf,
 			struct pf_vf_bulletin_content **bulletin)
 {
 	if (bp->state != BNX2X_STATE_OPEN) {
-- 
1.7.9.5

^ permalink raw reply related


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