get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 108487,
    "url": "http://patches.dpdk.org/api/patches/108487/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220302120701.2749772-1-vattunuru@marvell.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": "<20220302120701.2749772-1-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220302120701.2749772-1-vattunuru@marvell.com",
    "date": "2022-03-02T12:07:01",
    "name": "[1/1] common/cnxk: fix static assertion failure",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "0ec2f62f96928a66fe7f0f5b6d7008bd18738800",
    "submitter": {
        "id": 1277,
        "url": "http://patches.dpdk.org/api/people/1277/?format=api",
        "name": "Vamsi Krishna Attunuru",
        "email": "vattunuru@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220302120701.2749772-1-vattunuru@marvell.com/mbox/",
    "series": [
        {
            "id": 21985,
            "url": "http://patches.dpdk.org/api/series/21985/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21985",
            "date": "2022-03-02T12:07:01",
            "name": "[1/1] common/cnxk: fix static assertion failure",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/21985/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/108487/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/108487/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 0BC2CA04A4;\n\tWed,  2 Mar 2022 13:07:11 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9BA5442715;\n\tWed,  2 Mar 2022 13:07:10 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 5B7C540141\n for <dev@dpdk.org>; Wed,  2 Mar 2022 13:07:09 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id\n 2228E8C6026488\n for <dev@dpdk.org>; Wed, 2 Mar 2022 04:07:08 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ej4vf8x8f-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Wed, 02 Mar 2022 04:07:08 -0800",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Wed, 2 Mar 2022 04:07:05 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Wed, 2 Mar 2022 04:07:05 -0800",
            "from localhost.localdomain (unknown [10.28.48.51])\n by maili.marvell.com (Postfix) with ESMTP id 3BE3367387;\n Wed,  2 Mar 2022 04:07:04 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : mime-version : content-transfer-encoding :\n content-type; s=pfpt0220; bh=wPFr8SSzhj9TAblCZdvfVoTN9GKHhF0QtEnLBfAm7Fk=;\n b=k8XolWGqrI2shosDA7yMjjuOj7s44pfp45blq7L9J89x7+uztfZu7wyNlpwk7CMtAwJj\n 5ifcXmu2Inr6zZwDh7jg8oQibjC9/wLsS8IW16CYce3PrfgF4Q8hH6Apd/r49yCTmWpv\n hlhULaeZzRiKuCGjKR0gJM8Y/Gn4tauRseZ/skow7x8T8Gxa91UFr1A+qXzguSKA3NNU\n IIqSH1yZp78x1u+2ezDw/GbqdShBLJY0RUWBixVlgOQSEpB5zxxKEJ5BZhIfjcEJFq7K\n E2pGhEqfL4vb8OPKYpZ9te6OcdtY+a6ehTGoi6vcewzDBURa9/tJcMSexa++kTZT9PWb hQ==",
        "From": "Vamsi Attunuru <vattunuru@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<jerinj@marvell.com>, <vattunuru@marvell.com>, <ndabilpuram@marvell.com>,\n Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "Subject": "[PATCH 1/1] common/cnxk: fix static assertion failure",
        "Date": "Wed, 2 Mar 2022 17:37:01 +0530",
        "Message-ID": "<20220302120701.2749772-1-vattunuru@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "tA2W-nYgSkXaaoh7NetdgB7hEIcWfvG9",
        "X-Proofpoint-GUID": "tA2W-nYgSkXaaoh7NetdgB7hEIcWfvG9",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514\n definitions=2022-03-02_06,2022-02-26_01,2022-02-23_01",
        "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"
    },
    "content": "use dynamically allocated memory for storing soft expiry\nring base addresses which fixes the static assertion failure,\nsize of this dynamic allocation depends on RTE_MAX_ETHPORTS\nwhich varies based on the build config.\n\nFixes: d26185716d3f (\"net/cnxk: support outbound soft expiry\nnotification\")\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/common/cnxk/roc_nix_inl.c      | 23 +++++++++++++----------\n drivers/common/cnxk/roc_nix_inl.h      |  2 +-\n drivers/common/cnxk/roc_nix_inl_dev.c  | 11 ++++++++++-\n drivers/common/cnxk/roc_nix_inl_priv.h |  2 +-\n drivers/common/cnxk/roc_platform.h     | 16 ++++++++++++++++\n 5 files changed, 41 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c\nindex 11ed157703..826c6e99c1 100644\n--- a/drivers/common/cnxk/roc_nix_inl.c\n+++ b/drivers/common/cnxk/roc_nix_inl.c\n@@ -330,12 +330,13 @@ roc_nix_inl_outb_init(struct roc_nix *roc_nix)\n \tstruct dev *dev = &nix->dev;\n \tstruct msix_offset_rsp *rsp;\n \tstruct nix_inl_dev *inl_dev;\n+\tsize_t sa_sz, ring_sz;\n \tuint16_t sso_pffunc;\n \tuint8_t eng_grpmask;\n \tuint64_t blkaddr, i;\n+\tuint64_t *ring_base;\n \tuint16_t nb_lf;\n \tvoid *sa_base;\n-\tsize_t sa_sz;\n \tint j, rc;\n \tvoid *sa;\n \n@@ -468,16 +469,16 @@ roc_nix_inl_outb_init(struct roc_nix *roc_nix)\n \t/* Allocate memory to be used as a ring buffer to poll for\n \t * soft expiry event from ucode\n \t */\n+\tring_sz = (ROC_IPSEC_ERR_RING_MAX_ENTRY + 1) * sizeof(uint64_t);\n+\tring_base = inl_dev->sa_soft_exp_ring;\n \tfor (i = 0; i < nix->outb_se_ring_cnt; i++) {\n-\t\tinl_dev->sa_soft_exp_ring[nix->outb_se_ring_base + i] =\n-\t\t\tplt_zmalloc((ROC_IPSEC_ERR_RING_MAX_ENTRY + 1) *\n-\t\t\t\t\t    sizeof(uint64_t),\n-\t\t\t\t    0);\n-\t\tif (!inl_dev->sa_soft_exp_ring[i]) {\n+\t\tring_base[nix->outb_se_ring_base + i] =\n+\t\t\tPLT_U64_CAST(plt_zmalloc(ring_sz, 0));\n+\t\tif (!ring_base[nix->outb_se_ring_base + i]) {\n \t\t\tplt_err(\"Couldn't allocate memory for soft exp ring\");\n \t\t\twhile (i--)\n-\t\t\t\tplt_free(inl_dev->sa_soft_exp_ring\n-\t\t\t\t\t\t [nix->outb_se_ring_base + i]);\n+\t\t\t\tplt_free(PLT_PTR_CAST(\n+\t\t\t\t\tring_base[nix->outb_se_ring_base + i]));\n \t\t\trc = -ENOMEM;\n \t\t\tgoto lf_fini;\n \t\t}\n@@ -504,6 +505,7 @@ roc_nix_inl_outb_fini(struct roc_nix *roc_nix)\n \tstruct idev_cfg *idev = idev_get_cfg();\n \tstruct dev *dev = &nix->dev;\n \tstruct nix_inl_dev *inl_dev;\n+\tuint64_t *ring_base;\n \tint i, rc, ret = 0;\n \n \tif (!nix->inl_outb_ena)\n@@ -537,10 +539,11 @@ roc_nix_inl_outb_fini(struct roc_nix *roc_nix)\n \n \tif (idev && idev->nix_inl_dev) {\n \t\tinl_dev = idev->nix_inl_dev;\n+\t\tring_base = inl_dev->sa_soft_exp_ring;\n \n \t\tfor (i = 0; i < ROC_NIX_INL_MAX_SOFT_EXP_RNGS; i++) {\n-\t\t\tif (inl_dev->sa_soft_exp_ring[i])\n-\t\t\t\tplt_free(inl_dev->sa_soft_exp_ring[i]);\n+\t\t\tif (ring_base[i])\n+\t\t\t\tplt_free(PLT_PTR_CAST(ring_base[i]));\n \t\t}\n \t}\n \ndiff --git a/drivers/common/cnxk/roc_nix_inl.h b/drivers/common/cnxk/roc_nix_inl.h\nindex 1dc58f2da2..2c2a4d76f2 100644\n--- a/drivers/common/cnxk/roc_nix_inl.h\n+++ b/drivers/common/cnxk/roc_nix_inl.h\n@@ -137,7 +137,7 @@ struct roc_nix_inl_dev {\n \tbool set_soft_exp_poll;\n \t/* End of input parameters */\n \n-#define ROC_NIX_INL_MEM_SZ (2304)\n+#define ROC_NIX_INL_MEM_SZ (1280)\n \tuint8_t reserved[ROC_NIX_INL_MEM_SZ] __plt_cache_aligned;\n } __plt_cache_aligned;\n \ndiff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/roc_nix_inl_dev.c\nindex 1cfcdba3f2..5a032aab52 100644\n--- a/drivers/common/cnxk/roc_nix_inl_dev.c\n+++ b/drivers/common/cnxk/roc_nix_inl_dev.c\n@@ -653,7 +653,7 @@ inl_outb_soft_exp_poll(struct nix_inl_dev *inl_dev, uint32_t ring_idx)\n \tuint32_t port_id;\n \n \tport_id = ring_idx / ROC_NIX_SOFT_EXP_PER_PORT_MAX_RINGS;\n-\tring_base = inl_dev->sa_soft_exp_ring[ring_idx];\n+\tring_base = PLT_PTR_CAST(inl_dev->sa_soft_exp_ring[ring_idx]);\n \tif (!ring_base) {\n \t\tplt_err(\"Invalid soft exp ring base\");\n \t\treturn;\n@@ -751,6 +751,14 @@ nix_inl_outb_poll_thread_setup(struct nix_inl_dev *inl_dev)\n \n \tinl_dev->soft_exp_ring_bmap_mem = mem;\n \tinl_dev->soft_exp_ring_bmap = bmap;\n+\tinl_dev->sa_soft_exp_ring = plt_zmalloc(\n+\t\tROC_NIX_INL_MAX_SOFT_EXP_RNGS * sizeof(uint64_t), 0);\n+\tif (!inl_dev->sa_soft_exp_ring) {\n+\t\tplt_err(\"soft expiry ring pointer array alloc failed\");\n+\t\tplt_free(mem);\n+\t\trc = -ENOMEM;\n+\t\tgoto exit;\n+\t}\n \n \tfor (i = 0; i < ROC_NIX_INL_MAX_SOFT_EXP_RNGS; i++)\n \t\tplt_bitmap_clear(inl_dev->soft_exp_ring_bmap, i);\n@@ -896,6 +904,7 @@ roc_nix_inl_dev_fini(struct roc_nix_inl_dev *roc_inl_dev)\n \t\tpthread_join(inl_dev->soft_exp_poll_thread, NULL);\n \t\tplt_bitmap_free(inl_dev->soft_exp_ring_bmap);\n \t\tplt_free(inl_dev->soft_exp_ring_bmap_mem);\n+\t\tplt_free(inl_dev->sa_soft_exp_ring);\n \t}\n \n \t/* Flush Inbound CTX cache entries */\ndiff --git a/drivers/common/cnxk/roc_nix_inl_priv.h b/drivers/common/cnxk/roc_nix_inl_priv.h\nindex da6d6e9b03..0fa5e090d4 100644\n--- a/drivers/common/cnxk/roc_nix_inl_priv.h\n+++ b/drivers/common/cnxk/roc_nix_inl_priv.h\n@@ -58,7 +58,7 @@ struct nix_inl_dev {\n \t/* OUTB soft expiry poll thread */\n \tpthread_t soft_exp_poll_thread;\n \tuint32_t soft_exp_poll_freq;\n-\tvoid *sa_soft_exp_ring[ROC_NIX_INL_MAX_SOFT_EXP_RNGS];\n+\tuint64_t *sa_soft_exp_ring;\n \n \t/* Soft expiry ring bitmap */\n \tstruct plt_bitmap *soft_exp_ring_bmap;\ndiff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h\nindex fa285446bd..267cf6f8fc 100644\n--- a/drivers/common/cnxk/roc_platform.h\n+++ b/drivers/common/cnxk/roc_platform.h\n@@ -41,6 +41,7 @@\n #define PLT_MEMZONE_NAMESIZE\t RTE_MEMZONE_NAMESIZE\n #define PLT_STD_C11\t\t RTE_STD_C11\n #define PLT_PTR_ADD\t\t RTE_PTR_ADD\n+#define PLT_PTR_SUB\t\t RTE_PTR_SUB\n #define PLT_PTR_DIFF\t\t RTE_PTR_DIFF\n #define PLT_MAX_RXTX_INTR_VEC_ID RTE_MAX_RXTX_INTR_VEC_ID\n #define PLT_INTR_VEC_RXTX_OFFSET RTE_INTR_VEC_RXTX_OFFSET\n@@ -63,6 +64,17 @@\n #ifndef PLT_ETHER_ADDR_LEN\n #define PLT_ETHER_ADDR_LEN RTE_ETHER_ADDR_LEN\n #endif\n+\n+/* Cast to specific datatypes */\n+#define PLT_PTR_CAST(val) ((void *)(val))\n+#define PLT_U64_CAST(val) ((uint64_t)(val))\n+#define PLT_U32_CAST(val) ((uint32_t)(val))\n+#define PLT_U16_CAST(val) ((uint16_t)(val))\n+\n+/* Add / Sub pointer with scalar and cast to uint64_t */\n+#define PLT_PTR_ADD_U64_CAST(__ptr, __x) PLT_U64_CAST(PLT_PTR_ADD(__ptr, __x))\n+#define PLT_PTR_SUB_U64_CAST(__ptr, __x) PLT_U64_CAST(PLT_PTR_SUB(__ptr, __x))\n+\n /** Divide ceil */\n #define PLT_DIV_CEIL(x, y)\t\t\t\\\n \t({\t\t\t\t\t\\\n@@ -158,6 +170,10 @@\n #define plt_write64(val, addr)                                                 \\\n \trte_write64_relaxed((val), (volatile void *)(addr))\n \n+#define plt_read32(addr) rte_read32_relaxed((volatile void *)(addr))\n+#define plt_write32(val, addr)                                                 \\\n+\trte_write32_relaxed((val), (volatile void *)(addr))\n+\n #define plt_wmb()\t\trte_wmb()\n #define plt_rmb()\t\trte_rmb()\n #define plt_io_wmb()\t\trte_io_wmb()\n",
    "prefixes": [
        "1/1"
    ]
}