All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Daniel.Machon@microchip.com>
To: <luwei32@huawei.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <Lars.Povlsen@microchip.com>,
	<Steen.Hegelund@microchip.com>, <UNGLinuxDriver@microchip.com>,
	<netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [patch net] net: microchip: sparx5: Fix return value in sparx5_tc_setup_qdisc_ets()
Date: Fri, 18 Nov 2022 09:34:02 +0000	[thread overview]
Message-ID: <Y3dUG42A/UkVTpaa@DEN-LT-70577> (raw)
In-Reply-To: <20221117150722.2909271-1-luwei32@huawei.com>

Den Thu, Nov 17, 2022 at 11:07:22PM +0800 skrev Lu Wei:
> [Some people who received this message don't often get email from luwei32@huawei.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Function sparx5_tc_setup_qdisc_ets() always returns negative value
> because it return -EOPNOTSUPP in the end. This patch returns the
> rersult of sparx5_tc_ets_add() and sparx5_tc_ets_del() directly.
> 
> Fixes: 211225428d65 ("net: microchip: sparx5: add support for offloading ets qdisc")
> Signed-off-by: Lu Wei <luwei32@huawei.com>
> ---
>  drivers/net/ethernet/microchip/sparx5/sparx5_tc.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
> index e05429c751ee..dc2c3756e3a2 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
> @@ -90,13 +90,10 @@ static int sparx5_tc_setup_qdisc_ets(struct net_device *ndev,
>                         }
>                 }
> 
> -               sparx5_tc_ets_add(port, params);
> -               break;
> +               return sparx5_tc_ets_add(port, params);
>         case TC_ETS_DESTROY:
> 
> -               sparx5_tc_ets_del(port);
> -
> -               break;
> +               return sparx5_tc_ets_del(port);
>         case TC_ETS_GRAFT:
>                 return -EOPNOTSUPP;
> 
> --
> 2.31.1
>

Looks like ets_offload_change() does not check the return value of
ndo_setup_tc() here [1] - I wonder why this is. This also explains why
my ETS tests were passing.

Anyway, thank you for the patch.

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>

==================

[1] https://elixir.bootlin.com/linux/v6.1-rc5/source/net/sched/sch_ets.c#L143

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: <Daniel.Machon@microchip.com>
To: <luwei32@huawei.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <Lars.Povlsen@microchip.com>,
	<Steen.Hegelund@microchip.com>, <UNGLinuxDriver@microchip.com>,
	<netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [patch net] net: microchip: sparx5: Fix return value in sparx5_tc_setup_qdisc_ets()
Date: Fri, 18 Nov 2022 09:34:02 +0000	[thread overview]
Message-ID: <Y3dUG42A/UkVTpaa@DEN-LT-70577> (raw)
In-Reply-To: <20221117150722.2909271-1-luwei32@huawei.com>

Den Thu, Nov 17, 2022 at 11:07:22PM +0800 skrev Lu Wei:
> [Some people who received this message don't often get email from luwei32@huawei.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Function sparx5_tc_setup_qdisc_ets() always returns negative value
> because it return -EOPNOTSUPP in the end. This patch returns the
> rersult of sparx5_tc_ets_add() and sparx5_tc_ets_del() directly.
> 
> Fixes: 211225428d65 ("net: microchip: sparx5: add support for offloading ets qdisc")
> Signed-off-by: Lu Wei <luwei32@huawei.com>
> ---
>  drivers/net/ethernet/microchip/sparx5/sparx5_tc.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
> index e05429c751ee..dc2c3756e3a2 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
> @@ -90,13 +90,10 @@ static int sparx5_tc_setup_qdisc_ets(struct net_device *ndev,
>                         }
>                 }
> 
> -               sparx5_tc_ets_add(port, params);
> -               break;
> +               return sparx5_tc_ets_add(port, params);
>         case TC_ETS_DESTROY:
> 
> -               sparx5_tc_ets_del(port);
> -
> -               break;
> +               return sparx5_tc_ets_del(port);
>         case TC_ETS_GRAFT:
>                 return -EOPNOTSUPP;
> 
> --
> 2.31.1
>

Looks like ets_offload_change() does not check the return value of
ndo_setup_tc() here [1] - I wonder why this is. This also explains why
my ETS tests were passing.

Anyway, thank you for the patch.

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>

==================

[1] https://elixir.bootlin.com/linux/v6.1-rc5/source/net/sched/sch_ets.c#L143

  reply	other threads:[~2022-11-18  9:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 15:07 [patch net] net: microchip: sparx5: Fix return value in sparx5_tc_setup_qdisc_ets() Lu Wei
2022-11-17 15:07 ` Lu Wei
2022-11-18  9:34 ` Daniel.Machon [this message]
2022-11-18  9:34   ` Daniel.Machon
2022-11-21 11:10 ` patchwork-bot+netdevbpf
2022-11-21 11:10   ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3dUG42A/UkVTpaa@DEN-LT-70577 \
    --to=daniel.machon@microchip.com \
    --cc=Lars.Povlsen@microchip.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luwei32@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.