From patchwork Sat Jul 18 07:25:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 74412 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 36AE1A052A; Sat, 18 Jul 2020 09:27:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 11FE61C026; Sat, 18 Jul 2020 09:25:51 +0200 (CEST) Received: from mail-wr1-f97.google.com (mail-wr1-f97.google.com [209.85.221.97]) by dpdk.org (Postfix) with ESMTP id 4FBB31BFFF for ; Sat, 18 Jul 2020 09:25:46 +0200 (CEST) Received: by mail-wr1-f97.google.com with SMTP id z15so13255004wrl.8 for ; Sat, 18 Jul 2020 00:25:46 -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=Ln0u85c5DrxLoxFEqqc+r4C5kyTmKxRmqKHOtfxYcMQ=; b=Dj0n7f1refBzlopXIQt+jaWxXm7H+Vk04HD2UcNaErstfNudw5geVF0NuACjYYeU8i 8/pWJh3z/gdMO+kgojWMBf/LE4jzx8BxLEZHO/6u/iXIxMM4P9cc7C0qgehJot1wa2Jc d4Xg1qsocilPXVUCUVR7eyrrlGhfy8ouIW4XQ= 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=Ln0u85c5DrxLoxFEqqc+r4C5kyTmKxRmqKHOtfxYcMQ=; b=GfgfX87wH8HhNsZuLl6r9FObE0ahW7HGXYmjZZ6a5faBVaMLGXY2pTijtJmzMGAKa5 u19kPXrI10TI0airMRmJsmgWcack9hYVRbR0VUfH1PjR5Vd0VFaeAC0fcCMeG+7tMiyU cRmqXLy3rZj2pRdNIFB9mvnuMxbTOqYo3MnsGVyQjU9vr/IcgXF5r19Zn8Gcz3Zr8EkG jVbisWK5qNRwuPTcwvBrmKjLus9Ru/XQkKds3QhqzAthMtbQZDR8+GjC4mqprbHvdQ2A ctn/LCNXn0seSWUqCOZAgpsMll+7Oqu+nHFM53NnvY9ia+lBQdZKugfesDagjgLMsbco AWnA== X-Gm-Message-State: AOAM532t5H+nXXGVlHoy0iPGknLCe7gqsqyooREJRAFw85//EkoRDkrR 8EJNdDdJNxg5LtRajtWzk+7J9gZN2xzDacT7y5XHHCsrm5vTuz/LkOkEycnSPpA0ZEmVTG5FzET UzWZQs5Fm1a9mJ5IdvXbe+SRYistGU76/A6QaWMtfEKnco2qxf80VriGUYE4jq5wnYmFA5YLF73 wNSA== X-Google-Smtp-Source: ABdhPJwtDnnJnZkpcArhekXvrNNlnbGYEc0CMKoVpP36kchkWKbtiw+wbQE/+giyRWST8tY8UlS0sjlvxiTZ X-Received: by 2002:a5d:4a01:: with SMTP id m1mr13378146wrq.250.1595057145843; Sat, 18 Jul 2020 00:25:45 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp-relay.gmail.com with ESMTPS id g14sm34554wrb.16.2020.07.18.00.25.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jul 2020 00:25:45 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Ajit Khaparde To: dev@dpdk.org Cc: Kishore Padmanabha , Somnath Kotur , Michael Baucom Date: Sat, 18 Jul 2020 00:25:12 -0700 Message-Id: <20200718072515.62969-12-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200718072515.62969-1-ajit.khaparde@broadcom.com> References: <20200717141451.11705-1-somnath.kotur@broadcom.com> <20200718072515.62969-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 11/14] net/bnxt: modify default egress rule for VF representor 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 The default egress rule should include buffer descriptor action record only if the VF representor is enabled. Signed-off-by: Kishore Padmanabha Signed-off-by: Somnath Kotur Reviewed-by: Michael Baucom Reviewed-by: Ajit Khaparde --- 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 c4ce00329..8e44027d4 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 a13328426..f9e5e2ba6 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 b01ad0b68..4d4f7c4ea 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 a9295e006..fbeb31465 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 {