From owner-svn-src-head@FreeBSD.ORG Fri Aug 23 18:03:18 2013 Return-Path: Delivered-To: svn-src-head@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 ESMTP id CD3FBAFA; Fri, 23 Aug 2013 18:03:18 +0000 (UTC) (envelope-from np@FreeBSD.org) 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 BAF0127F1; Fri, 23 Aug 2013 18:03:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NI3Ieb096430; Fri, 23 Aug 2013 18:03:18 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NI3I6a096429; Fri, 23 Aug 2013 18:03:18 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201308231803.r7NI3I6a096429@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 23 Aug 2013 18:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254727 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:03:18 -0000 Author: np Date: Fri Aug 23 18:03:18 2013 New Revision: 254727 URL: http://svnweb.freebsd.org/changeset/base/254727 Log: There is no need to hold the freelist lock around alloc/free of software descriptors. This also silences WITNESS warnings when the software descriptors are allocated with M_WAITOK. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Aug 23 18:02:39 2013 (r254726) +++ head/sys/dev/cxgbe/t4_sge.c Fri Aug 23 18:03:18 2013 (r254727) @@ -1802,9 +1802,7 @@ alloc_iq_fl(struct port_info *pi, struct /* Allocate space for one software descriptor per buffer. */ fl->cap = (fl->qsize - spg_len / RX_FL_ESIZE) * 8; - FL_LOCK(fl); rc = alloc_fl_sdesc(fl); - FL_UNLOCK(fl); if (rc != 0) { device_printf(sc->dev, "failed to setup fl software descriptors: %d\n", @@ -1937,11 +1935,8 @@ free_iq_fl(struct port_info *pi, struct free_ring(sc, fl->desc_tag, fl->desc_map, fl->ba, fl->desc); - if (fl->sdesc) { - FL_LOCK(fl); + if (fl->sdesc) free_fl_sdesc(fl); - FL_UNLOCK(fl); - } if (mtx_initialized(&fl->fl_lock)) mtx_destroy(&fl->fl_lock); @@ -2788,8 +2783,6 @@ alloc_fl_sdesc(struct sge_fl *fl) bus_dma_tag_t tag; int i, rc; - FL_LOCK_ASSERT_OWNED(fl); - fl->sdesc = malloc(fl->cap * sizeof(struct fl_sdesc), M_CXGBE, M_ZERO | M_WAITOK); @@ -2828,8 +2821,6 @@ free_fl_sdesc(struct sge_fl *fl) struct fl_sdesc *sd; int i; - FL_LOCK_ASSERT_OWNED(fl); - sd = fl->sdesc; for (i = 0; i < fl->cap; i++, sd++) {