get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77620,
    "url": "http://patches.dpdk.org/api/patches/77620/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/4742db7f675112f5233bbc9e8a3e48fb1c90865d.1600093192.git.cloud.wangxiaoyun@huawei.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": "<4742db7f675112f5233bbc9e8a3e48fb1c90865d.1600093192.git.cloud.wangxiaoyun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/4742db7f675112f5233bbc9e8a3e48fb1c90865d.1600093192.git.cloud.wangxiaoyun@huawei.com",
    "date": "2020-09-14T14:31:45",
    "name": "[v1,4/5] net/hinic/base: get default cos from chip",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "24c9c08b0a5797845eb217a09ad93af31559ea1f",
    "submitter": {
        "id": 1446,
        "url": "http://patches.dpdk.org/api/people/1446/?format=api",
        "name": "Wangxiaoyun (Cloud)",
        "email": "cloud.wangxiaoyun@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/4742db7f675112f5233bbc9e8a3e48fb1c90865d.1600093192.git.cloud.wangxiaoyun@huawei.com/mbox/",
    "series": [
        {
            "id": 12199,
            "url": "http://patches.dpdk.org/api/series/12199/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12199",
            "date": "2020-09-14T14:31:41",
            "name": "some bugs fix",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12199/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77620/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77620/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 AB7F8A04C7;\n\tMon, 14 Sep 2020 16:31:36 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A0E7F1C0CE;\n\tMon, 14 Sep 2020 16:31:11 +0200 (CEST)",
            "from huawei.com (szxga06-in.huawei.com [45.249.212.32])\n by dpdk.org (Postfix) with ESMTP id B25051BE98;\n Mon, 14 Sep 2020 16:31:03 +0200 (CEST)",
            "from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58])\n by Forcepoint Email with ESMTP id CDD1CF67B9AB339F1297;\n Mon, 14 Sep 2020 22:31:02 +0800 (CST)",
            "from tester.localdomain (10.175.119.39) by\n DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id\n 14.3.487.0; Mon, 14 Sep 2020 22:30:55 +0800"
        ],
        "From": "Xiaoyun wang <cloud.wangxiaoyun@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <stable@dpdk.org>, <luoxingyu@huawei.com>,\n <yin.yinshi@huawei.com>, <luoxianjun@huawei.com>, <zhouguoyang@huawei.com>,\n <david.yangxiaoliang@huawei.com>, <zhaohui8@huawei.com>,\n <guojian365@huawei.com>, Xiaoyun wang <cloud.wangxiaoyun@huawei.com>",
        "Date": "Mon, 14 Sep 2020 22:31:45 +0800",
        "Message-ID": "\n <4742db7f675112f5233bbc9e8a3e48fb1c90865d.1600093192.git.cloud.wangxiaoyun@huawei.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<cover.1600093192.git.cloud.wangxiaoyun@huawei.com>",
        "References": "<cover.1600093192.git.cloud.wangxiaoyun@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.175.119.39]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v1 4/5] net/hinic/base: get default cos from chip",
        "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": "Get default cos of pf driver from chip configuration file.\n\nFixes: 6691acef0d3d (\"net/hinic: support VF\")\nCc: stable@dpdk.org\nSigned-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>\n---\n drivers/net/hinic/base/hinic_pmd_cfg.c |  7 ++++--\n drivers/net/hinic/base/hinic_pmd_cfg.h |  1 +\n drivers/net/hinic/hinic_pmd_ethdev.c   | 39 ++++++++++++++++++++++++++++------\n 3 files changed, 39 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/hinic/base/hinic_pmd_cfg.c b/drivers/net/hinic/base/hinic_pmd_cfg.c\nindex a0cc16d..837734f 100644\n--- a/drivers/net/hinic/base/hinic_pmd_cfg.c\n+++ b/drivers/net/hinic/base/hinic_pmd_cfg.c\n@@ -112,6 +112,7 @@ static void hinic_parse_pub_res_cap(struct service_cap *cap,\n \tcap->host_id = dev_cap->host_id;\n \tcap->ep_id = dev_cap->ep_id;\n \tcap->max_cos_id = dev_cap->max_cos_id;\n+\tcap->valid_cos_bitmap = dev_cap->valid_cos_bitmap;\n \tcap->er_id = dev_cap->er_id;\n \tcap->port_id = dev_cap->port_id;\n \n@@ -134,9 +135,11 @@ static void hinic_parse_pub_res_cap(struct service_cap *cap,\n \tcap->host_oq_id_mask_val = dev_cap->host_oq_id_mask_val;\n \n \tPMD_DRV_LOG(INFO, \"Get public resource capability:\");\n-\tPMD_DRV_LOG(INFO, \"host_id: 0x%x, ep_id: 0x%x, intr_type: 0x%x, max_cos_id: 0x%x, er_id: 0x%x, port_id: 0x%x\",\n+\tPMD_DRV_LOG(INFO, \"host_id: 0x%x, ep_id: 0x%x, intr_type: 0x%x, \"\n+\t\t    \"max_cos_id: 0x%x, cos_bitmap: 0x%x, er_id: 0x%x, port_id: 0x%x\",\n \t\t    cap->host_id, cap->ep_id, cap->intr_chip_en,\n-\t\t    cap->max_cos_id, cap->er_id, cap->port_id);\n+\t\t    cap->max_cos_id, cap->valid_cos_bitmap, cap->er_id,\n+\t\t    cap->port_id);\n \tPMD_DRV_LOG(INFO, \"host_total_function: 0x%x, host_oq_id_mask_val: 0x%x, max_vf: 0x%x\",\n \t\t    cap->host_total_function, cap->host_oq_id_mask_val,\n \t\t    cap->max_vf);\ndiff --git a/drivers/net/hinic/base/hinic_pmd_cfg.h b/drivers/net/hinic/base/hinic_pmd_cfg.h\nindex 1741ca4..6e76e1d 100644\n--- a/drivers/net/hinic/base/hinic_pmd_cfg.h\n+++ b/drivers/net/hinic/base/hinic_pmd_cfg.h\n@@ -54,6 +54,7 @@ struct service_cap {\n \tu8 ep_id;\n \tu8 intr_chip_en;\n \tu8 max_cos_id;\t/* PF/VF's max cos id */\n+\tu8 valid_cos_bitmap;\n \tu8 er_id;\t/* PF/VF's ER */\n \tu8 port_id;\t/* PF/VF's physical port */\n \tu8 max_vf;\t/* max VF number that PF supported */\ndiff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c\nindex b2c8a51..6fd16e6 100644\n--- a/drivers/net/hinic/hinic_pmd_ethdev.c\n+++ b/drivers/net/hinic/hinic_pmd_ethdev.c\n@@ -2583,26 +2583,53 @@ static int hinic_set_default_dcb_feature(struct hinic_nic_dev *nic_dev)\n \t\t\t\t\tup_pgid, up_bw, up_strict);\n }\n \n+static int hinic_pf_get_default_cos(struct hinic_hwdev *hwdev, u8 *cos_id)\n+{\n+\tu8 default_cos = 0;\n+\tu8 valid_cos_bitmap;\n+\tu8 i;\n+\n+\tvalid_cos_bitmap = hwdev->cfg_mgmt->svc_cap.valid_cos_bitmap;\n+\tif (!valid_cos_bitmap) {\n+\t\tPMD_DRV_LOG(ERR, \"PF has none cos to support\\n\");\n+\t\treturn -EFAULT;\n+\t}\n+\n+\tfor (i = 0; i < NR_MAX_COS; i++) {\n+\t\tif (valid_cos_bitmap & BIT(i))\n+\t\t\tdefault_cos = i; /* Find max cos id as default cos */\n+\t}\n+\n+\t*cos_id = default_cos;\n+\n+\treturn 0;\n+}\n+\n static int hinic_init_default_cos(struct hinic_nic_dev *nic_dev)\n {\n \tu8 cos_id = 0;\n \tint err;\n \n \tif (!HINIC_IS_VF(nic_dev->hwdev)) {\n-\t\tnic_dev->default_cos =\n-\t\t\t\t(hinic_global_func_id(nic_dev->hwdev) +\n-\t\t\t\t\t\tDEFAULT_BASE_COS) % NR_MAX_COS;\n+\t\terr = hinic_pf_get_default_cos(nic_dev->hwdev, &cos_id);\n+\t\tif (err) {\n+\t\t\tPMD_DRV_LOG(ERR, \"Get PF default cos failed, err: %d\",\n+\t\t\t\t    err);\n+\t\t\treturn HINIC_ERROR;\n+\t\t}\n \t} else {\n \t\terr = hinic_vf_get_default_cos(nic_dev->hwdev, &cos_id);\n \t\tif (err) {\n \t\t\tPMD_DRV_LOG(ERR, \"Get VF default cos failed, err: %d\",\n-\t\t\t\t\terr);\n+\t\t\t\t    err);\n \t\t\treturn HINIC_ERROR;\n \t\t}\n-\n-\t\tnic_dev->default_cos = cos_id;\n \t}\n \n+\tnic_dev->default_cos = cos_id;\n+\n+\tPMD_DRV_LOG(INFO, \"Default cos %d\", nic_dev->default_cos);\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "v1",
        "4/5"
    ]
}