Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/ip_reass.c
Show All 40 Lines | |||||
#include <sys/eventhandler.h> | #include <sys/eventhandler.h> | ||||
#include <sys/hash.h> | #include <sys/hash.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/limits.h> | #include <sys/limits.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/socket.h> | |||||
#include <net/if.h> | |||||
#include <net/if_var.h> | |||||
#include <net/rss_config.h> | #include <net/rss_config.h> | ||||
#include <net/netisr.h> | #include <net/netisr.h> | ||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/ip.h> | #include <netinet/ip.h> | ||||
#include <netinet/ip_var.h> | #include <netinet/ip_var.h> | ||||
#include <netinet/in_rss.h> | #include <netinet/in_rss.h> | ||||
▲ Show 20 Lines • Show All 542 Lines • ▼ Show 20 Lines | for (int i = 0; i < IPREASS_NHASH; i++) { | ||||
while(!TAILQ_EMPTY(&V_ipq[i].head)) | while(!TAILQ_EMPTY(&V_ipq[i].head)) | ||||
ipq_drop(&V_ipq[i], TAILQ_FIRST(&V_ipq[i].head)); | ipq_drop(&V_ipq[i], TAILQ_FIRST(&V_ipq[i].head)); | ||||
KASSERT(V_ipq[i].count == 0, | KASSERT(V_ipq[i].count == 0, | ||||
("%s: V_ipq[%d] count %d (V_ipq=%p)", __func__, i, | ("%s: V_ipq[%d] count %d (V_ipq=%p)", __func__, i, | ||||
V_ipq[i].count, V_ipq)); | V_ipq[i].count, V_ipq)); | ||||
IPQ_UNLOCK(i); | IPQ_UNLOCK(i); | ||||
} | } | ||||
} | } | ||||
/* | |||||
* Drain off all datagram fragments belonging to | |||||
* the given network interface. | |||||
*/ | |||||
static void | |||||
ipreass_cleanup(void *arg __unused, struct ifnet *ifp) | |||||
{ | |||||
struct ipq *fp, *temp; | |||||
struct mbuf *m; | |||||
int i; | |||||
KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); | |||||
CURVNET_SET_QUIET(ifp->if_vnet); | |||||
for (i = 0; i < IPREASS_NHASH; i++) { | |||||
IPQ_LOCK(i); | |||||
/* Scan fragment list. */ | |||||
TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, temp) { | |||||
for (m = fp->ipq_frags; m != NULL; m = m->m_nextpkt) { | |||||
if (m->m_pkthdr.rcvif == ifp) { | |||||
ipq_drop(&V_ipq[i], fp); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
IPQ_UNLOCK(i); | |||||
} | |||||
CURVNET_RESTORE(); | |||||
} | |||||
EVENTHANDLER_DEFINE(ifnet_departure_event, ipreass_cleanup, NULL, 0); | |||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
/* | /* | ||||
* Destroy IP reassembly structures. | * Destroy IP reassembly structures. | ||||
*/ | */ | ||||
void | void | ||||
ipreass_destroy(void) | ipreass_destroy(void) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines |