get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77398,
    "url": "http://patches.dpdk.org/api/patches/77398/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200911131954.15999-12-qi.z.zhang@intel.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": "<20200911131954.15999-12-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200911131954.15999-12-qi.z.zhang@intel.com",
    "date": "2020-09-11T13:19:25",
    "name": "[v2,11/40] net/ice/base: introduce and use bitmap hamming weight API",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "445847749e5592c5366d30cbd42521d0f56b69db",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200911131954.15999-12-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 12148,
            "url": "http://patches.dpdk.org/api/series/12148/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12148",
            "date": "2020-09-11T13:19:15",
            "name": "ice base code update",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/12148/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77398/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77398/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 1708AA04B7;\n\tFri, 11 Sep 2020 15:18:10 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 13E8B1C19C;\n\tFri, 11 Sep 2020 15:16:23 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id E396A1C114\n for <dev@dpdk.org>; Fri, 11 Sep 2020 15:16:16 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Sep 2020 06:16:16 -0700",
            "from dpdk51.sh.intel.com ([10.67.111.82])\n by FMSMGA003.fm.intel.com with ESMTP; 11 Sep 2020 06:16:15 -0700"
        ],
        "IronPort-SDR": [
            "\n uwBK/YH8zb56QFlsl02yeExQadWi80E4gtpIjkwfoOSGjc9iGEbeDWsXqbPjO6ao5F6wKDUXfr\n 8vp888gaG/zA==",
            "\n AA4B6Xg+1ZsiVJIGv3oLAn+EpgjhEDOAZM0+HzKQ1GR/xo8GZ4kgsg0EKxSqUeNqrpCwNzjOFZ\n wNxUpI8IWXaQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9740\"; a=\"146482185\"",
            "E=Sophos;i=\"5.76,415,1592895600\"; d=\"scan'208\";a=\"146482185\"",
            "E=Sophos;i=\"5.76,415,1592895600\"; d=\"scan'208\";a=\"342296535\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "ferruh.yigit@intel.com",
        "Cc": "dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n Bruce Allan <bruce.w.allan@intel.com>",
        "Date": "Fri, 11 Sep 2020 21:19:25 +0800",
        "Message-Id": "<20200911131954.15999-12-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20200911131954.15999-1-qi.z.zhang@intel.com>",
        "References": "<20200907112826.48493-1-qi.z.zhang@intel.com>\n <20200911131954.15999-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 11/40] net/ice/base: introduce and use bitmap\n\thamming weight API",
        "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": "Introduce ice_bitmap_hweight() and use it instead of open-coding that\nfunctionality.\n\nSigned-off-by: Bruce Allan <bruce.w.allan@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nAcked-by: Qiming Yang <qiming.yang@intel.com>\n---\n drivers/net/ice/base/ice_bitops.h | 23 +++++++++++++++++++++++\n drivers/net/ice/base/ice_switch.c | 11 +----------\n 2 files changed, 24 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_bitops.h b/drivers/net/ice/base/ice_bitops.h\nindex 8352b5dd7..a56d55455 100644\n--- a/drivers/net/ice/base/ice_bitops.h\n+++ b/drivers/net/ice/base/ice_bitops.h\n@@ -395,6 +395,29 @@ ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits)\n }\n \n /**\n+ * ice_bitmap_hweight - hamming weight of bitmap\n+ * @bm: bitmap pointer\n+ * @size: size of bitmap (in bits)\n+ *\n+ * This function determines the number of set bits in a bitmap.\n+ * Note that this function assumes it is operating on a bitmap declared using\n+ * ice_declare_bitmap.\n+ */\n+static inline int\n+ice_bitmap_hweight(ice_bitmap_t *bm, u16 size)\n+{\n+\tint count = 0;\n+\tu16 bit = 0;\n+\n+\twhile (size > (bit = ice_find_next_bit(bm, size, bit))) {\n+\t\tcount++;\n+\t\tbit++;\n+\t}\n+\n+\treturn count;\n+}\n+\n+/**\n  * ice_cmp_bitmaps - compares two bitmaps.\n  * @bmp1: the bitmap to compare\n  * @bmp2: the bitmap to compare with bmp1\ndiff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex 41ebfedc6..ecb411714 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -5932,7 +5932,6 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,\n \tice_declare_bitmap(possible_idx, ICE_MAX_FV_WORDS);\n \tice_declare_bitmap(recipes, ICE_MAX_NUM_RECIPES);\n \tice_declare_bitmap(used_idx, ICE_MAX_FV_WORDS);\n-\tu16 count = 0;\n \tu16 bit;\n \n \tice_zero_bitmap(possible_idx, ICE_MAX_FV_WORDS);\n@@ -5971,15 +5970,7 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,\n \tice_xor_bitmap(free_idx, used_idx, possible_idx, ICE_MAX_FV_WORDS);\n \n \t/* return number of free indexes */\n-\tcount = 0;\n-\tbit = 0;\n-\twhile (ICE_MAX_FV_WORDS >\n-\t       (bit = ice_find_next_bit(free_idx, ICE_MAX_FV_WORDS, bit))) {\n-\t\tcount++;\n-\t\tbit++;\n-\t}\n-\n-\treturn count;\n+\treturn (u16)ice_bitmap_hweight(free_idx, ICE_MAX_FV_WORDS);\n }\n \n /**\n",
    "prefixes": [
        "v2",
        "11/40"
    ]
}