aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/tc.h
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2022-09-26 19:57:34 +0100
committerDavid S. Miller <davem@davemloft.net>2022-09-28 09:43:22 +0100
commitf54a28a211664017531aebc997bf3c6a279e0d6f (patch)
tree0e49de2343dcadb5dab9747acbd61c10bec604ce /drivers/net/ethernet/sfc/tc.h
parent7c9d266d8faffab935fb7b30056a476289c2a4a3 (diff)
sfc: add a hashtable for offloaded TC rules
Nothing inserts into this table yet, but we have code to remove rules on FLOW_CLS_DESTROY or at driver teardown time, in both cases also attempting to remove the corresponding hardware rules. 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.h')
-rw-r--r--drivers/net/ethernet/sfc/tc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/tc.h b/drivers/net/ethernet/sfc/tc.h
index 3e2299c5a885..94a04374e505 100644
--- a/drivers/net/ethernet/sfc/tc.h
+++ b/drivers/net/ethernet/sfc/tc.h
@@ -12,6 +12,7 @@
#ifndef EFX_TC_H
#define EFX_TC_H
#include <net/flow_offload.h>
+#include <linux/rhashtable.h>
#include "net_driver.h"
/* Error reporting: convenience macros. For indicating why a given filter
@@ -55,6 +56,8 @@ struct efx_tc_action_set_list {
};
struct efx_tc_flow_rule {
+ unsigned long cookie;
+ struct rhash_head linkage;
struct efx_tc_match match;
struct efx_tc_action_set_list acts;
u32 fw_id;
@@ -69,6 +72,8 @@ enum efx_tc_rule_prios {
* struct efx_tc_state - control plane data for TC offload
*
* @block_list: List of &struct efx_tc_block_binding
+ * @mutex: Used to serialise operations on TC hashtables
+ * @match_action_ht: Hashtable of TC match-action rules
* @reps_mport_id: MAE port allocated for representor RX
* @reps_filter_uc: VNIC filter for representor unicast RX (promisc)
* @reps_filter_mc: VNIC filter for representor multicast RX (allmulti)
@@ -81,6 +86,8 @@ enum efx_tc_rule_prios {
*/
struct efx_tc_state {
struct list_head block_list;
+ struct mutex mutex;
+ struct rhashtable match_action_ht;
u32 reps_mport_id, reps_mport_vport_id;
s32 reps_filter_uc, reps_filter_mc;
struct {