From owner-freebsd-net@FreeBSD.ORG Fri Jun 20 22:36:12 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 597752D2; Fri, 20 Jun 2014 22:36:12 +0000 (UTC) Received: from stargate.chelsio.com (99-65-72-228.uvs.sntcca.sbcglobal.net [99.65.72.228]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3266D22AD; Fri, 20 Jun 2014 22:36:11 +0000 (UTC) Received: from nice.asicdesigners.com (nice.asicdesigners.com [10.192.160.7]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id s5KMaAvL003176; Fri, 20 Jun 2014 15:36:10 -0700 Received: from [10.192.166.0] (10.192.166.0) by nice.asicdesigners.com (10.192.160.7) with Microsoft SMTP Server id 14.2.247.3; Fri, 20 Jun 2014 15:36:09 -0700 Message-ID: <53A4B759.2060604@chelsio.com> Date: Fri, 20 Jun 2014 15:36:09 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alan Somers Subject: Re: ifaddr refcount problem References: <53A48849.8080504@chelsio.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.192.166.0] Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jun 2014 22:36:12 -0000 On 06/20/14 15:20, Alan Somers wrote: ... > > Do you have a test case that can reproduce the panic? > > -Alan > Just run some UDP traffic on head or stable/10 and watch the refcount leak on the transmitter. # netperf -H ... -t UDP_STREAM I see these two do ifa_ref (once per packet). kernel`ip_output+0x527 kernel`udp_send+0xa88 kernel`sosend_dgram+0x583 kernel`kern_sendit+0x244 kernel`sendit+0x129 kernel`sys_sendto+0x4d kernel`amd64_syscall+0x3fb kernel`in_pcbladdr+0x160 kernel`in_pcbconnect_setup+0x18b kernel`udp_send+0x3d7 kernel`sosend_dgram+0x583 kernel`kern_sendit+0x244 kernel`sendit+0x129 kernel`sys_sendto+0x4d kernel`amd64_syscall+0x3fb (kgdb) l *(ip_output + 0x527) 0xffffffff80ac37f7 is in ip_output (/usr/src/sys/netinet/ip_output.c:249). 244 ip->ip_ttl = 1; 245 isbroadcast = 1; 246 ifa_free((void *)ia); 247 } else if (flags & IP_ROUTETOIF) { 248 if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && 249 (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0))) == NULL) { 250 IPSTAT_INC(ips_noroute); 251 error = ENETUNREACH; 252 goto bad; 253 } And only this one does ifa_free (once per packet) kernel`in_pcbladdr+0x1fb kernel`in_pcbconnect_setup+0x18b kernel`udp_send+0x3d7 kernel`sosend_dgram+0x583 kernel`kern_sendit+0x244 kernel`sendit+0x129 kernel`sys_sendto+0x4d kernel`amd64_syscall+0x3fb So there is a net leak of 1 refcount per packet. Regards, Navdeep