From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B67FA0C43; Sat, 31 Jul 2021 06:49:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 894FE4067E; Sat, 31 Jul 2021 06:49:08 +0200 (CEST) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id C002740042 for ; Sat, 31 Jul 2021 06:49:07 +0200 (CEST) Received: by mail-pj1-f41.google.com with SMTP id m10-20020a17090a34cab0290176b52c60ddso17260287pjf.4 for ; Fri, 30 Jul 2021 21:49:07 -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:mime-version; bh=H3LJCe4SVZHVrRp4SHbw5kPbYHIEte7tAJ4krGbwiYU=; b=DLv8kdW+ayzqsJ+/FcOkXtOyOeeLWmJncXKdqivKwaVvdEAySW7L7pVIO62BpkVj0o +reRbF/+eESyJmItd/Zlmx1r/8VCDCpFCkPsinQLb3uzwfWHzkDnIufWwxfuo34fKEcY StReBSOOIaM6Z+hrgdRObh/AgwYxwFS4GSeuQ= 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:mime-version; bh=H3LJCe4SVZHVrRp4SHbw5kPbYHIEte7tAJ4krGbwiYU=; b=lRy1ARn1ofg5A4NJdufH8hMd51RIF7RMkMSqX6prhT2Z90AtWH7xnDT2OtuPct401f gtS9eUL6//hCTJpU+qpx8/6lPOihLzvAxRZfpUT+Mexia4CJ7O+PLAinJE9I/8uvgjp3 TLSZMg4GTEyrYNV+2s03Z4JfmeciqUPKKHd0rCJ0Cv6Ifbq36Zl0kGyx/G9QrCrjW3cx Ad4AXnGQYSATRYlzypzdBfPX8y9lRgIrXo5y/wkwkE9nH1/qzd8zAKewIt38GV3vbeVN Q12Jp/7tAqczQTlyn5KXX+6FhqMF5bizY3GcYsO2fbfoK+iFZDATGYWylV5cJhzqRyXx WLBQ== X-Gm-Message-State: AOAM531qu18GPPrB+iii0+N0dt8SVIzOv04/QvK1jNpcHhHer69CMWQf TQA+h14tmU9G5ksYjPkWHxPmYnNySyuLBthn9gG+64IeUQ8t6UeUzcN+g1iqSpMv5VCa1Tv2OWN TvpQbzPI99EMJAMBN4DP7EnsePdpZMwMzYNI2CJK68AxqLc/McYsH9DSQLzrp1lU= X-Google-Smtp-Source: ABdhPJwH2vTmR9JdW76ZWVFQvuEY1RSYUg2ELPY0pkOmPn8VSbkApMNLOhDqtqwrDrs9Z90RG7QHnA== X-Received: by 2002:a17:90a:c506:: with SMTP id k6mr6600452pjt.198.1627706946482; Fri, 30 Jul 2021 21:49:06 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id v10sm3805157pjd.29.2021.07.30.21.49.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jul 2021 21:49:05 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: stable@dpdk.org, Shuanglin Wang Date: Fri, 30 Jul 2021 21:48:55 -0700 Message-Id: <20210731044855.46991-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000005fe2ff05c8640ed1" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH] net/bnxt: fix incorrect action record calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" --0000000000005fe2ff05c8640ed1 Content-Transfer-Encoding: 8bit For Thor, the number of action records is being wrongly configured to 128 because of incorrect definition of divider. This results in an incorrect number of action records being negotiated with the FW. Remove the divider from the templates and delete the logic which uses the field in the resource manager logic. Fixes: 3fe124d2536c ("net/bnxt: support Thor platform") Cc: stable@dpdk.org Tested-by: Shuanglin Wang Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/tf_core/tf_device_p58.h | 14 ------------ drivers/net/bnxt/tf_core/tf_rm.c | 22 ------------------- .../generic_templates/ulp_template_db_tbl.c | 2 +- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/drivers/net/bnxt/tf_core/tf_device_p58.h b/drivers/net/bnxt/tf_core/tf_device_p58.h index b5e2598cb6..66b0f4e983 100644 --- a/drivers/net/bnxt/tf_core/tf_device_p58.h +++ b/drivers/net/bnxt/tf_core/tf_device_p58.h @@ -84,42 +84,36 @@ struct tf_rm_element_cfg tf_tbl_p58[TF_TBL_TYPE_MAX] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_PARENT, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_1, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_COMPACT_ACT_RECORD] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_FULL_ACT_RECORD, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_1, .slices = 1, - .divider = 8, }, /* Policy - Encaps in bank 2 */ [TF_TBL_TYPE_ACT_ENCAP_8B] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_PARENT, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_ACT_ENCAP_16B] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_ACT_ENCAP_8B, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_ACT_ENCAP_32B] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_ACT_ENCAP_8B, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_ACT_ENCAP_64B] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_ACT_ENCAP_8B, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2, .slices = 1, - .divider = 8, }, /* Policy - Modify in bank 2 with Encaps */ [TF_TBL_TYPE_ACT_MODIFY_8B] = { @@ -127,56 +121,48 @@ struct tf_rm_element_cfg tf_tbl_p58[TF_TBL_TYPE_MAX] = { .parent_subtype = TF_TBL_TYPE_ACT_ENCAP_8B, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_ACT_MODIFY_16B] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_ACT_ENCAP_8B, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_ACT_MODIFY_32B] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_ACT_ENCAP_8B, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_ACT_MODIFY_64B] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_ACT_ENCAP_8B, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2, .slices = 1, - .divider = 8, }, /* Policy - SP in bank 0 */ [TF_TBL_TYPE_ACT_SP_SMAC] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_PARENT, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_ACT_SP_SMAC_IPV4] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_ACT_SP_SMAC, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0, .slices = 1, - .divider = 8, }, [TF_TBL_TYPE_ACT_SP_SMAC_IPV6] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_CHILD, .parent_subtype = TF_TBL_TYPE_ACT_SP_SMAC, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0, .slices = 1, - .divider = 8, }, /* Policy - Stats in bank 3 */ [TF_TBL_TYPE_ACT_STATS_64] = { .cfg_type = TF_RM_ELEM_CFG_HCAPI_BA_PARENT, .hcapi_type = CFA_RESOURCE_TYPE_P58_SRAM_BANK_3, .slices = 1, - .divider = 8, }, }; diff --git a/drivers/net/bnxt/tf_core/tf_rm.c b/drivers/net/bnxt/tf_core/tf_rm.c index dcfba24b2c..0a46e2a343 100644 --- a/drivers/net/bnxt/tf_core/tf_rm.c +++ b/drivers/net/bnxt/tf_core/tf_rm.c @@ -624,17 +624,6 @@ tf_rm_create_db(struct tf *tfp, /* Only allocate BA pool if a BA type not a child */ if (cfg->cfg_type == TF_RM_ELEM_CFG_HCAPI_BA || cfg->cfg_type == TF_RM_ELEM_CFG_HCAPI_BA_PARENT) { - if (cfg->divider) { - resv[j].stride = - resv[j].stride / cfg->divider; - if (resv[j].stride <= 0) { - TFP_DRV_LOG(ERR, - "%s:Divide fails:%d:%s\n", - tf_dir_2_str(parms->dir), - cfg->hcapi_type, type_str); - goto fail; - } - } /* Create pool */ pool_size = (BITALLOC_SIZEOF(resv[j].stride) / sizeof(struct bitalloc)); @@ -868,17 +857,6 @@ tf_rm_create_db_no_reservation(struct tf *tfp, /* Only allocate BA pool if a BA type not a child */ if (cfg->cfg_type == TF_RM_ELEM_CFG_HCAPI_BA || cfg->cfg_type == TF_RM_ELEM_CFG_HCAPI_BA_PARENT) { - if (cfg->divider) { - resv[j].stride = - resv[j].stride / cfg->divider; - if (resv[j].stride <= 0) { - TFP_DRV_LOG(ERR, - "%s:Divide fails:%d:%s\n", - tf_dir_2_str(parms->dir), - cfg->hcapi_type, type_str); - goto fail; - } - } /* Create pool */ pool_size = (BITALLOC_SIZEOF(resv[j].stride) / sizeof(struct bitalloc)); diff --git a/drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c b/drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c index 7951de8a4e..2debaea0ca 100644 --- a/drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c +++ b/drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c @@ -1450,7 +1450,7 @@ struct bnxt_ulp_resource_resv_info ulp_resource_resv_list[] = { .direction = TF_DIR_RX, .resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE, .resource_type = TF_TBL_TYPE_FULL_ACT_RECORD, - .count = 1024 + .count = 2048 }, { .app_id = 0, -- 2.21.1 (Apple Git-122.3) --0000000000005fe2ff05c8640ed1--