All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find
@ 2017-08-18  7:23 gfree.wind
  2017-08-21 17:47 ` David Miller
  2017-08-21 20:40 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: gfree.wind @ 2017-08-18  7:23 UTC (permalink / raw)
  To: davem, netdev; +Cc: Gao Feng

From: Gao Feng <gfree.wind@vip.163.com>

Add the invalid handle "0" check to avoid unnecessary search, because
the qdisc uses the skb->priority as the handle value to look up, and
it is "0" usually.

Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
---
 include/net/sch_generic.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 5865db9..107c524 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -393,6 +393,9 @@ static inline unsigned int qdisc_class_hash(u32 id, u32 mask)
 	struct Qdisc_class_common *cl;
 	unsigned int h;
 
+	if (!id)
+		return NULL;
+
 	h = qdisc_class_hash(id, hash->hashmask);
 	hlist_for_each_entry(cl, &hash->hash[h], hnode) {
 		if (cl->classid == id)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find
  2017-08-18  7:23 [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find gfree.wind
@ 2017-08-21 17:47 ` David Miller
  2017-08-21 19:58   ` Cong Wang
  2017-08-21 20:40 ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: David Miller @ 2017-08-21 17:47 UTC (permalink / raw)
  To: gfree.wind; +Cc: netdev, xiyou.wangcong, jhs

From: gfree.wind@vip.163.com
Date: Fri, 18 Aug 2017 15:23:24 +0800

> From: Gao Feng <gfree.wind@vip.163.com>
> 
> Add the invalid handle "0" check to avoid unnecessary search, because
> the qdisc uses the skb->priority as the handle value to look up, and
> it is "0" usually.
> 
> Signed-off-by: Gao Feng <gfree.wind@vip.163.com>

Jamal, Cong, please review.

If 'id' zero is never hashed into the tables, this change looks
legitimate.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find
  2017-08-21 17:47 ` David Miller
@ 2017-08-21 19:58   ` Cong Wang
  2017-08-21 20:17     ` Jamal Hadi Salim
  2017-08-22  0:46     ` Gao Feng
  0 siblings, 2 replies; 7+ messages in thread
From: Cong Wang @ 2017-08-21 19:58 UTC (permalink / raw)
  To: David Miller; +Cc: Gao Feng, Linux Kernel Network Developers, Jamal Hadi Salim

On Mon, Aug 21, 2017 at 10:47 AM, David Miller <davem@davemloft.net> wrote:
> From: gfree.wind@vip.163.com
> Date: Fri, 18 Aug 2017 15:23:24 +0800
>
>> From: Gao Feng <gfree.wind@vip.163.com>
>>
>> Add the invalid handle "0" check to avoid unnecessary search, because
>> the qdisc uses the skb->priority as the handle value to look up, and
>> it is "0" usually.
>>
>> Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
>
> Jamal, Cong, please review.
>
> If 'id' zero is never hashed into the tables, this change looks
> legitimate.

Looks good to me.

Gao, in the future please Cc maintainers directly, you can
use ./scripts/get_maintainer.pl.

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find
  2017-08-21 19:58   ` Cong Wang
@ 2017-08-21 20:17     ` Jamal Hadi Salim
  2017-08-22  0:46     ` Gao Feng
  1 sibling, 0 replies; 7+ messages in thread
From: Jamal Hadi Salim @ 2017-08-21 20:17 UTC (permalink / raw)
  To: Cong Wang, David Miller; +Cc: Gao Feng, Linux Kernel Network Developers

On 17-08-21 03:58 PM, Cong Wang wrote:
> On Mon, Aug 21, 2017 at 10:47 AM, David Miller <davem@davemloft.net> wrote:
>> From: gfree.wind@vip.163.com
>> Date: Fri, 18 Aug 2017 15:23:24 +0800
>>
>>> From: Gao Feng <gfree.wind@vip.163.com>
>>>
>>> Add the invalid handle "0" check to avoid unnecessary search, because
>>> the qdisc uses the skb->priority as the handle value to look up, and
>>> it is "0" usually.
>>>
>>> Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
>>
>> Jamal, Cong, please review.
>>
>> If 'id' zero is never hashed into the tables, this change looks
>> legitimate.
> 
> Looks good to me.
>

Looks good to me as well...

cheers,
jamal

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find
  2017-08-18  7:23 [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find gfree.wind
  2017-08-21 17:47 ` David Miller
@ 2017-08-21 20:40 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2017-08-21 20:40 UTC (permalink / raw)
  To: gfree.wind; +Cc: netdev

From: gfree.wind@vip.163.com
Date: Fri, 18 Aug 2017 15:23:24 +0800

> From: Gao Feng <gfree.wind@vip.163.com>
> 
> Add the invalid handle "0" check to avoid unnecessary search, because
> the qdisc uses the skb->priority as the handle value to look up, and
> it is "0" usually.
> 
> Signed-off-by: Gao Feng <gfree.wind@vip.163.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re:Re: [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find
  2017-08-21 19:58   ` Cong Wang
  2017-08-21 20:17     ` Jamal Hadi Salim
@ 2017-08-22  0:46     ` Gao Feng
  2017-08-22  0:51       ` Cong Wang
  1 sibling, 1 reply; 7+ messages in thread
From: Gao Feng @ 2017-08-22  0:46 UTC (permalink / raw)
  To: Cong Wang; +Cc: David Miller, Linux Kernel Network Developers, Jamal Hadi Salim

At 2017-08-22 03:58:03, "Cong Wang" <xiyou.wangcong@gmail.com> wrote:
>On Mon, Aug 21, 2017 at 10:47 AM, David Miller <davem@davemloft.net> wrote:
>> From: gfree.wind@vip.163.com
>> Date: Fri, 18 Aug 2017 15:23:24 +0800
>>
>>> From: Gao Feng <gfree.wind@vip.163.com>
>>>
>>> Add the invalid handle "0" check to avoid unnecessary search, because
>>> the qdisc uses the skb->priority as the handle value to look up, and
>>> it is "0" usually.
>>>
>>> Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
>>
>> Jamal, Cong, please review.
>>
>> If 'id' zero is never hashed into the tables, this change looks
>> legitimate.
>
>Looks good to me.
>
>Gao, in the future please Cc maintainers directly, you can
>use ./scripts/get_maintainer.pl.
>
>Thanks.

Hi Cong,

Thanks your reminder firstly.
But I had used the get_maintainer.pl actually before sent the patch.

The following is the output.
[fgao@ikuai8 net-next]#./scripts/get_maintainer.pl patch_ScheCheck/0001-net-sched-Add-the-invalid-handle-check-in-qdisc_clas.patch
"David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING [GENERAL])
netdev@vger.kernel.org (open list:NETWORKING [GENERAL])
linux-kernel@vger.kernel.org (open list)

I don't know if it is an issue of the script "get_maintainer.pl"  or my usage is wrong.

Anyway, thanks you & Jamal's review.

Best Regards
Feng


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re: [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find
  2017-08-22  0:46     ` Gao Feng
@ 2017-08-22  0:51       ` Cong Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Cong Wang @ 2017-08-22  0:51 UTC (permalink / raw)
  To: Gao Feng; +Cc: David Miller, Linux Kernel Network Developers, Jamal Hadi Salim

On Mon, Aug 21, 2017 at 5:46 PM, Gao Feng <gfree.wind@vip.163.com> wrote:
> Hi Cong,
>
> Thanks your reminder firstly.
> But I had used the get_maintainer.pl actually before sent the patch.
>
> The following is the output.
> [fgao@ikuai8 net-next]#./scripts/get_maintainer.pl patch_ScheCheck/0001-net-sched-Add-the-invalid-handle-check-in-qdisc_clas.patch
> "David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING [GENERAL])
> netdev@vger.kernel.org (open list:NETWORKING [GENERAL])
> linux-kernel@vger.kernel.org (open list)
>
> I don't know if it is an issue of the script "get_maintainer.pl"  or my usage is wrong.

No, probably because we don't add include/net/sch_generic.h into TC
subsystem, while we should.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-22  0:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18  7:23 [PATCH net-next] net: sched: Add the invalid handle check in qdisc_class_find gfree.wind
2017-08-21 17:47 ` David Miller
2017-08-21 19:58   ` Cong Wang
2017-08-21 20:17     ` Jamal Hadi Salim
2017-08-22  0:46     ` Gao Feng
2017-08-22  0:51       ` Cong Wang
2017-08-21 20:40 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.