get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45209,
    "url": "https://patches.dpdk.org/api/patches/45209/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1537797030-26548-7-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": "<1537797030-26548-7-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1537797030-26548-7-git-send-email-arybchenko@solarflare.com",
    "date": "2018-09-24T13:50:25",
    "name": "[06/11] net/sfc/base: support improvements to bandwidth calculations",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "cf825941a417c9810c448cbc297545911e8625ac",
    "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/1537797030-26548-7-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 1467,
            "url": "https://patches.dpdk.org/api/series/1467/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1467",
            "date": "2018-09-24T13:50:22",
            "name": "net/sfc: update base driver to support 50G and 100G",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/1467/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/45209/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/45209/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 CAE9E5592;\n\tMon, 24 Sep 2018 15:51:07 +0200 (CEST)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n\t[148.163.129.52]) by dpdk.org (Postfix) with ESMTP id B9D161AFF\n\tfor <dev@dpdk.org>; Mon, 24 Sep 2018 15:50:51 +0200 (CEST)",
            "from webmail.solarflare.com (webmail.solarflare.com\n\t[12.187.104.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with\n\tESMTPS id\n\t768FCB4005A for <dev@dpdk.org>; Mon, 24 Sep 2018 13:50:50 +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.1395.4; Mon, 24 Sep 2018 06:50:47 -0700",
            "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.1395.4 via Frontend Transport; Mon, 24 Sep 2018 06:50:47 -0700",
            "from ukv-loginhost.uk.solarflarecom.com\n\t(ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tw8ODojNa014534; Mon, 24 Sep 2018 14:50:45 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\tB6B4A1626D1; Mon, 24 Sep 2018 14:50:45 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Richard Houldsworth <rhouldsworth@solarflare.com>",
        "Date": "Mon, 24 Sep 2018 14:50:25 +0100",
        "Message-ID": "<1537797030-26548-7-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1537797030-26548-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1537797030-26548-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-TM-AS-Product-Ver": "SMEX-12.5.0.1300-8.5.1010-24114.005",
        "X-TM-AS-Result": "No-3.117900-4.000000-10",
        "X-TMASE-MatchedRID": "BM62/VBoOSuqO+wHLkIcO3T7rnt3EYkYSOZtBHQ3LLyNxFb0yp4mr2fp\n\tJas3m/8V09NQNrxIpFZ087PttM+CRI0950jcMCP40Xw0ILvo/uXljSRvSGpq3L4UBECYc8KmWmr\n\tYr8SaWTUANcTxXeakRW2UIwvQdMxgO+R+kUWKdRq4jAucHcCqnX0tCKdnhB589yM15V5aWpj6C0\n\tePs7A07Sib6hcH39TzGz3o5UEMBdyZLqDwwuvUJoLJRjuPSYK574SAtcYLAWBE9dbffWyUMTtXL\n\tY03Jgc2rsBO/mljilQ4GoaeLuWvK9SUz6nF7J+N2kC7SwvGlKhDwb7Jglhh1lFkOwaJdCKgviPE\n\tqcclEtzAvpLE+mvX8g==",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--3.117900-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24114.005",
        "X-MDID": "1537797051-ppHKymZ3MFHE",
        "Subject": "[dpdk-dev] [PATCH 06/11] net/sfc/base: support improvements to\n\tbandwidth calculations",
        "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://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Richard Houldsworth <rhouldsworth@solarflare.com>\n\nChange the interface to ef10_nic_get_port_mode_bandwidth()\nso more NIC information can be used to infer bandwidth\nrequirements. Huntington calculations separated out\ncompletely.\n\nSigned-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/base/ef10_impl.h    |  2 +-\n drivers/net/sfc/base/ef10_nic.c     | 16 +++++++++++++---\n drivers/net/sfc/base/hunt_nic.c     | 13 +++----------\n drivers/net/sfc/base/medford2_nic.c | 12 +-----------\n drivers/net/sfc/base/medford_nic.c  | 12 +-----------\n 5 files changed, 19 insertions(+), 36 deletions(-)",
    "diff": "diff --git a/drivers/net/sfc/base/ef10_impl.h b/drivers/net/sfc/base/ef10_impl.h\nindex b72e7d256..e43e26e68 100644\n--- a/drivers/net/sfc/base/ef10_impl.h\n+++ b/drivers/net/sfc/base/ef10_impl.h\n@@ -1174,7 +1174,7 @@ efx_mcdi_get_port_modes(\n \n extern\t__checkReturn\tefx_rc_t\n ef10_nic_get_port_mode_bandwidth(\n-\t__in\t\tuint32_t port_mode,\n+\t__in\t\tefx_nic_t *enp,\n \t__out\t\tuint32_t *bandwidth_mbpsp);\n \n extern\t__checkReturn\tefx_rc_t\ndiff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c\nindex 1eea7c673..8cd76d690 100644\n--- a/drivers/net/sfc/base/ef10_nic.c\n+++ b/drivers/net/sfc/base/ef10_nic.c\n@@ -128,16 +128,24 @@ efx_mcdi_get_port_modes(\n \n \t__checkReturn\tefx_rc_t\n ef10_nic_get_port_mode_bandwidth(\n-\t__in\t\tuint32_t port_mode,\n+\t__in\t\tefx_nic_t *enp,\n \t__out\t\tuint32_t *bandwidth_mbpsp)\n {\n+\tuint32_t port_modes;\n+\tuint32_t current_mode;\n \tuint32_t single_lane = 10000;\n \tuint32_t dual_lane   = 50000;\n \tuint32_t quad_lane   = 40000;\n \tuint32_t bandwidth;\n \tefx_rc_t rc;\n \n-\tswitch (port_mode) {\n+\tif ((rc = efx_mcdi_get_port_modes(enp, &port_modes,\n+\t\t\t\t    &current_mode, NULL)) != 0) {\n+\t\t/* No port mode info available. */\n+\t\tgoto fail1;\n+\t}\n+\n+\tswitch (current_mode) {\n \tcase TLV_PORT_MODE_1x1_NA:\t\t\t/* mode 0 */\n \t\tbandwidth = single_lane;\n \t\tbreak;\n@@ -187,13 +195,15 @@ ef10_nic_get_port_mode_bandwidth(\n \t\tbreak;\n \tdefault:\n \t\trc = EINVAL;\n-\t\tgoto fail1;\n+\t\tgoto fail2;\n \t}\n \n \t*bandwidth_mbpsp = bandwidth;\n \n \treturn (0);\n \n+fail2:\n+\tEFSYS_PROBE(fail2);\n fail1:\n \tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n \ndiff --git a/drivers/net/sfc/base/hunt_nic.c b/drivers/net/sfc/base/hunt_nic.c\nindex 70c042f3f..ca30e90f7 100644\n--- a/drivers/net/sfc/base/hunt_nic.c\n+++ b/drivers/net/sfc/base/hunt_nic.c\n@@ -20,7 +20,6 @@ hunt_nic_get_required_pcie_bandwidth(\n \t__out\t\tuint32_t *bandwidth_mbpsp)\n {\n \tuint32_t port_modes;\n-\tuint32_t max_port_mode;\n \tuint32_t bandwidth;\n \tefx_rc_t rc;\n \n@@ -47,17 +46,13 @@ hunt_nic_get_required_pcie_bandwidth(\n \t\t\tgoto fail1;\n \t} else {\n \t\tif (port_modes & (1U << TLV_PORT_MODE_40G)) {\n-\t\t\tmax_port_mode = TLV_PORT_MODE_40G;\n+\t\t\tbandwidth = 40000;\n \t\t} else if (port_modes & (1U << TLV_PORT_MODE_10G_10G_10G_10G)) {\n-\t\t\tmax_port_mode = TLV_PORT_MODE_10G_10G_10G_10G;\n+\t\t\tbandwidth = 4 * 10000;\n \t\t} else {\n \t\t\t/* Assume two 10G ports */\n-\t\t\tmax_port_mode = TLV_PORT_MODE_10G_10G;\n+\t\t\tbandwidth = 2 * 10000;\n \t\t}\n-\n-\t\tif ((rc = ef10_nic_get_port_mode_bandwidth(max_port_mode,\n-\t\t\t\t\t\t\t    &bandwidth)) != 0)\n-\t\t\tgoto fail2;\n \t}\n \n out:\n@@ -65,8 +60,6 @@ hunt_nic_get_required_pcie_bandwidth(\n \n \treturn (0);\n \n-fail2:\n-\tEFSYS_PROBE(fail2);\n fail1:\n \tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n \ndiff --git a/drivers/net/sfc/base/medford2_nic.c b/drivers/net/sfc/base/medford2_nic.c\nindex 3efc35886..6bc1e87cc 100644\n--- a/drivers/net/sfc/base/medford2_nic.c\n+++ b/drivers/net/sfc/base/medford2_nic.c\n@@ -15,25 +15,15 @@ medford2_nic_get_required_pcie_bandwidth(\n \t__in\t\tefx_nic_t *enp,\n \t__out\t\tuint32_t *bandwidth_mbpsp)\n {\n-\tuint32_t port_modes;\n-\tuint32_t current_mode;\n \tuint32_t bandwidth;\n \tefx_rc_t rc;\n \n \t/* FIXME: support new Medford2 dynamic port modes */\n \n-\tif ((rc = efx_mcdi_get_port_modes(enp, &port_modes,\n-\t\t\t\t    &current_mode, NULL)) != 0) {\n-\t\t/* No port mode info available. */\n-\t\tbandwidth = 0;\n-\t\tgoto out;\n-\t}\n-\n-\tif ((rc = ef10_nic_get_port_mode_bandwidth(current_mode,\n+\tif ((rc = ef10_nic_get_port_mode_bandwidth(enp,\n \t\t\t\t\t\t    &bandwidth)) != 0)\n \t\tgoto fail1;\n \n-out:\n \t*bandwidth_mbpsp = bandwidth;\n \n \treturn (0);\ndiff --git a/drivers/net/sfc/base/medford_nic.c b/drivers/net/sfc/base/medford_nic.c\nindex 4f1896343..bfe01ca93 100644\n--- a/drivers/net/sfc/base/medford_nic.c\n+++ b/drivers/net/sfc/base/medford_nic.c\n@@ -15,23 +15,13 @@ medford_nic_get_required_pcie_bandwidth(\n \t__in\t\tefx_nic_t *enp,\n \t__out\t\tuint32_t *bandwidth_mbpsp)\n {\n-\tuint32_t port_modes;\n-\tuint32_t current_mode;\n \tuint32_t bandwidth;\n \tefx_rc_t rc;\n \n-\tif ((rc = efx_mcdi_get_port_modes(enp, &port_modes,\n-\t\t\t\t    &current_mode, NULL)) != 0) {\n-\t\t/* No port mode info available. */\n-\t\tbandwidth = 0;\n-\t\tgoto out;\n-\t}\n-\n-\tif ((rc = ef10_nic_get_port_mode_bandwidth(current_mode,\n+\tif ((rc = ef10_nic_get_port_mode_bandwidth(enp,\n \t\t\t\t\t\t    &bandwidth)) != 0)\n \t\tgoto fail1;\n \n-out:\n \t*bandwidth_mbpsp = bandwidth;\n \n \treturn (0);\n",
    "prefixes": [
        "06/11"
    ]
}