aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mwl
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2017-10-09 20:35:31 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2017-10-09 20:35:31 +0000
commite8fd18f306915c411b08ab4664ec0aa3bc03d4d4 (patch)
tree889c5459ce4e793e93ed7c8618572e602b4bf058 /sys/dev/mwl
parent32b413d7f0c47e033002e639b2049667b0891113 (diff)
downloadsrc-e8fd18f306915c411b08ab4664ec0aa3bc03d4d4.tar.gz
src-e8fd18f306915c411b08ab4664ec0aa3bc03d4d4.zip
Shorten list of arguments to mbuf external storage freeing function.
All of these arguments are stored in m_ext, so there is no reason to pass them in the argument list. Not all functions need the second argument, some don't even need the first one. The second argument lives in next cache line, so not dereferencing it is a performance gain. This was discovered in sendfile(2), which will be covered by next commits. The second goal of this commit is to bring even more flexibility to m_ext mbufs, allowing to create more fields in m_ext, opaque to the generic mbuf code, and potentially set and dereferenced by subsystems. Reviewed by: gallatin, kbowling Differential Revision: https://reviews.freebsd.org/D12615
Notes
Notes: svn path=/head/; revision=324446
Diffstat (limited to 'sys/dev/mwl')
-rw-r--r--sys/dev/mwl/if_mwl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c
index 79172aaf7bd7..861cbff950f3 100644
--- a/sys/dev/mwl/if_mwl.c
+++ b/sys/dev/mwl/if_mwl.c
@@ -2522,12 +2522,12 @@ mwl_rxbuf_init(struct mwl_softc *sc, struct mwl_rxbuf *bf)
}
static void
-mwl_ext_free(struct mbuf *m, void *data, void *arg)
+mwl_ext_free(struct mbuf *m)
{
- struct mwl_softc *sc = arg;
+ struct mwl_softc *sc = m->m_ext.ext_arg1;
/* XXX bounds check data */
- mwl_putrxdma(sc, data);
+ mwl_putrxdma(sc, m->m_ext.ext_buf);
/*
* If we were previously blocked by a lack of rx dma buffers
* check if we now have enough to restart rx interrupt handling.
@@ -2746,8 +2746,8 @@ mwl_rx_proc(void *arg, int npending)
* descriptor using the replacement dma
* buffer we just installed above.
*/
- MEXTADD(m, data, MWL_AGGR_SIZE, mwl_ext_free,
- data, sc, 0, EXT_NET_DRV);
+ m_extadd(m, data, MWL_AGGR_SIZE, mwl_ext_free, sc, NULL, 0,
+ EXT_NET_DRV);
m->m_data += off - hdrlen;
m->m_pkthdr.len = m->m_len = pktlen;
/* NB: dma buffer assumed read-only */