Hi David,

On Sun, Jun 12, 2016 at 08:47:20PM -0600, David Ahern wrote:
> Mike:
> 
> UDP tests in my vrf unit test suite are failing. git bisect points to:

Are you testing host or guest kernel?
If it's the host, can you please check if the patch below helps? 
 
> dsa@kenny:~/kernel-2.git$ git bisect good
> e858fae2b0b8f41f0bed2cdffde25e7c97da38a7 is the first bad commit
> commit e858fae2b0b8f41f0bed2cdffde25e7c97da38a7
> Author: Mike Rapoport <r...@linux.vnet.ibm.com>
> 
>     virtio_net: use common code for virtio_net_hdr and skb GSO conversion
> 
> On console I get the following:
> 
> [   80.414134] skbuff: bad partial csum: csum=34/6 len=40
> [   80.416105] eth1: bad gso: type: 0, size: 0
> 
> Networking arg:
> 
> -netdev
> type=tap,vhost=on,ifname=vm01-eth1,script=no,downscript=no,id=netdev1
> -device virtio-net-pci,mac=02:e0:f9:1c:b9:74,netdev=netdev1,romfile=
> 
> tap device is connected to a bridge.
> 
> David
> 

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 8cc6bf4..4884802 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1254,6 +1254,13 @@ static ssize_t tun_get_user(struct tun_struct *tun, 
struct tun_file *tfile,
                return -EFAULT;
        }
 
+       err = virtio_net_hdr_to_skb(skb, &gso, tun_is_little_endian(tun));
+       if (err) {
+               this_cpu_inc(tun->pcpu_stats->rx_frame_errors);
+               kfree_skb(skb);
+               return -EINVAL;
+       }
+
        switch (tun->flags & TUN_TYPE_MASK) {
        case IFF_TUN:
                if (tun->flags & IFF_NO_PI) {
@@ -1280,13 +1287,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, 
struct tun_file *tfile,
                break;
        }
 
-       err = virtio_net_hdr_to_skb(skb, &gso, tun_is_little_endian(tun));
-       if (err) {
-               this_cpu_inc(tun->pcpu_stats->rx_frame_errors);
-               kfree_skb(skb);
-               return -EINVAL;
-       }
-
        /* copy skb_ubuf_info for callback when skb has no error */
        if (zerocopy) {
                skb_shinfo(skb)->destructor_arg = msg_control;

Reply via email to