Message ID | 1503041004-105572-1-git-send-email-gfree.wind@vip.163.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
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.
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.
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
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.
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
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.
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)