diff options
| author | 2025-11-21 08:32:54 +0000 | |
|---|---|---|
| committer | 2025-11-25 16:10:32 +0100 | |
| commit | 0170d7f47c8bb0311bc802bad52245c045f151fe (patch) | |
| tree | f2f5c00b628fb7998946546330af840d60b2e823 /net/core/dev.c | |
| parent | net: annotate a data-race in __dev_xmit_skb() (diff) | |
| download | wireguard-linux-0170d7f47c8bb0311bc802bad52245c045f151fe.tar.xz wireguard-linux-0170d7f47c8bb0311bc802bad52245c045f151fe.zip | |
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 '')
| -rw-r--r-- | net/core/dev.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 10042139dbb0..e865cdb9b696 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4162,7 +4162,7 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, __qdisc_run(q); qdisc_run_end(q); - goto no_lock_out; + goto free_skbs; } qdisc_bstats_cpu_update(q, skb); @@ -4176,12 +4176,7 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, rc = dev_qdisc_enqueue(skb, q, &to_free, txq); qdisc_run(q); - -no_lock_out: - if (unlikely(to_free)) - kfree_skb_list_reason(to_free, - tcf_get_drop_reason(to_free)); - return rc; + goto free_skbs; } /* Open code llist_add(&skb->ll_node, &q->defer_list) + queue limit. @@ -4257,9 +4252,9 @@ no_lock_out: } unlock: spin_unlock(root_lock); - if (unlikely(to_free)) - kfree_skb_list_reason(to_free, - tcf_get_drop_reason(to_free)); + +free_skbs: + tcf_kfree_skb_list(to_free); return rc; } |
