get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17293,
    "url": "https://patches.dpdk.org/api/patches/17293/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1480436367-20749-36-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": "<1480436367-20749-36-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1480436367-20749-36-git-send-email-arybchenko@solarflare.com",
    "date": "2016-11-29T16:19:07",
    "name": "[dpdk-dev,v2,35/55] net/sfc: make available resources estimation and allocation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9690a94fb2dcf538a4f9c5e9da212ef54cb56baa",
    "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/1480436367-20749-36-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/17293/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/17293/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 C6F72FA3D;\n\tTue, 29 Nov 2016 17:21:51 +0100 (CET)",
            "from nbfkord-smmo01.seg.att.com (nbfkord-smmo01.seg.att.com\n\t[209.65.160.76]) by dpdk.org (Postfix) with ESMTP id 7EBF237A8\n\tfor <dev@dpdk.org>; Tue, 29 Nov 2016 17:20:49 +0100 (CET)",
            "from unknown [12.187.104.26] (EHLO nbfkord-smmo01.seg.att.com)\n\tby nbfkord-smmo01.seg.att.com(mxl_mta-7.2.4-7) with ESMTP id\n\t1eaad385.2b3eb028c940.83552.00-2499.173813.nbfkord-smmo01.seg.att.com\n\t(envelope-from <arybchenko@solarflare.com>); \n\tTue, 29 Nov 2016 16:20:49 +0000 (UTC)",
            "from unknown [12.187.104.26]\n\tby nbfkord-smmo01.seg.att.com(mxl_mta-7.2.4-7) with SMTP id\n\t9daad385.0.83424.00-2363.173714.nbfkord-smmo01.seg.att.com\n\t(envelope-from <arybchenko@solarflare.com>); \n\tTue, 29 Nov 2016 16:20:42 +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; Tue, 29 Nov 2016 08:20:25 -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; Tue, 29 Nov 2016 08:20:25 -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\tuATGKOfo030005; Tue, 29 Nov 2016 16:20:24 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\tuATGKM1h021233; Tue, 29 Nov 2016 16:20:24 GMT"
        ],
        "X-MXL-Hash": [
            "583daae134d79397-5d2c1c8ac4cd91740b1b7ea9f433cf4b0e7d3b64",
            "583daada7fc61de0-37b5423aa96838b857e8bdf9c3f7286eace83765"
        ],
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>",
        "Date": "Tue, 29 Nov 2016 16:19:07 +0000",
        "Message-ID": "<1480436367-20749-36-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.2.3",
        "In-Reply-To": "<1480436367-20749-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1479740470-6723-1-git-send-email-arybchenko@solarflare.com>\n\t<1480436367-20749-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-AnalysisOut": [
            "[v=2.1 cv=UoJlQrEB c=1 sm=1 tr=0 a=8BlWFWvVlq5taO8ncb8nKg==]",
            "[:17 a=L24OOQBejmoA:10 a=zRKbQ67AAAAA:8 a=YVv7UwWFKdRp1T9RU]",
            "[boA:9 a=e6KQowiNGcvGsGYV:21 a=Ss_Gg7I_FQST32_K:21 a=PA03WX]",
            "[8tBzeizutn5_OT:22]"
        ],
        "X-Spam": "[F=0.3167477523; CM=0.500; S=0.316(2015072901)]",
        "X-MAIL-FROM": "<arybchenko@solarflare.com>",
        "X-SOURCE-IP": "[12.187.104.26]",
        "Subject": "[dpdk-dev] [PATCH v2 35/55] net/sfc: make available resources\n\testimation and allocation",
        "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": "Resources required in accordance with configuration are\nallocated only.\n\nReviewed-by: Andy Moreton <amoreton@solarflare.com>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n doc/guides/nics/sfc_efx.rst |   8 +++\n drivers/net/sfc/sfc.c       | 117 +++++++++++++++++++++++++++++++++++++++++---\n 2 files changed, 117 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst\nindex 31e86a7..271c8c6 100644\n--- a/doc/guides/nics/sfc_efx.rst\n+++ b/doc/guides/nics/sfc_efx.rst\n@@ -37,6 +37,14 @@ More information can be found at `Solarflare Communications website\n <http://solarflare.com>`_.\n \n \n+Features\n+--------\n+\n+SFC EFX PMD has support for:\n+\n+- Multiple transmit and receive queues\n+\n+\n Non-supported Features\n ----------------------\n \ndiff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c\nindex 8c780ac..6d5fb9a 100644\n--- a/drivers/net/sfc/sfc.c\n+++ b/drivers/net/sfc/sfc.c\n@@ -126,6 +126,105 @@ sfc_check_conf(struct sfc_adapter *sa)\n \treturn rc;\n }\n \n+/*\n+ * Find out maximum number of receive and transmit queues which could be\n+ * advertised.\n+ *\n+ * NIC is kept initialized on success to allow other modules acquire\n+ * defaults and capabilities.\n+ */\n+static int\n+sfc_estimate_resource_limits(struct sfc_adapter *sa)\n+{\n+\tconst efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);\n+\tefx_drv_limits_t limits;\n+\tint rc;\n+\tuint32_t evq_allocated;\n+\tuint32_t rxq_allocated;\n+\tuint32_t txq_allocated;\n+\n+\tmemset(&limits, 0, sizeof(limits));\n+\n+\t/* Request at least one Rx and Tx queue */\n+\tlimits.edl_min_rxq_count = 1;\n+\tlimits.edl_min_txq_count = 1;\n+\t/* Management event queue plus event queue for each Tx and Rx queue */\n+\tlimits.edl_min_evq_count =\n+\t\t1 + limits.edl_min_rxq_count + limits.edl_min_txq_count;\n+\n+\t/* Divide by number of functions to guarantee that all functions\n+\t * will get promised resources\n+\t */\n+\t/* FIXME Divide by number of functions (not 2) below */\n+\tlimits.edl_max_evq_count = encp->enc_evq_limit / 2;\n+\tSFC_ASSERT(limits.edl_max_evq_count >= limits.edl_min_rxq_count);\n+\n+\t/* Split equally between receive and transmit */\n+\tlimits.edl_max_rxq_count =\n+\t\tMIN(encp->enc_rxq_limit, (limits.edl_max_evq_count - 1) / 2);\n+\tSFC_ASSERT(limits.edl_max_rxq_count >= limits.edl_min_rxq_count);\n+\n+\tlimits.edl_max_txq_count =\n+\t\tMIN(encp->enc_txq_limit,\n+\t\t    limits.edl_max_evq_count - 1 - limits.edl_max_rxq_count);\n+\tSFC_ASSERT(limits.edl_max_txq_count >= limits.edl_min_rxq_count);\n+\n+\t/* Configure the minimum required resources needed for the\n+\t * driver to operate, and the maximum desired resources that the\n+\t * driver is capable of using.\n+\t */\n+\tefx_nic_set_drv_limits(sa->nic, &limits);\n+\n+\tsfc_log_init(sa, \"init nic\");\n+\trc = efx_nic_init(sa->nic);\n+\tif (rc != 0)\n+\t\tgoto fail_nic_init;\n+\n+\t/* Find resource dimensions assigned by firmware to this function */\n+\trc = efx_nic_get_vi_pool(sa->nic, &evq_allocated, &rxq_allocated,\n+\t\t\t\t &txq_allocated);\n+\tif (rc != 0)\n+\t\tgoto fail_get_vi_pool;\n+\n+\t/* It still may allocate more than maximum, ensure limit */\n+\tevq_allocated = MIN(evq_allocated, limits.edl_max_evq_count);\n+\trxq_allocated = MIN(rxq_allocated, limits.edl_max_rxq_count);\n+\ttxq_allocated = MIN(txq_allocated, limits.edl_max_txq_count);\n+\n+\t/* Subtract management EVQ not used for traffic */\n+\tSFC_ASSERT(evq_allocated > 0);\n+\tevq_allocated--;\n+\n+\t/* Right now we use separate EVQ for Rx and Tx */\n+\tsa->rxq_max = MIN(rxq_allocated, evq_allocated / 2);\n+\tsa->txq_max = MIN(txq_allocated, evq_allocated - sa->rxq_max);\n+\n+\t/* Keep NIC initialized */\n+\treturn 0;\n+\n+fail_get_vi_pool:\n+fail_nic_init:\n+\tefx_nic_fini(sa->nic);\n+\treturn rc;\n+}\n+\n+static int\n+sfc_set_drv_limits(struct sfc_adapter *sa)\n+{\n+\tconst struct rte_eth_dev_data *data = sa->eth_dev->data;\n+\tefx_drv_limits_t lim;\n+\n+\tmemset(&lim, 0, sizeof(lim));\n+\n+\t/* Limits are strict since take into account initial estimation */\n+\tlim.edl_min_evq_count = lim.edl_max_evq_count =\n+\t\t1 + data->nb_rx_queues + data->nb_tx_queues;\n+\tlim.edl_min_rxq_count = lim.edl_max_rxq_count = data->nb_rx_queues;\n+\tlim.edl_min_txq_count = lim.edl_max_txq_count = data->nb_tx_queues;\n+\n+\treturn efx_nic_set_drv_limits(sa->nic, &lim);\n+}\n+\n int\n sfc_start(struct sfc_adapter *sa)\n {\n@@ -148,6 +247,11 @@ sfc_start(struct sfc_adapter *sa)\n \n \tsa->state = SFC_ADAPTER_STARTING;\n \n+\tsfc_log_init(sa, \"set resource limits\");\n+\trc = sfc_set_drv_limits(sa);\n+\tif (rc != 0)\n+\t\tgoto fail_set_drv_limits;\n+\n \tsfc_log_init(sa, \"init nic\");\n \trc = efx_nic_init(sa->nic);\n \tif (rc != 0)\n@@ -158,6 +262,7 @@ sfc_start(struct sfc_adapter *sa)\n \treturn 0;\n \n fail_nic_init:\n+fail_set_drv_limits:\n \tsa->state = SFC_ADAPTER_CONFIGURED;\n fail_bad_state:\n \tsfc_log_init(sa, \"failed %d\", rc);\n@@ -313,24 +418,20 @@ sfc_attach(struct sfc_adapter *sa)\n \tif (rc != 0)\n \t\tgoto fail_nic_reset;\n \n-\t/* Initialize NIC to double-check hardware */\n-\tsfc_log_init(sa, \"init nic\");\n-\trc = efx_nic_init(enp);\n+\tsfc_log_init(sa, \"estimate resource limits\");\n+\trc = sfc_estimate_resource_limits(sa);\n \tif (rc != 0)\n-\t\tgoto fail_nic_init;\n+\t\tgoto fail_estimate_rsrc_limits;\n \n \tsfc_log_init(sa, \"fini nic\");\n \tefx_nic_fini(enp);\n \n-\tsa->rxq_max = 1;\n-\tsa->txq_max = 1;\n-\n \tsa->state = SFC_ADAPTER_INITIALIZED;\n \n \tsfc_log_init(sa, \"done\");\n \treturn 0;\n \n-fail_nic_init:\n+fail_estimate_rsrc_limits:\n fail_nic_reset:\n \tsfc_log_init(sa, \"unprobe nic\");\n \tefx_nic_unprobe(enp);\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "35/55"
    ]
}