From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6752A00BE; Fri, 12 Jun 2020 14:56:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 523711BE99; Fri, 12 Jun 2020 14:55:07 +0200 (CEST) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 3904A1B951 for ; Fri, 12 Jun 2020 14:55:04 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 0142C1BD712; Fri, 12 Jun 2020 05:55:03 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 0142C1BD712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1591966504; bh=c+rqHopEgsN23yZpZ1RyRltxJhks08X0OfiDdpF8gjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mXYC+b1IvMFpZMovkbI3EyRbvLJfatfJsp/jBqTlYuNDzpX+874cC9t+T4SJplsP0 TpNAgZj2+d/AHsXBF7M9fcI7/51zT0TToa0PqMW6DRS+zD3aqVxTQgz/dOKOhGqjWR yBWkwdv5F6aT1PebBTOk0TZikRoGzIwEDOwR8T18= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 12 Jun 2020 18:19:56 +0530 Message-Id: <20200612125024.15989-9-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20200612125024.15989-1-somnath.kotur@broadcom.com> References: <20200612125024.15989-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 08/36] net/bnxt: add support for computed header field in result opcode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kishore Padmanabha Added support for computed header fields in the result field processing. The computed header fields are fields that are extracted from header fields or derived from data that is not part of the flow command but shall be used in setting up of the flow rule. Signed-off-by: Kishore Padmanabha Reviewed-by: Somnath Kotur Signed-off-by: Somnath Kotur --- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 16 ++++++++++++++++ drivers/net/bnxt/tf_ulp/ulp_template_db.h | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index 437b055..1ede967 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -662,6 +662,22 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms, return -EINVAL; } break; + case BNXT_ULP_RESULT_OPC_SET_TO_COMP_HDR_FIELD: + if (!ulp_operand_read(fld->result_operand, + (uint8_t *)&idx, + sizeof(uint16_t))) { + BNXT_TF_DBG(ERR, "%s key operand read failed.\n", name); + return -EINVAL; + } + idx = tfp_be_to_cpu_16(idx); + if (idx < BNXT_ULP_CHF_IDX_LAST) + val = ulp_blob_push_32(blob, &parms->comp_fld[idx], + fld->field_bit_size); + if (!val) { + BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name); + return -EINVAL; + } + break; default: return -EINVAL; } diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_db.h index f86cc42..82df8de 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h @@ -214,7 +214,8 @@ enum bnxt_ulp_result_opc { BNXT_ULP_RESULT_OPC_SET_TO_ENCAP_ACT_PROP_SZ = 2, BNXT_ULP_RESULT_OPC_SET_TO_REGFILE = 3, BNXT_ULP_RESULT_OPC_SET_TO_DEF_REGFILE = 4, - BNXT_ULP_RESULT_OPC_LAST = 5 + BNXT_ULP_RESULT_OPC_SET_TO_COMP_HDR_FIELD = 5, + BNXT_ULP_RESULT_OPC_LAST = 6 }; enum bnxt_ulp_search_before_alloc { -- 2.7.4