Skip to content

Commit

Permalink
net/mlx5: fix GENEVE TLV option management
Browse files Browse the repository at this point in the history
[ upstream commit 0303967e1127c00e78fc9ce742aa531b943a2a8b ]

In SW steering, the GENEVE TLV option matching flows must be created
using a translation function.
This function checks whether this option has already created a DevX
object for the matching and either creates the objects or updates the
reference counter.
After translation, a flag in flow structure is turned on indicating the
destroy function to release this DevX object.

When the flow rule has meter, the rule may be split, and call translate
function more than once per flow causing object reference counter to
increase each time without updating the flow flag accordingly.

This patch uses this flag as a reference counter which is increased
every translation and indicates the destroy function how many destroy
DevX to do.

Fixes: f15f0c3 ("net/mlx5: create GENEVE TLV option management")
Fixes: e440d6c ("net/mlx5: add GENEVE TLV option flow translation")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
michaelbaum1 authored and kevintraynor committed Mar 5, 2024
1 parent 9fe858d commit 5c8bbc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/mlx5/mlx5_flow_dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -14606,9 +14606,9 @@ flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
flow_dv_aso_ct_release(dev, flow->ct, NULL);
else if (flow->age)
flow_dv_aso_age_release(dev, flow->age);
if (flow->geneve_tlv_option) {
while (flow->geneve_tlv_option) {
flow_dv_geneve_tlv_option_resource_release(dev);
flow->geneve_tlv_option = 0;
flow->geneve_tlv_option--;
}
while (flow->dev_handles) {
uint32_t tmp_idx = flow->dev_handles;
Expand Down

0 comments on commit 5c8bbc6

Please sign in to comment.