summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2014-09-10 09:57:32 +0000
committerrwatson <rwatson@FreeBSD.org>2014-09-10 09:57:32 +0000
commitda0f8310e711ff8dccdee49800388adf470a051e (patch)
tree9737243e31cc5720a8d26c0e5d45824e5475aa02
parenteb9cf8a129025d43642a46baef699352458bd768 (diff)
downloadFreeBSD-src-da0f8310e711ff8dccdee49800388adf470a051e.zip
FreeBSD-src-da0f8310e711ff8dccdee49800388adf470a051e.tar.gz
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
-rw-r--r--sys/dev/ce/if_ce.c18
-rw-r--r--sys/dev/cp/if_cp.c18
-rw-r--r--sys/dev/ctau/if_ct.c18
-rw-r--r--sys/dev/cx/if_cx.c18
4 files changed, 4 insertions, 68 deletions
diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c
index 899f33f..6d77a1c 100644
--- a/sys/dev/ce/if_ce.c
+++ b/sys/dev/ce/if_ce.c
@@ -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, unsigned char *data, int len)
return;
}
if (c->debug > 1)
- printmbuf (m);
+ m_print (m, 0);
#ifdef NETGRAPH
m->m_pkthdr.rcvif = 0;
IF_ENQUEUE(&d->rqueue, m);
diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c
index ec5f042..4c728fc 100644
--- a/sys/dev/cp/if_cp.c
+++ b/sys/dev/cp/if_cp.c
@@ -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, unsigned char *data, int len)
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);
diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c
index 958faa5..43ea974 100644
--- a/sys/dev/ctau/if_ct.c
+++ b/sys/dev/ctau/if_ct.c
@@ -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, char *data, int len)
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);
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index 27112d5..83cac32 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -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, char *data, int len)
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);
OpenPOWER on IntegriCloud