linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next,v2 0/3] net: sched: remove unused variables
@ 2022-08-29  8:17 Zhengchao Shao
  2022-08-29  8:17 ` [PATCH net-next,v2 1/3] net: sched: choke: remove unused variables in struct choke_sched_data Zhengchao Shao
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Zhengchao Shao @ 2022-08-29  8:17 UTC (permalink / raw)
  To: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
	xiyou.wangcong, jiri
  Cc: weiyongjun1, yuehaibing, shaozhengchao

The variable "other" is unused, remove it.

Zhengchao Shao (3):
  net: sched: choke: remove unused variables in struct choke_sched_data
  net: sched: gred/red: remove unused variables in struct red_stats
  net: sched: gred: remove unused enumeration values

 include/net/red.h              | 1 -
 include/uapi/linux/pkt_sched.h | 4 ----
 net/sched/sch_choke.c          | 2 --
 net/sched/sch_gred.c           | 3 ---
 net/sched/sch_red.c            | 1 -
 5 files changed, 11 deletions(-)

-- 
2.17.1


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

* [PATCH net-next,v2 1/3] net: sched: choke: remove unused variables in struct choke_sched_data
  2022-08-29  8:17 [PATCH net-next,v2 0/3] net: sched: remove unused variables Zhengchao Shao
@ 2022-08-29  8:17 ` Zhengchao Shao
  2022-08-29 17:08   ` Eric Dumazet
  2022-08-29  8:17 ` [PATCH net-next,v2 2/3] net: sched: gred/red: remove unused variables in struct red_stats Zhengchao Shao
  2022-08-29  8:17 ` [PATCH net-next,v2 3/3] net: sched: gred: remove unused enumeration values Zhengchao Shao
  2 siblings, 1 reply; 6+ messages in thread
From: Zhengchao Shao @ 2022-08-29  8:17 UTC (permalink / raw)
  To: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
	xiyou.wangcong, jiri
  Cc: weiyongjun1, yuehaibing, shaozhengchao

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 */
 	__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


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

* [PATCH net-next,v2 2/3] net: sched: gred/red: remove unused variables in struct red_stats
  2022-08-29  8:17 [PATCH net-next,v2 0/3] net: sched: remove unused variables Zhengchao Shao
  2022-08-29  8:17 ` [PATCH net-next,v2 1/3] net: sched: choke: remove unused variables in struct choke_sched_data Zhengchao Shao
@ 2022-08-29  8:17 ` Zhengchao Shao
  2022-08-29  8:17 ` [PATCH net-next,v2 3/3] net: sched: gred: remove unused enumeration values Zhengchao Shao
  2 siblings, 0 replies; 6+ messages in thread
From: Zhengchao Shao @ 2022-08-29  8:17 UTC (permalink / raw)
  To: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
	xiyou.wangcong, jiri
  Cc: weiyongjun1, yuehaibing, shaozhengchao

The variable "other" in the struct red_stats 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/net/red.h              | 1 -
 include/uapi/linux/pkt_sched.h | 2 --
 net/sched/sch_gred.c           | 3 ---
 net/sched/sch_red.c            | 1 -
 4 files changed, 7 deletions(-)

diff --git a/include/net/red.h b/include/net/red.h
index be11dbd26492..454ac2b65d8c 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -122,7 +122,6 @@ struct red_stats {
 	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 */
 };
 
 struct red_parms {
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 32d49447cc7a..55fadb3ace17 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -296,7 +296,6 @@ struct tc_red_qopt {
 struct tc_red_xstats {
 	__u32           early;          /* Early drops */
 	__u32           pdrop;          /* Drops due to queue limits */
-	__u32           other;          /* Drops due to drop() calls */
 	__u32           marked;         /* Marked packets */
 };
 
@@ -352,7 +351,6 @@ struct tc_gred_qopt {
 	__u32		qave;
 	__u32		forced;
 	__u32		early;
-	__u32		other;
 	__u32		pdrop;
 	__u8		Wlog;         /* log(W)               */
 	__u8		Plog;         /* log(P_max/(qth_max-qth_min)) */
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index 1073c76d05c4..e7af53f607bb 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -829,7 +829,6 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
 		opt.Wlog	= q->parms.Wlog;
 		opt.Plog	= q->parms.Plog;
 		opt.Scell_log	= q->parms.Scell_log;
-		opt.other	= q->stats.other;
 		opt.early	= q->stats.prob_drop;
 		opt.forced	= q->stats.forced_drop;
 		opt.pdrop	= q->stats.pdrop;
@@ -895,8 +894,6 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
 			goto nla_put_failure;
 		if (nla_put_u32(skb, TCA_GRED_VQ_STAT_PDROP, q->stats.pdrop))
 			goto nla_put_failure;
-		if (nla_put_u32(skb, TCA_GRED_VQ_STAT_OTHER, q->stats.other))
-			goto nla_put_failure;
 
 		nla_nest_end(skb, vq);
 	}
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index f1e013e3f04a..f7ac40c0335e 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -461,7 +461,6 @@ static int red_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
 	}
 	st.early = q->stats.prob_drop + q->stats.forced_drop;
 	st.pdrop = q->stats.pdrop;
-	st.other = q->stats.other;
 	st.marked = q->stats.prob_mark + q->stats.forced_mark;
 
 	return gnet_stats_copy_app(d, &st, sizeof(st));
-- 
2.17.1


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

* [PATCH net-next,v2 3/3] net: sched: gred: remove unused enumeration values
  2022-08-29  8:17 [PATCH net-next,v2 0/3] net: sched: remove unused variables Zhengchao Shao
  2022-08-29  8:17 ` [PATCH net-next,v2 1/3] net: sched: choke: remove unused variables in struct choke_sched_data Zhengchao Shao
  2022-08-29  8:17 ` [PATCH net-next,v2 2/3] net: sched: gred/red: remove unused variables in struct red_stats Zhengchao Shao
@ 2022-08-29  8:17 ` Zhengchao Shao
  2 siblings, 0 replies; 6+ messages in thread
From: Zhengchao Shao @ 2022-08-29  8:17 UTC (permalink / raw)
  To: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
	xiyou.wangcong, jiri
  Cc: weiyongjun1, yuehaibing, shaozhengchao

In the previous patch, the variable "other" that is not used is removed.
The enumerated value TCA_GRED_VQ_STAT_OTHER of is not used. Remove it.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 include/uapi/linux/pkt_sched.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 55fadb3ace17..f2e0426e2414 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -335,7 +335,6 @@ enum {
 	TCA_GRED_VQ_STAT_FORCED_DROP,	/* u32 */
 	TCA_GRED_VQ_STAT_FORCED_MARK,	/* u32 */
 	TCA_GRED_VQ_STAT_PDROP,		/* u32 */
-	TCA_GRED_VQ_STAT_OTHER,		/* u32 */
 	TCA_GRED_VQ_FLAGS,		/* u32 */
 	__TCA_GRED_VQ_MAX
 };
-- 
2.17.1


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

* Re: [PATCH net-next,v2 1/3] net: sched: choke: remove unused variables in struct choke_sched_data
  2022-08-29  8:17 ` [PATCH net-next,v2 1/3] net: sched: choke: remove unused variables in struct choke_sched_data Zhengchao Shao
@ 2022-08-29 17:08   ` Eric Dumazet
  2022-08-30  0:44     ` shaozhengchao
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Dumazet @ 2022-08-29 17:08 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: netdev, LKML, David Miller, Jakub Kicinski, Paolo Abeni,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko, weiyongjun1, YueHaibing

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
>

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

* Re: [PATCH net-next,v2 1/3] net: sched: choke: remove unused variables in struct choke_sched_data
  2022-08-29 17:08   ` Eric Dumazet
@ 2022-08-30  0:44     ` shaozhengchao
  0 siblings, 0 replies; 6+ messages in thread
From: shaozhengchao @ 2022-08-30  0:44 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: netdev, LKML, David Miller, Jakub Kicinski, Paolo Abeni,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko, weiyongjun1, YueHaibing



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

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

end of thread, other threads:[~2022-08-30  0:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29  8:17 [PATCH net-next,v2 0/3] net: sched: remove unused variables Zhengchao Shao
2022-08-29  8:17 ` [PATCH net-next,v2 1/3] net: sched: choke: remove unused variables in struct choke_sched_data Zhengchao Shao
2022-08-29 17:08   ` Eric Dumazet
2022-08-30  0:44     ` shaozhengchao
2022-08-29  8:17 ` [PATCH net-next,v2 2/3] net: sched: gred/red: remove unused variables in struct red_stats Zhengchao Shao
2022-08-29  8:17 ` [PATCH net-next,v2 3/3] net: sched: gred: remove unused enumeration values Zhengchao Shao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).