From: Somnath Kotur <somnath.kotur@broadcom.com> To: dev@dpdk.org Cc: ferruh.yigit@intel.com Subject: [dpdk-dev] [PATCH 10/10] net/bnxt: add support for decrement TTL action Date: Wed, 15 Jul 2020 19:20:38 +0530 Message-ID: <20200715135038.16662-11-somnath.kotur@broadcom.com> (raw) In-Reply-To: <20200715135038.16662-1-somnath.kotur@broadcom.com> From: Kishore Padmanabha <kishore.padmanabha@broadcom.com> Added support for decrement TTL action. 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/ulp_rte_parser.c | 30 +++++++++++++++++++++++++++ drivers/net/bnxt/tf_ulp/ulp_rte_parser.h | 5 +++++ drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 4 ++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c index 68e59c4..4c1221a 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c @@ -189,6 +189,26 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params) match_port_type == BNXT_ULP_INTF_TYPE_VF_REP) ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_VF_TO_VF, 1); + /* Update the decrement ttl computational fields */ + if (ULP_BITMAP_ISSET(params->act_bitmap.bits, + BNXT_ULP_ACTION_BIT_DEC_TTL)) { + /* + * Check that vxlan proto is included and vxlan decap + * action is not set then decrement tunnel ttl. + * Similarly add GRE and NVGRE in future. + */ + if ((ULP_BITMAP_ISSET(params->hdr_bitmap.bits, + BNXT_ULP_HDR_BIT_T_VXLAN) && + !ULP_BITMAP_ISSET(params->act_bitmap.bits, + BNXT_ULP_ACTION_BIT_VXLAN_DECAP))) { + ULP_COMP_FLD_IDX_WR(params, + BNXT_ULP_CF_IDX_ACT_T_DEC_TTL, 1); + } else { + ULP_COMP_FLD_IDX_WR(params, + BNXT_ULP_CF_IDX_ACT_DEC_TTL, 1); + } + } + /* TBD: Handle the flow rejection scenarios */ return 0; } @@ -1814,3 +1834,13 @@ ulp_rte_set_tp_dst_act_handler(const struct rte_flow_action *action_item, BNXT_TF_DBG(ERR, "Parse Error: set tp src arg is invalid\n"); return BNXT_TF_RC_ERROR; } + +/* Function to handle the parsing of RTE Flow action dec ttl.*/ +int32_t +ulp_rte_dec_ttl_act_handler(const struct rte_flow_action *act __rte_unused, + struct ulp_rte_parser_params *params) +{ + /* Update the act_bitmap with dec ttl */ + ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_DEC_TTL); + return BNXT_TF_RC_SUCCESS; +} diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h index e155250..7b6b57e 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h @@ -216,4 +216,9 @@ int32_t ulp_rte_set_tp_dst_act_handler(const struct rte_flow_action *action_item, struct ulp_rte_parser_params *params); +/* Function to handle the parsing of RTE Flow action dec ttl.*/ +int32_t +ulp_rte_dec_ttl_act_handler(const struct rte_flow_action *action_item, + struct ulp_rte_parser_params *params); + #endif /* _ULP_RTE_PARSER_H_ */ diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c b/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c index 5847e58..9a27cbf 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c @@ -259,8 +259,8 @@ struct bnxt_ulp_rte_act_info ulp_act_info[] = { .proto_act_func = NULL }, [RTE_FLOW_ACTION_TYPE_DEC_TTL] = { - .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED, - .proto_act_func = NULL + .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED, + .proto_act_func = ulp_rte_dec_ttl_act_handler }, [RTE_FLOW_ACTION_TYPE_SET_TTL] = { .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED, -- 2.7.4
next prev parent reply other threads:[~2020-07-15 13:57 UTC|newest] Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-13 6:15 [dpdk-dev] [PATCH 00/10] bnxt patches Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 01/10] net/bnxt: add option to delay EEM sysmem mapping Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 02/10] net/bnxt: implement TF Identifier search Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 03/10] net/bnxt: check index range in bulk get Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 04/10] net/bnxt: add changes to support 2 table scopes Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 05/10] net/bnxt: add support to extract data from the ulp blob Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 06/10] net/bnxt: ignore ipv4 tos mask Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 07/10] net/bnxt: add support for identifier search and ref count Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 08/10] net/bnxt: consider vlan fields for the template match criteria Somnath Kotur 2020-07-13 6:15 ` [dpdk-dev] [PATCH 09/10] net/bnxt: increase the number of egress flow entries Somnath Kotur 2020-07-13 6:16 ` [dpdk-dev] [PATCH 10/10] net/bnxt: add support for decrement ttl action Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH v3 00/10] bnxt patches Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 01/10] net/bnxt: add option to delay EEM sysmem mapping Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 02/10] net/bnxt: implement TF Identifier search Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 03/10] net/bnxt: check index range in bulk get Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 04/10] net/bnxt: add changes to support 2 table scopes Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 05/10] net/bnxt: add support to extract data from the ulp blob Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 06/10] net/bnxt: ignore ipv4 TOS mask Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 07/10] net/bnxt: add support for identifier search and ref count Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 08/10] net/bnxt: consider VLAN fields for template match criteria Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 09/10] net/bnxt: increase the number of egress flow entries Somnath Kotur 2020-07-13 9:42 ` [dpdk-dev] [PATCH 10/10] net/bnxt: add support for decrement TTL action Somnath Kotur 2020-07-14 22:36 ` [dpdk-dev] [PATCH v3 00/10] bnxt patches Ajit Khaparde 2020-07-15 12:50 ` Ferruh Yigit 2020-07-15 13:50 ` [dpdk-dev] [PATCH v4 " Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 01/10] net/bnxt: add option to delay EEM sysmem mapping Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 02/10] net/bnxt: implement TF Identifier search Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 03/10] net/bnxt: check index range in bulk get Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 04/10] net/bnxt: add changes to support 2 table scopes Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 05/10] net/bnxt: add support to extract data from the ulp blob Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 06/10] net/bnxt: ignore ipv4 TOS mask Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 07/10] net/bnxt: add support for identifier search and ref count Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 08/10] net/bnxt: consider VLAN fields for template match criteria Somnath Kotur 2020-07-15 13:50 ` [dpdk-dev] [PATCH 09/10] net/bnxt: increase the number of egress flow entries Somnath Kotur 2020-07-15 13:50 ` Somnath Kotur [this message] 2020-07-16 23:04 ` [dpdk-dev] [PATCH v4 00/10] bnxt patches Ajit Khaparde 2020-07-13 6:28 [dpdk-dev] [v2 PATCH " Somnath Kotur 2020-07-13 6:28 ` [dpdk-dev] [PATCH 10/10] net/bnxt: add support for decrement ttl action Somnath Kotur
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=20200715135038.16662-11-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
DPDK patches and discussions This inbox may be cloned and mirrored by anyone: git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \ dev@dpdk.org public-inbox-index dev Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.dev AGPL code for this site: git clone https://public-inbox.org/public-inbox.git