lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cf849e82-afc8-a9e5-74b9-69f07f817926@mojatatu.com>
Date:   Thu, 14 Apr 2022 12:08:42 -0400
From:   Jamal Hadi Salim <jhs@...atatu.com>
To:     Eric Dumazet <eric.dumazet@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Cc:     Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>, netdev <netdev@...r.kernel.org>,
        Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next] net_sched: make qdisc_reset() smaller

On 2022-04-13 21:10, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
> 
> For some unknown reason qdisc_reset() is using
> a convoluted way of freeing two lists of skbs.
> 
> Use __skb_queue_purge() instead.
> 
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
>   net/sched/sch_generic.c | 12 ++----------
>   1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> index 5bab9f8b8f453526185c3b6df57065450b1e3d89..dba0b3e24af5e84f7116ae9b6fdb6f66b01a896c 100644
> --- a/net/sched/sch_generic.c
> +++ b/net/sched/sch_generic.c
> @@ -1019,22 +1019,14 @@ EXPORT_SYMBOL(qdisc_create_dflt);
>   void qdisc_reset(struct Qdisc *qdisc)
>   {
>   	const struct Qdisc_ops *ops = qdisc->ops;
> -	struct sk_buff *skb, *tmp;
>   
>   	trace_qdisc_reset(qdisc);
>   
>   	if (ops->reset)
>   		ops->reset(qdisc);
>   
> -	skb_queue_walk_safe(&qdisc->gso_skb, skb, tmp) {
> -		__skb_unlink(skb, &qdisc->gso_skb);
> -		kfree_skb_list(skb);
> -	}
> -
> -	skb_queue_walk_safe(&qdisc->skb_bad_txq, skb, tmp) {
> -		__skb_unlink(skb, &qdisc->skb_bad_txq);
> -		kfree_skb_list(skb);
> -	}
> +	__skb_queue_purge(&qdisc->gso_skb);
> +	__skb_queue_purge(&qdisc->skb_bad_txq);
>   

Acked-by: Jamal Hadi Salim <jhs@...atatu.com>

cheers,
jamal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ