Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH next] l2tp: add support for IPv4-mapped IPv6 addresses
From: David Miller @ 2013-10-01  4:57 UTC (permalink / raw)
  To: f.cachereul; +Cc: jchapman, netdev
In-Reply-To: <5245694D.3070105@init-sys.com>

From: François Cachereul <f.cachereul@init-sys.com>
Date: Fri, 27 Sep 2013 13:17:33 +0200

> @@ -1620,6 +1621,10 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32
>  	int err;
>  	struct socket *sock = NULL;
>  	struct sock *sk = NULL;
> +#if IS_ENABLED(CONFIG_IPV6)
> +	struct inet_sock *inet = NULL;
> +	struct ipv6_pinfo *np = NULL;
> +#endif
 ...
> +#if IS_ENABLED(CONFIG_IPV6)
> +	np = inet6_sk(sk);
> +	if (sk->sk_family == PF_INET6 &&
> +	    ipv6_addr_v4mapped(&np->saddr) &&
> +	    ipv6_addr_v4mapped(&np->daddr)) {
> +		tunnel->v4mapped = true;
> +		inet = inet_sk(sk);
> +		inet->inet_saddr = np->saddr.s6_addr32[3];
> +		inet->inet_rcv_saddr = np->rcv_saddr.s6_addr32[3];
> +		inet->inet_daddr = np->daddr.s6_addr32[3];
> +	} else {
> +		tunnel->v4mapped = false;
> +	}
> +#endif

You only need one ifdef here, get rid of the top level variable
declarations and then just go:

#if IS_ENABLED(CONFIG_IPV6)
	if (sk->sk_family == PF_INET6) {
		struct ipv6_pinfo *np = inet6_sk(sk);

		if (ipv6_addr_v4mapped(&np->saddr) &&
		    ipv6_addr_v4mapped(&np->daddr)) {
			struct inet_sock *inet = inet_sk(sk);

			tunnel->v4mapped = true;
			inet->inet_saddr = np->saddr.s6_addr32[3];
			inet->inet_rcv_saddr = np->rcv_saddr.s6_addr32[3];
			inet->inet_daddr = np->daddr.s6_addr32[3];
		} else {
			tunnel->v4mapped = false;
		}
	}
#endif

^ permalink raw reply

* Re: [PATCH net-next ] net ipv4: Convert ipv4.ip_local_port_range to be per netns v3
From: David Miller @ 2013-10-01  5:02 UTC (permalink / raw)
  To: ebiederm; +Cc: netdev, nicolas.dichtel
In-Reply-To: <87bo3c1wkc.fsf_-_@tw-ebiederman.twitter.com>

From: ebiederm@xmission.com (Eric W. Biederman)
Date: Sat, 28 Sep 2013 14:10:59 -0700

> 
> - Move sysctl_local_ports from a global variable into struct netns_ipv4.
> - Modify inet_get_local_port_range to take a struct net, and update all
>   of the callers.
> - Move the initialization of sysctl_local_ports into
>    sysctl_net_ipv4.c:ipv4_sysctl_init_net from inet_connection_sock.c
> 
> v2:
> - Ensure indentation used tabs
> - Fixed ip.h so it applies cleanly to todays net-next
> 
> v3:
> - Compile fixes of strange callers of inet_get_local_port_range.
>   This patch now successfully passes an allmodconfig build.
>   Removed manual inlining of inet_get_local_port_range in ipv4_local_port_range
> 
> Originally-by: Samya <samya@twitter.com>
> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>

Applied, thanks Eric.

^ permalink raw reply

* Re: [PATCH] ipv6: gre: correct calculation of max_headroom
From: David Miller @ 2013-10-01  5:04 UTC (permalink / raw)
  To: hannes; +Cc: netdev, xeb
In-Reply-To: <20130929034050.GB8602@order.stressinduktion.org>

From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Sun, 29 Sep 2013 05:40:50 +0200

> gre_hlen already accounts for sizeof(struct ipv6_hdr) + gre header,
> so initialize max_headroom to zero. Otherwise the
> 
> 	if (encap_limit >= 0) {
> 		max_headroom += 8;
> 		mtu -= 8;
> 	}
> 
> increments an uninitialized variable before max_headroom was reset.
> 
> Found with coverity: 728539
> 
> Cc: Dmitry Kozlov <xeb@mail.ru>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH] b44: add support for Byte Queue Limits
From: David Miller @ 2013-10-01  5:11 UTC (permalink / raw)
  To: hauke; +Cc: zambrano, netdev
In-Reply-To: <1380403338-12056-1-git-send-email-hauke@hauke-m.de>

From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 28 Sep 2013 23:22:18 +0200

> This makes it possible to use some more advanced queuing
> techniques with this driver.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Applied.

^ permalink raw reply

* Re: [PATCH v3] bgmac: add support for Byte Queue Limits
From: David Miller @ 2013-10-01  5:11 UTC (permalink / raw)
  To: eric.dumazet; +Cc: hauke, zajec5, netdev
In-Reply-To: <1380515684.3596.23.camel@edumazet-glaptop.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 29 Sep 2013 21:34:44 -0700

> On Sun, 2013-09-29 at 13:54 +0200, Hauke Mehrtens wrote:
>> This makes it possible to use some more advanced queuing
>> techniques with this driver.
>> 
>> When multi queue support will be added some changes to Byte Queue
>> handling is needed.
>> 
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
> 
> Reviewed-by: Eric Dumazet <edumazet@google.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: add missing sk_max_pacing_rate doc
From: David Miller @ 2013-10-01  5:11 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1380442360.3596.18.camel@edumazet-glaptop.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 29 Sep 2013 01:12:40 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> Warning(include/net/sock.h:411): No description found for parameter
> 'sk_max_pacing_rate'
> 
> Lets please "make htmldocs" and kbuild bot.
> 
> Reported-by: Wu Fengguang <fengguang.wu@intel.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: skb_is_gso_v6() requires skb_is_gso()
From: David Miller @ 2013-10-01  5:11 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, eilong
In-Reply-To: <1380442892.3596.22.camel@edumazet-glaptop.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 29 Sep 2013 01:21:32 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> bnx2x makes a dangerous use of skb_is_gso_v6().
> 
> It should first make sure skb is a gso packet
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [PATCH] bonding: Fix broken promiscuity reference counting issue
From: David Miller @ 2013-10-01  5:12 UTC (permalink / raw)
  To: nhorman; +Cc: netdev, fubar, andy, wudxw
In-Reply-To: <1380298935-32140-1-git-send-email-nhorman@tuxdriver.com>

From: Neil Horman <nhorman@tuxdriver.com>
Date: Fri, 27 Sep 2013 12:22:15 -0400

> Recently grabbed this report:
> https://bugzilla.redhat.com/show_bug.cgi?id=1005567
> 
> Of an issue in which the bonding driver, with an attached vlan encountered the
> following errors when bond0 was taken down and back up:
> 
> dummy1: promiscuity touches roof, set promiscuity failed. promiscuity feature of
> device might be broken.
> 
> The error occurs because, during __bond_release_one, if we release our last
> slave, we take on a random mac address and issue a NETDEV_CHANGEADDR
> notification.  With an attached vlan, the vlan may see that the vlan and bond
> mac address were in sync, but no longer are.  This triggers a call to dev_uc_add
> and dev_set_rx_mode, which enables IFF_PROMISC on the bond device.  Then, when
> we complete __bond_release_one, we use the current state of the bond flags to
> determine if we should decrement the promiscuity of the releasing slave.  But
> since the bond changed promiscuity state during the release operation, we
> incorrectly decrement the slave promisc count when it wasn't in promiscuous mode
> to begin with, causing the above error
> 
> Fix is pretty simple, just cache the bonding flags at the start of the function
> and use those when determining the need to set promiscuity.
> 
> This is also needed for the ALLMULTI flag
> 
> CC: Jay Vosburgh <fubar@us.ibm.com>
> CC: Andy Gospodarek <andy@greyhouse.net>
> CC: Mark Wu <wudxw@linux.vnet.ibm.com>
> CC: "David S. Miller" <davem@davemloft.net>
> Reported-by: Mark Wu <wudxw@linux.vnet.ibm.com>

Applied.

^ permalink raw reply

* Re: [PATCH] drivers: net: phy: marvell.c: removed checkpatch.pl warnings
From: David Miller @ 2013-10-01  5:15 UTC (permalink / raw)
  To: avi.kp.137; +Cc: michal.simek, lars, RHoover, netdev
In-Reply-To: <1380514004-8701-1-git-send-email-avi.kp.137@gmail.com>

From: Avinash kumar <avi.kp.137@gmail.com>
Date: Mon, 30 Sep 2013 09:36:44 +0530

> removes following warnings-
> drivers/net/phy/marvell.c:37: WARNING: Use #include <linux/io.h> instead of <asm/io.h>
> drivers/net/phy/marvell.c:39: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
> 
> Signed-off-by: Avinash Kumar <avi.kp.137@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: [net-next PATCH V2] virtio-net: switch to use XPS to choose txq
From: David Miller @ 2013-10-01  5:10 UTC (permalink / raw)
  To: jasowang; +Cc: netdev, virtualization, linux-kernel, mst
In-Reply-To: <1380526637-35524-1-git-send-email-jasowang@redhat.com>

From: Jason Wang <jasowang@redhat.com>
Date: Mon, 30 Sep 2013 15:37:17 +0800

> We used to use a percpu structure vq_index to record the cpu to queue
> mapping, this is suboptimal since it duplicates the work of XPS and
> loses all other XPS functionality such as allowing use to configure
> their own transmission steering strategy.
> 
> So this patch switches to use XPS and suggest a default mapping when
> the number of cpus is equal to the number of queues. With XPS support,
> there's no need for keeping per-cpu vq_index and .ndo_select_queue(),
> so they were removed also.
> 
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> Changes from V1:
> - use cpumask_of() instead of allocate dynamically

This generates build warnings:

drivers/net/virtio_net.c: In function ‘virtnet_set_affinity’:
drivers/net/virtio_net.c:1093:3: warning: passing argument 2 of ‘netif_set_xps_queue’ discards ‘const’ qualifier from pointer target type [enabled by default]
In file included from drivers/net/virtio_net.c:20:0:
include/linux/netdevice.h:2275:5: note: expected ‘struct cpumask *’ but argument is of type ‘const struct cpumask *’
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH net 1/2] ip_tunnel: Fix a memory corruption in ip_tunnel_xmit
From: Steffen Klassert @ 2013-10-01  5:15 UTC (permalink / raw)
  To: David Miller; +Cc: pshelar, netdev
In-Reply-To: <20130930.144026.652414415839724107.davem@davemloft.net>

On Mon, Sep 30, 2013 at 02:40:26PM -0400, David Miller wrote:
> 
> Steffen can you respin these patches and make sure to:
> 
> 1) Add reference to SHA1_ID and commit header line of commit
>    introducing this bug, as Eric requested, in this format:
> 
> 	$SHA1_ID ("Commit header line text.")

Sure, will do that.

> 
> 2) __skb_push() --> skb_push()
> 

I'll do an additional patch for this, as it was not introduced
with the same commit as the memory corruption I've fixed here.

I'll also add a patch to fix the double unregister of the fallback
device that was introduced with commit 6c742e714d8
("ipip: add x-netns support").

^ permalink raw reply

* Re: [PATCH] ethernet: moxa: fix incorrect placement of __initdata tag
From: David Miller @ 2013-10-01  5:17 UTC (permalink / raw)
  To: b.zolnierkie; +Cc: jonas.jensen, netdev, linux-kernel, kyungmin.park
In-Reply-To: <172588984.DhoE4BmVdc@amdc1032>

From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Date: Mon, 30 Sep 2013 15:18:27 +0200

> __initdata tag should be placed between the variable name and equal
> sign for the variable to be placed in the intended .init.data section.
> 
> In this particular case __initdata is incorrect as moxart_mac_driver
> can be used after the driver gets initialized.
> 
> Also while at it static-ize moxart_mac_driver.
> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] include/linux/skbuff.h: move CONFIG_XFRM check inside the skb_sec_path()
From: David Miller @ 2013-10-01  5:25 UTC (permalink / raw)
  To: kda; +Cc: netdev
In-Reply-To: <1380463645-4633-1-git-send-email-kda@linux-powerpc.org>

From: Denis Kirjanov <kda@linux-powerpc.org>
Date: Sun, 29 Sep 2013 18:07:25 +0400

> And thus we have only one function definition
> 
> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>

This does not apply cleanly to the current net-next tree.

^ permalink raw reply

* Re: [PATCH net-next] bonding: RCUify bond_set_rx_mode()
From: David Miller @ 2013-10-01  5:27 UTC (permalink / raw)
  To: vfalico; +Cc: netdev, joe.lawrence, fubar, andy
In-Reply-To: <1380395936-13429-1-git-send-email-vfalico@redhat.com>

From: Veaceslav Falico <vfalico@redhat.com>
Date: Sat, 28 Sep 2013 21:18:56 +0200

> Currently we rely on rtnl locking in bond_set_rx_mode(), however it's not
> always the case:
> 
> RTNL: assertion failed at drivers/net/bonding/bond_main.c (3391)
> ...
>  [<ffffffff81651ca5>] dump_stack+0x54/0x74
>  [<ffffffffa029e717>] bond_set_rx_mode+0xc7/0xd0 [bonding]
>  [<ffffffff81553af7>] __dev_set_rx_mode+0x57/0xa0
>  [<ffffffff81557ff8>] __dev_mc_add+0x58/0x70
>  [<ffffffff81558020>] dev_mc_add+0x10/0x20
>  [<ffffffff8161e26e>] igmp6_group_added+0x18e/0x1d0
>  [<ffffffff81186f76>] ? kmem_cache_alloc_trace+0x236/0x260
>  [<ffffffff8161f80f>] ipv6_dev_mc_inc+0x29f/0x320
>  [<ffffffff8161f9e7>] ipv6_sock_mc_join+0x157/0x260
> ...
> 
> Fix this by using RCU primitives.
> 
> Reported-by: Joe Lawrence <joe.lawrence@stratus.com>
> Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
> CC: Jay Vosburgh <fubar@us.ibm.com>
> CC: Andy Gospodarek <andy@greyhouse.net>
> Signed-off-by: Veaceslav Falico <vfalico@redhat.com>

Applied, thanks.

^ permalink raw reply

* Request.
From: Cham Tao Soon @ 2013-10-01  2:13 UTC (permalink / raw)
  To: ctsoon1



I need your assistance to move funds from Singapore. I will forward details
upon your request.

Cham Tao Soon

^ permalink raw reply

* Re: [PATCH 1/2] ipv4 igmp: use in_dev_put in timer handlers instead of __in_dev_put
From: David Miller @ 2013-10-01  5:30 UTC (permalink / raw)
  To: noureddine; +Cc: kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1380487182-1644-1-git-send-email-noureddine@aristanetworks.com>

From: Salam Noureddine <noureddine@aristanetworks.com>
Date: Sun, 29 Sep 2013 13:39:42 -0700

> It is possible for the timer handlers to run after the call to
> ip_mc_down so use in_dev_put instead of __in_dev_put in the handler
> function in order to do proper cleanup when the refcnt reaches 0.
> Otherwise, the refcnt can reach zero without the in_device being
> destroyed and we end up leaking a reference to the net_device and
> see messages like the following,
> 
> unregister_netdevice: waiting for eth0 to become free. Usage count = 1
> 
> Tested on linux-3.4.43.
> 
> Signed-off-by: Salam Noureddine <noureddine@aristanetworks.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH 2/2] ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put
From: David Miller @ 2013-10-01  5:30 UTC (permalink / raw)
  To: noureddine; +Cc: kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1380487294-1676-1-git-send-email-noureddine@aristanetworks.com>

From: Salam Noureddine <noureddine@aristanetworks.com>
Date: Sun, 29 Sep 2013 13:41:34 -0700

> It is possible for the timer handlers to run after the call to
> ipv6_mc_down so use in6_dev_put instead of __in6_dev_put in the
> handler function in order to do proper cleanup when the refcnt
> reaches 0. Otherwise, the refcnt can reach zero without the
> inet6_dev being destroyed and we end up leaking a reference to
> the net_device and see messages like the following,
> 
> unregister_netdevice: waiting for eth0 to become free. Usage count = 1
> 
> Tested on linux-3.4.43.
> 
> Signed-off-by: Salam Noureddine <noureddine@aristanetworks.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH net] skbuff: size of hole is wrong in a comment
From: David Miller @ 2013-10-01  5:32 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, mgorman
In-Reply-To: <1380543401-29502-1-git-send-email-nicolas.dichtel@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Mon, 30 Sep 2013 14:16:41 +0200

> Since commit c93bdd0e03e8 ("netvm: allow skb allocation to use PFMEMALLOC
> reserves"), hole size is one bit less than what is written in the comment.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.

^ permalink raw reply

* Re: pull-request: can 2013-09-30
From: David Miller @ 2013-10-01  5:32 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, kernel
In-Reply-To: <1380542343-5299-1-git-send-email-mkl@pengutronix.de>

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 30 Sep 2013 13:59:02 +0200

> here is a fix for the v3.12 release cycle. Lothar Waßmann reported a problem in
> the flexcan driver that leads to an imprecise external abort on imx6. The patch
> by me fixes the problem. It was tested by Lothar on imx53 and imx6.

Pulled, thanks Marc.

^ permalink raw reply

* Re: [PATCH] ll_temac: Reset dma descriptors on ndo_open
From: Ricardo Ribalda Delgado @ 2013-10-01  5:46 UTC (permalink / raw)
  To: David Miller; +Cc: joe, jg1.han, Greg Kroah-Hartman, wfp5p, netdev, LKML
In-Reply-To: <20130930.212153.531876068589922786.davem@davemloft.net>

Hello David

lp->tx_bd_ci, lp->tx_bd_next...  are only initialized to zero on
temac_of_probe (inside  alloc_etherdev).  Those vars are used to index
the dma descriptors.

The initialization of  lp->tx_bd_v[i].app0 = 0; is redundant, because
it is already done on dma_zalloc_coherent in temac_dma_bd_init called
on open.

What if I move
       lp->tx_bd_ci = 0;
       lp->tx_bd_next = 0;
       lp->tx_bd_tail = 0;
       lp->rx_bd_ci = 0;

to temac_dma_bd_init? Will this be more correct?

Without this patch a script like these kills the card in 1-10 iterations:


ifdown eth0
ifdown eth1
while true

do
ifconfig eth1 10.100.10.100
udhcpc -i eth0
ping 192.168.2.1 -c 5 || break
ifconfig eth0 down


ifconfig eth0 10.100.10.100
udhcpc -i eth1
ping 192.168.2.1 -c 5 || break
ifconfig eth1 down

done


Regards

On Tue, Oct 1, 2013 at 6:21 AM, David Miller <davem@davemloft.net> wrote:
> From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> Date: Fri, 27 Sep 2013 13:24:28 +0200
>
>> The dma descriptors are only initialized on the probe function.
>>
>> If a packet is on the buffer when temac_stop is called, the dma
>> descriptors can be left on a incorrect status where no other package can
>> be sent.
>>
>> So an interface could be left in an usable state after ifdow/ifup.
>>
>> This patch makes sure that the descriptors are in a proper status when
>> the device is started.
>>
>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
>
> This analysis is not correct.
>
> In the current driver, the descriptors are allocated and initialized
> in the open function, not the probe function.
>
> I'm not applying this patch.



-- 
Ricardo Ribalda

^ permalink raw reply

* Re: [PATCH] ll_temac: Reset dma descriptors on ndo_open
From: David Miller @ 2013-10-01  6:01 UTC (permalink / raw)
  To: ricardo.ribalda; +Cc: joe, jg1.han, gregkh, wfp5p, netdev, linux-kernel
In-Reply-To: <CAPybu_0OrwTo7CkuauRpu_ohQRY80U6BJDXQ6=KC0caOFiFCQA@mail.gmail.com>

From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Date: Tue, 1 Oct 2013 07:46:31 +0200

> What if I move
>        lp->tx_bd_ci = 0;
>        lp->tx_bd_next = 0;
>        lp->tx_bd_tail = 0;
>        lp->rx_bd_ci = 0;
> 
> to temac_dma_bd_init? Will this be more correct?

Yes, that would be a lot better.

^ permalink raw reply

* Re: [PATCH] dm9601: fix IFF_ALLMULTI handling
From: Peter Korsgaard @ 2013-10-01  6:07 UTC (permalink / raw)
  To: David Miller; +Cc: peter, netdev, joseph_chang
In-Reply-To: <20130930.194950.1406135155659503628.davem@davemloft.net>

>>>>> "David" == David Miller <davem@davemloft.net> writes:

Hi,

 David> Applied, thanks.

Thanks!

 David> It would be so much better if these register values were all
 David> properly documented, one by one, with macros.

Yes, I know. I'll take a look at getting rid of all the magic values.

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* [PATCH v2] ll_temac: Reset dma descriptors indexes on ndo_open
From: Ricardo Ribalda Delgado @ 2013-10-01  6:17 UTC (permalink / raw)
  To: David S. Miller, Joe Perches, Jingoo Han, Greg Kroah-Hartman,
	Bill Pemberton, netdev, linux-kernel
  Cc: Ricardo Ribalda Delgado

The dma descriptors indexes are only initialized on the probe function.

If a packet is on the buffer when temac_stop is called, the dma
descriptors indexes can be left on a incorrect state where no other
package can be sent.

So an interface could be left in an usable state after ifdow/ifup.

This patch makes sure that the descriptors indexes are in a proper
status when the device is open.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
v2: As suggested by David Miller:

- Remove unneded app0=0 on dma descriptors
- Move all code to temac_dma_bd_init
- Fix changelog

 drivers/net/ethernet/xilinx/ll_temac_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index b88121f..0029148 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -297,6 +297,12 @@ static int temac_dma_bd_init(struct net_device *ndev)
 		       lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1)));
 	lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p);
 
+	/* Init descriptor indexes */
+	lp->tx_bd_ci = 0;
+	lp->tx_bd_next = 0;
+	lp->tx_bd_tail = 0;
+	lp->rx_bd_ci = 0;
+
 	return 0;
 
 out:
-- 
1.8.4.rc3

^ permalink raw reply related

* Re: [PATCH] ll_temac: Reset dma descriptors on ndo_open
From: Ricardo Ribalda Delgado @ 2013-10-01  6:18 UTC (permalink / raw)
  To: David Miller; +Cc: joe, jg1.han, Greg Kroah-Hartman, wfp5p, netdev, LKML
In-Reply-To: <20131001.020134.756782177490714135.davem@davemloft.net>

Just send a v2 of the patch

http://patchwork.ozlabs.org/patch/279339/

Thanks!

On Tue, Oct 1, 2013 at 8:01 AM, David Miller <davem@davemloft.net> wrote:
> From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> Date: Tue, 1 Oct 2013 07:46:31 +0200
>
>> What if I move
>>        lp->tx_bd_ci = 0;
>>        lp->tx_bd_next = 0;
>>        lp->tx_bd_tail = 0;
>>        lp->rx_bd_ci = 0;
>>
>> to temac_dma_bd_init? Will this be more correct?
>
> Yes, that would be a lot better.



-- 
Ricardo Ribalda

^ permalink raw reply

* [PATCH v2.41 0/5] MPLS actions and matches
From: Simon Horman @ 2013-10-01  6:47 UTC (permalink / raw)
  To: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	Jesse Gross, Ben Pfaff
  Cc: Isaku Yamahata, Ravi K

Hi,

This series implements MPLS actions and matches based on work by
Ravi K, Leo Alterman, Yamahata-san and Joe Stringer.

This series provides two changes

* Patches 1 - 3

  Provide user-space support for the VLAN/MPLS tag insertion order
  up to and including OpenFlow 1.2, and the different ordering
  specified from OpenFlow 1.3. In a nutshell the datapath always
  uses the OpenFlow 1.3 ordering, which is to always insert tags
  immediately after the L2 header, regardless of the presence of other
  tags. And ovs-vswtichd provides compatibility for the behaviour up
  to OpenFlow 1.2, which is that MPLS tags should follow VLAN tags
  if present.

  These patches have been updated since v2.40.

  Ben, these are for you to review.

* Patches 4 and 5

  Adding basic MPLS action and match support to the kernel datapath

  These patches have not been updated since v2.40.

  Jesse, these are for you to review.


Differences between v2.41 and v2.40:

* As suggested by Ben Pfaff
  + Expand struct ofpact_reg_load to include a mpls_before_vlan field
    rather than using the compat field of the ofpact field of
    struct ofpact_reg_load.
  + Pass version to  ofpacts_pull_openflow11_actions and
    ofpacts_pull_openflow11_instructions.  This removes the invalid
    assumption that that these functions are passed a full message and are
    thus able to deduce the OpenFlow version.


Differences between v2.40 and v2.39:

* Rebase for:
  + New dev_queue_xmit compat code
  + Updated put_vlan()
  + Removal of mpls_depth field from struct flow
* As suggested by Jesse Gross
  + Remove bogus mac_len update from push_mpls()
  + Slightly simplify push_mpls() by using eth_hdr()
  + Remove dubious condition !eth_p_mpls(inner_protocol) on
    an skb being considered to be MPLS in netdev_send()
  + Only use compatibility code for MPLS GSO segmentation on kernels
    older than 3.11
  + Revamp setting of inner_protocol
    1. Do not unconditionally set inner_protocol to the value of
       skb->protocol in ovs_execute_actions().
    2. Initialise inner_protocol it to zero only if compatibility code is in
       use. In the case where compatibility code is not in use it will either
       be zero due since the allocation of the skb or some other value set
       by some other user.
    3. Conditionally set the inner_protocol in push_mpls() to the value of
       skb->protocol when entering push_mpls(). The condition is that
       inner_protocol is zero and the value of skb->protocol is not an MPLS
       ethernet type.
    - This new scheme:
      + Pushes logic to set inner_protocol closer to the case where it is
	needed.
      + Avoids over-writing values set by other users.
* As suggested by Pravin Shelar
  + Only set and restore skb->protocol in rpl___skb_gso_segment() in the
    case of MPLS
  + Add inner_protocol field to struct ovs_gso_cb instead of ovs_skb_cb.
    This moves compatibility code closer to where it is used
    and creates fewer differences with mainline.
* Update comment on mac_len updates in datapath/actions.c
* Remove HAVE_INNER_PROCOTOL and instead just check
  against kernel version 3.11 directly.
  HAVE_INNER_PROCOTOL is a hang-over from work done prior
  to the merge of inner_protocol into the kernel.
* Remove dubious condition !eth_p_mpls(inner_protocol) on
  using inner_protocol as the type in rpl_skb_network_protocol()
* Do not update type of features in rpl_dev_queue_xmit.
  Though arguably correct this is not an inherent part of
  the changes made by this patch.
* Use skb_cow_head() in push_mpls()
  + Call skb_cow_head(skb, MPLS_HLEN) instead of
    make_writable(skb, skb->mac_len) to ensure that there is enough head
    room to push an MPLS LSE regardless of whether the skb is cloned or not.
  + This is consistent with the behaviour of rpl__vlan_put_tag().
  + This is a fix for crashes reported when performing mpls_push
    with headroom less than 4. This problem was introduced in v3.36.
* Skip popping in mpls_pop if the skb is too short to contain an MPLS LSE


Differences between v2.39 and v2.38:

* Rebase for removal of vlan, checksum and skb->mark compat code
  - This includes adding adding a new patch,
    "[PATCH v2.39 6/7] datapath: Break out deacceleration portion of
    vlan_push" to allow re-use of some existing code.


Differences between v2.38 and v2.37:

* Rebase for SCTP support
* Refactor validate_tp_port() to iterate over eth_types rather
  than open-coding the loop. With the addition of SCTP this logic
  is now used three times.


Differences between v2.37 and v2.36:

* Rebase


Differences between v2.36 and v2.35:

* Rebase

* Do not add set_ethertype() to datapath/actions.c.
  As this patch has evolved this function had devolved into
  to sets of functionality wrapped into a single function with
  only one line of common code. Refactor things to simply
  open-code setting the ether type in the two locations where
  set_ethertype() was previously used. The aim here is to improve
  readability.

* Update setting skb->ethertype after mpls push and pop.
  - In the case of push_mpls it should be set unconditionally
    as in v2.35 the behaviour of this function to always push
    an MPLS LSE before any VLAN tags.
  - In the case of mpls_pop eth_p_mpls(skb->protocol) is a better
    test than skb->protocol != htons(ETH_P_8021Q) as it will give the
    correct behaviour in the presence of other VLAN ethernet types,
    for example 0x88a8 which is used by 802.1ad. Moreover, it seems
    correct to update the ethernet type if it was previously set
    according to the top-most MPLS LSE.

* Deaccelerate VLANs when pushing MPLS tags the
  - Since v2.35 MPLS push will insert an MPLS LSE before any VLAN tags.
    This means that if an accelerated tag is present it should be
    deaccelerated to ensure it ends up in the correct position.

* Update skb->mac_len in push_mpls() so that it will be correct
  when used by a subsequent call to pop_mpls().

  As things stand I do not believe this is strictly necessary as
  ovs-vswitchd will not send a pop MPLS action after a push MPLS action.
  However, I have added this in order to code more defensively as I believe
  that if such a sequence did occur it would be rather unobvious why
  it didn't work.

* Do not add skb_cow_head() call in push_mpls().
  It is unnecessary as there is a make_writable() call.
  This change was also made in v2.30 but some how the
  code regressed between then and v2.35.


Differences between v2.35 and v2.34:

* Add support for the tag ordering specified up until OpenFlow 1.2 and
  the ordering specified from OpenFlow 1.3.

* Correct error in datapath patch's handling of GSO in the presence
  of MPLS and absence of VLANs.


To aid review this series is available in git at:

git://github.com/horms/openvswitch.git devel/mpls-v2.41


Patch list and overall diffstat:

Joe Stringer (3):
  odp: Allow VLAN actions after MPLS actions
  ofp-actions: Add separate OpenFlow 1.3 action parser
  lib: Support pushing of MPLS LSE before or after VLAN tag

Simon Horman (2):
  datapath: Break out deacceleration portion of vlan_push
  datapath: Add basic MPLS support to kernel

 datapath/Modules.mk                             |   1 +
 datapath/actions.c                              | 156 ++++++++-
 datapath/datapath.c                             | 259 ++++++++++++--
 datapath/datapath.h                             |   2 +
 datapath/flow.c                                 |  58 ++-
 datapath/flow.h                                 |  17 +-
 datapath/linux/compat/gso.c                     | 117 ++++++-
 datapath/linux/compat/gso.h                     |  53 +++
 datapath/linux/compat/include/linux/netdevice.h |  14 +-
 datapath/linux/compat/netdevice.c               |  28 --
 datapath/mpls.h                                 |  15 +
 include/linux/openvswitch.h                     |   7 +-
 lib/flow.c                                      |   2 +-
 lib/odp-util.c                                  |   9 +-
 lib/odp-util.h                                  |   2 +-
 lib/ofp-actions.c                               |  68 +++-
 lib/ofp-actions.h                               |   9 +
 lib/ofp-print.c                                 |   2 +-
 lib/ofp-util.c                                  |  24 +-
 lib/ofp-util.h                                  |   2 +-
 lib/packets.c                                   |  10 +-
 lib/packets.h                                   |   2 +-
 ofproto/ofproto-dpif-xlate.c                    | 110 ++++--
 ofproto/ofproto-dpif-xlate.h                    |   5 +
 tests/ofproto-dpif.at                           | 446 ++++++++++++++++++++++++
 utilities/ovs-ofctl.c                           |   8 +-
 26 files changed, 1273 insertions(+), 153 deletions(-)
 create mode 100644 datapath/mpls.h

-- 
1.8.4

^ 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