Show a patch.

GET /api/patches/74723/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 74723,
    "url": "https://patches.dpdk.org/api/patches/74723/",
    "web_url": "https://patches.dpdk.org/patch/74723/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<20200724053235.71069-14-ajit.khaparde@broadcom.com>",
    "date": "2020-07-24T05:32:26",
    "name": "[v3,13/22] net/bnxt: modify ulp mapper to use tbl search",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4a41ca75ac42a33c2c0e847407adac086d8e8cec",
    "submitter": {
        "id": 501,
        "url": "https://patches.dpdk.org/api/people/501/",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74723/mbox/",
    "series": [
        {
            "id": 11269,
            "url": "https://patches.dpdk.org/api/series/11269/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11269",
            "date": "2020-07-24T05:32:13",
            "name": "bnxt patches",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/11269/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74723/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74723/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Gm-Message-State": "AOAM5308kq6TKjSERYmFLomtunjEUVkR22eh0S4t2VS3ofyQJsuRJmLe\n lAGjTyT8T2lghcoCEUWYaX4f4qyr2UmNCqWO0Bm7K6M7b4PmRekUJkE6PIraoYuAUBpC3+CRo3v\n DK/n2bDkl1cTZS6JNSqvZZXvhituGMfx95COAkKW5MAEeyvJOHQ6PerByFeeSX02CE6SqruonMn\n mvhQ==",
        "X-Google-Smtp-Source": "\n ABdhPJxMFxubaxmxPgb9mSa8MwqPPs7JVBWV3EXN1V0uyxPOHPSc92vrKWwp6aYw2NLOtBEMZZyzXtW8U4KH",
        "List-Post": "<mailto:dev@dpdk.org>",
        "MIME-Version": "1.0",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200723115639.22357-1-somnath.kotur@broadcom.com>\n <20200724053235.71069-1-ajit.khaparde@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH v3 13/22] net/bnxt: modify ulp mapper to use tbl\n\tsearch",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BCCE7A0518;\n\tFri, 24 Jul 2020 07:35:15 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 030401C117;\n\tFri, 24 Jul 2020 07:33:48 +0200 (CEST)",
            "from mail-vs1-f97.google.com (mail-vs1-f97.google.com\n [209.85.217.97]) by dpdk.org (Postfix) with ESMTP id 309C71C112\n for <dev@dpdk.org>; Fri, 24 Jul 2020 07:33:35 +0200 (CEST)",
            "by mail-vs1-f97.google.com with SMTP id j186so4279080vsd.10\n for <dev@dpdk.org>; Thu, 23 Jul 2020 22:33:35 -0700 (PDT)",
            "from localhost.localdomain ([192.19.223.252])\n by smtp-relay.gmail.com with ESMTPS id h17sm592840vsk.0.2020.07.23.22.33.31\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 23 Jul 2020 22:33:34 -0700 (PDT)"
        ],
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=+8dpsFxwDYL4XhU+luIFm63o0JK5x98RGzdl1Cs2+1I=;\n b=kxVWSo9uCMBV+NsykxqXUlFSzVUIjgKZMPcY/bAs7a0gvJmGNYzdiPLicTBcZHViY1\n KY0oVKR1GhFSbPhfp2mXjLCKxZQ0s+lUQxHq56NbwIOT4sUm7utnqXseR3bsSH7zCbE+\n voGjY4Ph6Bv+GhQJCDmiTpiPR6OYno85hnUwic0R9L7w87IuOkQhmki6UbtlF5RRAAE0\n EcF6WqScYDJZAiTbmC+rXFIFnYvWcRWvyWyj1MpVhIqh1SrIvD2dWYKUglf2Kb5Vi3Q4\n qM0+EFtcxQIQCCIkozdrzQ4VFHajxcHIHy3n05NLhZENNYI9/1E1Q/5UukEZKxm+6Q0b\n +hww==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=+8dpsFxwDYL4XhU+luIFm63o0JK5x98RGzdl1Cs2+1I=;\n b=cMia10JsVMBWdt1TjcZPGA8VbC8MtJM6qd145EXGtyZkHs/rRUYcVQfpOTyJivv62a\n Htygf9M9NfDUV9JJQqTJfm2lNJAW9D+auLHsaPp3wQSzUvoWVE3/5dGZzfPqgzwXDuuh\n Kor2RNV+JBsNY5k3d6xEFmPBVyCrnSEUAgDW4=",
        "Date": "Thu, 23 Jul 2020 22:32:26 -0700",
        "Content-Transfer-Encoding": "8bit",
        "X-Received": "by 2002:a67:eac5:: with SMTP id s5mr6678603vso.216.1595568814422;\n Thu, 23 Jul 2020 22:33:34 -0700 (PDT)",
        "To": "dev@dpdk.org",
        "X-Relaying-Domain": "broadcom.com",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "In-Reply-To": "<20200724053235.71069-1-ajit.khaparde@broadcom.com>",
        "Cc": "ferruh.yigit@intel.com, Mike Baucom <michael.baucom@broadcom.com>,\n Kishore Padmanabha <kishore.padmanabha@broadcom.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200724053235.71069-14-ajit.khaparde@broadcom.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "From: Mike Baucom <michael.baucom@broadcom.com>\n\nmodified ulp mappper to use the new tf_search_tbl_entry API.\nWhen search before allocation is requested, mapper calls\ntc_search_tbl_entry with the alloc flag.\n\n- On HIT, the result and table index is returned.\n- On MISS, the table index is returned but the result is\ncreated and the table entry is set.\n- On REJECT, the flow request is rejected.\n\nSigned-off-by: Mike Baucom <michael.baucom@broadcom.com>\nReviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_mapper.c | 75 +++++++++++++++++++---------\n 1 file changed, 51 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\nindex a071c0750..4dee65971 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c\n@@ -1764,9 +1764,10 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tstruct ulp_blob\tdata;\n \tuint64_t idx = 0;\n \tuint16_t tmplen;\n-\tuint32_t i, num_flds;\n+\tuint32_t i, num_flds, index, hit;\n \tint32_t rc = 0, trc = 0;\n \tstruct tf_alloc_tbl_entry_parms\taparms = { 0 };\n+\tstruct tf_search_tbl_entry_parms srchparms = { 0 };\n \tstruct tf_set_tbl_entry_parms\tsparms = { 0 };\n \tstruct tf_free_tbl_entry_parms\tfree_parms = { 0 };\n \tuint32_t tbl_scope_id;\n@@ -1868,33 +1869,59 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t\treturn 0; /* success */\n \t}\n \n+\tindex = 0;\n+\thit = 0;\n \t/* Perform the tf table allocation by filling the alloc params */\n-\taparms.dir\t\t= tbl->direction;\n-\taparms.type\t\t= tbl->resource_type;\n-\taparms.search_enable\t= tbl->srch_b4_alloc;\n-\taparms.result\t\t= ulp_blob_data_get(&data, &tmplen);\n-\taparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n-\taparms.tbl_scope_id\t= tbl_scope_id;\n-\n-\t/* All failures after the alloc succeeds require a free */\n-\trc = tf_alloc_tbl_entry(tfp, &aparms);\n-\tif (rc) {\n-\t\tBNXT_TF_DBG(ERR, \"Alloc table[%d][%s] failed rc=%d\\n\",\n-\t\t\t    aparms.type,\n-\t\t\t    (aparms.dir == TF_DIR_RX) ? \"RX\" : \"TX\",\n-\t\t\t    rc);\n-\t\treturn rc;\n-\t}\n+\tif (tbl->srch_b4_alloc) {\n+\t\tmemset(&srchparms, 0, sizeof(srchparms));\n+\t\tsrchparms.dir = tbl->direction;\n+\t\tsrchparms.type = tbl->resource_type;\n+\t\tsrchparms.alloc\t= 1;\n+\t\tsrchparms.result = ulp_blob_data_get(&data, &tmplen);\n+\t\tsrchparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n+\t\tsrchparms.tbl_scope_id = tbl_scope_id;\n+\t\trc = tf_search_tbl_entry(tfp, &srchparms);\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Alloc table[%s][%s] failed rc=%d\\n\",\n+\t\t\t\t    tf_tbl_type_2_str(tbl->resource_type),\n+\t\t\t\t    tf_dir_2_str(tbl->direction), rc);\n+\t\t\treturn rc;\n+\t\t}\n+\t\tif (srchparms.search_status == REJECT) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Alloc table[%s][%s] rejected.\\n\",\n+\t\t\t\t    tf_tbl_type_2_str(tbl->resource_type),\n+\t\t\t\t    tf_dir_2_str(tbl->direction));\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+\t\tindex = srchparms.idx;\n+\t\thit = srchparms.hit;\n+\t} else {\n+\t\taparms.dir\t\t= tbl->direction;\n+\t\taparms.type\t\t= tbl->resource_type;\n+\t\taparms.search_enable\t= tbl->srch_b4_alloc;\n+\t\taparms.result\t\t= ulp_blob_data_get(&data, &tmplen);\n+\t\taparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n+\t\taparms.tbl_scope_id\t= tbl_scope_id;\n \n+\t\t/* All failures after the alloc succeeds require a free */\n+\t\trc = tf_alloc_tbl_entry(tfp, &aparms);\n+\t\tif (rc) {\n+\t\t\tBNXT_TF_DBG(ERR, \"Alloc table[%s][%s] failed rc=%d\\n\",\n+\t\t\t\t    tf_tbl_type_2_str(tbl->resource_type),\n+\t\t\t\t    tf_dir_2_str(tbl->direction), rc);\n+\t\t\treturn rc;\n+\t\t}\n+\t\tindex = aparms.idx;\n+\t}\n \t/*\n \t * calculate the idx for the result record, for external EM the offset\n \t * needs to be shifted accordingly. If external non-inline table types\n \t * are used then need to revisit this logic.\n \t */\n-\tif (aparms.type == TF_TBL_TYPE_EXT)\n-\t\tidx = TF_ACT_REC_OFFSET_2_PTR(aparms.idx);\n+\tif (tbl->resource_type == TF_TBL_TYPE_EXT)\n+\t\tidx = TF_ACT_REC_OFFSET_2_PTR(index);\n \telse\n-\t\tidx = aparms.idx;\n+\t\tidx = index;\n \n \t/* Always storing values in Regfile in BE */\n \tidx = tfp_cpu_to_be_64(idx);\n@@ -1908,12 +1935,12 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t}\n \n \t/* Perform the tf table set by filling the set params */\n-\tif (!tbl->srch_b4_alloc || !aparms.hit) {\n+\tif (!tbl->srch_b4_alloc || !hit) {\n \t\tsparms.dir\t\t= tbl->direction;\n \t\tsparms.type\t\t= tbl->resource_type;\n \t\tsparms.data\t\t= ulp_blob_data_get(&data, &tmplen);\n \t\tsparms.data_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);\n-\t\tsparms.idx\t\t= aparms.idx;\n+\t\tsparms.idx\t\t= index;\n \t\tsparms.tbl_scope_id\t= tbl_scope_id;\n \n \t\trc = tf_set_tbl_entry(tfp, &sparms);\n@@ -1933,7 +1960,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \tfid_parms.resource_func\t= tbl->resource_func;\n \tfid_parms.resource_type\t= tbl->resource_type;\n \tfid_parms.resource_sub_type = tbl->resource_sub_type;\n-\tfid_parms.resource_hndl\t= aparms.idx;\n+\tfid_parms.resource_hndl\t= index;\n \tfid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;\n \n \trc = ulp_flow_db_resource_add(parms->ulp_ctx,\n@@ -1960,7 +1987,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,\n \t */\n \tfree_parms.dir\t= tbl->direction;\n \tfree_parms.type\t= tbl->resource_type;\n-\tfree_parms.idx\t= aparms.idx;\n+\tfree_parms.idx\t= index;\n \tfree_parms.tbl_scope_id = tbl_scope_id;\n \n \ttrc = tf_free_tbl_entry(tfp, &free_parms);\n",
    "prefixes": [
        "v3",
        "13/22"
    ]
}