From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: xdp and fragments with virtio Date: Wed, 16 May 2018 20:55:12 -0600 Message-ID: References: <4d6952b4-b252-2fe5-8893-a3e2329bd34b@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Jason Wang , "netdev@vger.kernel.org" Return-path: Received: from mail-pl0-f48.google.com ([209.85.160.48]:45727 "EHLO mail-pl0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbeEQCzQ (ORCPT ); Wed, 16 May 2018 22:55:16 -0400 Received: by mail-pl0-f48.google.com with SMTP id bi12-v6so1573424plb.12 for ; Wed, 16 May 2018 19:55:16 -0700 (PDT) In-Reply-To: <4d6952b4-b252-2fe5-8893-a3e2329bd34b@redhat.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 5/16/18 1:24 AM, Jason Wang wrote: > > > On 2018年05月16日 11:51, David Ahern wrote: >> Hi Jason: >> >> I am trying to test MTU changes to the BPF fib_lookup helper and seeing >> something odd. Hoping you can help. >> >> I have a VM with multiple virtio based NICs and tap backends. I install >> the xdp program on eth1 and eth2 to do forwarding. In the host I send a >> large packet to eth1: >> >> $ ping -s 1500 9.9.9.9 >> >> >> The tap device in the host sees 2 packets: >> >> $ sudo tcpdump -nv -i vm02-eth1 >> 20:44:33.943160 IP (tos 0x0, ttl 64, id 58746, offset 0, flags [+], >> proto ICMP (1), length 1500) >>      10.100.1.254 > 9.9.9.9: ICMP echo request, id 17917, seq 1, >> length 1480 >> 20:44:33.943172 IP (tos 0x0, ttl 64, id 58746, offset 1480, flags >> [none], proto ICMP (1), length 48) >>      10.100.1.254 > 9.9.9.9: ip-proto-1 >> >> >> In the VM, the XDP program only sees the first packet, not the fragment. >> I added a printk to the program (see diff below): >> >> $ cat trace_pipe >>            -0     [003] ..s2   254.436467: 0: packet length 1514 >> >> >> Anything come to mind in the virtio xdp implementation that affects >> fragment packets? I see this with both IPv4 and v6. > > Not yet. But we do turn of tap gso when virtio has XDP set, but it > shouldn't matter this case. > > Will try to see what's wrong. > I added this to the command line for the NICs and it works: "mrg_rxbuf=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,guest_ufo=off" XDP program sees the full size packet and the fragment. Fun fact: only adding mrg_rxbuf=off so that mergeable_rx_bufs is false but big_packets is true generates a panic when it receives large packets.