DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
To: dev@dpdk.org
Cc: Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
	Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>,
	Shahaji Bhosle <sbhosle@broadcom.com>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>
Subject: [PATCH v8 44/47] net/bnxt: tf_ulp: enable support for truflow feature configuration
Date: Thu,  7 Nov 2024 19:22:51 +0530	[thread overview]
Message-ID: <20241107135254.1611676-45-sriharsha.basavapatna@broadcom.com> (raw)
In-Reply-To: <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com>

From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>

Added truflow feature bit meson configuration parameter to enable
optional capability features of the application.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c    |  6 ++++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c   |  6 ++++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h | 32 ++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
index c591f9327c..fa7e8fe000 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
@@ -476,7 +476,11 @@ ulp_tf_cntxt_app_caps_init(struct bnxt *bp,
 					       info[i].min_flow_priority);
 		bnxt_ulp_max_flow_priority_set(ulp_ctx,
 					       info[i].max_flow_priority);
-		ulp_ctx->cfg_data->feature_bits = info[i].feature_bits;
+		/* Update the capability feature bits*/
+		if (bnxt_ulp_cap_feat_process(info[i].feature_bits,
+					      &ulp_ctx->cfg_data->feature_bits))
+			return -EINVAL;
+
 		bnxt_ulp_cntxt_ptr2_default_class_bits_set(ulp_ctx,
 							   info[i].default_class_bits);
 		bnxt_ulp_cntxt_ptr2_default_act_bits_set(ulp_ctx,
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
index ebbc5a85a9..d83f3df884 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
@@ -536,7 +536,11 @@ ulp_tfc_cntxt_app_caps_init(struct bnxt *bp, uint8_t app_id, uint32_t dev_id)
 					    "Socket Direct feature is enabled\n");
 			}
 		}
-		ulp_ctx->cfg_data->feature_bits = info[i].feature_bits;
+		/* Update the capability feature bits*/
+		if (bnxt_ulp_cap_feat_process(info[i].feature_bits,
+					      &ulp_ctx->cfg_data->feature_bits))
+			return -EINVAL;
+
 		bnxt_ulp_default_app_priority_set(ulp_ctx,
 						  info[i].default_priority);
 		bnxt_ulp_max_def_priority_set(ulp_ctx,
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h b/drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h
index a1fd00f002..5ca99780e2 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h
@@ -1035,4 +1035,36 @@ bnxt_ulp_vfr_session_fid_rem(struct bnxt_ulp_context *ulp_ctx,
 	return rc;
 }
 
+static inline int32_t
+bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)
+{
+#ifdef RTE_BNXT_TF_FEAT_BITS
+	uint64_t bit = RTE_BNXT_TF_FEAT_BITS;
+#else
+	uint64_t bit = 0;
+#endif
+
+	*out_bits = 0;
+	if ((feat_bits | bit) != feat_bits) {
+		BNXT_DRV_DBG(ERR, "Invalid TF feature bit is set %" PRIu64 "\n",
+			     bit);
+		return -EINVAL;
+	}
+	if ((bit & BNXT_ULP_FEATURE_BIT_PARENT_DMAC) &&
+	    (bit & BNXT_ULP_FEATURE_BIT_PORT_DMAC)) {
+		BNXT_DRV_DBG(ERR, "Invalid both Port and Parent Mac set\n");
+		return -EINVAL;
+	}
+
+	if (bit & BNXT_ULP_FEATURE_BIT_PARENT_DMAC)
+		BNXT_DRV_DBG(ERR, "Parent Mac Address Feature is enabled\n");
+	if (bit & BNXT_ULP_FEATURE_BIT_PORT_DMAC)
+		BNXT_DRV_DBG(ERR, "Port Mac Address Feature is enabled\n");
+	if (bit & BNXT_ULP_FEATURE_BIT_MULTI_TUNNEL_FLOW)
+		BNXT_DRV_DBG(ERR, "Multi Tunnel Flow Feature is enabled\n");
+
+	*out_bits =  bit;
+	return 0;
+}
+
 #endif /* _BNXT_ULP_UTILS_H_ */
-- 
2.39.3


  parent reply	other threads:[~2024-11-07 13:47 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 13:52 [PATCH v8 00/47] TruFlow update for Thor2 Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 01/47] net/bnxt: tf_core: fix wc tcam multi slice delete issue Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 02/47] net/bnxt: tf_core: tcam manager data corruption Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 03/47] net/bnxt: tf_core: External EM support cleanup Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 04/47] net/bnxt: tf_core: Thor TF EM key size check Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 05/47] net/bnxt: tf_core: flow scale improvement Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 06/47] net/bnxt: tf_core: TF support flow scale query Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 07/47] net/bnxt: tf_core: fix slice count in case of HA entry move Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 08/47] net/bnxt: tf_core: convert priority based TCAM manager to dynamic allocation Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 09/47] net/bnxt: tf_core: remove dead AFM code from session-based priority TCAM mgr Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 10/47] net/bnxt: tf_core: remove dead " Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 11/47] net/bnxt: tfc: support tf-core for Thor2 Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 12/47] net/bnxt: tf_ulp: add vxlan-gpe base support Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 13/47] net/bnxt: tf_ulp: add custom l2 etype tunnel support Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 14/47] net/bnxt: tf_ulp: add support for vf to vf flow offload Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 15/47] net/bnxt: tf_ulp: Wh+ mirroring support Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 16/47] net/bnxt: tf_ulp: miscellaneous fixes Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 17/47] net/bnxt: tf_ulp: support for Thor2 ulp layer Sriharsha Basavapatna
2024-12-10 13:32   ` David Marchand
2024-11-07 13:52 ` [PATCH v8 18/47] net/bnxt: tf_ulp: add support for overlapping flows Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 19/47] net/bnxt: tf_ulp: convert recipe table to dynamic memory Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 20/47] net/bnxt: tf_ulp: add feature bit support Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 21/47] net/bnxt: tf_ulp: add action read and clear support Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 22/47] net/bnxt: tf_ulp: update template files Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 23/47] net/bnxt: tf_ulp: VFR updates for Thor 2 Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 24/47] net/bnxt: tf_ulp: add support for tunnel flow stats Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 25/47] net/bnxt: tf_ulp: update template files Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 26/47] net/bnxt: tf_ulp: enable recipe id generation Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 27/47] net/bnxt: tf_ulp: fixed parent child db counters Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 28/47] net/bnxt: tf_ulp: modify return values to adhere to C coding standard Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 29/47] net/bnxt: tf_ulp: update template files Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 30/47] net/bnxt: tf_ulp: add mask defaults when mask is not specified Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 31/47] net/bnxt: tf_ulp: add jump action support Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 32/47] net/bnxt: tf_ulp: add support for flow priority Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 33/47] net/bnxt: tf_ulp: support for dynamic tunnel ports Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 34/47] net/bnxt: tf_ulp: add rte_mtr support for Thor2 Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 35/47] net/bnxt: tf_ulp: TF support flow scale query Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 36/47] net/bnxt: tf_ulp: add support for rss flow query to ULP Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 37/47] net/bnxt: tf_ulp: add track type feature to tables Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 38/47] net/bnxt: tf_ulp: inline utility functions and use likely/unlikely Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 39/47] net/bnxt: tf_ulp: switch ulp to use rte crc32 hash Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 40/47] net/bnxt: tf_ulp: update template files Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 41/47] net/bnxt: tf_ulp: support a few generic template items Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 42/47] net/bnxt: tf_ulp: TFC support flow scale query for Thor2 Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 43/47] net/bnxt: tf_ulp: update template files Sriharsha Basavapatna
2024-11-07 13:52 ` Sriharsha Basavapatna [this message]
2024-11-07 13:52 ` [PATCH v8 45/47] net/bnxt: tf_ulp: support a few feature extensions Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 46/47] net/bnxt: tf_ulp: update template files Sriharsha Basavapatna
2024-11-07 13:52 ` [PATCH v8 47/47] net/bnxt: tf_ulp: add stats cache for thor2 Sriharsha Basavapatna
2024-11-08  2:05 ` [PATCH v8 00/47] TruFlow update for Thor2 Sriharsha Basavapatna
2024-11-08  2:14   ` Ajit Khaparde
2024-11-12 11:00     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241107135254.1611676-45-sriharsha.basavapatna@broadcom.com \
    --to=sriharsha.basavapatna@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=kishore.padmanabha@broadcom.com \
    --cc=sbhosle@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).