From owner-freebsd-net@freebsd.org Fri Mar 16 13:47:38 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBCE6F50842 for ; Fri, 16 Mar 2018 13:47:37 +0000 (UTC) (envelope-from sthaug@nethelp.no) Received: from bizet.nethelp.no (bizet.nethelp.no [IPv6:2001:8c0:9e04:500::1]) by mx1.freebsd.org (Postfix) with ESMTP id 604F67F594 for ; Fri, 16 Mar 2018 13:47:36 +0000 (UTC) (envelope-from sthaug@nethelp.no) Received: from localhost (bizet.nethelp.no [IPv6:2001:8c0:9e04:500::1]) by bizet.nethelp.no (Postfix) with ESMTP id 93349E6047; Fri, 16 Mar 2018 14:47:34 +0100 (CET) Date: Fri, 16 Mar 2018 14:47:34 +0100 (CET) Message-Id: <20180316.144734.78772139.sthaug@nethelp.no> To: "Andrey V. Elsukov" Cc: melifaro@ipfw.ru, freebsd-net@freebsd.org Subject: Re: Does FreeBSD do proactive ARP refresh?,Re: Does FreeBSD do proactive ARP refresh? From: sthaug@nethelp.no In-Reply-To: <21eca372-6fc0-6c86-4ca8-a398bfa37d92@yandex.ru> References: <20180316.122720.71152047.sthaug@nethelp.no> <20180316.124748.104098359.sthaug@nethelp.no> <21eca372-6fc0-6c86-4ca8-a398bfa37d92@yandex.ru> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 13:47:38 -0000 > >> And thank you for that suggestion! The packet loss during ARP refresh > >> (of the destination address connected to the output interface) does > >> *not* happen when the box is forwarding! It only happens with locally > >> generated traffic. > > > > Checking once per second with "arp -n " I can see the > > following behavior with net.link.ether.inet.max_age=120: > > > > - Locally generated traffic: The ARP entry is refreshed after > > net.link.ether.inet.max_age seconds - which presumably means it > > actually expires first. And there is some packet loss. > > > > - Transit traffic (the box is forwarding): The ARP entry is refreshed > > 5 seconds *before* net.link.ether.inet.max_age has passed, and there > > is no packet loss. > > Can you test this patch? I did not tested it, but I think it should fix > this issue. Looks like this is a patch against HEAD. I don't have any boxes running HEAD, but I can get one installed and test the patch this weekend (unless you want to produce a patch against 11.1-STABLE). I tried the patch manually applied on 11.1-STABLE, but got lots of errors during kernel compilation (see the end of this message). Steinar Haug, Nethelp consulting, sthaug@nethelp.no ---------------------------------------------------------------------- cc -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I../../.. -I../../../contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.if_ethersubr.o -MTif_ethersubr.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 -Werror ../../../net/if_ethersubr.c ../../../net/if_ethersubr.c:288:18: error: unused variable 't' [-Werror,-Wunused-variable] struct pf_mtag *t; ^ ../../../net/if_ethersubr.c:286:7: error: unused variable 'linkhdr' [-Werror,-Wunused-variable] char linkhdr[ETHER_HDR_LEN], *phdr; ^ ../../../net/if_ethersubr.c:285:6: error: unused variable 'error' [-Werror,-Wunused-variable] int error = 0; ^ ../../../net/if_ethersubr.c:289:6: error: unused variable 'loop_copy' [-Werror,-Wunused-variable] int loop_copy = 1; ^ ../../../net/if_ethersubr.c:287:23: error: unused variable 'eh' [-Werror,-Wunused-variable] struct ether_header *eh; ^ ../../../net/if_ethersubr.c:293:18: error: unused variable 'rt0' [-Werror,-Wunused-variable] struct rtentry *rt0 = NULL; ^ ../../../net/if_ethersubr.c:335:4: error: control reaches end of non-void function [-Werror,-Wreturn-type] } ^ ../../../net/if_ethersubr.c:336:3: error: extraneous closing brace ('}') } ^ ../../../net/if_ethersubr.c:337:3: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] rt0 = ro->ro_rt; ^ ../../../net/if_ethersubr.c:337:9: error: use of undeclared identifier 'ro' rt0 = ro->ro_rt; ^ ../../../net/if_ethersubr.c:338:2: error: extraneous closing brace ('}') } ^ ../../../net/if_ethersubr.c:341:2: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] error = mac_ifnet_check_transmit(ifp, m); ^ ../../../net/if_ethersubr.c:341:35: error: use of undeclared identifier 'ifp' error = mac_ifnet_check_transmit(ifp, m); ^ ../../../net/if_ethersubr.c:341:40: error: use of undeclared identifier 'm' error = mac_ifnet_check_transmit(ifp, m); ^ ../../../net/if_ethersubr.c:342:2: error: expected identifier or '(' if (error) ^ ../../../net/if_ethersubr.c:343:3: error: expected identifier or '(' senderr(error); ^ ../../../net/if_ethersubr.c:123:49: note: expanded from macro 'senderr' #define senderr(e) do { error = (e); goto bad;} while (0) ^ ../../../net/if_ethersubr.c:347:2: error: expected identifier or '(' if (ifp->if_flags & IFF_MONITOR) ^ ../../../net/if_ethersubr.c:348:3: error: expected identifier or '(' senderr(ENETDOWN); ^ ../../../net/if_ethersubr.c:123:49: note: expanded from macro 'senderr' #define senderr(e) do { error = (e); goto bad;} while (0) ^ ../../../net/if_ethersubr.c:349:2: error: expected identifier or '(' if (!((ifp->if_flags & IFF_UP) && ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. *** Error code 1 Stop. make: stopped in /usr/src/sys/amd64/compile/DNS_VIMAGE