get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54596,
    "url": "http://patches.dpdk.org/api/patches/54596/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1560152324-20538-23-git-send-email-arybchenko@solarflare.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": "<1560152324-20538-23-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1560152324-20538-23-git-send-email-arybchenko@solarflare.com",
    "date": "2019-06-10T07:38:37",
    "name": "[22/29] net/sfc/base: factor out upstream port vAdaptor allocation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "05a77f8c238dacab6f7803df23094f311060b9c2",
    "submitter": {
        "id": 607,
        "url": "http://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1560152324-20538-23-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 4965,
            "url": "http://patches.dpdk.org/api/series/4965/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4965",
            "date": "2019-06-10T07:38:19",
            "name": "net/sfc/base: update base driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4965/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54596/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54596/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 957761BEEF;\n\tMon, 10 Jun 2019 09:39:23 +0200 (CEST)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n\t[67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 4C54F1BE8C\n\tfor <dev@dpdk.org>; Mon, 10 Jun 2019 09:38:56 +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-us5.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n\t507674C005D\n\tfor <dev@dpdk.org>; Mon, 10 Jun 2019 07:38:55 +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, 10 Jun 2019 00:38:51 -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, 10 Jun 2019 00:38:51 -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\tx5A7coQJ008848; Mon, 10 Jun 2019 08:38:50 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\t190CE1616E0; Mon, 10 Jun 2019 08:38:50 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Gautam Dawar <gdawar@solarflare.com>",
        "Date": "Mon, 10 Jun 2019 08:38:37 +0100",
        "Message-ID": "<1560152324-20538-23-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1560152324-20538-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1560152324-20538-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-24664.003",
        "X-TM-AS-Result": "No-14.271900-4.000000-10",
        "X-TMASE-MatchedRID": "SiIDtsa93LUtzpM6mjSdxx23b+lJHvPAAp+UH372RZW8rUtbtWe8+jp0\n\tRQ1/bKBc8XVI39JCRnSlskwMhnibr1PnI9A/227jA9lly13c/gHYuVu0X/rOkFubLFXlyveGVi9\n\taaU/oXJ5Q1prQmHXLf9be6R7w+/aMBy0s9WEbFp4MMH/Sbj9cxNTHOkgubClWWfmMcjcXc0edW2\n\tC/Ex2sg+KLOjqmtohR5knayZl8+1joHbqL/L9QxLPkZNSlyz+bXGjQf7uckKuo8aocg8ZmIyWdE\n\t74gUZAvBsboHPaVxKZfgGj0tt374Nru4wh6t5n7IAjxomarSPAO9z+P2gwiBeD0a1g8E91LWyRx\n\tgP0YDatbiKWUT4TqT6qwMXftVY2Fp0SPFudH7AVM0MpnLn+G9AZyESFXAljfhAGfvGH09D0cQoT\n\tKCLE09XRTisYeVClsDH/0TyZH6mYY2qJOfToy6Z4CIKY/Hg3AGdQnQSTrKGPEQdG7H66TyH4gKq\n\t42LRYkMRYzRU8MtpiF5TvRaqqRLXESh+X6ZjvfCWoFEmEKrDZ+3BndfXUhXQ==",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--14.271900-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24664.003",
        "X-MDID": "1560152335-TiRnhiyzc73W",
        "Subject": "[dpdk-dev] [PATCH 22/29] net/sfc/base: factor out upstream port\n\tvAdaptor allocation",
        "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: Gautam Dawar <gdawar@solarflare.com>\n\nSeparate out vAdaptor allocation from ef10_nic_init() as it is not\nrequired for SR-IOV use case. In case of SR-IOV, vAdaptor is allocated\nearly along with vSwitch creation and vPort configuration.\n\nSigned-off-by: Gautam Dawar <gdawar@solarflare.com>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/base/ef10_nic.c | 110 ++++++++++++++++++++++++++--------------\n 1 file changed, 72 insertions(+), 38 deletions(-)",
    "diff": "diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c\nindex 7eada57..0cf9ddd 100644\n--- a/drivers/net/sfc/base/ef10_nic.c\n+++ b/drivers/net/sfc/base/ef10_nic.c\n@@ -2220,6 +2220,58 @@\n \treturn (rc);\n }\n \n+static\t__checkReturn\tefx_rc_t\n+ef10_upstream_port_vadaptor_alloc(\n+\t__in\t\tefx_nic_t *enp)\n+{\n+\tuint32_t retry;\n+\tuint32_t delay_us;\n+\tefx_rc_t rc;\n+\n+\t/*\n+\t * On a VF, this may fail with MC_CMD_ERR_NO_EVB_PORT (ENOENT) if the PF\n+\t * driver has yet to bring up the EVB port. See bug 56147. In this case,\n+\t * retry the request several times after waiting a while. The wait time\n+\t * between retries starts small (10ms) and exponentially increases.\n+\t * Total wait time is a little over two seconds. Retry logic in the\n+\t * client driver may mean this whole loop is repeated if it continues to\n+\t * fail.\n+\t */\n+\tretry = 0;\n+\tdelay_us = 10000;\n+\twhile ((rc = efx_mcdi_vadaptor_alloc(enp, EVB_PORT_ID_ASSIGNED)) != 0) {\n+\t\tif (EFX_PCI_FUNCTION_IS_PF(&enp->en_nic_cfg) ||\n+\t\t    (rc != ENOENT)) {\n+\t\t\t/*\n+\t\t\t * Do not retry alloc for PF, or for other errors on\n+\t\t\t * a VF.\n+\t\t\t */\n+\t\t\tgoto fail1;\n+\t\t}\n+\n+\t\t/* VF startup before PF is ready. Retry allocation. */\n+\t\tif (retry > 5) {\n+\t\t\t/* Too many attempts */\n+\t\t\trc = EINVAL;\n+\t\t\tgoto fail2;\n+\t\t}\n+\t\tEFSYS_PROBE1(mcdi_no_evb_port_retry, int, retry);\n+\t\tEFSYS_SLEEP(delay_us);\n+\t\tretry++;\n+\t\tif (delay_us < 500000)\n+\t\t\tdelay_us <<= 2;\n+\t}\n+\n+\treturn (0);\n+\n+fail2:\n+\tEFSYS_PROBE(fail2);\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\n+\treturn (rc);\n+}\n+\n \t__checkReturn\tefx_rc_t\n ef10_nic_init(\n \t__in\t\tefx_nic_t *enp)\n@@ -2228,12 +2280,13 @@\n \tuint32_t min_vi_count, max_vi_count;\n \tuint32_t vi_count, vi_base, vi_shift;\n \tuint32_t i;\n-\tuint32_t retry;\n-\tuint32_t delay_us;\n \tuint32_t vi_window_size;\n \tefx_rc_t rc;\n+\tboolean_t alloc_vadaptor = B_TRUE;\n \n-\tEFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));\n+\tEFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||\n+\t    enp->en_family == EFX_FAMILY_MEDFORD ||\n+\t    enp->en_family == EFX_FAMILY_MEDFORD2);\n \n \t/* Enable reporting of some events (e.g. link change) */\n \tif ((rc = efx_mcdi_log_ctrl(enp)) != 0)\n@@ -2330,48 +2383,29 @@\n \t}\n \n \t/*\n-\t * Allocate a vAdaptor attached to our upstream vPort/pPort.\n-\t *\n-\t * On a VF, this may fail with MC_CMD_ERR_NO_EVB_PORT (ENOENT) if the PF\n-\t * driver has yet to bring up the EVB port. See bug 56147. In this case,\n-\t * retry the request several times after waiting a while. The wait time\n-\t * between retries starts small (10ms) and exponentially increases.\n-\t * Total wait time is a little over two seconds. Retry logic in the\n-\t * client driver may mean this whole loop is repeated if it continues to\n-\t * fail.\n+\t * For SR-IOV use case, vAdaptor is allocated for PF and associated VFs\n+\t * during NIC initialization when vSwitch is created and vports are\n+\t * allocated. Hence, skip vAdaptor allocation for EVB and update vport\n+\t * id in NIC structure with the one allocated for PF.\n \t */\n-\tretry = 0;\n-\tdelay_us = 10000;\n-\twhile ((rc = efx_mcdi_vadaptor_alloc(enp, EVB_PORT_ID_ASSIGNED)) != 0) {\n-\t\tif (EFX_PCI_FUNCTION_IS_PF(&enp->en_nic_cfg) ||\n-\t\t    (rc != ENOENT)) {\n-\t\t\t/*\n-\t\t\t * Do not retry alloc for PF, or for other errors on\n-\t\t\t * a VF.\n-\t\t\t */\n-\t\t\tgoto fail5;\n-\t\t}\n-\n-\t\t/* VF startup before PF is ready. Retry allocation. */\n-\t\tif (retry > 5) {\n-\t\t\t/* Too many attempts */\n-\t\t\trc = EINVAL;\n-\t\t\tgoto fail6;\n-\t\t}\n-\t\tEFSYS_PROBE1(mcdi_no_evb_port_retry, int, retry);\n-\t\tEFSYS_SLEEP(delay_us);\n-\t\tretry++;\n-\t\tif (delay_us < 500000)\n-\t\t\tdelay_us <<= 2;\n-\t}\n \n \tenp->en_vport_id = EVB_PORT_ID_ASSIGNED;\n+#if EFSYS_OPT_EVB\n+\tif ((enp->en_vswitchp != NULL) && (enp->en_vswitchp->ev_evcp != NULL)) {\n+\t\t/* For EVB use vport allocated on vswitch */\n+\t\tenp->en_vport_id = enp->en_vswitchp->ev_evcp->evc_vport_id;\n+\t\talloc_vadaptor = B_FALSE;\n+\t}\n+#endif\n+\tif (alloc_vadaptor != B_FALSE) {\n+\t\t/* Allocate a vAdaptor attached to our upstream vPort/pPort */\n+\t\tif ((rc = ef10_upstream_port_vadaptor_alloc(enp)) != 0)\n+\t\t\tgoto fail5;\n+\t}\n \tenp->en_nic_cfg.enc_mcdi_max_payload_length = MCDI_CTL_SDU_LEN_MAX_V2;\n \n \treturn (0);\n \n-fail6:\n-\tEFSYS_PROBE(fail6);\n fail5:\n \tEFSYS_PROBE(fail5);\n fail4:\n",
    "prefixes": [
        "22/29"
    ]
}