Module Name: src Committed By: snj Date: Fri Nov 17 20:24:05 UTC 2017
Modified Files: src/sys/net [netbsd-8]: if_llatbl.c if_llatbl.h src/sys/netinet [netbsd-8]: if_arp.c in.c src/sys/netinet6 [netbsd-8]: in6.c nd6.c Log Message: Pull up following revision(s) (requested by ozaki-r in ticket #353): sys/net/if_llatbl.c: 1.22 sys/net/if_llatbl.h: 1.13 sys/netinet/if_arp.c: 1.254 sys/netinet/in.c: 1.208-1.209 sys/netinet6/in6.c: 1.249-1.250 sys/netinet6/nd6.c: 1.237 Remove redundant KASSERTMSG The function is static, has just one caller and the caller does the same check. -- Fix a deadlock between a route update and lltable It happens because rtalloc1 is called from lltable with holding IF_AFDATA_WLOCK. If a route update is in action, rtalloc1 would wait for its completion with holding IF_AFDATA_WLOCK. At the same moment, a softint (e.g., arpintr) may try to take IF_AFDATA_WLOCK and get stuck on it. Unfortunately the stuck softint prevents the route update from progressing because the route update calls psref_target_destroy that needs the softint to complete. A resource allocation graph of the senario looks like this: route update =(psref_target_destroy)=> softint => IF_AFDATA_WLOCK =(rt_update_wait)=> route update Fix the deadlock by pulling rtalloc1 out of the lltable codes inside IF_AFDATA_WLOCK. Note that the deadlock happens only if NET_MPSAFE is enabled. To generate a diff of this commit: cvs rdiff -u -r1.18.6.1 -r1.18.6.2 src/sys/net/if_llatbl.c cvs rdiff -u -r1.10.8.1 -r1.10.8.2 src/sys/net/if_llatbl.h cvs rdiff -u -r1.250.2.2 -r1.250.2.3 src/sys/netinet/if_arp.c cvs rdiff -u -r1.203.2.1 -r1.203.2.2 src/sys/netinet/in.c cvs rdiff -u -r1.245.2.1 -r1.245.2.2 src/sys/netinet6/in6.c cvs rdiff -u -r1.232.2.2 -r1.232.2.3 src/sys/netinet6/nd6.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.