[06/14] net/bnxt: add build option for EM slot allocation

Message ID 1602916089-18576-7-git-send-email-venkatkumar.duvvuru@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ajit Khaparde
Headers
Series bnxt patches |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Venkat Duvvuru Oct. 17, 2020, 6:28 a.m. UTC
  From: Peter Spreadborough <peter.spreadborough@broadcom.com>

- Add build option to select either 2 or 4 slot EM entries.
- The default is 4 slot entries.

Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
---
 drivers/net/bnxt/tf_core/tf_session.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/tf_core/tf_session.h b/drivers/net/bnxt/tf_core/tf_session.h
index aa7a278..6a5c894 100644
--- a/drivers/net/bnxt/tf_core/tf_session.h
+++ b/drivers/net/bnxt/tf_core/tf_session.h
@@ -33,16 +33,16 @@ 
 #define TF_SESSION_ID_INVALID     0xFFFFFFFF /** Invalid Session ID define */
 
 /**
- * Number of EM entries. Static for now will be removed
- * when parameter added at a later date. At this stage we
- * are using fixed size entries so that each stack entry
- * represents 4 RT (f/n)blocks. So we take the total block
- * allocation for truflow and divide that by 4.
+ * At this stage we are using fixed size entries so that each
+ * stack entry represents either 2 or 4 RT (f/n)blocks. So we
+ * take the total block allocation for truflow and divide that
+ * by either 2 or 4.
  */
-#define TF_SESSION_TOTAL_FN_BLOCKS (1024 * 8) /* 8K blocks */
+#ifdef TF_EM_ENTRY_IPV4_ONLY
+#define TF_SESSION_EM_ENTRY_SIZE 2 /* 2 blocks per entry */
+#else
 #define TF_SESSION_EM_ENTRY_SIZE 4 /* 4 blocks per entry */
-#define TF_SESSION_EM_POOL_SIZE \
-	(TF_SESSION_TOTAL_FN_BLOCKS / TF_SESSION_EM_ENTRY_SIZE)
+#endif
 
 /**
  * Session