Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/mpath_ctl.c
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
#include <net/route/nhop_var.h> | #include <net/route/nhop_var.h> | ||||
/* | /* | ||||
* This file contains the supporting functions for adding/deleting/updating | * This file contains the supporting functions for adding/deleting/updating | ||||
* multipath routes to the routing table. | * multipath routes to the routing table. | ||||
*/ | */ | ||||
SYSCTL_DECL(_net_route); | SYSCTL_DECL(_net_route); | ||||
VNET_DEFINE(u_int, fib_hash_outbound) = 0; | |||||
SYSCTL_UINT(_net_route, OID_AUTO, hash_outbound, CTLFLAG_RD | CTLFLAG_VNET, | |||||
ae: Maybe we should allow set it from loader.conf? I.e. use CTLFLAG_RDTUN flag? | |||||
&VNET_NAME(fib_hash_outbound), 0, | |||||
"Compute flowid for locally-originated packets"); | |||||
/* Default entropy to add to the hash calculation for the outbound connections*/ | |||||
emasteUnsubmitted Not Done Inline ActionsWhere does this come from? emaste: Where does this come from?
| |||||
melifaroAuthorUnsubmitted Not Done Inline ActionsThat's the default key from Microsoft RSS spec, copied from rss_config.c melifaro: That's the default key from Microsoft RSS spec, copied from [rss_config.c](https://svnweb. | |||||
uint8_t mpath_entropy_key[MPATH_ENTROPY_KEY_LEN] = { | |||||
0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, | |||||
0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, | |||||
0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, | |||||
0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, | |||||
0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa, | |||||
}; | |||||
/* | /* | ||||
* Tries to add @rnd_add nhop to the existing set of nhops (@nh_orig) for the | * Tries to add @rnd_add nhop to the existing set of nhops (@nh_orig) for the | ||||
* prefix specified by @rt. | * prefix specified by @rt. | ||||
* | * | ||||
* Return 0 ans consumes rt / rnd_add nhop references. @rc gets populated | * Return 0 ans consumes rt / rnd_add nhop references. @rc gets populated | ||||
* with the operation result. | * with the operation result. | ||||
* Otherwise errno is returned. | * Otherwise errno is returned. | ||||
* | * | ||||
Show All 32 Lines | if (error != 0) { | ||||
continue; | continue; | ||||
} | } | ||||
error = change_route_conditional(rnh, rt, info, rnd_orig, | error = change_route_conditional(rnh, rt, info, rnd_orig, | ||||
&rnd_new, rc); | &rnd_new, rc); | ||||
if (error != EAGAIN) | if (error != EAGAIN) | ||||
break; | break; | ||||
RTSTAT_INC(rts_add_retry); | RTSTAT_INC(rts_add_retry); | ||||
} | |||||
if (V_fib_hash_outbound == 0 && error == 0 && | |||||
NH_IS_NHGRP(rc->rc_nh_new)) { | |||||
/* | |||||
* First multipath route got installed. Enable local | |||||
* outbound connections hashing. | |||||
*/ | |||||
if (bootverbose) | |||||
printf("FIB: enabled flowid calculation for locally-originated packets\n"); | |||||
V_fib_hash_outbound = 1; | |||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
struct rt_match_info { | struct rt_match_info { | ||||
struct rt_addrinfo *info; | struct rt_addrinfo *info; | ||||
struct rtentry *rt; | struct rtentry *rt; | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
Maybe we should allow set it from loader.conf? I.e. use CTLFLAG_RDTUN flag?