Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_pcb.c
Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* | /* | ||||
* Add PCB to load balance group for SO_REUSEPORT_LB option. | * Add PCB to load balance group for SO_REUSEPORT_LB option. | ||||
*/ | */ | ||||
static int | static int | ||||
in_pcbinslbgrouphash(struct inpcb *inp) | in_pcbinslbgrouphash(struct inpcb *inp) | ||||
{ | { | ||||
const static struct timeval interval = { 60, 0 }; | const struct timeval interval = { 60, 0 }; | ||||
static struct timeval lastprint; | |||||
struct inpcbinfo *pcbinfo; | struct inpcbinfo *pcbinfo; | ||||
struct inpcblbgrouphead *hdr; | struct inpcblbgrouphead *hdr; | ||||
struct inpcblbgroup *grp; | struct inpcblbgroup *grp; | ||||
uint32_t idx; | uint32_t idx; | ||||
pcbinfo = inp->inp_pcbinfo; | pcbinfo = inp->inp_pcbinfo; | ||||
INP_WLOCK_ASSERT(inp); | INP_WLOCK_ASSERT(inp); | ||||
Show All 31 Lines | if (grp == NULL) { | ||||
/* Create new load balance group. */ | /* Create new load balance group. */ | ||||
grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag, | grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag, | ||||
inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, | inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, | ||||
INPCBLBGROUP_SIZMIN); | INPCBLBGROUP_SIZMIN); | ||||
if (grp == NULL) | if (grp == NULL) | ||||
return (ENOBUFS); | return (ENOBUFS); | ||||
} else if (grp->il_inpcnt == grp->il_inpsiz) { | } else if (grp->il_inpcnt == grp->il_inpsiz) { | ||||
if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { | if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { | ||||
if (ratecheck(&lastprint, &interval)) | if (ratecheck(&grp->il_lastprint, &interval)) | ||||
printf("lb group port %d, limit reached\n", | printf("lb group port %d, limit reached\n", | ||||
ntohs(grp->il_lport)); | ntohs(grp->il_lport)); | ||||
return (0); | return (0); | ||||
} | } | ||||
/* Expand this local group. */ | /* Expand this local group. */ | ||||
grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); | grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); | ||||
if (grp == NULL) | if (grp == NULL) | ||||
▲ Show 20 Lines • Show All 3,067 Lines • Show Last 20 Lines |