[26/37] net/dpaa2: free flow rule memory
diff mbox series

Message ID 20200527132326.1382-27-hemant.agrawal@nxp.com
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • NXP DPAAx enhancements
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Hemant Agrawal May 27, 2020, 1:23 p.m. UTC
From: Jun Yang <jun.yang@nxp.com>

Free rule memory when the flow is destroyed.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 drivers/net/dpaa2/dpaa2_flow.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch
diff mbox series

diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c
index 507a5d0e3..941d62b80 100644
--- a/drivers/net/dpaa2/dpaa2_flow.c
+++ b/drivers/net/dpaa2/dpaa2_flow.c
@@ -3594,6 +3594,7 @@  int dpaa2_flow_destroy(struct rte_eth_dev *dev,
 			"Error in entry addition in QoS table(%d)", ret);
 			goto error;
 		}
+		priv->qos_index[flow->qos_index] = 0;
 		break;
 	default:
 		DPAA2_PMD_ERR(
@@ -3603,6 +3604,10 @@  int dpaa2_flow_destroy(struct rte_eth_dev *dev,
 	}
 
 	LIST_REMOVE(flow, next);
+	rte_free((void *)(size_t)flow->qos_rule.key_iova);
+	rte_free((void *)(size_t)flow->qos_rule.mask_iova);
+	rte_free((void *)(size_t)flow->fs_rule.key_iova);
+	rte_free((void *)(size_t)flow->fs_rule.mask_iova);
 	/* Now free the flow */
 	rte_free(flow);