• Louis Peens's avatar
    nfp: flower-ct: add nft flows to nft list · 95255017
    Louis Peens authored
    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: default avatarLouis Peens <louis.peens@corigine.com>
    Signed-off-by: default avatarYinjun Zhang <yinjun.zhang@corigine.com>
    Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    95255017
metadata.c 19.3 KB