get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77969,
    "url": "http://patches.dpdk.org/api/patches/77969/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200917053035.1889989-10-mk@semihalf.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": "<20200917053035.1889989-10-mk@semihalf.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200917053035.1889989-10-mk@semihalf.com",
    "date": "2020-09-17T05:30:24",
    "name": "[09/20] net/ena/base: split RSS function and hash getters",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "1a7202efa15daf825a3818c90d5d33bef2331095",
    "submitter": {
        "id": 786,
        "url": "http://patches.dpdk.org/api/people/786/?format=api",
        "name": "Michal Krawczyk",
        "email": "mk@semihalf.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/20200917053035.1889989-10-mk@semihalf.com/mbox/",
    "series": [
        {
            "id": 12298,
            "url": "http://patches.dpdk.org/api/series/12298/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12298",
            "date": "2020-09-17T05:30:15",
            "name": "Upgrade HAL and add ENI metrics support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12298/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77969/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/77969/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 00045A04B6;\n\tThu, 17 Sep 2020 07:32:13 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D46EA1D569;\n\tThu, 17 Sep 2020 07:31:06 +0200 (CEST)",
            "from mail-lf1-f53.google.com (mail-lf1-f53.google.com\n [209.85.167.53]) by dpdk.org (Postfix) with ESMTP id D45ED1D559\n for <dev@dpdk.org>; Thu, 17 Sep 2020 07:31:01 +0200 (CEST)",
            "by mail-lf1-f53.google.com with SMTP id z19so779646lfr.4\n for <dev@dpdk.org>; Wed, 16 Sep 2020 22:31:01 -0700 (PDT)",
            "from mkPC.semihalf.local (193-106-246-138.noc.fibertech.net.pl.\n [193.106.246.138])\n by smtp.gmail.com with ESMTPSA id j3sm5033686lfb.185.2020.09.16.22.30.59\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 16 Sep 2020 22:31:00 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=semihalf-com.20150623.gappssmtp.com; s=20150623;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=bfUlrcp2N1NI8HoziMKy7pnA6K0CJi1FC33JD3KhABE=;\n b=RcdbytBoiGEvFs28shv1WG2k3s8igxVePwteo9JXwlwCUSIxlSRyFV/PqXciRSsmYL\n IR+p6V6oELByAZfrn7QN2G99J4Rx5Ynlb7lTGVsFIoydd8yMy0TrMCG9eVWdK26+xiWp\n qijrP5/3AoxbQu15wOGJJnWi9JPeGlXZUDhicRSPLVDlaxTF9W5x2vbXIgn38Ps4ZbK2\n lDnbIMhhHHdfCPB6MKjBjvX77uOAYbRgttRrNjgr2qJ1qpXGcFFTZK8WOUItGsPvzcQb\n QtBMmM4jTyTj4NCv/kSQavCnse/5mxa7InwKa0PWeUucbgwYlzxhy0Jn1OPXoY/RTxxp\n 6WIw==",
        "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=bfUlrcp2N1NI8HoziMKy7pnA6K0CJi1FC33JD3KhABE=;\n b=rJ8tqFizuUhGd0cg8BD/rOM2rc847KLzwWSWObIQsxbTeiTnn0uDuV7V7aSKtKGg8w\n XB23QDAGZ/upXZAyPhKDfdnwBCPtiNrOkJp5T62HvbHGkq7ALrc0R/oW9Gpkc34uolOn\n NSk50w7dkRBV4EZZCoQgwlRgqzMKVR/cE/QrNkArESY58NBCiYXvekDSCDzne7MeCwUe\n L/egEmQQS00E9ml2/8Zi9pAkFsmI6MqQpJT0ZAeYFPggx3n0AxUJRyYPu/PxnT1mBKpz\n ZRjq1+Eh2ekAhtdi16Gr29d7988Eew0NP9bi3DMBBqDHZyJrxqAp5VkRDj/120gDLaXQ\n LCEA==",
        "X-Gm-Message-State": "AOAM530gVaqphe8Ppu9GdI9PoititeNXoVQFwK0zLd+ccitlcje8as9i\n sSDyOQlcza+Cxex8PlCdtTCV1PTXeTtM2NKD",
        "X-Google-Smtp-Source": "\n ABdhPJzb7zKSBD37Q1fHG0/1ARJfzJVWzjAYyuhLq218y3eTvrXZ2TcOZ3uoOQ0Nbc/bN9uUvppwZA==",
        "X-Received": "by 2002:ac2:5298:: with SMTP id q24mr8551477lfm.164.1600320661143;\n Wed, 16 Sep 2020 22:31:01 -0700 (PDT)",
        "From": "Michal Krawczyk <mk@semihalf.com>",
        "To": "dev@dpdk.org",
        "Cc": "gtzalik@amazon.com, igorch@amazon.com, Michal Krawczyk <mk@semihalf.com>,\n Marcin Wojtas <mw@semihalf.com>, Evgeny Schemeilin <evgenys@amazon.com>",
        "Date": "Thu, 17 Sep 2020 07:30:24 +0200",
        "Message-Id": "<20200917053035.1889989-10-mk@semihalf.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200917053035.1889989-1-mk@semihalf.com>",
        "References": "<20200917053035.1889989-1-mk@semihalf.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 09/20] net/ena/base: split RSS function and hash\n\tgetters",
        "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": "There is no need to keep single function for both hash function and\nthe key. If the caller want's to get only single value, then it had to\npass NULL as one of the values, making the API harder to use.\n\nExcept reading functions from the device, one can also use function\nena_com_get_current_hash_function() to get the integer value, which\nis represeting current hash function stored in the ena_com layer.\n\nSigned-off-by: Michal Krawczyk <mk@semihalf.com>\nReviewed-by: Igor Chauskin <igorch@amazon.com>\nReviewed-by: Guy Tzalik <gtzalik@amazon.com>\n---\n drivers/net/ena/base/ena_com.c | 26 +++++++++++++++++++-------\n drivers/net/ena/base/ena_com.h | 31 ++++++++++++++++++++++++-------\n 2 files changed, 43 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c\nindex 1463f5f1d4..bf1de09c5c 100644\n--- a/drivers/net/ena/base/ena_com.c\n+++ b/drivers/net/ena/base/ena_com.c\n@@ -1062,6 +1062,11 @@ static int ena_com_get_feature(struct ena_com_dev *ena_dev,\n \t\t\t\t      feature_ver);\n }\n \n+int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev)\n+{\n+\treturn ena_dev->rss.hash_func;\n+}\n+\n static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev)\n {\n \tstruct ena_admin_feature_rss_flow_hash_control *hash_key =\n@@ -2408,15 +2413,15 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena_dev,\n }\n \n int ena_com_get_hash_function(struct ena_com_dev *ena_dev,\n-\t\t\t      enum ena_admin_hash_functions *func,\n-\t\t\t      u8 *key)\n+\t\t\t      enum ena_admin_hash_functions *func)\n {\n \tstruct ena_rss *rss = &ena_dev->rss;\n \tstruct ena_admin_get_feat_resp get_resp;\n-\tstruct ena_admin_feature_rss_flow_hash_control *hash_key =\n-\t\trss->hash_key;\n \tint rc;\n \n+\tif (unlikely(!func))\n+\t\treturn ENA_COM_INVAL;\n+\n \trc = ena_com_get_feature_ex(ena_dev, &get_resp,\n \t\t\t\t    ENA_ADMIN_RSS_HASH_FUNCTION,\n \t\t\t\t    rss->hash_key_dma_addr,\n@@ -2424,13 +2429,20 @@ int ena_com_get_hash_function(struct ena_com_dev *ena_dev,\n \tif (unlikely(rc))\n \t\treturn rc;\n \n-\t/* ENA_FFS returns 1 in case the lsb is set */\n+\t/* ENA_FFS() returns 1 in case the lsb is set */\n \trss->hash_func = ENA_FFS(get_resp.u.flow_hash_func.selected_func);\n \tif (rss->hash_func)\n \t\trss->hash_func--;\n \n-\tif (func)\n-\t\t*func = rss->hash_func;\n+\t*func = rss->hash_func;\n+\n+\treturn 0;\n+}\n+\n+int ena_com_get_hash_key(struct ena_com_dev *ena_dev, u8 *key)\n+{\n+\tstruct ena_admin_feature_rss_flow_hash_control *hash_key =\n+\t\tena_dev->rss.hash_key;\n \n \tif (key)\n \t\tmemcpy(key, hash_key->key, (size_t)(hash_key->keys_num) << 2);\ndiff --git a/drivers/net/ena/base/ena_com.h b/drivers/net/ena/base/ena_com.h\nindex 751bfcdd7e..ba367b4ca0 100644\n--- a/drivers/net/ena/base/ena_com.h\n+++ b/drivers/net/ena/base/ena_com.h\n@@ -645,6 +645,14 @@ int ena_com_rss_init(struct ena_com_dev *ena_dev, u16 log_size);\n  */\n void ena_com_rss_destroy(struct ena_com_dev *ena_dev);\n \n+/* ena_com_get_current_hash_function - Get RSS hash function\n+ * @ena_dev: ENA communication layer struct\n+ *\n+ * Return the current hash function.\n+ * @return: 0 or one of the ena_admin_hash_functions values.\n+ */\n+int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev);\n+\n /* ena_com_fill_hash_function - Fill RSS hash function\n  * @ena_dev: ENA communication layer struct\n  * @func: The hash function (Toeplitz or crc)\n@@ -676,23 +684,32 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena_dev,\n  */\n int ena_com_set_hash_function(struct ena_com_dev *ena_dev);\n \n-/* ena_com_get_hash_function - Retrieve the hash function and the hash key\n- * from the device.\n+/* ena_com_get_hash_function - Retrieve the hash function from the device.\n  * @ena_dev: ENA communication layer struct\n  * @func: hash function\n- * @key: hash key\n  *\n- * Retrieve the hash function and the hash key from the device.\n+ * Retrieve the hash function from the device.\n  *\n- * @note: If the caller called ena_com_fill_hash_function but didn't flash\n+ * @note: If the caller called ena_com_fill_hash_function but didn't flush\n  * it to the device, the new configuration will be lost.\n  *\n  * @return: 0 on Success and negative value otherwise.\n  */\n int ena_com_get_hash_function(struct ena_com_dev *ena_dev,\n-\t\t\t      enum ena_admin_hash_functions *func,\n-\t\t\t      u8 *key);\n+\t\t\t      enum ena_admin_hash_functions *func);\n \n+/* ena_com_get_hash_key - Retrieve the hash key\n+ * @ena_dev: ENA communication layer struct\n+ * @key: hash key\n+ *\n+ * Retrieve the hash key.\n+ *\n+ * @note: If the caller called ena_com_fill_hash_key but didn't flush\n+ * it to the device, the new configuration will be lost.\n+ *\n+ * @return: 0 on Success and negative value otherwise.\n+ */\n+int ena_com_get_hash_key(struct ena_com_dev *ena_dev, u8 *key);\n /* ena_com_fill_hash_ctrl - Fill RSS hash control\n  * @ena_dev: ENA communication layer struct.\n  * @proto: The protocol to configure.\n",
    "prefixes": [
        "09/20"
    ]
}