aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-07-06 18:51:20 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-07-07 11:05:46 +0000
commitc2c34ee5401d8772165707e2c80beddf8a7d60df (patch)
tree4fee1986e04ab2f63f6fe57033f8bf253d130418 /sys/sys
parent0a718a6e6ebaa1b8442123df8bdbae5a04a77987 (diff)
downloadsrc-c2c34ee5401d8772165707e2c80beddf8a7d60df.tar.gz
src-c2c34ee5401d8772165707e2c80beddf8a7d60df.zip
mbuf: add m_get_raw and m_gethdr_raw
The intent is to eliminate the MT_NOINIT flag and consequently a branch from the constructor. Reviewed by: gallatin Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31080
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/mbuf.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 1dac5fcf32b7..2936966f6acc 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -62,7 +62,9 @@
SDT_PROBE5(sdt, , , probe, arg0, arg1, arg2, arg3, arg4)
SDT_PROBE_DECLARE(sdt, , , m__init);
+SDT_PROBE_DECLARE(sdt, , , m__gethdr_raw);
SDT_PROBE_DECLARE(sdt, , , m__gethdr);
+SDT_PROBE_DECLARE(sdt, , , m__get_raw);
SDT_PROBE_DECLARE(sdt, , , m__get);
SDT_PROBE_DECLARE(sdt, , , m__getcl);
SDT_PROBE_DECLARE(sdt, , , m__getjcl);
@@ -957,6 +959,19 @@ m_init(struct mbuf *m, int how, short type, int flags)
}
static __inline struct mbuf *
+m_get_raw(int how, short type)
+{
+ struct mbuf *m;
+ struct mb_args args;
+
+ args.flags = 0;
+ args.type = type | MT_NOINIT;
+ m = uma_zalloc_arg(zone_mbuf, &args, how);
+ MBUF_PROBE3(m__get_raw, how, type, m);
+ return (m);
+}
+
+static __inline struct mbuf *
m_get(int how, short type)
{
struct mbuf *m;
@@ -970,6 +985,19 @@ m_get(int how, short type)
}
static __inline struct mbuf *
+m_gethdr_raw(int how, short type)
+{
+ struct mbuf *m;
+ struct mb_args args;
+
+ args.flags = M_PKTHDR;
+ args.type = type | MT_NOINIT;
+ m = uma_zalloc_arg(zone_mbuf, &args, how);
+ MBUF_PROBE3(m__gethdr_raw, how, type, m);
+ return (m);
+}
+
+static __inline struct mbuf *
m_gethdr(int how, short type)
{
struct mbuf *m;