net: add napi_get_frags_check() helper
authorEric Dumazet <edumazet@google.com>
Wed, 8 Jun 2022 16:04:38 +0000 (09:04 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Jun 2022 04:53:57 +0000 (21:53 -0700)
commitfd9ea57f4e9514f9d0f0dec505eefd99a8faa148
tree78722b3552044be2170fe2330968b9e7a8251f97
parentee2640df2393141a2975af726802b349d51713be
net: add napi_get_frags_check() helper

This is a follow up of commit 3226b158e67c
("net: avoid 32 x truesize under-estimation for tiny skbs")

When/if we increase MAX_SKB_FRAGS, we better make sure
the old bug will not come back.

Adding a check in napi_get_frags() would be costly,
even if using DEBUG_NET_WARN_ON_ONCE().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c