Lines Matching refs:q
94 static unsigned int ip6_hashfn(const struct inet_frag_queue *q) in ip6_hashfn() argument
98 fq = container_of(q, struct frag_queue, q); in ip6_hashfn()
102 bool ip6_frag_match(const struct inet_frag_queue *q, const void *a) in ip6_frag_match() argument
107 fq = container_of(q, struct frag_queue, q); in ip6_frag_match()
118 void ip6_frag_init(struct inet_frag_queue *q, const void *a) in ip6_frag_init() argument
120 struct frag_queue *fq = container_of(q, struct frag_queue, q); in ip6_frag_init()
136 spin_lock(&fq->q.lock); in ip6_expire_frag_queue()
138 if (fq->q.flags & INET_FRAG_COMPLETE) in ip6_expire_frag_queue()
141 inet_frag_kill(&fq->q, frags); in ip6_expire_frag_queue()
150 if (fq->q.flags & INET_FRAG_EVICTED) in ip6_expire_frag_queue()
156 if (!(fq->q.flags & INET_FRAG_FIRST_IN) || !fq->q.fragments) in ip6_expire_frag_queue()
163 fq->q.fragments->dev = dev; in ip6_expire_frag_queue()
164 icmpv6_send(fq->q.fragments, ICMPV6_TIME_EXCEED, ICMPV6_EXC_FRAGTIME, 0); in ip6_expire_frag_queue()
168 spin_unlock(&fq->q.lock); in ip6_expire_frag_queue()
169 inet_frag_put(&fq->q, frags); in ip6_expire_frag_queue()
178 fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q); in ip6_frag_expire()
179 net = container_of(fq->q.net, struct net, ipv6.frags); in ip6_frag_expire()
188 struct inet_frag_queue *q; in fq_find() local
201 q = inet_frag_find(&net->ipv6.frags, &ip6_frags, &arg, hash); in fq_find()
202 if (IS_ERR_OR_NULL(q)) { in fq_find()
203 inet_frag_maybe_warn_overflow(q, pr_fmt()); in fq_find()
206 return container_of(q, struct frag_queue, q); in fq_find()
218 if (fq->q.flags & INET_FRAG_COMPLETE) in ip6_frag_queue()
248 if (end < fq->q.len || in ip6_frag_queue()
249 ((fq->q.flags & INET_FRAG_LAST_IN) && end != fq->q.len)) in ip6_frag_queue()
251 fq->q.flags |= INET_FRAG_LAST_IN; in ip6_frag_queue()
252 fq->q.len = end; in ip6_frag_queue()
267 if (end > fq->q.len) { in ip6_frag_queue()
269 if (fq->q.flags & INET_FRAG_LAST_IN) in ip6_frag_queue()
271 fq->q.len = end; in ip6_frag_queue()
289 prev = fq->q.fragments_tail; in ip6_frag_queue()
295 for (next = fq->q.fragments; next != NULL; next = next->next) { in ip6_frag_queue()
323 fq->q.fragments_tail = skb; in ip6_frag_queue()
327 fq->q.fragments = skb; in ip6_frag_queue()
334 fq->q.stamp = skb->tstamp; in ip6_frag_queue()
335 fq->q.meat += skb->len; in ip6_frag_queue()
337 add_frag_mem_limit(&fq->q, skb->truesize); in ip6_frag_queue()
344 fq->q.flags |= INET_FRAG_FIRST_IN; in ip6_frag_queue()
347 if (fq->q.flags == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) && in ip6_frag_queue()
348 fq->q.meat == fq->q.len) { in ip6_frag_queue()
362 inet_frag_kill(&fq->q, &ip6_frags); in ip6_frag_queue()
382 struct net *net = container_of(fq->q.net, struct net, ipv6.frags); in ip6_frag_reasm()
383 struct sk_buff *fp, *head = fq->q.fragments; in ip6_frag_reasm()
389 inet_frag_kill(&fq->q, &ip6_frags); in ip6_frag_reasm()
405 fq->q.fragments_tail = fp; in ip6_frag_reasm()
408 skb_morph(head, fq->q.fragments); in ip6_frag_reasm()
409 head->next = fq->q.fragments->next; in ip6_frag_reasm()
411 consume_skb(fq->q.fragments); in ip6_frag_reasm()
412 fq->q.fragments = head; in ip6_frag_reasm()
420 sizeof(struct ipv6hdr) + fq->q.len - in ip6_frag_reasm()
450 add_frag_mem_limit(&fq->q, clone->truesize); in ip6_frag_reasm()
488 sub_frag_mem_limit(&fq->q, sum_truesize); in ip6_frag_reasm()
492 head->tstamp = fq->q.stamp; in ip6_frag_reasm()
507 fq->q.fragments = NULL; in ip6_frag_reasm()
508 fq->q.fragments_tail = NULL; in ip6_frag_reasm()
562 spin_lock(&fq->q.lock); in ipv6_frag_rcv()
566 spin_unlock(&fq->q.lock); in ipv6_frag_rcv()
567 inet_frag_put(&fq->q, &ip6_frags); in ipv6_frag_rcv()