Lines Matching defs:con
168 npf_conn_t *con;
186 con = CONNDB_GET_PTR(val);
187 KASSERT(con != NULL);
192 atomic_inc_uint(&con->c_refcnt);
194 return con;
204 npf_conn_t *con, npf_flow_t flow)
214 KASSERT(!CONNDB_ISFORW_P(con));
215 val = (void *)((uintptr_t)(void *)con | tag);
246 npf_conndb_enqueue(npf_conndb_t *cd, npf_conn_t *con)
252 atomic_store_relaxed(&con->c_next, head);
253 } while (atomic_cas_ptr(&cd->cd_new, head, con) != head);
264 npf_conn_t *con;
266 con = atomic_swap_ptr(&cd->cd_new, NULL);
267 while (con) {
268 npf_conn_t *next = atomic_load_relaxed(&con->c_next); // union
269 LIST_INSERT_HEAD(&cd->cd_list, con, c_entry);
270 con = next;
289 npf_conndb_getnext(npf_conndb_t *cd, npf_conn_t *con)
292 if (con == NULL || (con = LIST_NEXT(con, c_entry)) == NULL) {
293 con = LIST_FIRST(&cd->cd_list);
295 return con;
307 npf_conn_t *con;
315 if ((con = cd->cd_marker) == NULL) {
316 con = npf_conndb_getnext(cd, NULL);
317 cd->cd_marker = con;
326 while (con && target--) {
327 npf_conn_t *next = npf_conndb_getnext(cd, con);
332 if (npf_conn_expired(npf, con, now)) {
334 LIST_REMOVE(con, c_entry);
335 LIST_INSERT_HEAD(&cd->cd_gclist, con, c_entry);
336 npf_conn_remove(cd, con);
340 if (con == next) {
343 if (con == cd->cd_marker) {
345 con = next;
349 con = next;
355 if (con == cd->cd_marker) {
359 cd->cd_marker = con;
393 npf_conn_t *con;
403 while ((con = LIST_FIRST(&cd->cd_list)) != NULL) {
404 LIST_REMOVE(con, c_entry);
405 LIST_INSERT_HEAD(&cd->cd_gclist, con, c_entry);
406 npf_conn_remove(cd, con);
438 while ((con = LIST_FIRST(&cd->cd_gclist)) != NULL) {
443 const unsigned refcnt = atomic_load_relaxed(&con->c_refcnt);
452 LIST_REMOVE(con, c_entry);
453 npf_conn_destroy(npf, con);