MCPcopy Create free account
hub / github.com/F-Stack/f-stack / drop

Function drop

freebsd/netpfil/ipfw/test/main.c:112–133  ·  view source on GitHub ↗

release a packet for a given flow_id. * Put the mbuf in the freelist, and in case move the * flow to the end of the bucket. */

Source from the content-addressed store, hash-verified

110 * flow to the end of the bucket.
111 */
112static int
113drop(struct cfg_s *c, struct mbuf *m)
114{
115 struct dn_queue *q;
116 int i;
117
118 c->drop++;
119 q = FI2Q(c, m->flow_id);
120 i = q->ni.length; // XXX or ffs...
121
122 ND("q %p id %d current length %d", q, m->flow_id, i);
123 if (i < BACKLOG) {
124 struct list_head *h = &q->ni.h;
125 c->llmask &= ~(1<<(i+1));
126 c->llmask |= (1<<(i));
127 list_del(h);
128 list_add_tail(h, &c->ll[i]);
129 }
130 m->m_nextpkt = c->freelist;
131 c->freelist = m;
132 return 0;
133}
134
135/*
136 * dn_sch_inst does not have a queue, for the RR we

Callers 1

mainloopFunction · 0.85

Calls 2

list_delFunction · 0.70
list_add_tailFunction · 0.70

Tested by

no test coverage detected