2d084f69aa
When creating a flow with this action context for CT, it needs to be translated in 2 levels. First, retrieve from action context to rte_flow action. Second, translate it to the corresponding DR action with traffic direction that was specified when creating or updating via rte_flow_action_handle* API. Before using the DR action in a flow, the CT context should be available to use in the hardware. A synchronization is done before inserting the flow rule with CT action to check the HW availability of this CT context. In order to release the DR actions and reuse the context of a CT, the reference count should also be handled in the flow rule destroying. The CT index will be recorded in the rte_flow by reusing the ASO age index to save memory, since only one ASO action is supported in one flow rule currently. The action context type should also be saved for CT. When destroying a flow rule, if the context type is CT and the index is valid (non-zero), the release process should be handled. By default, the handling will fall back to try to release the ASO age if any. Signed-off-by: Bing Zhao <bingz@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>