DPDK patches and discussions
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH 11/14] net/bnxt: default egress rule changes
Date: Fri, 17 Jul 2020 19:44:48 +0530	[thread overview]
Message-ID: <20200717141451.11705-12-somnath.kotur@broadcom.com> (raw)
In-Reply-To: <20200717141451.11705-1-somnath.kotur@broadcom.com>

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

The default egress rule should include buffer descriptor  action
record only if the VF representor is enabled.

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/tf_ulp/bnxt_ulp.c             | 13 +++++++++++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h             |  9 +++++++++
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c        | 11 ++++++++++-
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h |  3 ++-
 4 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
index c4ce003..8e44027 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
@@ -361,6 +361,7 @@ ulp_ctx_init(struct bnxt *bp,
 	bp->ulp_ctx->cfg_data = ulp_data;
 	session->cfg_data = ulp_data;
 	ulp_data->ref_cnt++;
+	ulp_data->ulp_flags |= BNXT_ULP_VF_REP_ENABLED;
 
 	/* Open the ulp session. */
 	rc = ulp_ctx_session_open(bp, session);
@@ -1009,3 +1010,15 @@ bnxt_ulp_cntxt_ptr2_fc_info_get(struct bnxt_ulp_context *ulp_ctx)
 
 	return ulp_ctx->cfg_data->fc_info;
 }
+
+/* Function to get the ulp flags from the ulp context. */
+int32_t
+bnxt_ulp_cntxt_ptr2_ulp_flags_get(struct bnxt_ulp_context *ulp_ctx,
+				  uint32_t *flags)
+{
+	if (!ulp_ctx || !ulp_ctx->cfg_data)
+		return -1;
+
+	*flags =  ulp_ctx->cfg_data->ulp_flags;
+	return 0;
+}
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h
index a133284..f9e5e2b 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h
@@ -14,6 +14,10 @@
 
 #include "ulp_template_db_enum.h"
 
+/* defines for the ulp_flags */
+#define BNXT_ULP_VF_REP_ENABLED		0x1
+#define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
+
 struct bnxt_ulp_data {
 	uint32_t			tbl_scope_id;
 	struct bnxt_ulp_mark_tbl	*mark_tbl;
@@ -23,6 +27,7 @@ struct bnxt_ulp_data {
 	void				*mapper_data;
 	struct bnxt_ulp_port_db		*port_db;
 	struct bnxt_ulp_fc_info		*fc_info;
+	uint32_t			ulp_flags;
 	uint32_t			port_to_app_flow_id;
 	uint32_t			app_to_port_flow_id;
 	uint32_t			tx_cfa_action;
@@ -162,4 +167,8 @@ bnxt_ulp_cntxt_ptr2_fc_info_set(struct bnxt_ulp_context *ulp_ctx,
 struct bnxt_ulp_fc_info *
 bnxt_ulp_cntxt_ptr2_fc_info_get(struct bnxt_ulp_context *ulp_ctx);
 
+int32_t
+bnxt_ulp_cntxt_ptr2_ulp_flags_get(struct bnxt_ulp_context *ulp_ctx,
+				  uint32_t *flags);
+
 #endif /* _BNXT_ULP_H_ */
diff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
index b01ad0b..4d4f7c4 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
@@ -309,7 +309,7 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
 	struct ulp_rte_act_prop		act_prop;
 	struct ulp_rte_act_bitmap	act = { 0 };
 	struct bnxt_ulp_context		*ulp_ctx;
-	uint32_t type;
+	uint32_t type, ulp_flags = 0;
 	int rc;
 
 	memset(&mapper_params, 0, sizeof(mapper_params));
@@ -329,6 +329,15 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
 		return -EINVAL;
 	}
 
+	/* update the vf rep flag */
+	if (bnxt_ulp_cntxt_ptr2_ulp_flags_get(ulp_ctx, &ulp_flags)) {
+		BNXT_TF_DBG(ERR, "Error in getting ULP context flags\n");
+		return -EINVAL;
+	}
+	if (ULP_VF_REP_IS_ENABLED(ulp_flags))
+		ULP_COMP_FLD_IDX_WR(&mapper_params,
+				    BNXT_ULP_CF_IDX_VFR_MODE, 1);
+
 	type = param_list->type;
 	while (type != BNXT_ULP_DF_PARAM_TYPE_LAST) {
 		if (ulp_def_handler_tbl[type].vfr_func) {
diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h
index a9295e0..fbeb314 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h
@@ -134,7 +134,8 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_VF_TO_VF = 38,
 	BNXT_ULP_CF_IDX_L3_HDR_CNT = 39,
 	BNXT_ULP_CF_IDX_L4_HDR_CNT = 40,
-	BNXT_ULP_CF_IDX_LAST = 41
+	BNXT_ULP_CF_IDX_VFR_MODE = 41,
+	BNXT_ULP_CF_IDX_LAST = 42
 };
 
 enum bnxt_ulp_cond_opcode {
-- 
2.7.4


  parent reply	other threads:[~2020-07-17 14:22 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17  9:49 [dpdk-dev] [PATCH 00/14] bnxt patches Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 01/14] net/bnxt: changes to support new RM and multi-region Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 02/14] net/bnxt: initialize table scope rm parameters Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 03/14] net/bnxt: enable default flows in truflow mode Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 04/14] net/bnxt: fix to avoid accumulation of flow counters Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 05/14] net/bnxt: add protocol header info based on proto field data Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 06/14] net/bnxt: fix em message size Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 07/14] net/bnxt: replace NAT IPv4 action SRC/DEST Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 08/14] net/bnxt: clean up em message definition Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 09/14] net/bnxt: change header to SPDX-License Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 10/14] net/bnxt: fix dereference of a null pointer Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 11/14] net/bnxt: default egress rule changes Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 12/14] net/bnxt: update cfa truflow resource allocation numbers Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 13/14] net/bnxt: enable support for exact match templates Somnath Kotur
2020-07-17  9:49 ` [dpdk-dev] [PATCH 14/14] net/bnxt: add debug logs to the TF-ULP layer Somnath Kotur
2020-07-17 14:14 ` [dpdk-dev] [PATCH v2 00/14] bnxt patches Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 01/14] net/bnxt: changes to support new RM and multi-region Somnath Kotur
2020-07-17 14:34     ` Thomas Monjalon
2020-07-17 14:14   ` [dpdk-dev] [PATCH 02/14] net/bnxt: initialize table scope rm parameters Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 03/14] net/bnxt: enable default flows in truflow mode Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 04/14] net/bnxt: fix to avoid accumulation of flow counters Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 05/14] net/bnxt: add protocol header info based on proto field data Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 06/14] net/bnxt: fix em message size Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 07/14] net/bnxt: replace NAT IPv4 action SRC/DEST Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 08/14] net/bnxt: clean up em message definition Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 09/14] net/bnxt: change header to SPDX-License Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 10/14] net/bnxt: fix dereference of a null pointer Somnath Kotur
2020-07-17 14:14   ` Somnath Kotur [this message]
2020-07-17 14:14   ` [dpdk-dev] [PATCH 12/14] net/bnxt: update cfa truflow resource allocation numbers Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 13/14] net/bnxt: enable support for exact match templates Somnath Kotur
2020-07-17 14:14   ` [dpdk-dev] [PATCH 14/14] net/bnxt: remove unnecessary debug log Somnath Kotur
2020-07-18  7:25   ` [dpdk-dev] [PATCH v3 00/14] bnxt patches Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 01/14] net/bnxt: modify resource management scheme Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 02/14] net/bnxt: initialize table scope parameter Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 03/14] net/bnxt: enable default flows in truflow mode Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 04/14] net/bnxt: fix to avoid accumulation of flow counters Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 05/14] net/bnxt: add protocol header info based on proto field data Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 06/14] net/bnxt: fix exact match message size Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 07/14] net/bnxt: use NAT IPv4 action Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 08/14] net/bnxt: remove unused macro Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 09/14] net/bnxt: change header to use SPDX license Ajit Khaparde
2020-07-23  4:35       ` Stephen Hemminger
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 10/14] net/bnxt: fix dereference of a null pointer Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 11/14] net/bnxt: modify default egress rule for VF representor Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 12/14] net/bnxt: update truflow resource allocation numbers Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 13/14] net/bnxt: enable support for exact match templates Ajit Khaparde
2020-07-18  7:25     ` [dpdk-dev] [PATCH v3 14/14] net/bnxt: remove unnecessary debug log Ajit Khaparde
2020-07-20 15:02     ` [dpdk-dev] [PATCH v3 00/14] bnxt patches Ajit Khaparde

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=20200717141451.11705-12-somnath.kotur@broadcom.com \
    --to=somnath.kotur@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).