[03/36] net/bnxt: add vfr flag to the mark manager
diff mbox series

Message ID 20200612125024.15989-4-somnath.kotur@broadcom.com
State Superseded, archived
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 June 12, 2020, 12:49 p.m. UTC
From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>

Add support for the vfr flag to the mark manager

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Michael Baucom <michael.baucom@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c            | 3 ++-
 drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c | 7 +++++++
 drivers/net/bnxt/tf_ulp/ulp_mark_mgr.h | 4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 91ff729..bd452b7 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -413,6 +413,7 @@  bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
 	uint32_t mark_id;
 	uint32_t flags2;
 	int rc;
+	uint32_t vfr_flag;
 
 	cfa_code = rte_le_to_cpu_16(rxcmp1->cfa_code);
 	flags2 = rte_le_to_cpu_32(rxcmp1->flags2);
@@ -466,7 +467,7 @@  bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
 	}
 
 	rc = ulp_mark_db_mark_get(bp->ulp_ctx, gfid,
-				  cfa_code, &mark_id);
+				  cfa_code, &vfr_flag, &mark_id);
 	if (!rc) {
 		/* Got the mark, write it to the mbuf and return */
 		mbuf->hash.fdir.hi = mark_id;
diff --git a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c
index 9e8b81e..0e13a46 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c
@@ -18,6 +18,8 @@ 
 						BNXT_ULP_MARK_VALID)
 #define ULP_MARK_DB_ENTRY_IS_INVALID(mark_info) (!((mark_info)->flags &\
 						   BNXT_ULP_MARK_VALID))
+#define ULP_MARK_DB_ENTRY_IS_VFR_ID(mark_info) ((mark_info)->flags &\
+						BNXT_ULP_MARK_VFR_ID)
 #define ULP_MARK_DB_ENTRY_IS_GLOBAL_HW_FID(mark_info) ((mark_info)->flags &\
 						BNXT_ULP_MARK_GLOBAL_HW_FID)
 
@@ -153,6 +155,8 @@  ulp_mark_db_deinit(struct bnxt_ulp_context *ctxt)
  *
  * fid [in] The flow id that is returned by HW in BD
  *
+ * vfr_flag [out].it indicatesif mark is vfr_id or mark id
+ *
  * mark [out] The mark that is associated with the FID
  *
  */
@@ -160,6 +164,7 @@  int32_t
 ulp_mark_db_mark_get(struct bnxt_ulp_context *ctxt,
 		     bool is_gfid,
 		     uint32_t fid,
+		     uint32_t *vfr_flag,
 		     uint32_t *mark)
 {
 	struct bnxt_ulp_mark_tbl *mtbl;
@@ -184,6 +189,7 @@  ulp_mark_db_mark_get(struct bnxt_ulp_context *ctxt,
 		BNXT_TF_DBG(DEBUG, "Get GFID[0x%0x] = 0x%0x\n",
 			    idx, mtbl->gfid_tbl[idx].mark_id);
 
+		*vfr_flag = ULP_MARK_DB_ENTRY_IS_VFR_ID(&mtbl->gfid_tbl[idx]);
 		*mark = mtbl->gfid_tbl[idx].mark_id;
 	} else {
 		if (idx >= mtbl->lfid_num_entries ||
@@ -193,6 +199,7 @@  ulp_mark_db_mark_get(struct bnxt_ulp_context *ctxt,
 		BNXT_TF_DBG(DEBUG, "Get LFID[0x%0x] = 0x%0x\n",
 			    idx, mtbl->lfid_tbl[idx].mark_id);
 
+		*vfr_flag = ULP_MARK_DB_ENTRY_IS_VFR_ID(&mtbl->lfid_tbl[idx]);
 		*mark = mtbl->lfid_tbl[idx].mark_id;
 	}
 
diff --git a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.h b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.h
index fd0d840..9696730 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.h
@@ -9,6 +9,7 @@ 
 #include "bnxt_ulp.h"
 
 #define BNXT_ULP_MARK_VALID   0x1
+#define BNXT_ULP_MARK_VFR_ID  0x2
 #define BNXT_ULP_MARK_GLOBAL_HW_FID 0x4
 #define BNXT_ULP_MARK_LOCAL_HW_FID 0x8
 
@@ -67,6 +68,8 @@  ulp_mark_db_deinit(struct bnxt_ulp_context *ctxt);
  *
  * fid [in] The flow id that is returned by HW in BD
  *
+ * vfr_flag [out].it indicatesif mark is vfr_id or mark id
+ *
  * mark [out] The mark that is associated with the FID
  *
  */
@@ -74,6 +77,7 @@  int32_t
 ulp_mark_db_mark_get(struct bnxt_ulp_context *ctxt,
 		     bool is_gfid,
 		     uint32_t fid,
+		     uint32_t *vfr_flag,
 		     uint32_t *mark);
 
 /*