[01/13] net/bnxt: fix the corruption of the session details
diff mbox series

Message ID 20201009111130.10422-2-somnath.kotur@broadcom.com
State Superseded
Delegated to: Ajit Khaparde
Headers show
Series
  • bnxt patches
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Somnath Kotur Oct. 9, 2020, 11:11 a.m. UTC
From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>

The session details that is shared among multiple ports
need to be outside the bnxt structure.

Fixes: 70e64b27af5b ("net/bnxt: support ULP session manager cleanup")
Cc: stable@dpdk.org

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Michael Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
index 2896194..a4d48c7 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
@@ -159,7 +159,9 @@  ulp_ctx_session_open(struct bnxt *bp,
 	}
 	if (!session->session_opened) {
 		session->session_opened = 1;
-		session->g_tfp = &bp->tfp;
+		session->g_tfp = rte_zmalloc("bnxt_ulp_session_tfp",
+					     sizeof(struct tf), 0);
+		session->g_tfp->session = bp->tfp.session;
 	}
 	return rc;
 }
@@ -176,6 +178,7 @@  ulp_ctx_session_close(struct bnxt *bp,
 	if (session->session_opened)
 		tf_close_session(&bp->tfp);
 	session->session_opened = 0;
+	rte_free(session->g_tfp);
 	session->g_tfp = NULL;
 }