Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jul 2021 12:05:09 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f1c39eb170dd - stable/13 - mbuf: add m_free_raw to be used instead of directly calling uma_zfree
Message-ID:  <202107051205.165C59tl059029@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=f1c39eb170ddeca5137edb706d89216f5a1a1d4f

commit f1c39eb170ddeca5137edb706d89216f5a1a1d4f
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-06-30 14:15:25 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2021-07-05 12:04:59 +0000

    mbuf: add m_free_raw to be used instead of directly calling uma_zfree
    
    The intent is to remove all direct zone_mbuf consumers so that ctor/dtor
    from that zone can be reimplemented as wrappers around uma, avoiding an
    indirect function call.
    
    Reviewed by:    kbowling
    Discussed with: gallatin
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D30959
    
    (cherry picked from commit 05462babd424124762375dca186802d7355af566)
---
 sys/kern/kern_mbuf.c | 10 ++++++++++
 sys/sys/mbuf.h       |  1 +
 2 files changed, 11 insertions(+)

diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c
index a46c576bad90..3b202bf3aab7 100644
--- a/sys/kern/kern_mbuf.c
+++ b/sys/kern/kern_mbuf.c
@@ -1525,6 +1525,16 @@ m_freem(struct mbuf *mb)
 		mb = m_free(mb);
 }
 
+/*
+ * Temporary primitive to allow freeing without going through m_free.
+ */
+void
+m_free_raw(struct mbuf *mb)
+{
+
+	uma_zfree(zone_mbuf, mb);
+}
+
 int
 m_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params,
     struct m_snd_tag **mstp)
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 729653fa1e55..bb6bf9f62b7a 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -827,6 +827,7 @@ void		 m_extadd(struct mbuf *, char *, u_int, m_ext_free_t,
 u_int		 m_fixhdr(struct mbuf *);
 struct mbuf	*m_fragment(struct mbuf *, int, int);
 void		 m_freem(struct mbuf *);
+void		 m_free_raw(struct mbuf *);
 struct mbuf	*m_get2(int, int, short, int);
 struct mbuf	*m_getjcl(int, short, int, int);
 struct mbuf	*m_getm2(struct mbuf *, int, int, short, int);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107051205.165C59tl059029>