From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: XDP breakage with virtio due to 6870de435b90c083ae0f3f7f341287976ef56f03 Date: Sun, 22 Apr 2018 16:47:48 -0600 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" To: tehnerd@tehnerd.com, Jason Wang , daniel@iogearbox.net Return-path: Received: from mail-pg0-f44.google.com ([74.125.83.44]:44427 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbeDVWru (ORCPT ); Sun, 22 Apr 2018 18:47:50 -0400 Received: by mail-pg0-f44.google.com with SMTP id l12so7018856pgp.11 for ; Sun, 22 Apr 2018 15:47:50 -0700 (PDT) Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: This commit breaks my FIB forwarding program: commit 6870de435b90c083ae0f3f7f341287976ef56f03 Author: Nikita V. Shirokov Date: Tue Apr 17 21:42:20 2018 -0700 bpf: make virtio compatible w/ bpf_xdp_adjust_tail w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for virtio driver we need to adjust XDP_PASS handling by recalculating length of the packet if it was passed to the TCP/IP stack Reviewed-by: Jason Wang Signed-off-by: Nikita V. Shirokov Signed-off-by: Daniel Borkmann ### Some of the packets (e.g., ARP or those without a resolved neighbor) are passed to the networking stack. What shows up are clearly broken packets: # tcpdump -n -i eth1 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes 15:45:29.693238 [|ARP] 0x0000: 0001 0800 0604 0001 42c0 ce2f 3fa9 0a64 ........B../?..d 15:45:30.710327 [|ARP] 0x0000: 0001 0800 0604 0001 42c0 ce2f 3fa9 0a64 ........B../?..d 15:45:31.734296 [|ARP] 0x0000: 0001 0800 0604 0001 42c0 ce2f 3fa9 0a64 ........B../?..d 15:45:32.908720 IP6 truncated-ip6 - 12 bytes missing!fe80::40c0:ceff:fe2f:3fa9 > ff02::1:ff00:2: ICMP6, neighbor solicitation[|icmp6] 15:45:33.910530 IP6 truncated-ip6 - 12 bytes missing!2001:db8:1::64 > ff02::1:ff00:2: ICMP6, neighbor solicitation[|icmp6] 15:45:34.934437 IP6 truncated-ip6 - 12 bytes missing!2001:db8:1::64 > ff02::1:ff00:2: ICMP6, neighbor solicitation[|icmp6] 15:45:35.958394 IP6 truncated-ip6 - 12 bytes missing!2001:db8:1::64 > ff02::1:ff00:2: ICMP6, neighbor solicitation[|icmp6] Reverting the mentioned patch fixes the problem.