* [PATCH net-next,1/3] net: sched: make mq_offload() void
2022-08-16 2:04 [PATCH net-next,0/3] cleanup of qdisc offload function Zhengchao Shao
@ 2022-08-16 2:04 ` Zhengchao Shao
2022-08-16 2:04 ` [PATCH net-next,2/3] net: sched: make prio_offload() void Zhengchao Shao
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Zhengchao Shao @ 2022-08-16 2:04 UTC (permalink / raw)
To: netdev, linux-kernel, jhs, xiyou.wangcong, jiri, davem, edumazet,
kuba, pabeni
Cc: weiyongjun1, yuehaibing, shaozhengchao
The return value of function mq_offload is unused, make mq_offload() void.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
net/sched/sch_mq.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c
index 83d2e54bf303..9bfa9c8d4872 100644
--- a/net/sched/sch_mq.c
+++ b/net/sched/sch_mq.c
@@ -21,7 +21,7 @@ struct mq_sched {
struct Qdisc **qdiscs;
};
-static int mq_offload(struct Qdisc *sch, enum tc_mq_command cmd)
+static void mq_offload(struct Qdisc *sch, enum tc_mq_command cmd)
{
struct net_device *dev = qdisc_dev(sch);
struct tc_mq_qopt_offload opt = {
@@ -30,9 +30,9 @@ static int mq_offload(struct Qdisc *sch, enum tc_mq_command cmd)
};
if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
- return -EOPNOTSUPP;
+ return;
- return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_MQ, &opt);
+ dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_MQ, &opt);
}
static int mq_offload_stats(struct Qdisc *sch)
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next,2/3] net: sched: make prio_offload() void
2022-08-16 2:04 [PATCH net-next,0/3] cleanup of qdisc offload function Zhengchao Shao
2022-08-16 2:04 ` [PATCH net-next,1/3] net: sched: make mq_offload() void Zhengchao Shao
@ 2022-08-16 2:04 ` Zhengchao Shao
2022-08-16 2:04 ` [PATCH net-next,3/3] net: sched: make red_offload() void Zhengchao Shao
2022-08-16 3:10 ` [PATCH net-next,0/3] cleanup of qdisc offload function Jakub Kicinski
3 siblings, 0 replies; 8+ messages in thread
From: Zhengchao Shao @ 2022-08-16 2:04 UTC (permalink / raw)
To: netdev, linux-kernel, jhs, xiyou.wangcong, jiri, davem, edumazet,
kuba, pabeni
Cc: weiyongjun1, yuehaibing, shaozhengchao
The return value of function prio_offload is unused, make prio_offload()
void.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
net/sched/sch_prio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 3b8d7197c06b..a7124c63f700 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -139,7 +139,7 @@ prio_reset(struct Qdisc *sch)
sch->q.qlen = 0;
}
-static int prio_offload(struct Qdisc *sch, struct tc_prio_qopt *qopt)
+static void prio_offload(struct Qdisc *sch, struct tc_prio_qopt *qopt)
{
struct net_device *dev = qdisc_dev(sch);
struct tc_prio_qopt_offload opt = {
@@ -148,7 +148,7 @@ static int prio_offload(struct Qdisc *sch, struct tc_prio_qopt *qopt)
};
if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
- return -EOPNOTSUPP;
+ return;
if (qopt) {
opt.command = TC_PRIO_REPLACE;
@@ -160,7 +160,7 @@ static int prio_offload(struct Qdisc *sch, struct tc_prio_qopt *qopt)
opt.command = TC_PRIO_DESTROY;
}
- return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_PRIO, &opt);
+ dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_PRIO, &opt);
}
static void
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next,3/3] net: sched: make red_offload() void
2022-08-16 2:04 [PATCH net-next,0/3] cleanup of qdisc offload function Zhengchao Shao
2022-08-16 2:04 ` [PATCH net-next,1/3] net: sched: make mq_offload() void Zhengchao Shao
2022-08-16 2:04 ` [PATCH net-next,2/3] net: sched: make prio_offload() void Zhengchao Shao
@ 2022-08-16 2:04 ` Zhengchao Shao
2022-08-16 3:10 ` [PATCH net-next,0/3] cleanup of qdisc offload function Jakub Kicinski
3 siblings, 0 replies; 8+ messages in thread
From: Zhengchao Shao @ 2022-08-16 2:04 UTC (permalink / raw)
To: netdev, linux-kernel, jhs, xiyou.wangcong, jiri, davem, edumazet,
kuba, pabeni
Cc: weiyongjun1, yuehaibing, shaozhengchao
The return value of function red_offload is unused, make red_offload()
void.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
net/sched/sch_red.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 40adf1f07a82..8425f4169eed 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -181,7 +181,7 @@ static void red_reset(struct Qdisc *sch)
red_restart(&q->vars);
}
-static int red_offload(struct Qdisc *sch, bool enable)
+static void red_offload(struct Qdisc *sch, bool enable)
{
struct red_sched_data *q = qdisc_priv(sch);
struct net_device *dev = qdisc_dev(sch);
@@ -191,7 +191,7 @@ static int red_offload(struct Qdisc *sch, bool enable)
};
if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
- return -EOPNOTSUPP;
+ return;
if (enable) {
opt.command = TC_RED_REPLACE;
@@ -207,7 +207,7 @@ static int red_offload(struct Qdisc *sch, bool enable)
opt.command = TC_RED_DESTROY;
}
- return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_RED, &opt);
+ dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_RED, &opt);
}
static void red_destroy(struct Qdisc *sch)
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next,0/3] cleanup of qdisc offload function
2022-08-16 2:04 [PATCH net-next,0/3] cleanup of qdisc offload function Zhengchao Shao
` (2 preceding siblings ...)
2022-08-16 2:04 ` [PATCH net-next,3/3] net: sched: make red_offload() void Zhengchao Shao
@ 2022-08-16 3:10 ` Jakub Kicinski
2022-08-16 3:32 ` shaozhengchao
3 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2022-08-16 3:10 UTC (permalink / raw)
To: Zhengchao Shao
Cc: netdev, linux-kernel, jhs, xiyou.wangcong, jiri, davem, edumazet,
pabeni, weiyongjun1, yuehaibing
On Tue, 16 Aug 2022 10:04:20 +0800 Zhengchao Shao wrote:
> Some qdiscs don't care return value of qdisc offload function, so make
> function void.
How many of these patches do you have? Is there a goal you're working
towards? I don't think the pure return value removals are worth the
noise. They don't even save LoC:
3 files changed, 9 insertions(+), 9 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next,0/3] cleanup of qdisc offload function
2022-08-16 3:10 ` [PATCH net-next,0/3] cleanup of qdisc offload function Jakub Kicinski
@ 2022-08-16 3:32 ` shaozhengchao
2022-08-16 18:13 ` Jakub Kicinski
0 siblings, 1 reply; 8+ messages in thread
From: shaozhengchao @ 2022-08-16 3:32 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev, linux-kernel, jhs, xiyou.wangcong, jiri, davem, edumazet,
pabeni, weiyongjun1, yuehaibing
On 2022/8/16 11:10, Jakub Kicinski wrote:
> On Tue, 16 Aug 2022 10:04:20 +0800 Zhengchao Shao wrote:
>> Some qdiscs don't care return value of qdisc offload function, so make
>> function void.
>
> How many of these patches do you have? Is there a goal you're working
> towards? I don't think the pure return value removals are worth the
> noise. They don't even save LoC:
>
> 3 files changed, 9 insertions(+), 9 deletions(-)
Hi Jakub.
Thank you for your reply. Recently I've been studying the kernel code
related to qdisc, and my goal is to understand how qdisc works. If the
code can be optimized, I do what I can to modify the optimization. Is it
more appropriate to add warning to the offload return value? I look
forward to your reply. Thank you.
Zhengchao Shao
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next,0/3] cleanup of qdisc offload function
2022-08-16 3:32 ` shaozhengchao
@ 2022-08-16 18:13 ` Jakub Kicinski
2022-08-17 13:19 ` Jamal Hadi Salim
0 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2022-08-16 18:13 UTC (permalink / raw)
To: shaozhengchao
Cc: netdev, linux-kernel, jhs, xiyou.wangcong, jiri, davem, edumazet,
pabeni, weiyongjun1, yuehaibing
On Tue, 16 Aug 2022 11:32:03 +0800 shaozhengchao wrote:
> On 2022/8/16 11:10, Jakub Kicinski wrote:
> > On Tue, 16 Aug 2022 10:04:20 +0800 Zhengchao Shao wrote:
> >> Some qdiscs don't care return value of qdisc offload function, so make
> >> function void.
> >
> > How many of these patches do you have? Is there a goal you're working
> > towards? I don't think the pure return value removals are worth the
> > noise. They don't even save LoC:
> >
> > 3 files changed, 9 insertions(+), 9 deletions(-)
>
> Thank you for your reply. Recently I've been studying the kernel code
> related to qdisc, and my goal is to understand how qdisc works. If the
> code can be optimized, I do what I can to modify the optimization. Is it
> more appropriate to add warning to the offload return value? I look
> forward to your reply. Thank you.
Understood. Please stop sending the cleanups removing return values
unless the patches materially improve the code.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next,0/3] cleanup of qdisc offload function
2022-08-16 18:13 ` Jakub Kicinski
@ 2022-08-17 13:19 ` Jamal Hadi Salim
0 siblings, 0 replies; 8+ messages in thread
From: Jamal Hadi Salim @ 2022-08-17 13:19 UTC (permalink / raw)
To: Jakub Kicinski
Cc: shaozhengchao, netdev, linux-kernel, xiyou.wangcong, jiri, davem,
edumazet, pabeni, weiyongjun1, yuehaibing
On Tue, Aug 16, 2022 at 2:13 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue, 16 Aug 2022 11:32:03 +0800 shaozhengchao wrote:
> > On 2022/8/16 11:10, Jakub Kicinski wrote:
> > > On Tue, 16 Aug 2022 10:04:20 +0800 Zhengchao Shao wrote:
> > >> Some qdiscs don't care return value of qdisc offload function, so make
> > >> function void.
> > >
> > > How many of these patches do you have? Is there a goal you're working
> > > towards? I don't think the pure return value removals are worth the
> > > noise. They don't even save LoC:
> > >
> > > 3 files changed, 9 insertions(+), 9 deletions(-)
> >
> > Thank you for your reply. Recently I've been studying the kernel code
> > related to qdisc, and my goal is to understand how qdisc works. If the
> > code can be optimized, I do what I can to modify the optimization. Is it
> > more appropriate to add warning to the offload return value? I look
> > forward to your reply. Thank you.
>
> Understood. Please stop sending the cleanups removing return values
> unless the patches materially improve the code.
Quoting appropriate here.
+1
cheers,
jamal
^ permalink raw reply [flat|nested] 8+ messages in thread