From 60909669f00c3675bab15d82d9d63aaff61dfafa Mon Sep 17 00:00:00 2001 From: rwatson Date: Tue, 6 Jan 2015 12:59:37 +0000 Subject: In order to reduce use of M_EXT outside of the mbuf allocator and socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division --- sys/dev/hifn/hifn7751.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/dev/hifn') diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index e9d47a1..8330d30 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -1890,8 +1890,7 @@ hifn_crypto( goto err_srcmap; } if (totlen >= MINCLSIZE) { - MCLGET(m0, M_NOWAIT); - if ((m0->m_flags & M_EXT) == 0) { + if (!(MCLGET(m0, M_NOWAIT))) { hifnstats.hst_nomem_mcl++; err = sc->sc_cmdu ? ERESTART : ENOMEM; m_freem(m0); @@ -1913,8 +1912,7 @@ hifn_crypto( } len = MLEN; if (totlen >= MINCLSIZE) { - MCLGET(m, M_NOWAIT); - if ((m->m_flags & M_EXT) == 0) { + if (!(MCLGET(m, M_NOWAIT))) { hifnstats.hst_nomem_mcl++; err = sc->sc_cmdu ? ERESTART : ENOMEM; mlast->m_next = m; -- cgit v1.1