diff options
author | 2021-06-16 12:02:01 +0200 | |
---|---|---|
committer | 2021-06-16 12:42:52 -0700 | |
commit | 95255017e0a84692faa33fdc0746433987b5aff0 (patch) | |
tree | fd02b09f9e10abb3ef41820774ca3e7d3dc3b724 /drivers/net/ethernet/netronome/nfp/flower/conntrack.h | |
parent | nfp: flower-ct: add nft callback stubs (diff) | |
download | linux-dev-95255017e0a84692faa33fdc0746433987b5aff0.tar.xz linux-dev-95255017e0a84692faa33fdc0746433987b5aff0.zip |
nfp: flower-ct: add nft flows to nft list
Implement code to add and remove nft flows to the relevant list.
Registering and deregistering the callback function for the nft
table is quite complicated. The safest is to delete the callback
on the removal of the last pre_ct flow. This is because if this
is also the latest pre_ct flow in software it means that this
specific nft table will be freed, so there will not be a later
opportunity to do this. Another place where it looks possible
to delete the callback is when the last nft_flow is deleted,
but this happens under the flow_table lock, which is also taken
when deregistering the callback, leading to a deadlock situation.
This means the final solution here is to delete the callback
when removing the last pre_ct flow, and then clean up any
remaining nft_flow entries which may still be present, since
there will never be a callback now to do this, leaving them
orphaned if not cleaned up here as well.
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/flower/conntrack.h')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/flower/conntrack.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h index b6e750dad929..def95c3e8bb7 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h @@ -28,6 +28,9 @@ extern const struct rhashtable_params nfp_tc_ct_merge_params; * * @tc_merge_tb: The table of merged tc flows * @tc_merge_count: Keep count of the number of merged tc entries + * + * @nft_flows_list: The list of nft relatednfp_fl_ct_flow_entry entries + * @nft_flows_count: Keep count of the number of nft_flow entries */ struct nfp_fl_ct_zone_entry { u16 zone; @@ -44,6 +47,9 @@ struct nfp_fl_ct_zone_entry { struct rhashtable tc_merge_tb; unsigned int tc_merge_count; + + struct list_head nft_flows_list; + unsigned int nft_flows_count; }; enum ct_entry_type { |