Date: Fri, 02 Sep 2005 13:56:00 -0400 From: Ben Thomas <bthomas@virtualiron.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/85648: [patch] provide more specific default network driver queue mutex name Message-ID: <43189230.7050603@virtualiron.com> Resent-Message-ID: <200509021800.j82I0Y2l055112@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 85648 >Category: kern >Synopsis: [patch] provide more specific default network driver queue mutex name >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Sep 02 18:00:33 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Ben Thomas >Release: FreeBSD 5.4-RELEASE i386 >Organization: Virtual Iron Software >Environment: System: FreeBSD bthomas4.katana-technology.com 5.4-RELEASE FreeBSD 5.4-RELEASE #10: Sun Aug 28 13:48:00 EDT 2005 ben@bthomas4.katana-technology.com:/usr/obj/usr/home/ben/BSD/RELENG_5_4_0_RELEASE/src/sys/BEN i386 >Description: This change modifies the default name given to a network driver queue mutex. The new name contains the device name, which makes for easier debugging and tracking. While tracking down mutexes and debugging, it made work a little easier to have more specific names on mutexes. This patch is against the 5_4_0_RELEASE code >How-To-Repeat: >Fix: --- if.c-DIFF begins here --- --- /usr/src.original/sys/net/if.c Thu Apr 14 21:52:03 2005 +++ /usr/src/sys/net/if.c Fri Aug 5 17:31:35 2005 @@ -291,6 +291,7 @@ { struct ifnet *ifp; int s; + char name[IFNAMSIZ + sizeof(" ifq_mtx") + 1]; s = splimp(); IFNET_RLOCK(); /* could sleep on rare error; mostly okay XXX */ @@ -300,9 +301,10 @@ ifp->if_snd.ifq_maxlen = ifqmaxlen; } if (!mtx_initialized(&ifp->if_snd.ifq_mtx)) { + snprintf(name, sizeof(name), "%s ifq_mtx", ifp->if_xname); if_printf(ifp, - "XXX: driver didn't initialize queue mtx\n"); - mtx_init(&ifp->if_snd.ifq_mtx, "unknown", + "XXX: Initializing driver queue mtx to '%s'\n", name); + mtx_init(&ifp->if_snd.ifq_mtx, name, MTX_NETWORK_LOCK, MTX_DEF); } } --- if.c-DIFF ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43189230.7050603>