get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64253,
    "url": "http://patches.dpdk.org/api/patches/64253/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200107003735.96055-3-ajit.khaparde@broadcom.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20200107003735.96055-3-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200107003735.96055-3-ajit.khaparde@broadcom.com",
    "date": "2020-01-07T00:37:30",
    "name": "[v3,2/7] net/bnxt: fix to use first valid profile",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "769008a6b5812ba6a36215ee9162274cf732b4e3",
    "submitter": {
        "id": 501,
        "url": "http://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "http://patches.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200107003735.96055-3-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 7997,
            "url": "http://patches.dpdk.org/api/series/7997/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7997",
            "date": "2020-01-07T00:37:28",
            "name": "bnxt patchset",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/7997/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64253/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/64253/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.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 3DBC3A04F6;\n\tTue,  7 Jan 2020 01:38:20 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C7AC11D733;\n\tTue,  7 Jan 2020 01:37:50 +0100 (CET)",
            "from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com\n [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id A3BDA1D70F;\n Tue,  7 Jan 2020 01:37:41 +0100 (CET)",
            "from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net\n [10.75.242.48])\n by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 54A9830C2CC;\n Mon,  6 Jan 2020 16:31:49 -0800 (PST)",
            "from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net\n [10.69.74.102])\n by mail-irv-17.broadcom.com (Postfix) with ESMTP id 6DE6614008D;\n Mon,  6 Jan 2020 16:37:38 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 54A9830C2CC",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1578357109;\n bh=7Gexiwwk4EVT2C2p1+T20cKdwscqD+Ft2sDFPj7avMo=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=mc9ZJAM6ieC4vcF6i2R3peLtmlfbDM9Pnvp65EW20f+Bwxfx/oORTr4BTWaK8vBW/\n ja6AHXIkJ7Lm21pwmAhDfYFiOYGl59KNN4rU9waAxx9jB39hhKxpfeF/oQJYTUEQIy\n mDexXiqeQnGpSJs9Rx59a0NeYfHqZm7yiKluA30w=",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, Somnath Kotur <somnath.kotur@broadcom.com>,\n stable@dpdk.org",
        "Date": "Mon,  6 Jan 2020 16:37:30 -0800",
        "Message-Id": "<20200107003735.96055-3-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.21.0 (Apple Git-122.2)",
        "In-Reply-To": "<20200107003735.96055-1-ajit.khaparde@broadcom.com>",
        "References": "<20191221022937.54397-1-ajit.khaparde@broadcom.com>\n <20200107003735.96055-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 2/7] net/bnxt: fix to use first valid profile",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Somnath Kotur <somnath.kotur@broadcom.com>\n\nIn the case when CoS classification is disabled, driver was iterating\nlooking for only lossy profiles as that is what is expected to be used\nfor regular NIC operations. But in certain custom profiles, there were\nno lossy profiles configured, only lossless profiles instead.\nTo handle such cases, it is better to fallback to using the first valid\nprofile.\n\nFixes: 698aa7e95325 (\"net/bnxt: add code to determine the Tx COS queue\")\nCc: stable@dpdk.org\n\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c | 44 +++++++++++++++++++++++++++++-------\n drivers/net/bnxt/bnxt_hwrm.h |  3 +++\n 2 files changed, 39 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex d0dcd561c..bee4c154f 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -1210,6 +1210,35 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,\n \treturn rc;\n }\n \n+static bool bnxt_find_lossy_profile(struct bnxt *bp)\n+{\n+\tint i = 0;\n+\n+\tfor (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) {\n+\t\tif (bp->tx_cos_queue[i].profile ==\n+\t\t    HWRM_QUEUE_SERVICE_PROFILE_LOSSY) {\n+\t\t\tbp->tx_cosq_id[0] = bp->tx_cos_queue[i].id;\n+\t\t\treturn true;\n+\t\t}\n+\t}\n+\treturn false;\n+}\n+\n+static void bnxt_find_first_valid_profile(struct bnxt *bp)\n+{\n+\tint i = 0;\n+\n+\tfor (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) {\n+\t\tif (bp->tx_cos_queue[i].profile !=\n+\t\t    HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN &&\n+\t\t    bp->tx_cos_queue[i].id !=\n+\t\t    HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN) {\n+\t\t\tbp->tx_cosq_id[0] = bp->tx_cos_queue[i].id;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+}\n+\n int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)\n {\n \tint rc = 0;\n@@ -1269,14 +1298,13 @@ int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)\n \t\t\t\t\t\tbp->tx_cos_queue[i].id;\n \t\t\t}\n \t\t} else {\n-\t\t\tfor (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) {\n-\t\t\t\tif (bp->tx_cos_queue[i].profile ==\n-\t\t\t\t\tHWRM_QUEUE_SERVICE_PROFILE_LOSSY) {\n-\t\t\t\t\tbp->tx_cosq_id[0] =\n-\t\t\t\t\t\tbp->tx_cos_queue[i].id;\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t}\n+\t\t\t/* When CoS classification is disabled, for normal NIC\n+\t\t\t * operations, ideally we should look to use LOSSY.\n+\t\t\t * If not found, fallback to the first valid profile\n+\t\t\t */\n+\t\t\tif (!bnxt_find_lossy_profile(bp))\n+\t\t\t\tbnxt_find_first_valid_profile(bp);\n+\n \t\t}\n \t}\n \ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex abe5de9db..d8d1360f9 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -35,6 +35,9 @@ struct bnxt_cp_ring_info;\n #define HWRM_QUEUE_SERVICE_PROFILE_LOSSY \\\n \tHWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY\n \n+#define HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN \\\n+\tHWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN\n+\n #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MINIMAL_STATIC \\\n \tHWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC\n #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MAXIMAL \\\n",
    "prefixes": [
        "v3",
        "2/7"
    ]
}