Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: add kdoc for napi_consume_skb()

Looks like AI reviewers miss that napi_consume_skb() must have
a real budget passed to it. Let's see if adding a real kdoc will
help them figure this out.

Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://patch.msgid.link/20260119224140.1362729-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+12 -1
+12 -1
net/core/skbuff.c
··· 1507 1507 napi_skb_cache_put(skb); 1508 1508 } 1509 1509 1510 + /** 1511 + * napi_consume_skb() - consume skb in NAPI context, try to feed skb cache 1512 + * @skb: buffer to free 1513 + * @budget: NAPI budget 1514 + * 1515 + * Non-zero @budget must come from the @budget argument passed by the core 1516 + * to a NAPI poll function. Note that core may pass budget of 0 to NAPI poll 1517 + * for example when polling for netpoll / netconsole. 1518 + * 1519 + * Passing @budget of 0 is safe from any context, it turns this function 1520 + * into dev_consume_skb_any(). 1521 + */ 1510 1522 void napi_consume_skb(struct sk_buff *skb, int budget) 1511 1523 { 1512 - /* Zero budget indicate non-NAPI context called us, like netpoll */ 1513 1524 if (unlikely(!budget || !skb)) { 1514 1525 dev_consume_skb_any(skb); 1515 1526 return;