From owner-svn-src-head@FreeBSD.ORG Wed Sep 10 09:57:33 2014 Return-Path: Delivered-To: svn-src-head@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 EF933E74; Wed, 10 Sep 2014 09:57:33 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF949172C; Wed, 10 Sep 2014 09:57:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8A9vX95053632; Wed, 10 Sep 2014 09:57:33 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8A9vX2x053622; Wed, 10 Sep 2014 09:57:33 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201409100957.s8A9vX2x053622@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Wed, 10 Sep 2014 09:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271373 - in head/sys/dev: ce cp ctau cx 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.18-1 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: Wed, 10 Sep 2014 09:57:34 -0000 Author: rwatson Date: Wed Sep 10 09:57:32 2014 New Revision: 271373 URL: http://svnweb.freebsd.org/changeset/base/271373 Log: Replace local copy-and-paste implementations of printmbuf() in several device drivers with calls to the centralised m_print() implementation. While the formatting and output details differ a little, the content is essentially the same, and it is unlikely anyone has used this debugging output in some time. This change reduces awareness of mbuf cluster allocation (and, especially, the M_EXT flag) outside of the mbuf allocator, which will make it easier to refine the external storage mechanism without disrupting drivers in the future. Style bugs are preserved. Reviewed by: bz, glebius MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ce/if_ce.c head/sys/dev/cp/if_cp.c head/sys/dev/ctau/if_ct.c head/sys/dev/cx/if_cx.c Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Wed Sep 10 09:47:16 2014 (r271372) +++ head/sys/dev/ce/if_ce.c Wed Sep 10 09:57:32 2014 (r271373) @@ -298,22 +298,6 @@ static struct cdevsw ce_cdevsw = { #endif /* - * Print the mbuf chain, for debug purposes only. - */ -static void printmbuf (struct mbuf *m) -{ - printf ("mbuf:"); - for (; m; m=m->m_next) { - if (m->m_flags & M_PKTHDR) - printf (" HDR %d:", m->m_pkthdr.len); - if (m->m_flags & M_EXT) - printf (" EXT:"); - printf (" %d", m->m_len); - } - printf ("\n"); -} - -/* * Make an mbuf from data. */ static struct mbuf *makembuf (void *buf, unsigned len) @@ -1140,7 +1124,7 @@ static void ce_receive (ce_chan_t *c, un return; } if (c->debug > 1) - printmbuf (m); + m_print (m, 0); #ifdef NETGRAPH m->m_pkthdr.rcvif = 0; IF_ENQUEUE(&d->rqueue, m); Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Wed Sep 10 09:47:16 2014 (r271372) +++ head/sys/dev/cp/if_cp.c Wed Sep 10 09:57:32 2014 (r271373) @@ -182,22 +182,6 @@ static struct cdevsw cp_cdevsw = { }; /* - * Print the mbuf chain, for debug purposes only. - */ -static void printmbuf (struct mbuf *m) -{ - printf ("mbuf:"); - for (; m; m=m->m_next) { - if (m->m_flags & M_PKTHDR) - printf (" HDR %d:", m->m_pkthdr.len); - if (m->m_flags & M_EXT) - printf (" EXT:"); - printf (" %d", m->m_len); - } - printf ("\n"); -} - -/* * Make an mbuf from data. */ static struct mbuf *makembuf (void *buf, unsigned len) @@ -909,7 +893,7 @@ static void cp_receive (cp_chan_t *c, un return; } if (c->debug > 1) - printmbuf (m); + m_print (m, 0); #ifdef NETGRAPH m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Wed Sep 10 09:47:16 2014 (r271372) +++ head/sys/dev/ctau/if_ct.c Wed Sep 10 09:57:32 2014 (r271373) @@ -185,22 +185,6 @@ static struct cdevsw ct_cdevsw = { }; /* - * Print the mbuf chain, for debug purposes only. - */ -static void printmbuf (struct mbuf *m) -{ - printf ("mbuf:"); - for (; m; m=m->m_next) { - if (m->m_flags & M_PKTHDR) - printf (" HDR %d:", m->m_pkthdr.len); - if (m->m_flags & M_EXT) - printf (" EXT:"); - printf (" %d", m->m_len); - } - printf ("\n"); -} - -/* * Make an mbuf from data. */ static struct mbuf *makembuf (void *buf, u_int len) @@ -1127,7 +1111,7 @@ static void ct_receive (ct_chan_t *c, ch return; } if (c->debug > 1) - printmbuf (m); + m_print (m, 0); #ifdef NETGRAPH m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Wed Sep 10 09:47:16 2014 (r271372) +++ head/sys/dev/cx/if_cx.c Wed Sep 10 09:57:32 2014 (r271373) @@ -232,22 +232,6 @@ static struct cdevsw cx_cdevsw = { static int MY_SOFT_INTR; /* - * Print the mbuf chain, for debug purposes only. - */ -static void printmbuf (struct mbuf *m) -{ - printf ("mbuf:"); - for (; m; m=m->m_next) { - if (m->m_flags & M_PKTHDR) - printf (" HDR %d:", m->m_pkthdr.len); - if (m->m_flags & M_EXT) - printf (" EXT:"); - printf (" %d", m->m_len); - } - printf ("\n"); -} - -/* * Make an mbuf from data. */ static struct mbuf *makembuf (void *buf, u_int len) @@ -1325,7 +1309,7 @@ static void cx_receive (cx_chan_t *c, ch return; } if (c->debug > 1) - printmbuf (m); + m_print (m, 0); #ifdef NETGRAPH m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m);