get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17146,
    "url": "https://patches.dpdk.org/api/patches/17146/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1479740470-6723-45-git-send-email-arybchenko@solarflare.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": "<1479740470-6723-45-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1479740470-6723-45-git-send-email-arybchenko@solarflare.com",
    "date": "2016-11-21T15:00:58",
    "name": "[dpdk-dev,44/56] net/sfc: implement Rx subsystem stubs",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "2c3bf462da57a380d8adac713daba7df333389f9",
    "submitter": {
        "id": 607,
        "url": "https://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.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/1479740470-6723-45-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/17146/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/17146/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id D77A4D5E6;\n\tMon, 21 Nov 2016 16:03:35 +0100 (CET)",
            "from nbfkord-smmo02.seg.att.com (nbfkord-smmo02.seg.att.com\n\t[209.65.160.78]) by dpdk.org (Postfix) with ESMTP id 9E3BE2A5D\n\tfor <dev@dpdk.org>; Mon, 21 Nov 2016 16:01:41 +0100 (CET)",
            "from unknown [12.187.104.26]\n\tby nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-7) with SMTP id\n\t55c03385.0.1541296.00-2318.3424248.nbfkord-smmo02.seg.att.com\n\t(envelope-from <arybchenko@solarflare.com>); \n\tMon, 21 Nov 2016 15:01:41 +0000 (UTC)",
            "from ocex03.SolarFlarecom.com (10.20.40.36) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id 15.0.1044.25; Mon, 21 Nov 2016 07:01:22 -0800",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id\n\t15.0.1044.25 via Frontend Transport; Mon, 21 Nov 2016 07:01:22 -0800",
            "from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com\n\t[10.17.10.10])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tuALF1LxU007230 for <dev@dpdk.org>; Mon, 21 Nov 2016 15:01:21 GMT",
            "from uklogin.uk.solarflarecom.com (localhost.localdomain\n\t[127.0.0.1])\n\tby uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tuALF1J3Z006765 for <dev@dpdk.org>; Mon, 21 Nov 2016 15:01:21 GMT"
        ],
        "X-MXL-Hash": "58330c555cb82f2c-03accbf6b88cd4b94dbe722d6011924f06e77839",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "Date": "Mon, 21 Nov 2016 15:00:58 +0000",
        "Message-ID": "<1479740470-6723-45-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.2.3",
        "In-Reply-To": "<1479740470-6723-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1479740470-6723-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-AnalysisOut": [
            "[v=2.1 cv=UI/baXry c=1 sm=1 tr=0 a=8BlWFWvVlq5taO8ncb8nKg==]",
            "[:17 a=L24OOQBejmoA:10 a=zRKbQ67AAAAA:8 a=3AGVCxh2S-hBM6XUf]",
            "[DkA:9 a=PA03WX8tBzeizutn5_OT:22]"
        ],
        "X-Spam": "[F=0.2000000000; CM=0.500; S=0.200(2015072901)]",
        "X-MAIL-FROM": "<arybchenko@solarflare.com>",
        "X-SOURCE-IP": "[12.187.104.26]",
        "Subject": "[dpdk-dev] [PATCH 44/56] net/sfc: implement Rx subsystem stubs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://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": "<http://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": "Reviewed-by: Andy Moreton <amoreton@solarflare.com>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/efx/Makefile     |   1 +\n drivers/net/sfc/efx/sfc.c        |   9 ++++\n drivers/net/sfc/efx/sfc.h        |   4 ++\n drivers/net/sfc/efx/sfc_ethdev.c |  10 ++++\n drivers/net/sfc/efx/sfc_rx.c     | 104 +++++++++++++++++++++++++++++++++++++++\n drivers/net/sfc/efx/sfc_rx.h     |  53 ++++++++++++++++++++\n 6 files changed, 181 insertions(+)\n create mode 100644 drivers/net/sfc/efx/sfc_rx.c\n create mode 100644 drivers/net/sfc/efx/sfc_rx.h",
    "diff": "diff --git a/drivers/net/sfc/efx/Makefile b/drivers/net/sfc/efx/Makefile\nindex 6e860b8..eb82c89 100644\n--- a/drivers/net/sfc/efx/Makefile\n+++ b/drivers/net/sfc/efx/Makefile\n@@ -87,6 +87,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc_mcdi.c\n SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc_intr.c\n SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc_ev.c\n SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc_port.c\n+SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc_rx.c\n \n VPATH += $(SRCDIR)/base\n \ndiff --git a/drivers/net/sfc/efx/sfc.c b/drivers/net/sfc/efx/sfc.c\nindex 01e0c94..c0f48a8 100644\n--- a/drivers/net/sfc/efx/sfc.c\n+++ b/drivers/net/sfc/efx/sfc.c\n@@ -37,6 +37,7 @@\n #include \"sfc.h\"\n #include \"sfc_log.h\"\n #include \"sfc_ev.h\"\n+#include \"sfc_rx.h\"\n \n \n int\n@@ -349,10 +350,17 @@ sfc_configure(struct sfc_adapter *sa)\n \tif (rc != 0)\n \t\tgoto fail_port_init;\n \n+\trc = sfc_rx_init(sa);\n+\tif (rc != 0)\n+\t\tgoto fail_rx_init;\n+\n \tsa->state = SFC_ADAPTER_CONFIGURED;\n \tsfc_log_init(sa, \"done\");\n \treturn 0;\n \n+fail_rx_init:\n+\tsfc_port_fini(sa);\n+\n fail_port_init:\n \tsfc_ev_fini(sa);\n \n@@ -376,6 +384,7 @@ sfc_close(struct sfc_adapter *sa)\n \tSFC_ASSERT(sa->state == SFC_ADAPTER_CONFIGURED);\n \tsa->state = SFC_ADAPTER_CLOSING;\n \n+\tsfc_rx_fini(sa);\n \tsfc_port_fini(sa);\n \tsfc_ev_fini(sa);\n \tsfc_intr_fini(sa);\ndiff --git a/drivers/net/sfc/efx/sfc.h b/drivers/net/sfc/efx/sfc.h\nindex f328482..a592b53 100644\n--- a/drivers/net/sfc/efx/sfc.h\n+++ b/drivers/net/sfc/efx/sfc.h\n@@ -114,6 +114,7 @@ struct sfc_intr {\n };\n \n struct sfc_evq_info;\n+struct sfc_rxq_info;\n \n struct sfc_port {\n \tunsigned int\t\t\tflow_ctrl;\n@@ -152,6 +153,9 @@ struct sfc_adapter {\n \n \tunsigned int\t\t\tmgmt_evq_index;\n \trte_spinlock_t\t\t\tmgmt_evq_lock;\n+\n+\tunsigned int\t\t\trxq_count;\n+\tstruct sfc_rxq_info\t\t*rxq_info;\n };\n \n /*\ndiff --git a/drivers/net/sfc/efx/sfc_ethdev.c b/drivers/net/sfc/efx/sfc_ethdev.c\nindex a8a6a17..8d628fe 100644\n--- a/drivers/net/sfc/efx/sfc_ethdev.c\n+++ b/drivers/net/sfc/efx/sfc_ethdev.c\n@@ -48,6 +48,16 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n \tsfc_log_init(sa, \"entry\");\n \n \tdev_info->max_rx_pktlen = EFX_MAC_PDU_MAX;\n+\n+\t/* By default packets are dropped if no descriptors are available */\n+\tdev_info->default_rxconf.rx_drop_en = 1;\n+\n+\tdev_info->rx_desc_lim.nb_max = EFX_RXQ_MAXNDESCS;\n+\tdev_info->rx_desc_lim.nb_min = EFX_RXQ_MINNDESCS;\n+\t/* The RXQ hardware requires that the descriptor count is a power\n+\t * of 2, but rx_desc_lim cannot properly describe that constraint.\n+\t */\n+\tdev_info->rx_desc_lim.nb_align = EFX_RXQ_MINNDESCS;\n }\n \n static int\ndiff --git a/drivers/net/sfc/efx/sfc_rx.c b/drivers/net/sfc/efx/sfc_rx.c\nnew file mode 100644\nindex 0000000..961e6b6\n--- /dev/null\n+++ b/drivers/net/sfc/efx/sfc_rx.c\n@@ -0,0 +1,104 @@\n+/*-\n+ * Copyright (c) 2016 Solarflare Communications Inc.\n+ * All rights reserved.\n+ *\n+ * This software was jointly developed between OKTET Labs (under contract\n+ * for Solarflare) and Solarflare Communications, Inc.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice,\n+ *    this list of conditions and the following disclaimer.\n+ * 2. Redistributions in binary form must reproduce the above copyright notice,\n+ *    this list of conditions and the following disclaimer in the documentation\n+ *    and/or other materials provided with the distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include \"efx.h\"\n+\n+#include \"sfc.h\"\n+#include \"sfc_log.h\"\n+#include \"sfc_rx.h\"\n+\n+static int\n+sfc_rx_qinit_info(struct sfc_adapter *sa, unsigned int sw_index)\n+{\n+\tstruct sfc_rxq_info *rxq_info = &sa->rxq_info[sw_index];\n+\tunsigned int max_entries;\n+\tint rc;\n+\n+\tmax_entries = EFX_RXQ_MAXNDESCS;\n+\tSFC_ASSERT(rte_is_power_of_2(max_entries));\n+\n+\trxq_info->max_entries = max_entries;\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * Initialize Rx subsystem.\n+ *\n+ * Called at device configuration stage when number of receive queues is\n+ * specified together with other device level receive configuration.\n+ *\n+ * It should be used to allocate NUMA-unaware resources.\n+ */\n+int\n+sfc_rx_init(struct sfc_adapter *sa)\n+{\n+\tunsigned int sw_index;\n+\tint rc;\n+\n+\tsa->rxq_count = sa->eth_dev->data->nb_rx_queues;\n+\n+\trc = ENOMEM;\n+\tsa->rxq_info = rte_calloc_socket(\"sfc-rxqs\", sa->rxq_count,\n+\t\t\t\t\t sizeof(struct sfc_rxq_info), 0,\n+\t\t\t\t\t sa->socket_id);\n+\tif (sa->rxq_info == NULL)\n+\t\tgoto fail_rxqs_alloc;\n+\n+\tfor (sw_index = 0; sw_index < sa->rxq_count; ++sw_index) {\n+\t\trc = sfc_rx_qinit_info(sa, sw_index);\n+\t\tif (rc != 0)\n+\t\t\tgoto fail_rx_qinit_info;\n+\t}\n+\n+\treturn 0;\n+\n+fail_rx_qinit_info:\n+\trte_free(sa->rxq_info);\n+\tsa->rxq_info = NULL;\n+\n+fail_rxqs_alloc:\n+\tsa->rxq_count = 0;\n+\tsfc_log_init(sa, \"failed %d\", rc);\n+\treturn rc;\n+}\n+\n+/**\n+ * Shutdown Rx subsystem.\n+ *\n+ * Called at device close stage, for example, before device\n+ * reconfiguration or shutdown.\n+ */\n+void\n+sfc_rx_fini(struct sfc_adapter *sa)\n+{\n+\trte_free(sa->rxq_info);\n+\tsa->rxq_info = NULL;\n+\tsa->rxq_count = 0;\n+}\ndiff --git a/drivers/net/sfc/efx/sfc_rx.h b/drivers/net/sfc/efx/sfc_rx.h\nnew file mode 100644\nindex 0000000..c1758a1\n--- /dev/null\n+++ b/drivers/net/sfc/efx/sfc_rx.h\n@@ -0,0 +1,53 @@\n+/*-\n+ * Copyright (c) 2016 Solarflare Communications Inc.\n+ * All rights reserved.\n+ *\n+ * This software was jointly developed between OKTET Labs (under contract\n+ * for Solarflare) and Solarflare Communications, Inc.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice,\n+ *    this list of conditions and the following disclaimer.\n+ * 2. Redistributions in binary form must reproduce the above copyright notice,\n+ *    this list of conditions and the following disclaimer in the documentation\n+ *    and/or other materials provided with the distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _SFC_RX_H\n+#define\t_SFC_RX_H\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+struct sfc_adapter;\n+\n+/**\n+ * Receive queue information used during setup/release only.\n+ * Allocated on the same socket as adapter data.\n+ */\n+struct sfc_rxq_info {\n+\tunsigned int\t\tmax_entries;\n+};\n+\n+int sfc_rx_init(struct sfc_adapter *sa);\n+void sfc_rx_fini(struct sfc_adapter *sa);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+#endif  /* _SFC_RX_H */\n",
    "prefixes": [
        "dpdk-dev",
        "44/56"
    ]
}