diff options
| author | Eric Dumazet <edumazet@google.com> | 2025-11-21 08:32:54 +0000 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2025-11-25 16:10:32 +0100 |
| commit | 0170d7f47c8bb0311bc802bad52245c045f151fe (patch) | |
| tree | f2f5c00b628fb7998946546330af840d60b2e823 /include/net | |
| parent | 4792c3a4c1470202b0d5bf44b6058cb0fb050ba8 (diff) | |
| download | tip-0170d7f47c8bb0311bc802bad52245c045f151fe.tar.gz | |
net_sched: add tcf_kfree_skb_list() helper
Using kfree_skb_list_reason() to free list of skbs from qdisc
operations seems wrong as each skb might have a different drop reason.
Cleanup __dev_xmit_skb() to call tcf_kfree_skb_list() once
in preparation of the following patch.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251121083256.674562-13-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/sch_generic.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 79501499dafba5..b8092d0378a0ca 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -1105,6 +1105,17 @@ static inline void tcf_set_drop_reason(const struct sk_buff *skb, tc_skb_cb(skb)->drop_reason = reason; } +static inline void tcf_kfree_skb_list(struct sk_buff *skb) +{ + while (unlikely(skb)) { + struct sk_buff *next = skb->next; + + prefetch(next); + kfree_skb_reason(skb, tcf_get_drop_reason(skb)); + skb = next; + } +} + /* Instead of calling kfree_skb() while root qdisc lock is held, * queue the skb for future freeing at end of __dev_xmit_skb() */ |
