sfc: TC probe fixes
Subsystems (3)
cover sfc: TC probe fixes
From: Edward Cree <[email protected]>
Fix a couple of minor infelicities in the error paths of EF100 TC
offload setup at probe time. Both found by code inspection.
Patch #1 will produce a conflict when merging net into net-next
(with 3bf969e88ada ("sfc: add MAE table machinery for conntrack table")); the resolution is appended.
Edward Cree (2):
sfc: don't unregister flow_indr if it was never registered
sfc: don't fail probe if MAE/TC setup fails
drivers/net/ethernet/sfc/ef100_nic.c | 2 +- drivers/net/ethernet/sfc/tc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
---
drivers/net/ethernet/sfc/tc.c +0 -0
@@@ -1657,11 -2087,17 +2087,17 @@@ int efx_init_tc(struct efx_nic *efx rc =efx_tc_configure_fallback_acts_reps (efx);if (rc)return rc; - rc =flow_indr_dev_register (efx_tc_indr_setup_cb, efx); + rc =efx_mae_get_tables (efx);if (rc)return rc; - efx->tc->up = true; + rc =flow_indr_dev_register (efx_tc_indr_setup_cb, efx); +if (rc) + goto out_free; + efx->tc->up = true;return 0 ; + out_free: +efx_mae_free_tables (efx); +return rc; }void efx_fini_tc (struct efx_nic *efx)
PATCH 1/2 sfc: don't unregister flow_indr if it was never registered
From: Edward Cree <[email protected]>
In efx_init_tc(), move the setting of efx->tc->up after the
flow_indr_dev_register() call, so that if it fails, efx_fini_tc() won't call flow_indr_dev_unregister().
--- drivers/net/ethernet/sfc/tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sfc/tc.c +1 -1
@@ -1657,10 +1657,10 @@ int efx_init_tc(struct efx_nic *efx) rc =efx_tc_configure_fallback_acts_reps (efx);if (rc)return rc; - efx->tc->up = true; rc =flow_indr_dev_register (efx_tc_indr_setup_cb, efx);if (rc)return rc; + efx->tc->up = true;return 0 ; }
PATCH 2/2 sfc: don't fail probe if MAE/TC setup fails
In reply to [email protected]From: Edward Cree <[email protected]>
Existing comment in the source explains why we don't want efx_init_tc()
failure to be fatal. Cited commit erroneously consolidated failure paths causing the probe to be failed in this case.
--- drivers/net/ethernet/sfc/ef100_nic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sfc/ef100_nic.c +1 -1
@@ -1194,7 +1194,7 @@ int ef100_probe_netdev_pf(struct efx_nic *efx) net_dev->features |=NETIF_F_HW_TC ; efx->fixed_features |=NETIF_F_HW_TC ; } -return rc; +return 0 ; }int ef100_probe_vf (struct efx_nic *efx)
Quoted 8 lines · On Tue, Aug 15, 2023 at 04:57:26PM +0100, [email protected] wrote:
From: Edward Cree <[email protected]>
Fix a couple of minor infelicities in the error paths of EF100 TC
offload setup at probe time. Both found by code inspection.
Patch #1 will produce a conflict when merging net into net-next
(with3bf969e88ada("sfc: add MAE table machinery for conntrack table")); the resolution is appended.
Quoted 7 lines
Edward Cree (2):
sfc: don't unregisterflow_indrif it was never registered
sfc: don't fail probe if MAE/TC setup failsdrivers/net/ethernet/sfc/ef100_nic.c | 2 +- drivers/net/ethernet/sfc/tc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
For series:
Re: [PATCH net 1/2] sfc: don't unregister flow_indr if it was never registered
In reply to [email protected]This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Tue, 15 Aug 2023 16:57:27 +0100 you wrote:
From: Edward Cree <[email protected]>
In
efx_init_tc(), move the setting ofefx->tc->upafter the
flow_indr_dev_register()call, so that if it fails,efx_fini_tc()won't callflow_indr_dev_unregister().
Quoted 6 lines
Fixes 5b2e12d51bd8 ("sfc: bind indirect blocks for TC offload on EF100")Suggested-by Pieter Jansen van Vuuren <[email protected]>Reviewed-by Martin Habets <[email protected]>Signed-off-by Edward Cree <[email protected]>[...]
Here is the summary with links:
- [net,1/2] sfc: don't unregister flow_indr if it was never registered
https://git.kernel.org/netdev/net/c/fa165e194997 - [net,2/2] sfc: don't fail probe if MAE/TC setup fails https://git.kernel.org/netdev/net/c/54c9016eb8ed
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html