get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 99528,
    "url": "https://patches.dpdk.org/api/patches/99528/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210924043722.27980-5-nipun.gupta@nxp.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": "<20210924043722.27980-5-nipun.gupta@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210924043722.27980-5-nipun.gupta@nxp.com",
    "date": "2021-09-24T04:37:17",
    "name": "[v6,4/9] baseband/la12xx: add support for multiple modems",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "85230034d79eb9821cb6fc249535b3a9585f593e",
    "submitter": {
        "id": 471,
        "url": "https://patches.dpdk.org/api/people/471/?format=api",
        "name": "Nipun Gupta",
        "email": "nipun.gupta@nxp.com"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210924043722.27980-5-nipun.gupta@nxp.com/mbox/",
    "series": [
        {
            "id": 19119,
            "url": "https://patches.dpdk.org/api/series/19119/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19119",
            "date": "2021-09-24T04:37:14",
            "name": "baseband: add NXP LA12xx driver",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/19119/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/99528/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/99528/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 7E259A0C43;\n\tFri, 24 Sep 2021 06:39:01 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3F724412D8;\n\tFri, 24 Sep 2021 06:38:43 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n by mails.dpdk.org (Postfix) with ESMTP id 3D101412B9\n for <dev@dpdk.org>; Fri, 24 Sep 2021 06:38:37 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A0A6820098D;\n Fri, 24 Sep 2021 06:38:35 +0200 (CEST)",
            "from aprdc01srsp001v.ap-rdc01.nxp.com\n (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 83167200970;\n Fri, 24 Sep 2021 06:38:31 +0200 (CEST)",
            "from lsv03274.swis.in-blr01.nxp.com (lsv03274.swis.in-blr01.nxp.com\n [92.120.147.114])\n by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id E02B6183AD51;\n Fri, 24 Sep 2021 12:37:24 +0800 (+08)"
        ],
        "From": "nipun.gupta@nxp.com",
        "To": "dev@dpdk.org,\n\tgakhil@marvell.com,\n\tnicolas.chautru@intel.com",
        "Cc": "david.marchand@redhat.com,\n\themant.agrawal@nxp.com",
        "Date": "Fri, 24 Sep 2021 10:07:17 +0530",
        "Message-Id": "<20210924043722.27980-5-nipun.gupta@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210924043722.27980-1-nipun.gupta@nxp.com>",
        "References": "<20210318063421.14895-1-hemant.agrawal@nxp.com>\n <20210924043722.27980-1-nipun.gupta@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v6 4/9] baseband/la12xx: add support for multiple\n modems",
        "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: Hemant Agrawal <hemant.agrawal@nxp.com>\n\nThis patch add support for multiple modems by assigning\na modem id as dev args in vdev creation.\n\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/baseband/la12xx/bbdev_la12xx.c     | 64 +++++++++++++++++++---\n drivers/baseband/la12xx/bbdev_la12xx.h     | 56 +++++++++++++++++++\n drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 +++++++\n 3 files changed, 133 insertions(+), 7 deletions(-)\n create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h\n create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h",
    "diff": "diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c\nindex 8886b35429..f26f3f2a08 100644\n--- a/drivers/baseband/la12xx/bbdev_la12xx.c\n+++ b/drivers/baseband/la12xx/bbdev_la12xx.c\n@@ -14,6 +14,8 @@\n #include <rte_bbdev_pmd.h>\n \n #include <bbdev_la12xx_pmd_logs.h>\n+#include <bbdev_la12xx_ipc.h>\n+#include <bbdev_la12xx.h>\n \n #define DRIVER_NAME baseband_la12xx\n \n@@ -22,18 +24,18 @@ RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE);\n /*  Initialisation params structure that can be used by LA12xx BBDEV driver */\n struct bbdev_la12xx_params {\n \tuint8_t queues_num; /*< LA12xx BBDEV queues number */\n+\tint8_t modem_id; /*< LA12xx modem instance id */\n };\n \n #define LA12XX_MAX_NB_QUEUES_ARG\t\"max_nb_queues\"\n+#define LA12XX_VDEV_MODEM_ID_ARG\t\"modem\"\n+#define LA12XX_MAX_MODEM 4\n \n static const char * const bbdev_la12xx_valid_params[] = {\n \tLA12XX_MAX_NB_QUEUES_ARG,\n+\tLA12XX_VDEV_MODEM_ID_ARG,\n };\n \n-/* private data structure */\n-struct bbdev_la12xx_private {\n-\tunsigned int max_nb_queues;  /**< Max number of queues */\n-};\n static inline int\n parse_u16_arg(const char *key, const char *value, void *extra_args)\n {\n@@ -52,6 +54,28 @@ parse_u16_arg(const char *key, const char *value, void *extra_args)\n \treturn 0;\n }\n \n+/* Parse integer from integer argument */\n+static int\n+parse_integer_arg(const char *key __rte_unused,\n+\t\tconst char *value, void *extra_args)\n+{\n+\tint i;\n+\tchar *end;\n+\n+\terrno = 0;\n+\n+\ti = strtol(value, &end, 10);\n+\tif (*end != 0 || errno != 0 || i < 0 || i > LA12XX_MAX_MODEM) {\n+\t\trte_bbdev_log(ERR, \"Supported Port IDS are 0 to %d\",\n+\t\t\tLA12XX_MAX_MODEM - 1);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t*((uint32_t *)extra_args) = i;\n+\n+\treturn 0;\n+}\n+\n /* Parse parameters used to create device */\n static int\n parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params,\n@@ -73,6 +97,16 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params,\n \t\tif (ret < 0)\n \t\t\tgoto exit;\n \n+\t\tret = rte_kvargs_process(kvlist,\n+\t\t\t\t\tbbdev_la12xx_valid_params[1],\n+\t\t\t\t\t&parse_integer_arg,\n+\t\t\t\t\t&params->modem_id);\n+\n+\t\tif (params->modem_id >= LA12XX_MAX_MODEM) {\n+\t\t\trte_bbdev_log(ERR, \"Invalid modem id, must be < %u\",\n+\t\t\t\t\tLA12XX_MAX_MODEM);\n+\t\t\tgoto exit;\n+\t\t}\n \t}\n \n exit:\n@@ -84,10 +118,11 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params,\n /* Create device */\n static int\n la12xx_bbdev_create(struct rte_vdev_device *vdev,\n-\t\tstruct bbdev_la12xx_params *init_params __rte_unused)\n+\t\tstruct bbdev_la12xx_params *init_params)\n {\n \tstruct rte_bbdev *bbdev;\n \tconst char *name = rte_vdev_device_name(vdev);\n+\tstruct bbdev_la12xx_private *priv;\n \n \tPMD_INIT_FUNC_TRACE();\n \n@@ -103,6 +138,20 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,\n \t\treturn -ENOMEM;\n \t}\n \n+\tpriv = bbdev->data->dev_private;\n+\tpriv->modem_id = init_params->modem_id;\n+\t/* if modem id is not configured */\n+\tif (priv->modem_id == -1)\n+\t\tpriv->modem_id = bbdev->data->dev_id;\n+\n+\t/* Reset Global variables */\n+\tpriv->num_ldpc_enc_queues = 0;\n+\tpriv->num_ldpc_dec_queues = 0;\n+\tpriv->num_valid_queues = 0;\n+\tpriv->max_nb_queues = init_params->queues_num;\n+\n+\trte_bbdev_log(INFO, \"Setting Up %s: DevId=%d, ModemId=%d\",\n+\t\t\t\tname, bbdev->data->dev_id, priv->modem_id);\n \tbbdev->dev_ops = NULL;\n \tbbdev->device = &vdev->device;\n \tbbdev->data->socket_id = 0;\n@@ -122,7 +171,7 @@ static int\n la12xx_bbdev_probe(struct rte_vdev_device *vdev)\n {\n \tstruct bbdev_la12xx_params init_params = {\n-\t\t8\n+\t\t8, -1,\n \t};\n \tconst char *name;\n \tconst char *input_args;\n@@ -174,4 +223,5 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = {\n \n RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv);\n RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME,\n-\tLA12XX_MAX_NB_QUEUES_ARG\"=<int>\");\n+\tLA12XX_MAX_NB_QUEUES_ARG\"=<int>\"\n+\tLA12XX_VDEV_MODEM_ID_ARG \"=<int> \");\ndiff --git a/drivers/baseband/la12xx/bbdev_la12xx.h b/drivers/baseband/la12xx/bbdev_la12xx.h\nnew file mode 100644\nindex 0000000000..5228502331\n--- /dev/null\n+++ b/drivers/baseband/la12xx/bbdev_la12xx.h\n@@ -0,0 +1,56 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020-2021 NXP\n+ */\n+\n+#ifndef __BBDEV_LA12XX_H__\n+#define __BBDEV_LA12XX_H__\n+\n+#define BBDEV_IPC_ENC_OP_TYPE\t1\n+#define BBDEV_IPC_DEC_OP_TYPE\t2\n+\n+#define MAX_LDPC_ENC_FECA_QUEUES\t4\n+#define MAX_LDPC_DEC_FECA_QUEUES\t4\n+\n+#define MAX_CHANNEL_DEPTH 16\n+/* private data structure */\n+struct bbdev_la12xx_private {\n+\tvoid *ipc_priv;\n+\tuint8_t num_valid_queues;\n+\tuint8_t max_nb_queues;\n+\tuint8_t num_ldpc_enc_queues;\n+\tuint8_t num_ldpc_dec_queues;\n+\tint8_t modem_id;\n+\tstruct bbdev_la12xx_q_priv *queues_priv[32];\n+};\n+\n+struct hugepage_info {\n+\tvoid *vaddr;\n+\tphys_addr_t paddr;\n+\tsize_t len;\n+};\n+\n+struct bbdev_la12xx_q_priv {\n+\tstruct bbdev_la12xx_private *bbdev_priv;\n+\tuint32_t q_id;\t/**< Channel ID */\n+\tuint32_t feca_blk_id;\t/** FECA block ID for processing */\n+\tuint32_t feca_blk_id_be32; /**< FECA Block ID for this queue */\n+\tuint8_t en_napi; /* 0: napi disabled, 1: napi enabled */\n+\tuint16_t queue_size;\t/**< Queue depth */\n+\tint32_t eventfd;\t/**< Event FD value */\n+\tenum rte_bbdev_op_type op_type; /**< Operation type */\n+\tuint32_t la12xx_core_id;\n+\t\t/* LA12xx core ID on which this will be scheduled */\n+\tstruct rte_mempool *mp; /**< Pool from where buffers would be cut */\n+\tvoid *bbdev_op[MAX_CHANNEL_DEPTH];\n+\t\t\t/**< Stores bbdev op for each index */\n+\tvoid *msg_ch_vaddr[MAX_CHANNEL_DEPTH];\n+\t\t\t/**< Stores msg channel addr for modem->host */\n+\tuint32_t host_pi;\t/**< Producer_Index for HOST->MODEM */\n+\tuint32_t host_ci;\t/**< Consumer Index for MODEM->HOST */\n+\thost_ipc_params_t *host_params; /**< Host parameters */\n+};\n+\n+#define lower_32_bits(x) ((uint32_t)((uint64_t)x))\n+#define upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16))\n+\n+#endif\ndiff --git a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h\nnew file mode 100644\nindex 0000000000..9aa5562981\n--- /dev/null\n+++ b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h\n@@ -0,0 +1,20 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020-2021 NXP\n+ */\n+#ifndef __BBDEV_LA12XX_IPC_H__\n+#define __BBDEV_LA12XX_IPC_H__\n+\n+/** No. of max channel per instance */\n+#define IPC_MAX_DEPTH\t(16)\n+\n+/* This shared memory would be on the host side which have copy of some\n+ * of the parameters which are also part of Shared BD ring. Read access\n+ * of these parameters from the host side would not be over PCI.\n+ */\n+typedef struct host_ipc_params {\n+\tvolatile uint32_t pi;\n+\tvolatile uint32_t ci;\n+\tvolatile uint32_t modem_ptr[IPC_MAX_DEPTH];\n+} __rte_packed host_ipc_params_t;\n+\n+#endif\n",
    "prefixes": [
        "v6",
        "4/9"
    ]
}