Lines Matching full:napi
254 static void napi_gro_complete(struct napi_struct *napi, struct sk_buff *skb) in napi_gro_complete() argument
287 gro_normal_one(napi, skb, NAPI_GRO_CB(skb)->count); in napi_gro_complete()
290 static void __napi_gro_flush_chain(struct napi_struct *napi, u32 index, in __napi_gro_flush_chain() argument
293 struct list_head *head = &napi->gro_hash[index].list; in __napi_gro_flush_chain()
300 napi_gro_complete(napi, skb); in __napi_gro_flush_chain()
301 napi->gro_hash[index].count--; in __napi_gro_flush_chain()
304 if (!napi->gro_hash[index].count) in __napi_gro_flush_chain()
305 __clear_bit(index, &napi->gro_bitmask); in __napi_gro_flush_chain()
308 /* napi->gro_hash[].list contains packets ordered by age.
312 void napi_gro_flush(struct napi_struct *napi, bool flush_old) in napi_gro_flush() argument
314 unsigned long bitmask = napi->gro_bitmask; in napi_gro_flush()
320 __napi_gro_flush_chain(napi, base, flush_old); in napi_gro_flush()
442 static void gro_flush_oldest(struct napi_struct *napi, struct list_head *head) in gro_flush_oldest() argument
454 /* Do not adjust napi->gro_hash[].count, caller is adding a new in gro_flush_oldest()
458 napi_gro_complete(napi, oldest); in gro_flush_oldest()
461 static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) in dev_gro_receive() argument
464 struct gro_list *gro_list = &napi->gro_hash[bucket]; in dev_gro_receive()
529 napi_gro_complete(napi, pp); in dev_gro_receive()
540 gro_flush_oldest(napi, &gro_list->list); in dev_gro_receive()
554 if (!test_bit(bucket, &napi->gro_bitmask)) in dev_gro_receive()
555 __set_bit(bucket, &napi->gro_bitmask); in dev_gro_receive()
556 } else if (test_bit(bucket, &napi->gro_bitmask)) { in dev_gro_receive()
557 __clear_bit(bucket, &napi->gro_bitmask); in dev_gro_receive()
596 static gro_result_t napi_skb_finish(struct napi_struct *napi, in napi_skb_finish() argument
602 gro_normal_one(napi, skb, 1); in napi_skb_finish()
623 gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) in napi_gro_receive() argument
627 skb_mark_napi_id(skb, napi); in napi_gro_receive()
632 ret = napi_skb_finish(napi, skb, dev_gro_receive(napi, skb)); in napi_gro_receive()
639 static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) in napi_reuse_skb() argument
649 skb->dev = napi->dev; in napi_reuse_skb()
666 napi->skb = skb; in napi_reuse_skb()
669 struct sk_buff *napi_get_frags(struct napi_struct *napi) in napi_get_frags() argument
671 struct sk_buff *skb = napi->skb; in napi_get_frags()
674 skb = napi_alloc_skb(napi, GRO_MAX_HEAD); in napi_get_frags()
676 napi->skb = skb; in napi_get_frags()
677 skb_mark_napi_id(skb, napi); in napi_get_frags()
684 static gro_result_t napi_frags_finish(struct napi_struct *napi, in napi_frags_finish() argument
694 gro_normal_one(napi, skb, 1); in napi_frags_finish()
701 napi_reuse_skb(napi, skb); in napi_frags_finish()
716 static struct sk_buff *napi_frags_skb(struct napi_struct *napi) in napi_frags_skb() argument
718 struct sk_buff *skb = napi->skb; in napi_frags_skb()
722 napi->skb = NULL; in napi_frags_skb()
731 __func__, napi->dev->name); in napi_frags_skb()
732 napi_reuse_skb(napi, skb); in napi_frags_skb()
756 gro_result_t napi_gro_frags(struct napi_struct *napi) in napi_gro_frags() argument
759 struct sk_buff *skb = napi_frags_skb(napi); in napi_gro_frags()
763 ret = napi_frags_finish(napi, skb, dev_gro_receive(napi, skb)); in napi_gro_frags()