From owner-svn-src-all@FreeBSD.ORG Tue Mar 4 19:49:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 235FD65E; Tue, 4 Mar 2014 19:49:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 106C9F55; Tue, 4 Mar 2014 19:49:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24JnfXn078471; Tue, 4 Mar 2014 19:49:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24JnfLn078470; Tue, 4 Mar 2014 19:49:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041949.s24JnfLn078470@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 19:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262747 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 19:49:42 -0000 Author: glebius Date: Tue Mar 4 19:49:41 2014 New Revision: 262747 URL: http://svnweb.freebsd.org/changeset/base/262747 Log: Remove ifa_ref()/ifa_free(), which are atomic(9), from ip_output(). The ifaddr is already referenced by the rtentry, and we are holding reference on the rtentry throughout the function execution. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Tue Mar 4 19:41:16 2014 (r262746) +++ head/sys/netinet/ip_output.c Tue Mar 4 19:49:41 2014 (r262747) @@ -293,7 +293,6 @@ again: goto bad; } ia = ifatoia(rte->rt_ifa); - ifa_ref(&ia->ia_ifa); ifp = rte->rt_ifp; rte->rt_rmx.rmx_pksent++; if (rte->rt_flags & RTF_GATEWAY) @@ -550,11 +549,8 @@ sendit: #endif error = netisr_queue(NETISR_IP, m); goto done; - } else { - if (ia != NULL) - ifa_free(&ia->ia_ifa); + } else goto again; /* Redo the routing table lookup. */ - } } /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ @@ -583,8 +579,6 @@ sendit: m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; m_tag_delete(m, fwd_tag); - if (ia != NULL) - ifa_free(&ia->ia_ifa); goto again; } @@ -697,8 +691,6 @@ passout: done: if (ro == &iproute) RO_RTFREE(ro); - if (ia != NULL) - ifa_free(&ia->ia_ifa); return (error); bad: m_freem(m);