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. */
| 110 | * flow to the end of the bucket. |
| 111 | */ |
| 112 | static int |
| 113 | drop(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 |
no test coverage detected