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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 07 Jul 2016 15:51:03 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Jiri Kosina <jikos@...nel.org>,
	Craig Gallek <kraigatgoog@...il.com>
Cc:	Jamal Hadi Salim <jhs@...atatu.com>, Phil Sutter <phil@....cc>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] net: sched: convert qdisc linked list to hashtable
 (was Re: Deleting child qdisc doesn't reset parent to default qdisc?)

On Thu, 2016-07-07 at 11:04 +0200, Jiri Kosina wrote:

> 
> 
> From: Jiri Kosina <jkosina@...e.cz>
> Subject: [PATCH] net: sched: convert qdisc linked list to hashtable
> 
> Convert the per-device linked list into a hashtable. The primary motivation
> for this change is that currently, we're not tracking all the qdiscs in
> hierarchy (e.g. excluding default qdiscs), as the lookup performed over the
> linked list by qdisc_match_from_root() is rather expensive.

...

>  	}
> @@ -1440,6 +1441,7 @@ static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
>  {
>  	int ret = 0, q_idx = *q_idx_p;
>  	struct Qdisc *q;
> +	int b;
>  
>  	if (!root)
>  		return 0;
> @@ -1454,7 +1456,7 @@ static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
>  			goto done;
>  		q_idx++;
>  	}
> -	list_for_each_entry(q, &root->list, list) {
> +	hash_for_each(qdisc_dev(root)->qdisc_hash, b, q, hash) {
>  		if (q_idx < s_q_idx) {
>  			q_idx++;
>  			continue;
> @@ -1771,6 +1773,7 @@ static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
>  			       int *t_p, int s_t)
>  {
>  	struct Qdisc *q;
> +	int b;
>  
>  	if (!root)
>  		return 0;
> @@ -1778,7 +1781,7 @@ static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
>  	if (tc_dump_tclass_qdisc(root, skb, tcm, cb, t_p, s_t) < 0)
>  		return -1;
>  
> -	list_for_each_entry(q, &root->list, list) {
> +	hash_for_each_rcu(qdisc_dev(root)->qdisc_hash, b, q, hash) {
>  		if (tc_dump_tclass_qdisc(q, skb, tcm, cb, t_p, s_t) < 0)
>  			return -1;
>  	}


Not sure why you used the rcu version here, but the non rcu version in
tc_dump_qdisc_root()

Thanks.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ