Date: Sun, 9 Nov 2014 22:59:22 +0000 (UTC) From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r274335 - in projects/routing: share/man/man9 sys/net Message-ID: <201411092259.sA9MxMJR060236@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: melifaro Date: Sun Nov 9 22:59:21 2014 New Revision: 274335 URL: https://svnweb.freebsd.org/changeset/base/274335 Log: Since we no longer return individual radix entries, it is not possible to do per-rte accounting. Remove rt_kpktsent. Modified: projects/routing/share/man/man9/rtentry.9 projects/routing/sys/net/route.c projects/routing/sys/net/route.h projects/routing/sys/net/route_internal.h projects/routing/sys/net/rtsock.c Modified: projects/routing/share/man/man9/rtentry.9 ============================================================================== --- projects/routing/share/man/man9/rtentry.9 Sun Nov 9 22:54:40 2014 (r274334) +++ projects/routing/share/man/man9/rtentry.9 Sun Nov 9 22:59:21 2014 (r274335) @@ -101,8 +101,6 @@ See description of rmx_mtu below. See description of rmx_weight below. .It Vt "u_long rt_expire"; See description of rmx_expire below. -.It Vt "counter64_t rt_pksent"; -See description of rmx_pksent below. .It Vt "struct rtentry *rt_gwroute" ; This member is a reference to a route whose destination is .Va rt_gateway . @@ -174,9 +172,9 @@ passed with routing control messages via .Xr route 4 API. Currently only -.Vt rmx_mtu , rmx_expire , +.Vt rmx_mtu , and -.Vt rmx_pksent +.Vt rmx_expire metrics are supplied. All others are ignored. .Pp @@ -221,8 +219,6 @@ The average deviation of the round-trip units of .Dv RMX_RTTUNIT per second. -.It Vt "u_long rmx_pksent" ; -A count of packets successfully sent via this route. .It Vt "u_long rmx_filler[4]" ; .\" XXX badly named Empty space available for protocol-specific information. Modified: projects/routing/sys/net/route.c ============================================================================== --- projects/routing/sys/net/route.c Sun Nov 9 22:54:40 2014 (r274334) +++ projects/routing/sys/net/route.c Sun Nov 9 22:59:21 2014 (r274335) @@ -201,48 +201,6 @@ route_init(void) } SYSINIT(route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, 0); -static int -rtentry_zinit(void *mem, int size, int how) -{ - struct rtentry *rt = mem; - - rt->rt_pksent = counter_u64_alloc(how); - if (rt->rt_pksent == NULL) - return (ENOMEM); - - RT_LOCK_INIT(rt); - - return (0); -} - -static void -rtentry_zfini(void *mem, int size) -{ - struct rtentry *rt = mem; - - RT_LOCK_DESTROY(rt); - counter_u64_free(rt->rt_pksent); -} - -static int -rtentry_ctor(void *mem, int size, void *arg, int how) -{ - struct rtentry *rt = mem; - - bzero(rt, offsetof(struct rtentry, rt_endzero)); - counter_u64_zero(rt->rt_pksent); - - return (0); -} - -static void -rtentry_dtor(void *mem, int size, void *arg) -{ - struct rtentry *rt = mem; - - RT_UNLOCK_COND(rt); -} - static void vnet_route_init(const void *unused __unused) { @@ -255,8 +213,7 @@ vnet_route_init(const void *unused __unu sizeof(struct rib_head *), M_RTABLE, M_WAITOK|M_ZERO); V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), - rtentry_ctor, rtentry_dtor, - rtentry_zinit, rtentry_zfini, UMA_ALIGN_PTR, 0); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { if (dom->dom_rtattach == NULL) continue; @@ -1341,11 +1298,12 @@ rtrequest1_fib(int req, struct rt_addrin } else ifa_ref(info->rti_ifa); ifa = info->rti_ifa; - rt = uma_zalloc(V_rtzone, M_NOWAIT); + rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO); if (rt == NULL) { ifa_free(ifa); senderr(ENOBUFS); } + RT_LOCK_INIT(rt); rt->rt_flags = RTF_UP | flags; rt->rt_fibnum = fibnum; /* @@ -1353,6 +1311,7 @@ rtrequest1_fib(int req, struct rt_addrin */ RT_LOCK(rt); if ((error = rt_setgate(rt, dst, gateway)) != 0) { + RT_LOCK_DESTROY(rt); ifa_free(ifa); uma_zfree(V_rtzone, rt); senderr(error); @@ -1388,6 +1347,7 @@ rtrequest1_fib(int req, struct rt_addrin rt_mpath_conflict(rh, rt, netmask)) { ifa_free(rt->rt_ifa); Free(rt_key(rt)); + RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); senderr(EEXIST); } Modified: projects/routing/sys/net/route.h ============================================================================== --- projects/routing/sys/net/route.h Sun Nov 9 22:54:40 2014 (r274334) +++ projects/routing/sys/net/route.h Sun Nov 9 22:59:21 2014 (r274335) @@ -33,7 +33,6 @@ #ifndef _NET_ROUTE_H_ #define _NET_ROUTE_H_ -#include <sys/counter.h> #include <net/vnet.h> /* Modified: projects/routing/sys/net/route_internal.h ============================================================================== --- projects/routing/sys/net/route_internal.h Sun Nov 9 22:54:40 2014 (r274334) +++ projects/routing/sys/net/route_internal.h Sun Nov 9 22:59:21 2014 (r274335) @@ -73,8 +73,7 @@ struct rtentry { 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 */ +#define rt_endzero rt_mtx struct mtx rt_mtx; /* mutex for routing entry */ }; Modified: projects/routing/sys/net/rtsock.c ============================================================================== --- projects/routing/sys/net/rtsock.c Sun Nov 9 22:54:40 2014 (r274334) +++ projects/routing/sys/net/rtsock.c Sun Nov 9 22:59:21 2014 (r274335) @@ -922,7 +922,6 @@ rt_getmetrics(const struct rtentry *rt, bzero(out, sizeof(*out)); out->rmx_mtu = rt->rt_mtu; out->rmx_weight = rt->rt_weight; - out->rmx_pksent = counter_u64_fetch(rt->rt_pksent); /* Kernel -> userland timebase conversion. */ out->rmx_expire = rt->rt_expire ? rt->rt_expire - time_uptime + time_second : 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411092259.sA9MxMJR060236>