diff mbox series

[net-next,v2,1/3] net: sched: choke: remove unused variables in struct choke_sched_data

Message ID 20220829081704.255235-2-shaozhengchao@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: sched: remove unused variables | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 4428 this patch: 4428
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1070 this patch: 1070
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4590 this patch: 4590
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shaozhengchao Aug. 29, 2022, 8:17 a.m. UTC
The variable "other" in the struct choke_sched_data is not used. Remove it.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
v1: qdisc_drop() already counts drops, unnecessary to use "other" to duplicate the same information.
---
 include/uapi/linux/pkt_sched.h | 1 -
 net/sched/sch_choke.c          | 2 --
 2 files changed, 3 deletions(-)

Comments

Eric Dumazet Aug. 29, 2022, 5:08 p.m. UTC | #1
On Mon, Aug 29, 2022 at 1:14 AM Zhengchao Shao <shaozhengchao@huawei.com> wrote:
>
> The variable "other" in the struct choke_sched_data is not used. Remove it.
>
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
> v1: qdisc_drop() already counts drops, unnecessary to use "other" to duplicate the same information.
> ---
>  include/uapi/linux/pkt_sched.h | 1 -
>  net/sched/sch_choke.c          | 2 --
>  2 files changed, 3 deletions(-)
>
> diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
> index f292b467b27f..32d49447cc7a 100644
> --- a/include/uapi/linux/pkt_sched.h
> +++ b/include/uapi/linux/pkt_sched.h
> @@ -396,7 +396,6 @@ struct tc_choke_qopt {
>  struct tc_choke_xstats {
>         __u32           early;          /* Early drops */
>         __u32           pdrop;          /* Drops due to queue limits */
> -       __u32           other;          /* Drops due to drop() calls */

You can not remove a field in UAPI.

>         __u32           marked;         /* Marked packets */
>         __u32           matched;        /* Drops due to flow match */
>  };
> diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
> index 25d2daaa8122..3ac3e5c80b6f 100644
> --- a/net/sched/sch_choke.c
> +++ b/net/sched/sch_choke.c
> @@ -60,7 +60,6 @@ struct choke_sched_data {
>                 u32     forced_drop;    /* Forced drops, qavg > max_thresh */
>                 u32     forced_mark;    /* Forced marks, qavg > max_thresh */
>                 u32     pdrop;          /* Drops due to queue limits */
> -               u32     other;          /* Drops due to drop() calls */
>                 u32     matched;        /* Drops to flow match */
>         } stats;
>
> @@ -464,7 +463,6 @@ static int choke_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
>                 .early  = q->stats.prob_drop + q->stats.forced_drop,
>                 .marked = q->stats.prob_mark + q->stats.forced_mark,
>                 .pdrop  = q->stats.pdrop,
> -               .other  = q->stats.other,
>                 .matched = q->stats.matched,
>         };
>
> --
> 2.17.1
>
shaozhengchao Aug. 30, 2022, 12:44 a.m. UTC | #2
On 2022/8/30 1:08, Eric Dumazet wrote:
> On Mon, Aug 29, 2022 at 1:14 AM Zhengchao Shao <shaozhengchao@huawei.com> wrote:
>>
>> The variable "other" in the struct choke_sched_data is not used. Remove it.
>>
>> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
>> ---
>> v1: qdisc_drop() already counts drops, unnecessary to use "other" to duplicate the same information.
>> ---
>>   include/uapi/linux/pkt_sched.h | 1 -
>>   net/sched/sch_choke.c          | 2 --
>>   2 files changed, 3 deletions(-)
>>
>> diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
>> index f292b467b27f..32d49447cc7a 100644
>> --- a/include/uapi/linux/pkt_sched.h
>> +++ b/include/uapi/linux/pkt_sched.h
>> @@ -396,7 +396,6 @@ struct tc_choke_qopt {
>>   struct tc_choke_xstats {
>>          __u32           early;          /* Early drops */
>>          __u32           pdrop;          /* Drops due to queue limits */
>> -       __u32           other;          /* Drops due to drop() calls */
> 
> You can not remove a field in UAPI.
> 
>>          __u32           marked;         /* Marked packets */
>>          __u32           matched;        /* Drops due to flow match */
>>   };
>> diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
>> index 25d2daaa8122..3ac3e5c80b6f 100644
>> --- a/net/sched/sch_choke.c
>> +++ b/net/sched/sch_choke.c
>> @@ -60,7 +60,6 @@ struct choke_sched_data {
>>                  u32     forced_drop;    /* Forced drops, qavg > max_thresh */
>>                  u32     forced_mark;    /* Forced marks, qavg > max_thresh */
>>                  u32     pdrop;          /* Drops due to queue limits */
>> -               u32     other;          /* Drops due to drop() calls */
>>                  u32     matched;        /* Drops to flow match */
>>          } stats;
>>
>> @@ -464,7 +463,6 @@ static int choke_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
>>                  .early  = q->stats.prob_drop + q->stats.forced_drop,
>>                  .marked = q->stats.prob_mark + q->stats.forced_mark,
>>                  .pdrop  = q->stats.pdrop,
>> -               .other  = q->stats.other,
>>                  .matched = q->stats.matched,
>>          };
>>
>> --
>> 2.17.1
>>

Hi Eric:
	Thanks for the heads up. I'll pay attention in the future.

Zhengchao Shao
diff mbox series

Patch

diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index f292b467b27f..32d49447cc7a 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -396,7 +396,6 @@  struct tc_choke_qopt {
 struct tc_choke_xstats {
 	__u32		early;          /* Early drops */
 	__u32		pdrop;          /* Drops due to queue limits */
-	__u32		other;          /* Drops due to drop() calls */
 	__u32		marked;         /* Marked packets */
 	__u32		matched;	/* Drops due to flow match */
 };
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index 25d2daaa8122..3ac3e5c80b6f 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -60,7 +60,6 @@  struct choke_sched_data {
 		u32	forced_drop;	/* Forced drops, qavg > max_thresh */
 		u32	forced_mark;	/* Forced marks, qavg > max_thresh */
 		u32	pdrop;          /* Drops due to queue limits */
-		u32	other;          /* Drops due to drop() calls */
 		u32	matched;	/* Drops to flow match */
 	} stats;
 
@@ -464,7 +463,6 @@  static int choke_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
 		.early	= q->stats.prob_drop + q->stats.forced_drop,
 		.marked	= q->stats.prob_mark + q->stats.forced_mark,
 		.pdrop	= q->stats.pdrop,
-		.other	= q->stats.other,
 		.matched = q->stats.matched,
 	};