From patchwork Tue Jul 28 06:34:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 74902 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2BF9A0521; Tue, 28 Jul 2020 08:35:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58C171C0DB; Tue, 28 Jul 2020 08:34:58 +0200 (CEST) Received: from mail-wr1-f98.google.com (mail-wr1-f98.google.com [209.85.221.98]) by dpdk.org (Postfix) with ESMTP id 3D1281C0CE for ; Tue, 28 Jul 2020 08:34:54 +0200 (CEST) Received: by mail-wr1-f98.google.com with SMTP id b6so17078598wrs.11 for ; Mon, 27 Jul 2020 23:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yPlw7zKCs9xZnX0EY+Ul1xd9z8rV6ANE1DUYZEBLr44=; b=aQY91r3g+RlezrjxZqYBys98H9DgHwcdhLA6+GhsbAziuTkxhzr2MUlEGiO03HKHia c3kw1UW8tYvfE83dkIdKIdv5qU2NNdCjIIpYLgysidAjorSqlQkGEsahzkayuU7Ygatr Aveli/5Uui6t3hnVQZc36F51fKjAR8J9ha5Rw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yPlw7zKCs9xZnX0EY+Ul1xd9z8rV6ANE1DUYZEBLr44=; b=ODZwid0DDspZv5yFUSg+nM+XHroPr1+cUO4yRgQ1vX2+9BHXOYTWEHEvnTdVSYAIvy 9JkSXbsumqGIdYsF9B0ixVES2rvkdd/4FVaWSesCF3AlMmBkae1HOV6CH1QJ10I0m3/O u56rxKn/1h8fIJ5M1YwlU9wHxOJ6kChzDH+D4up65xbsfbmGJ5uNVtMTjiTiOxIhnm3I YG5TTUw8NrkJtssRhjA6KW0w71MGuXzxggRzyx63Bl1AftdspPb17g8dewLAZKgOhLDF Y+h4tvfh0U4SBetSG/ifRtCQ9u3MXAwjxg0gZH+if7ev29gCUphZkcNybPaop9fKTF5y Swig== X-Gm-Message-State: AOAM532rgt3zRAvsKVbFQjK58+k5EvukpumpbLsGFCwSwjOVR9xZ8l4L fDy05s/7wJYJvdg4exvOTJdAjpx8vOxdn+zLMKBHCN03wM53r9dsDVgJrby2d67mgBqtkpd+pnT e2ZirH/d5djhdpixgZEZRalrUo//bQ+pK5eFJfe5S4PoS8mRZhonAjl8U7emuMO4/AyFYwA8++I /lCw== X-Google-Smtp-Source: ABdhPJywiB/jOKkmelin0M5wwzl9DDOkpyZn5BJDj1Q0yur0LVnpwlv6qDIaDQkxaiHiMVg/whmlk8LldBWB X-Received: by 2002:a5d:484d:: with SMTP id n13mr23798613wrs.297.1595918093550; Mon, 27 Jul 2020 23:34:53 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp-relay.gmail.com with ESMTPS id r16sm30828wmh.29.2020.07.27.23.34.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2020 23:34:53 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kishore Padmanabha , Michael Baucom Date: Mon, 27 Jul 2020 23:34:20 -0700 Message-Id: <20200728063439.23114-4-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200728063439.23114-1-ajit.khaparde@broadcom.com> References: <20200728063439.23114-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 03/22] net/bnxt: configure parif for offload miss rules 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 PARIF is handler to a partition of the physical port. For the offload miss rules, the parif miss path needs to be considered. The higher parif are reserved for handling this. Signed-off-by: Kishore Padmanabha Reviewed-by: Michael Baucom Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 4 +-- drivers/net/bnxt/tf_ulp/ulp_port_db.h | 1 + drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 40 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c index 4d4f7c4ea..d86e4c9ae 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c +++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c @@ -12,8 +12,6 @@ #include "ulp_flow_db.h" #include "ulp_mapper.h" -#define BNXT_ULP_FREE_PARIF_BASE 11 - struct bnxt_ulp_def_param_handler { int32_t (*vfr_func)(struct bnxt_ulp_context *ulp_ctx, struct ulp_tlv_param *param, @@ -85,6 +83,8 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx, if (parif_type == BNXT_ULP_PHY_PORT_PARIF) { idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF; + /* Parif needs to be reset to a free partition */ + parif += BNXT_ULP_FREE_PARIF_BASE; } else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) { idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF; /* Parif needs to be reset to a free partition */ diff --git a/drivers/net/bnxt/tf_ulp/ulp_port_db.h b/drivers/net/bnxt/tf_ulp/ulp_port_db.h index 393d01b7c..2b323d168 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_port_db.h +++ b/drivers/net/bnxt/tf_ulp/ulp_port_db.h @@ -10,6 +10,7 @@ #define BNXT_PORT_DB_MAX_INTF_LIST 256 #define BNXT_PORT_DB_MAX_FUNC 2048 +#define BNXT_ULP_FREE_PARIF_BASE 11 enum bnxt_ulp_svif_type { BNXT_ULP_DRV_FUNC_SVIF = 0, diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c index 3891bcdc1..39f801b2f 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c @@ -158,6 +158,43 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[], return BNXT_TF_RC_SUCCESS; } +/* + * Function to handle the post processing of the computed + * fields for the interface. + */ +static void +bnxt_ulp_comp_fld_intf_update(struct ulp_rte_parser_params *params) +{ + uint32_t ifindex; + uint16_t port_id, parif; + enum bnxt_ulp_direction_type dir; + + /* get the direction details */ + dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION); + + if (dir == BNXT_ULP_DIR_INGRESS) { + /* read the port id details */ + port_id = ULP_COMP_FLD_IDX_RD(params, + BNXT_ULP_CF_IDX_INCOMING_IF); + if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx, + port_id, + &ifindex)) { + BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n"); + return; + } + /* Set port PARIF */ + if (ulp_port_db_parif_get(params->ulp_ctx, ifindex, + BNXT_ULP_PHY_PORT_PARIF, &parif)) { + BNXT_TF_DBG(ERR, "ParseErr:ifindex is not valid\n"); + return; + } + /* Parif needs to be reset to a free partition */ + parif += BNXT_ULP_FREE_PARIF_BASE; + ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_PHY_PORT_PARIF, + parif); + } +} + /* * Function to handle the post processing of the parsing details */ @@ -213,6 +250,9 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params) /* Merge the hdr_fp_bit into the proto header bit */ params->hdr_bitmap.bits |= params->hdr_fp_bit.bits; + /* Update the computed interface parameters */ + bnxt_ulp_comp_fld_intf_update(params); + /* TBD: Handle the flow rejection scenarios */ return 0; }