summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2016-03-01 00:17:14 +0000
committerglebius <glebius@FreeBSD.org>2016-03-01 00:17:14 +0000
commit163857deb49218689359c45361b584e1e3bea11f (patch)
tree5e3706d3c3c67b5379480ec58de16084b5a5f486 /sys/netinet6
parent646a8831c3579d8a22b0f5b99555206ce7800134 (diff)
downloadFreeBSD-src-163857deb49218689359c45361b584e1e3bea11f.zip
FreeBSD-src-163857deb49218689359c45361b584e1e3bea11f.tar.gz
New way to manage reference counting of mbuf external storage.
The m_ext.ext_cnt pointer becomes a union. It can now hold the refcount value itself. To tell that m_ext.ext_flags flag EXT_FLAG_EMBREF is used. The first mbuf to attach a cluster stores the refcount. The further mbufs to reference the cluster point at refcount in the first mbuf. The first mbuf is freed only when the last reference is freed. The benefit over refcounts stored in separate slabs is that now refcounts of different, unrelated mbufs do not share a cache line. For EXT_EXTREF mbufs the zone_ext_refcnt is no longer needed, and m_extadd() becomes void, making widely used M_EXTADD macro safe. For EXT_SFBUF mbufs the sf_ext_ref() is removed, which was an optimization exactly against the cache aliasing problem with regular refcounting. Discussed with: rrs, rwatson, gnn, hiren, sbruno, np Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D5396 Sponsored by: Netflix
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c2
-rw-r--r--sys/netinet6/ip6_var.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index ccbac7d..3a47285 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -2972,7 +2972,7 @@ ip6_setpktopt(int optname, u_char *buf, int len, struct ip6_pktopts *opt,
* pointer that might NOT be &loif -- easier than replicating that code here.
*/
void
-ip6_mloopback(struct ifnet *ifp, const struct mbuf *m)
+ip6_mloopback(struct ifnet *ifp, struct mbuf *m)
{
struct mbuf *copym;
struct ip6_hdr *ip6;
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index ef86eca..8a45f55 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -382,7 +382,7 @@ int ip6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
void ip6_forward(struct mbuf *, int);
-void ip6_mloopback(struct ifnet *, const struct mbuf *);
+void ip6_mloopback(struct ifnet *, struct mbuf *);
int ip6_output(struct mbuf *, struct ip6_pktopts *,
struct route_in6 *,
int,
OpenPOWER on IntegriCloud