diff options
author | rwatson <rwatson@FreeBSD.org> | 2015-01-06 12:59:37 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2015-01-06 12:59:37 +0000 |
commit | 60909669f00c3675bab15d82d9d63aaff61dfafa (patch) | |
tree | 8da641e0473d723ab1cc2e5a5772cb1eed6e4d6f /sys/dev/my | |
parent | ff9d81bf5b98e98550d75c454cbd7b6d5002e628 (diff) | |
download | FreeBSD-src-60909669f00c3675bab15d82d9d63aaff61dfafa.zip FreeBSD-src-60909669f00c3675bab15d82d9d63aaff61dfafa.tar.gz |
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
Diffstat (limited to 'sys/dev/my')
-rw-r--r-- | sys/dev/my/if_my.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c index e94e9ab..e2430c1 100644 --- a/sys/dev/my/if_my.c +++ b/sys/dev/my/if_my.c @@ -1085,8 +1085,7 @@ my_newbuf(struct my_softc * sc, struct my_chain_onefrag * c) "no memory for rx list -- packet dropped!\n"); return (ENOBUFS); } - MCLGET(m_new, M_NOWAIT); - if (!(m_new->m_flags & M_EXT)) { + if (!(MCLGET(m_new, M_NOWAIT))) { device_printf(sc->my_dev, "no memory for rx list -- packet dropped!\n"); m_freem(m_new); @@ -1352,8 +1351,7 @@ my_encap(struct my_softc * sc, struct my_chain * c, struct mbuf * m_head) return (1); } if (m_head->m_pkthdr.len > MHLEN) { - MCLGET(m_new, M_NOWAIT); - if (!(m_new->m_flags & M_EXT)) { + if (!(MCLGET(m_new, M_NOWAIT))) { m_freem(m_new); device_printf(sc->my_dev, "no memory for tx list"); return (1); |