aboutsummaryrefslogtreecommitdiff
path: root/sys/net/route.h
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2020-05-08 21:06:10 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2020-05-08 21:06:10 +0000
commit656442a718ec2e874ca390b6a8ae11d216bef4ed (patch)
treea46e3636e6fc862eaa25034890b1e6336d2522a6 /sys/net/route.h
parent2e661d07fe3c6c3a635b57857a06aa56404887ce (diff)
Embed dst sockaddr into rtentry and remove rte packet counter
Currently each rtentry has dst&gateway allocated separately from another zone, bloating cache accesses. Current 'struct rtentry' has 12 "mandatory" radix pointers in the beginning, leaving 4 usable pointers/32 bytes in the first 2 cache lines (amd64). Fields needed for the datapath are destination sockaddr and rt_nhop. So far it doesn't look like there is other routable addressing protocol other than IPv4/IPv6/MPLS, which uses keys longer than 20 bytes. With that in mind, embed dst into struct rtentry, making the first 24 bytes of rtentry within 128 bytes. That is enough to make IPv6 address within first 128 bytes. It is still pretty easy to add code for supporting separately-allocated dst, however it doesn't make a lot of sense in having such code without a use case. As rS359823 moved the gateway to the nexthop structure, the dst embedding change removes the need for any additional allocations done by rt_setgate(). Lastly, as a part of cleanup, remove counter(9) allocation code, as this field is not used in packet processing anymore. Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D24669
Notes
svn path=/head/; revision=360824
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index e834105f55a8..c13e627c54bd 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -378,7 +378,6 @@ int rt_addrmsg(int, struct ifaddr *, int);
int rt_routemsg(int, struct rtentry *, struct ifnet *ifp, int, int);
int rt_routemsg_info(int, struct rt_addrinfo *, int);
void rt_newmaddrmsg(int, struct ifmultiaddr *);
-int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *);
void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *);
struct rib_head *rt_table_init(int, int, u_int);
void rt_table_destroy(struct rib_head *);