get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92506,
    "url": "https://patches.dpdk.org/api/patches/92506/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210430125725.28796-18-mk@semihalf.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210430125725.28796-18-mk@semihalf.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210430125725.28796-18-mk@semihalf.com",
    "date": "2021-04-30T12:57:20",
    "name": "[17/22] net/ena: support SMP for mz alloc counter",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cea387ae58ac79eefabbccd90c1aa8126057df93",
    "submitter": {
        "id": 786,
        "url": "https://patches.dpdk.org/api/people/786/?format=api",
        "name": "Michal Krawczyk",
        "email": "mk@semihalf.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210430125725.28796-18-mk@semihalf.com/mbox/",
    "series": [
        {
            "id": 16774,
            "url": "https://patches.dpdk.org/api/series/16774/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16774",
            "date": "2021-04-30T12:57:03",
            "name": "net/ena: update ENA PMD to v2.3.0",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/16774/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/92506/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/92506/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id EC536A0546;\n\tFri, 30 Apr 2021 14:59:25 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B74674132C;\n\tFri, 30 Apr 2021 14:58:06 +0200 (CEST)",
            "from mail-wr1-f50.google.com (mail-wr1-f50.google.com\n [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id E2376412A1\n for <dev@dpdk.org>; Fri, 30 Apr 2021 14:57:59 +0200 (CEST)",
            "by mail-wr1-f50.google.com with SMTP id l14so637838wrx.5\n for <dev@dpdk.org>; Fri, 30 Apr 2021 05:57:59 -0700 (PDT)",
            "from DESKTOP-U5LNN3J.localdomain (89-79-189-199.dynamic.chello.pl.\n [89.79.189.199])\n by smtp.gmail.com with ESMTPSA id l13sm13476245wmj.3.2021.04.30.05.57.58\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 30 Apr 2021 05:57:58 -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=EFjw7JZyl9lLkDheCmLMVq7RDLMhODbQjNctlLB7nuU=;\n b=Oj1t1lzKQXTt8s695rRzn+rmZq37lm1J9lGhOT4/rPhRBL3c8mOpZxlXmu1IOyiUiV\n wpvTv2aHpiL7EO0Nv56Z/IGqYnq8Po3VWKlYBdVWFlwAWrtSaERi4vGxB8jJwsHP/TPh\n ZNgf2U5TyeXB5R01nvTPqEvFxMHM98eucbM2D5d9RlW64hPhjeQcHSLJBVhuq9Gx+9JG\n HJxV05HM1n6NYCg2CKiHExPHExquqfbhgpCFJRh/i7PiTp2yJYRBRJc6N0BNjOZbzNOY\n 5jyMpqv2H/IzD2JzSSW0Kt3vVJyWZG1t094wnNQwY0K4ukgkUvQ3q59I4Q5QWU6XWFUo\n Y/oQ==",
        "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=EFjw7JZyl9lLkDheCmLMVq7RDLMhODbQjNctlLB7nuU=;\n b=f8LxD/n6yuFBG2qvFwAfT9JwvJ+N0EC73ldp1xO9jotRuvr+CGAoAh0icOpfASSWbd\n 8iElsetKnWLqhSSgQlqp0pGAjDL24yV7m7A4rKpiVMdUPlHvdu2N5s1zEEBQNEkG7rRH\n /7l1lv8cft9hahdDrytIgvFUkMCkIlBR2KWHStUY5mz1job/LM0Bylq5Qlh2NYZl3Qvp\n jbRws0J65SCiG8Kx9gEWCvpPBqF3+Yw36zLa+IyCc+H47R8xX9hJ66feTsEi4/2DHIlc\n 2n2eGMoG65ERUZJqRJiJ7XIP+UKB7ul5aL8T0hXo826huQvjBQ5tGDzZqz7N/IG66JLk\n iD2A==",
        "X-Gm-Message-State": "AOAM531nEDvgnVcIQPNhgY+nqZnWGkGkkW7++4hNIBKnOr7QagmuCS0M\n aYpk8p9+lYnSsMZzIFcP5Ra0wCqqmHySOdc/",
        "X-Google-Smtp-Source": "\n ABdhPJyTCf/rwALJnwgjZeD5YUvyBjOuyqrAiosMT8T0JUo/68QTcUsRro3U7MSio/pUb7dTWqu/bA==",
        "X-Received": "by 2002:a05:6000:1012:: with SMTP id\n a18mr604399wrx.68.1619787479329;\n Fri, 30 Apr 2021 05:57:59 -0700 (PDT)",
        "From": "Michal Krawczyk <mk@semihalf.com>",
        "To": "dev@dpdk.org",
        "Cc": "ndagan@amazom.com, gtzalik@amazon.com, igorch@amazon.com, mw@semihalf.com,\n Stanislaw Kardach <kda@semihalf.com>, Michal Krawczyk <mk@semihalf.com>,\n Shay Agroskin <shayagr@amazon.com>",
        "Date": "Fri, 30 Apr 2021 14:57:20 +0200",
        "Message-Id": "<20210430125725.28796-18-mk@semihalf.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210430125725.28796-1-mk@semihalf.com>",
        "References": "<20210430125725.28796-1-mk@semihalf.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 17/22] net/ena: support SMP for mz alloc counter",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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: Stanislaw Kardach <kda@semihalf.com>\n\nIntroduce a memory area for ENA driver shared between all the processes\nof a same prefix (memzone backed).\nMove the memzone allocation counter for ENA_MEM_ALLOC_COHERENT there so\nthat all processes may utilize it.\n\nSigned-off-by: Stanislaw Kardach <kda@semihalf.com>\nReviewed-by: Michal Krawczyk <mk@semihalf.com>\nReviewed-by: Igor Chauskin <igorch@amazon.com>\nReviewed-by: Shay Agroskin <shayagr@amazon.com>\n---\n drivers/net/ena/base/ena_plat_dpdk.h |  6 ++--\n drivers/net/ena/ena_ethdev.c         | 46 +++++++++++++++++++++++++++-\n drivers/net/ena/ena_ethdev.h         |  8 +++++\n 3 files changed, 56 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h\nindex 2e2cd0736c..1282c05f59 100644\n--- a/drivers/net/ena/base/ena_plat_dpdk.h\n+++ b/drivers/net/ena/base/ena_plat_dpdk.h\n@@ -206,7 +206,7 @@ typedef struct {\n  * Each rte_memzone should have unique name.\n  * To satisfy it, count number of allocations and add it to name.\n  */\n-extern rte_atomic64_t ena_alloc_cnt;\n+extern rte_atomic64_t *ena_alloc_cnt;\n \n #define ENA_MEM_ALLOC_COHERENT_ALIGNED(\t\t\t\t\t       \\\n \tdmadev, size, virt, phys, mem_handle, alignment)\t\t       \\\n@@ -216,7 +216,7 @@ extern rte_atomic64_t ena_alloc_cnt;\n \t\tif (size > 0) {\t\t\t\t\t\t       \\\n \t\t\tchar z_name[RTE_MEMZONE_NAMESIZE];\t\t       \\\n \t\t\tsnprintf(z_name, sizeof(z_name), \"ena_alloc_%\"PRIi64\"\",\\\n-\t\t\t\trte_atomic64_add_return(&ena_alloc_cnt,\t1));   \\\n+\t\t\t\trte_atomic64_add_return(ena_alloc_cnt, 1));    \\\n \t\t\tmz = rte_memzone_reserve_aligned(z_name, size,\t       \\\n \t\t\t\t\tSOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG,\\\n \t\t\t\t\talignment);\t\t\t       \\\n@@ -246,7 +246,7 @@ extern rte_atomic64_t ena_alloc_cnt;\n \t\tif (size > 0) {\t\t\t\t\t\t       \\\n \t\t\tchar z_name[RTE_MEMZONE_NAMESIZE];\t\t       \\\n \t\t\tsnprintf(z_name, sizeof(z_name), \"ena_alloc_%\"PRIi64\"\",\\\n-\t\t\t\trte_atomic64_add_return(&ena_alloc_cnt, 1));   \\\n+\t\t\t\trte_atomic64_add_return(ena_alloc_cnt, 1));    \\\n \t\t\tmz = rte_memzone_reserve_aligned(z_name, size,\t       \\\n \t\t\t\tnode, RTE_MEMZONE_IOVA_CONTIG, alignment);     \\\n \t\t\tmem_handle = mz;\t\t\t\t       \\\ndiff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c\nindex 5d107775f4..0780e2fee2 100644\n--- a/drivers/net/ena/ena_ethdev.c\n+++ b/drivers/net/ena/ena_ethdev.c\n@@ -83,11 +83,15 @@ struct ena_stats {\n /* Device arguments */\n #define ENA_DEVARG_LARGE_LLQ_HDR \"large_llq_hdr\"\n \n+#define ENA_MZ_SHARED_DATA \"ena_shared_data\"\n+\n /*\n  * Each rte_memzone should have unique name.\n  * To satisfy it, count number of allocation and add it to name.\n  */\n-rte_atomic64_t ena_alloc_cnt;\n+rte_atomic64_t *ena_alloc_cnt;\n+\n+struct ena_shared_data *ena_shared_data;\n \n static const struct ena_stats ena_stats_global_strings[] = {\n \tENA_STAT_GLOBAL_ENTRY(wd_expired),\n@@ -1752,6 +1756,42 @@ static uint32_t ena_calc_max_io_queue_num(struct ena_com_dev *ena_dev,\n \treturn max_num_io_queues;\n }\n \n+static void ena_prepare_shared_data(struct ena_shared_data *shared_data)\n+{\n+\tmemset(shared_data, 0, sizeof(*shared_data));\n+}\n+\n+static int ena_shared_data_init(void)\n+{\n+\tconst struct rte_memzone *mz;\n+\n+\tif (ena_shared_data != NULL)\n+\t\treturn 0;\n+\n+\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n+\t\t/* Allocate shared memory. */\n+\t\tmz = rte_memzone_reserve(ENA_MZ_SHARED_DATA,\n+\t\t\t\t\t sizeof(*ena_shared_data),\n+\t\t\t\t\t SOCKET_ID_ANY, 0);\n+\t\tif (mz == NULL) {\n+\t\t\tPMD_INIT_LOG(CRIT, \"Cannot allocate ena shared data\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t\tena_prepare_shared_data(mz->addr);\n+\t} else {\n+\t\t/* Lookup allocated shared memory. */\n+\t\tmz = rte_memzone_lookup(ENA_MZ_SHARED_DATA);\n+\t\tif (mz == NULL) {\n+\t\t\tPMD_INIT_LOG(CRIT, \"Cannot attach ena shared data\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t}\n+\tena_shared_data = mz->addr;\n+\t/* Setup ENA_MEM memzone name counter. */\n+\tena_alloc_cnt = &ena_shared_data->mz_alloc_cnt;\n+\treturn 0;\n+}\n+\n static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct ena_calc_queue_size_ctx calc_queue_ctx = { 0 };\n@@ -1773,6 +1813,10 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)\n \teth_dev->tx_pkt_burst = &eth_ena_xmit_pkts;\n \teth_dev->tx_pkt_prepare = &eth_ena_prep_pkts;\n \n+\trc = ena_shared_data_init();\n+\tif (rc != 0)\n+\t\treturn rc;\n+\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn 0;\n \ndiff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h\nindex ae235897ee..e8858c6118 100644\n--- a/drivers/net/ena/ena_ethdev.h\n+++ b/drivers/net/ena/ena_ethdev.h\n@@ -207,6 +207,14 @@ struct ena_offloads {\n \tbool rx_csum_supported;\n };\n \n+/* Holds data shared between all instances of ENA PMD. */\n+struct ena_shared_data {\n+\t/* Each rte_memzone should have unique name.\n+\t * To satisfy it, count number of allocation and add it to name.\n+\t */\n+\trte_atomic64_t mz_alloc_cnt;\n+};\n+\n /* board specific private data structure */\n struct ena_adapter {\n \t/* OS defined structs */\n",
    "prefixes": [
        "17/22"
    ]
}