From owner-freebsd-net@FreeBSD.ORG Thu Jan 29 15:57:28 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E78E553B for ; Thu, 29 Jan 2015 15:57:28 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9791E41 for ; Thu, 29 Jan 2015 15:57:28 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t0TFvSJK082856 for ; Thu, 29 Jan 2015 15:57:28 GMT (envelope-from mat@phabric-backend.isc.freebsd.org) Received: (from root@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t0TFvSeG082855; Thu, 29 Jan 2015 15:57:28 GMT (envelope-from mat) Date: Thu, 29 Jan 2015 15:57:28 +0000 To: freebsd-net@freebsd.org From: "gnn (George Neville-Neil)" Subject: [Differential] [Requested Changes To] D1707: sfxge: access statistics buffers under port lock Message-ID: <63958787bd31353ba613da583e4e4b19@localhost.localdomain> X-Priority: 3 Thread-Topic: D1707: sfxge: access statistics buffers under port lock X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: MmFkY2EyODhjMzI1YWNkNjhmYWJmNzczN2QyIFTKWGg= X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2015 15:57:29 -0000 gnn requested changes to this revision. gnn added a comment. This revision now requires changes to proceed. If you look at other drivers you'll see they have #define'd macros for the locks, rather than direct calls. This allows us to name the lock in the macro. See, for instance, this example from cxgbe/adapter.h: #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) #define ADAPTER_UNLOCK(sc) mtx_unlock(&(sc)->sc_lock) #define ADAPTER_LOCK_ASSERT_OWNED(sc) mtx_assert(&(sc)->sc_lock, MA_OWNED) #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED) You should move to this model and then update the patch. REVISION DETAIL https://reviews.freebsd.org/D1707 To: arybchik, gnn Cc: freebsd-net