summaryrefslogtreecommitdiffstats
path: root/sys/net/route.h
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-03-05 01:17:47 +0000
committerglebius <glebius@FreeBSD.org>2014-03-05 01:17:47 +0000
commit8a3e4bbebb00c94db1ecf732ad3a6e3aa982384d (patch)
treec94a610c690dc0167aec575edf34ac5b23f1f498 /sys/net/route.h
parentc23c087e5b36b9341d9242aae6bd8eb7835dfd43 (diff)
downloadFreeBSD-src-8a3e4bbebb00c94db1ecf732ad3a6e3aa982384d.zip
FreeBSD-src-8a3e4bbebb00c94db1ecf732ad3a6e3aa982384d.tar.gz
- Remove rt_metrics_lite and simply put its members into rtentry.
- Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This removes another cache trashing ++ from packet forwarding path. - Create zini/fini methods for the rtentry UMA zone. Via initialize mutex and counter in them. - Fix reporting of rmx_pksent to routing socket. - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode. The change is mostly targeted for stable/10 merge. For head, rt_pksent is expected to just disappear. Discussed with: melifaro Sponsored by: Netflix Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h32
1 files changed, 11 insertions, 21 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index 3842b16..f15be36 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -33,6 +33,8 @@
#ifndef _NET_ROUTE_H_
#define _NET_ROUTE_H_
+#include <sys/counter.h>
+
/*
* Kernel resident routing tables.
*
@@ -57,17 +59,6 @@ struct route {
#define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */
#define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */
-/*
- * These numbers are used by reliable protocols for determining
- * retransmission behavior and are included in the routing structure.
- */
-struct rt_metrics_lite {
- u_long rmx_mtu; /* MTU for this path */
- u_long rmx_expire; /* lifetime for route, e.g. redirect */
- u_long rmx_pksent; /* packets sent using this route */
- u_long rmx_weight; /* absolute weight */
-};
-
struct rt_metrics {
u_long rmx_locks; /* Kernel must leave these values alone */
u_long rmx_mtu; /* MTU for this path */
@@ -124,16 +115,17 @@ struct rtentry {
#define rt_key(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_key)))
#define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask)))
struct sockaddr *rt_gateway; /* value */
- int rt_flags; /* up/down?, host/net */
- int rt_refcnt; /* # held references */
struct ifnet *rt_ifp; /* the answer: interface to use */
struct ifaddr *rt_ifa; /* the answer: interface address to use */
- struct rt_metrics_lite rt_rmx; /* metrics used by rx'ing protocols */
- u_int rt_fibnum; /* which FIB */
-#ifdef _KERNEL
- /* XXX ugly, user apps use this definition but don't have a mtx def */
- struct mtx rt_mtx; /* mutex for routing entry */
-#endif
+ int rt_flags; /* up/down?, host/net */
+ int rt_refcnt; /* # held references */
+ u_int rt_fibnum; /* which FIB */
+ u_long rt_mtu; /* MTU for this path */
+ u_long rt_weight; /* absolute weight */
+ u_long rt_expire; /* lifetime for route, e.g. redirect */
+#define rt_endzero rt_pksent
+ counter_u64_t rt_pksent; /* packets sent using this route */
+ struct mtx rt_mtx; /* mutex for routing entry */
};
/*
@@ -150,8 +142,6 @@ struct ortentry {
struct ifnet *rt_ifp; /* the answer: interface to use */
};
-#define rt_use rt_rmx.rmx_pksent
-
#define RTF_UP 0x1 /* route usable */
#define RTF_GATEWAY 0x2 /* destination is a gateway */
#define RTF_HOST 0x4 /* host entry (net otherwise) */
OpenPOWER on IntegriCloud