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
This commit is contained in:
parent
eb4e5b0ad5
commit
620dbb4ed1
@ -297,22 +297,6 @@ static struct cdevsw ce_cdevsw = {
|
|||||||
};
|
};
|
||||||
#endif
|
#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.
|
* Make an mbuf from data.
|
||||||
*/
|
*/
|
||||||
@ -1140,7 +1124,7 @@ static void ce_receive (ce_chan_t *c, unsigned char *data, int len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (c->debug > 1)
|
if (c->debug > 1)
|
||||||
printmbuf (m);
|
m_print (m, 0);
|
||||||
#ifdef NETGRAPH
|
#ifdef NETGRAPH
|
||||||
m->m_pkthdr.rcvif = 0;
|
m->m_pkthdr.rcvif = 0;
|
||||||
IF_ENQUEUE(&d->rqueue, m);
|
IF_ENQUEUE(&d->rqueue, m);
|
||||||
|
@ -181,22 +181,6 @@ static struct cdevsw cp_cdevsw = {
|
|||||||
.d_name = "cp",
|
.d_name = "cp",
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* 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.
|
* Make an mbuf from data.
|
||||||
*/
|
*/
|
||||||
@ -909,7 +893,7 @@ static void cp_receive (cp_chan_t *c, unsigned char *data, int len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (c->debug > 1)
|
if (c->debug > 1)
|
||||||
printmbuf (m);
|
m_print (m, 0);
|
||||||
#ifdef NETGRAPH
|
#ifdef NETGRAPH
|
||||||
m->m_pkthdr.rcvif = 0;
|
m->m_pkthdr.rcvif = 0;
|
||||||
NG_SEND_DATA_ONLY (error, d->hook, m);
|
NG_SEND_DATA_ONLY (error, d->hook, m);
|
||||||
|
@ -184,22 +184,6 @@ static struct cdevsw ct_cdevsw = {
|
|||||||
.d_name = "ct",
|
.d_name = "ct",
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* 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.
|
* Make an mbuf from data.
|
||||||
*/
|
*/
|
||||||
@ -1127,7 +1111,7 @@ static void ct_receive (ct_chan_t *c, char *data, int len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (c->debug > 1)
|
if (c->debug > 1)
|
||||||
printmbuf (m);
|
m_print (m, 0);
|
||||||
#ifdef NETGRAPH
|
#ifdef NETGRAPH
|
||||||
m->m_pkthdr.rcvif = 0;
|
m->m_pkthdr.rcvif = 0;
|
||||||
NG_SEND_DATA_ONLY (error, d->hook, m);
|
NG_SEND_DATA_ONLY (error, d->hook, m);
|
||||||
|
@ -231,22 +231,6 @@ static struct cdevsw cx_cdevsw = {
|
|||||||
|
|
||||||
static int MY_SOFT_INTR;
|
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.
|
* Make an mbuf from data.
|
||||||
*/
|
*/
|
||||||
@ -1325,7 +1309,7 @@ static void cx_receive (cx_chan_t *c, char *data, int len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (c->debug > 1)
|
if (c->debug > 1)
|
||||||
printmbuf (m);
|
m_print (m, 0);
|
||||||
#ifdef NETGRAPH
|
#ifdef NETGRAPH
|
||||||
m->m_pkthdr.rcvif = 0;
|
m->m_pkthdr.rcvif = 0;
|
||||||
NG_SEND_DATA_ONLY (error, d->hook, m);
|
NG_SEND_DATA_ONLY (error, d->hook, m);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user