Commit 1909387f authored by Edward Cree's avatar Edward Cree Committed by David S. Miller

sfc: offload conntrack flow entries (match only) from CT zones

No handling yet for FLOW_ACTION_MANGLE (NAT or NAPT) actions.
Reviewed-by: default avatarPieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 94aa05bd
...@@ -18,12 +18,10 @@ ...@@ -18,12 +18,10 @@
#define IS_ALL_ONES(v) (!(typeof (v))~(v)) #define IS_ALL_ONES(v) (!(typeof (v))~(v))
#ifdef CONFIG_IPV6
static inline bool efx_ipv6_addr_all_ones(struct in6_addr *addr) static inline bool efx_ipv6_addr_all_ones(struct in6_addr *addr)
{ {
return !memchr_inv(addr, 0xff, sizeof(*addr)); return !memchr_inv(addr, 0xff, sizeof(*addr));
} }
#endif
struct efx_tc_encap_action; /* see tc_encap_actions.h */ struct efx_tc_encap_action; /* see tc_encap_actions.h */
...@@ -197,6 +195,7 @@ struct efx_tc_table_ct { /* TABLE_ID_CONNTRACK_TABLE */ ...@@ -197,6 +195,7 @@ struct efx_tc_table_ct { /* TABLE_ID_CONNTRACK_TABLE */
* @encap_match_ht: Hashtable of TC encap matches * @encap_match_ht: Hashtable of TC encap matches
* @match_action_ht: Hashtable of TC match-action rules * @match_action_ht: Hashtable of TC match-action rules
* @ct_zone_ht: Hashtable of TC conntrack flowtable bindings * @ct_zone_ht: Hashtable of TC conntrack flowtable bindings
* @ct_ht: Hashtable of TC conntrack flow entries
* @neigh_ht: Hashtable of neighbour watches (&struct efx_neigh_binder) * @neigh_ht: Hashtable of neighbour watches (&struct efx_neigh_binder)
* @meta_ct: MAE table layout for conntrack table * @meta_ct: MAE table layout for conntrack table
* @reps_mport_id: MAE port allocated for representor RX * @reps_mport_id: MAE port allocated for representor RX
...@@ -230,6 +229,7 @@ struct efx_tc_state { ...@@ -230,6 +229,7 @@ struct efx_tc_state {
struct rhashtable encap_match_ht; struct rhashtable encap_match_ht;
struct rhashtable match_action_ht; struct rhashtable match_action_ht;
struct rhashtable ct_zone_ht; struct rhashtable ct_zone_ht;
struct rhashtable ct_ht;
struct rhashtable neigh_ht; struct rhashtable neigh_ht;
struct efx_tc_table_ct meta_ct; struct efx_tc_table_ct meta_ct;
u32 reps_mport_id, reps_mport_vport_id; u32 reps_mport_id, reps_mport_vport_id;
......
This diff is collapsed.
...@@ -22,6 +22,8 @@ struct efx_tc_ct_zone { ...@@ -22,6 +22,8 @@ struct efx_tc_ct_zone {
refcount_t ref; refcount_t ref;
struct nf_flowtable *nf_ft; struct nf_flowtable *nf_ft;
struct efx_nic *efx; struct efx_nic *efx;
struct mutex mutex; /* protects cts list */
struct list_head cts; /* list of efx_tc_ct_entry in this zone */
}; };
/* create/teardown hashtables */ /* create/teardown hashtables */
...@@ -45,6 +47,7 @@ struct efx_tc_ct_entry { ...@@ -45,6 +47,7 @@ struct efx_tc_ct_entry {
struct efx_tc_ct_zone *zone; struct efx_tc_ct_zone *zone;
u32 mark; u32 mark;
struct efx_tc_counter *cnt; struct efx_tc_counter *cnt;
struct list_head list; /* entry on zone->cts */
}; };
#endif /* CONFIG_SFC_SRIOV */ #endif /* CONFIG_SFC_SRIOV */
......
...@@ -129,8 +129,8 @@ static void efx_tc_counter_work(struct work_struct *work) ...@@ -129,8 +129,8 @@ static void efx_tc_counter_work(struct work_struct *work)
/* Counter allocation */ /* Counter allocation */
static struct efx_tc_counter *efx_tc_flower_allocate_counter(struct efx_nic *efx, struct efx_tc_counter *efx_tc_flower_allocate_counter(struct efx_nic *efx,
int type) int type)
{ {
struct efx_tc_counter *cnt; struct efx_tc_counter *cnt;
int rc, rc2; int rc, rc2;
...@@ -169,8 +169,8 @@ static struct efx_tc_counter *efx_tc_flower_allocate_counter(struct efx_nic *efx ...@@ -169,8 +169,8 @@ static struct efx_tc_counter *efx_tc_flower_allocate_counter(struct efx_nic *efx
return ERR_PTR(rc > 0 ? -EIO : rc); return ERR_PTR(rc > 0 ? -EIO : rc);
} }
static void efx_tc_flower_release_counter(struct efx_nic *efx, void efx_tc_flower_release_counter(struct efx_nic *efx,
struct efx_tc_counter *cnt) struct efx_tc_counter *cnt)
{ {
int rc; int rc;
......
...@@ -49,6 +49,10 @@ int efx_tc_init_counters(struct efx_nic *efx); ...@@ -49,6 +49,10 @@ int efx_tc_init_counters(struct efx_nic *efx);
void efx_tc_destroy_counters(struct efx_nic *efx); void efx_tc_destroy_counters(struct efx_nic *efx);
void efx_tc_fini_counters(struct efx_nic *efx); void efx_tc_fini_counters(struct efx_nic *efx);
struct efx_tc_counter *efx_tc_flower_allocate_counter(struct efx_nic *efx,
int type);
void efx_tc_flower_release_counter(struct efx_nic *efx,
struct efx_tc_counter *cnt);
struct efx_tc_counter_index *efx_tc_flower_get_counter_index( struct efx_tc_counter_index *efx_tc_flower_get_counter_index(
struct efx_nic *efx, unsigned long cookie, struct efx_nic *efx, unsigned long cookie,
enum efx_tc_counter_type type); enum efx_tc_counter_type type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment