aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/tc.c
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2022-09-26 19:57:32 +0100
committerDavid S. Miller <davem@davemloft.net>2022-09-28 09:43:22 +0100
commit5b2e12d51bd8efaf0be8309d5b2c716ad848cb37 (patch)
tree0193b6642f02ac4e46d839d9257c3ba51f278de0 /drivers/net/ethernet/sfc/tc.c
parentsfc: bind blocks for TC offload on EF100 (diff)
downloadlinux-dev-5b2e12d51bd8efaf0be8309d5b2c716ad848cb37.tar.xz
linux-dev-5b2e12d51bd8efaf0be8309d5b2c716ad848cb37.zip
sfc: bind indirect blocks for TC offload on EF100
Bind indirect blocks for recognised tunnel netdevices. Currently these connect to a stub efx_tc_flower() that only returns -EOPNOTSUPP; subsequent patches will implement flower offloads to the Match-Action Engine. Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/tc.c')
-rw-r--r--drivers/net/ethernet/sfc/tc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/tc.c b/drivers/net/ethernet/sfc/tc.c
index 23c4325e739a..cb7f76c74e66 100644
--- a/drivers/net/ethernet/sfc/tc.c
+++ b/drivers/net/ethernet/sfc/tc.c
@@ -10,6 +10,7 @@
*/
#include "tc.h"
+#include "tc_bindings.h"
#include "mae.h"
#include "ef100_rep.h"
#include "efx.h"
@@ -217,6 +218,9 @@ int efx_init_tc(struct efx_nic *efx)
if (rc)
return rc;
efx->tc->up = true;
+ rc = flow_indr_dev_register(efx_tc_indr_setup_cb, efx);
+ if (rc)
+ return rc;
return 0;
}
@@ -225,6 +229,8 @@ void efx_fini_tc(struct efx_nic *efx)
/* We can get called even if efx_init_struct_tc() failed */
if (!efx->tc)
return;
+ if (efx->tc->up)
+ flow_indr_dev_unregister(efx_tc_indr_setup_cb, efx, efx_tc_block_unbind);
efx_tc_deconfigure_rep_mport(efx);
efx_tc_deconfigure_default_rule(efx, &efx->tc->dflt.pf);
efx_tc_deconfigure_default_rule(efx, &efx->tc->dflt.wire);