Skip to contentSkip to conversation

sfc: TC probe fixes

PATCH Applied [email protected] 3 participants 5 messages Aug 15, 2023 – Aug 17, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
diff --cc drivers/net/ethernet/sfc/tc.c
index fe268b6c1cac,246657222958..000000000000
@@@ -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)
#1 lore raw

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().

Fixes 5b2e12d51bd8 ("sfc: bind indirect blocks for TC offload on EF100")
---
 drivers/net/ethernet/sfc/tc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sfc/tc.c +1 -1
index 15ebd3973922..fe268b6c1cac 100644
@@ -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;
 }
 
#3 lore raw

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.

Fixes 7e056e2360d9 ("sfc: obtain device mac address based on firmware handle for ef100")
---
 drivers/net/ethernet/sfc/ef100_nic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sfc/ef100_nic.c +1 -1
index 7adde9639c8a..35d8e9811998 100644
@@ -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)
reviewer Reviewed-by on the v1 series
#4 lore raw
In reply to [email protected]
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
(with 3bf969e88ada ("sfc: add MAE table machinery for conntrack table")); the resolution is appended.

Quoted 7 lines

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(-)

For series:

#2 lore raw

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 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().

Quoted 6 lines
Fixes 5b2e12d51bd8 ("sfc: bind indirect blocks for TC offload on EF100")

[...]

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