get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41196,
    "url": "http://patches.dpdk.org/api/patches/41196/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180615165224.25004-3-jasvinder.singh@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": "<20180615165224.25004-3-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180615165224.25004-3-jasvinder.singh@intel.com",
    "date": "2018-06-15T16:52:04",
    "name": "[v2,02/22] net/softnic: add software queue object",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fa7e8417cbbd0f92015b51186d3d20c8ab64de75",
    "submitter": {
        "id": 285,
        "url": "http://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": {
        "id": 10018,
        "url": "http://patches.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180615165224.25004-3-jasvinder.singh@intel.com/mbox/",
    "series": [
        {
            "id": 147,
            "url": "http://patches.dpdk.org/api/series/147/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=147",
            "date": "2018-06-15T16:52:03",
            "name": "[v2,01/22] net/softnic: restructuring",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/147/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41196/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41196/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 558DF1C012;\n\tFri, 15 Jun 2018 18:52:34 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 5AA101BEAA\n\tfor <dev@dpdk.org>; Fri, 15 Jun 2018 18:52:28 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t15 Jun 2018 09:52:28 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.222.149])\n\tby fmsmga006.fm.intel.com with ESMTP; 15 Jun 2018 09:52:27 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,227,1526367600\"; d=\"scan'208\";a=\"237791012\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com",
        "Date": "Fri, 15 Jun 2018 17:52:04 +0100",
        "Message-Id": "<20180615165224.25004-3-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20180615165224.25004-1-jasvinder.singh@intel.com>",
        "References": "<20180608124155.140663-2-jasvinder.singh@intel.com>\n\t<20180615165224.25004-1-jasvinder.singh@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 02/22] net/softnic: add software queue object",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add swq object implementation to the softnic.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\n---\n drivers/net/softnic/Makefile                    |  1 +\n drivers/net/softnic/rte_eth_softnic.c           |  7 ++\n drivers/net/softnic/rte_eth_softnic_internals.h | 39 ++++++++++\n drivers/net/softnic/rte_eth_softnic_swq.c       | 97 +++++++++++++++++++++++++\n 4 files changed, 144 insertions(+)\n create mode 100644 drivers/net/softnic/rte_eth_softnic_swq.c",
    "diff": "diff --git a/drivers/net/softnic/Makefile b/drivers/net/softnic/Makefile\nindex d56fecd..d8e62bf 100644\n--- a/drivers/net/softnic/Makefile\n+++ b/drivers/net/softnic/Makefile\n@@ -22,6 +22,7 @@ LIBABIVER := 1\n # all source are stored in SRCS-y\n #\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic.c\n+SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic_swq.c\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic_tm.c\n \n #\ndiff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c\nindex bc636e8..e95b2ba 100644\n--- a/drivers/net/softnic/rte_eth_softnic.c\n+++ b/drivers/net/softnic/rte_eth_softnic.c\n@@ -218,14 +218,21 @@ pmd_init(struct pmd_params *params)\n \tif (p == NULL)\n \t\treturn NULL;\n \n+\t/* Params */\n \tmemcpy(&p->params, params, sizeof(p->params));\n \n+\t/* Resources */\n+\tswq_init(p);\n \treturn p;\n }\n \n static void\n pmd_free(struct pmd_internals *p)\n {\n+\tif (p == NULL)\n+\t\treturn;\n+\n+\tswq_free(p);\n \trte_free(p);\n }\n \ndiff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h\nindex 1be1868..ee6283b 100644\n--- a/drivers/net/softnic/rte_eth_softnic_internals.h\n+++ b/drivers/net/softnic/rte_eth_softnic_internals.h\n@@ -7,8 +7,10 @@\n \n #include <stddef.h>\n #include <stdint.h>\n+#include <sys/queue.h>\n \n #include <rte_mbuf.h>\n+#include <rte_ring.h>\n #include <rte_ethdev.h>\n #include <rte_sched.h>\n #include <rte_ethdev_driver.h>\n@@ -16,6 +18,8 @@\n \n #include \"rte_eth_softnic.h\"\n \n+#define NAME_SIZE                                            64\n+\n /**\n  * PMD Parameters\n  */\n@@ -50,6 +54,21 @@ struct pmd_params {\n };\n \n /**\n+ * SWQ\n+ */\n+struct swq_params {\n+\tuint32_t size;\n+};\n+\n+struct swq {\n+\tTAILQ_ENTRY(swq) node;\n+\tchar name[NAME_SIZE];\n+\tstruct rte_ring *r;\n+};\n+\n+TAILQ_HEAD(swq_list, swq);\n+\n+/**\n  * Traffic Management (TM) Internals\n  */\n \n@@ -172,9 +191,29 @@ struct pmd_internals {\n \tstruct {\n \t\tstruct tm_internals tm; /**< Traffic Management */\n \t} soft;\n+\n+\tstruct swq_list swq_list;\n };\n \n /**\n+ * SWQ\n+ */\n+int\n+swq_init(struct pmd_internals *p);\n+\n+void\n+swq_free(struct pmd_internals *p);\n+\n+struct swq *\n+swq_find(struct pmd_internals *p,\n+\tconst char *name);\n+\n+struct swq *\n+swq_create(struct pmd_internals *p,\n+\tconst char *name,\n+\tstruct swq_params *params);\n+\n+/**\n  * Traffic Management (TM) Operation\n  */\n extern const struct rte_tm_ops pmd_tm_ops;\ndiff --git a/drivers/net/softnic/rte_eth_softnic_swq.c b/drivers/net/softnic/rte_eth_softnic_swq.c\nnew file mode 100644\nindex 0000000..3e810f3\n--- /dev/null\n+++ b/drivers/net/softnic/rte_eth_softnic_swq.c\n@@ -0,0 +1,97 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2018 Intel Corporation\n+ */\n+\n+#include <stdlib.h>\n+#include <string.h>\n+\n+#include <rte_string_fns.h>\n+\n+#include \"rte_eth_softnic_internals.h\"\n+\n+int\n+swq_init(struct pmd_internals *p)\n+{\n+\tTAILQ_INIT(&p->swq_list);\n+\n+\treturn 0;\n+}\n+\n+void\n+swq_free(struct pmd_internals *p)\n+{\n+\tfor ( ; ; ) {\n+\t\tstruct swq *swq;\n+\n+\t\tswq = TAILQ_FIRST(&p->swq_list);\n+\t\tif (swq == NULL)\n+\t\t\tbreak;\n+\n+\t\tTAILQ_REMOVE(&p->swq_list, swq, node);\n+\t\trte_ring_free(swq->r);\n+\t\tfree(swq);\n+\t}\n+}\n+\n+struct swq *\n+swq_find(struct pmd_internals *p,\n+\tconst char *name)\n+{\n+\tstruct swq *swq;\n+\n+\tif (name == NULL)\n+\t\treturn NULL;\n+\n+\tTAILQ_FOREACH(swq, &p->swq_list, node)\n+\t\tif (strcmp(swq->name, name) == 0)\n+\t\t\treturn swq;\n+\n+\treturn NULL;\n+}\n+\n+struct swq *\n+swq_create(struct pmd_internals *p,\n+\tconst char *name,\n+\tstruct swq_params *params)\n+{\n+\tchar ring_name[NAME_SIZE];\n+\tstruct swq *swq;\n+\tstruct rte_ring *r;\n+\tunsigned int flags = RING_F_SP_ENQ | RING_F_SC_DEQ;\n+\n+\t/* Check input params */\n+\tif (name == NULL ||\n+\t\tswq_find(p, name) ||\n+\t\tparams == NULL ||\n+\t\tparams->size == 0)\n+\t\treturn NULL;\n+\n+\t/* Resource create */\n+\tsnprintf(ring_name, sizeof(ring_name), \"%s_%s\",\n+\t\tp->params.name,\n+\t\tname);\n+\n+\tr = rte_ring_create(ring_name,\n+\t\tparams->size,\n+\t\tp->params.cpu_id,\n+\t\tflags);\n+\n+\tif (r == NULL)\n+\t\treturn NULL;\n+\n+\t/* Node allocation */\n+\tswq = calloc(1, sizeof(struct swq));\n+\tif (swq == NULL) {\n+\t\trte_ring_free(r);\n+\t\treturn NULL;\n+\t}\n+\n+\t/* Node fill in */\n+\tstrlcpy(swq->name, name, sizeof(swq->name));\n+\tswq->r = r;\n+\n+\t/* Node add to list */\n+\tTAILQ_INSERT_TAIL(&p->swq_list, swq, node);\n+\n+\treturn swq;\n+}\n",
    "prefixes": [
        "v2",
        "02/22"
    ]
}