[PATCH net-next 0/3] net: sched: add other statistics when calling qdisc_drop()

Zhengchao Shao posted 3 patches 3 years, 7 months ago
include/net/red.h     | 2 +-
net/sched/sch_choke.c | 5 ++++-
net/sched/sch_gred.c  | 2 ++
net/sched/sch_red.c   | 1 +
4 files changed, 8 insertions(+), 2 deletions(-)
[PATCH net-next 0/3] net: sched: add other statistics when calling qdisc_drop()
Posted by Zhengchao Shao 3 years, 7 months ago
According to the description, "other" should be added when calling
qdisc_drop() to discard packets.

Zhengchao Shao (3):
  net: sched: sch_choke: add statistics when calling qdisc_drop() in
    sch_choke
  net: sched: sch_gred: add statistics when calling qdisc_drop() in
    sch_gred
  net: sched: sch_red: add statistics when calling qdisc_drop() in
    sch_red

 include/net/red.h     | 2 +-
 net/sched/sch_choke.c | 5 ++++-
 net/sched/sch_gred.c  | 2 ++
 net/sched/sch_red.c   | 1 +
 4 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.17.1
Re: [PATCH net-next 0/3] net: sched: add other statistics when calling qdisc_drop()
Posted by Jakub Kicinski 3 years, 7 months ago
On Thu, 25 Aug 2022 11:29:40 +0800 Zhengchao Shao wrote:
> According to the description, "other" should be added when calling
> qdisc_drop() to discard packets.

The fact that an old copy & pasted comment says something is not 
in itself a sufficient justification to make code changes.

qdisc_drop() already counts drops, duplicating the same information 
in another place seems like a waste of CPU cycles.
Re: [PATCH net-next 0/3] net: sched: add other statistics when calling qdisc_drop()
Posted by shaozhengchao 3 years, 7 months ago
On 2022/8/27 10:40, Jakub Kicinski wrote:
> On Thu, 25 Aug 2022 11:29:40 +0800 Zhengchao Shao wrote:
>> According to the description, "other" should be added when calling
>> qdisc_drop() to discard packets.
> 
> The fact that an old copy & pasted comment says something is not
> in itself a sufficient justification to make code changes.
> 
> qdisc_drop() already counts drops, duplicating the same information
> in another place seems like a waste of CPU cycles.

Hi Jakub:
	Thank you for your reply. It seems more appropriate to delete the other 
variable, if it is unused?

Zhengchao Shao
Re: [PATCH net-next 0/3] net: sched: add other statistics when calling qdisc_drop()
Posted by Jakub Kicinski 3 years, 7 months ago
On Sat, 27 Aug 2022 11:16:53 +0800 shaozhengchao wrote:
> On 2022/8/27 10:40, Jakub Kicinski wrote:
> > On Thu, 25 Aug 2022 11:29:40 +0800 Zhengchao Shao wrote:  
> >> According to the description, "other" should be added when calling
> >> qdisc_drop() to discard packets.  
> > 
> > The fact that an old copy & pasted comment says something is not
> > in itself a sufficient justification to make code changes.
> > 
> > qdisc_drop() already counts drops, duplicating the same information
> > in another place seems like a waste of CPU cycles.  
> 
> Hi Jakub:
> 	Thank you for your reply. It seems more appropriate to delete the other 
> variable, if it is unused?

Yes, removing it SGTM.
Re: [PATCH net-next 0/3] net: sched: add other statistics when calling qdisc_drop()
Posted by shaozhengchao 3 years, 7 months ago

On 2022/8/30 12:48, Jakub Kicinski wrote:
> On Sat, 27 Aug 2022 11:16:53 +0800 shaozhengchao wrote:
>> On 2022/8/27 10:40, Jakub Kicinski wrote:
>>> On Thu, 25 Aug 2022 11:29:40 +0800 Zhengchao Shao wrote:
>>>> According to the description, "other" should be added when calling
>>>> qdisc_drop() to discard packets.
>>>
>>> The fact that an old copy & pasted comment says something is not
>>> in itself a sufficient justification to make code changes.
>>>
>>> qdisc_drop() already counts drops, duplicating the same information
>>> in another place seems like a waste of CPU cycles.
>>
>> Hi Jakub:
>> 	Thank you for your reply. It seems more appropriate to delete the other
>> variable, if it is unused?
> 
> Yes, removing it SGTM.

Hi Jakub:
	Thank you. I have send v3.

Zhengchao Shao