diff mbox series

[net] net: microchip: sparx5: Fix return value in sparx5_tc_setup_qdisc_ets()

Message ID 20221117150722.2909271-1-luwei32@huawei.com (mailing list archive)
State Accepted
Commit 19d04a947db53e0d99e60aeb914d2148f61ab5f9
Delegated to: Netdev Maintainers
Headers show
Series [net] net: microchip: sparx5: Fix return value in sparx5_tc_setup_qdisc_ets() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
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: 23 this patch: 23
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 6 this patch: 6
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 Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 21 this patch: 21
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Lu Wei Nov. 17, 2022, 3:07 p.m. UTC
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(-)

Comments

Daniel Machon Nov. 18, 2022, 9:34 a.m. UTC | #1
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
patchwork-bot+netdevbpf@kernel.org Nov. 21, 2022, 11:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 17 Nov 2022 23:07:22 +0800 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [net] net: microchip: sparx5: Fix return value in sparx5_tc_setup_qdisc_ets()
    https://git.kernel.org/netdev/net/c/19d04a947db5

You are awesome, thank you!
diff mbox series

Patch

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;