get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1099623,
    "url": "http://patchwork.ozlabs.org/api/patches/1099623/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190514173709.62431-9-alice.michael@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20190514173709.62431-9-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2019-05-14T17:37:07",
    "name": "[next,S5,iavf,09/11] iavf: Refactor initstate machine",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8207ee49a91fe175f054d08bd03b212c01a584bb",
    "submitter": {
        "id": 71123,
        "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api",
        "name": "Michael, Alice",
        "email": "alice.michael@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190514173709.62431-9-alice.michael@intel.com/mbox/",
    "series": [
        {
            "id": 107823,
            "url": "http://patchwork.ozlabs.org/api/series/107823/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=107823",
            "date": "2019-05-14T17:37:00",
            "name": "[next,S5,iavf,01/11] iavf: Create VLAN tagelements starting from the first element",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/107823/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1099623/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1099623/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 453Pyv0RwZz9sN1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 15 May 2019 03:37:43 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6C7D3860C5;\n\tTue, 14 May 2019 17:37:41 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id sujxvoJOytLQ; Tue, 14 May 2019 17:37:39 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 37147860EF;\n\tTue, 14 May 2019 17:37:39 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id AAF851BF3FF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 May 2019 17:37:36 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 941A830048\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 May 2019 17:37:36 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 9lHwf7v3OMqr for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 May 2019 17:37:33 +0000 (UTC)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 19CCF3015B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 14 May 2019 17:37:33 +0000 (UTC)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t14 May 2019 10:37:31 -0700",
            "from alicemic-2.jf.intel.com ([10.166.16.121])\n\tby orsmga003.jf.intel.com with ESMTP; 14 May 2019 10:37:30 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 14 May 2019 10:37:07 -0700",
        "Message-Id": "<20190514173709.62431-9-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.19.2",
        "In-Reply-To": "<20190514173709.62431-1-alice.michael@intel.com>",
        "References": "<20190514173709.62431-1-alice.michael@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next PATCH S5 iavf 09/11] iavf: Refactor init\n\tstate machine",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "Jakub Pawlak <jakub.pawlak@intel.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Jakub Pawlak <jakub.pawlak@intel.com>\n\nCleanup of init state machine, move state specific\ncode to separate functions and rewrite the\niavf_init_task() function.\n\nSigned-off-by: Jakub Pawlak <jakub.pawlak@intel.com>\n---\n drivers/net/ethernet/intel/iavf/iavf_main.c | 447 ++++++++++++--------\n 1 file changed, 259 insertions(+), 188 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c\nindex 5c25cf3754bb..8763486ff2b2 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_main.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c\n@@ -14,6 +14,8 @@\n static int iavf_setup_all_tx_resources(struct iavf_adapter *adapter);\n static int iavf_setup_all_rx_resources(struct iavf_adapter *adapter);\n static int iavf_close(struct net_device *netdev);\n+static int iavf_init_get_resources(struct iavf_adapter *adapter);\n+static int iavf_check_reset_complete(struct iavf_hw *hw);\n \n char iavf_driver_name[] = \"iavf\";\n static const char iavf_driver_string[] =\n@@ -57,6 +59,7 @@ MODULE_DESCRIPTION(\"Intel(R) Ethernet Adaptive Virtual Function Network Driver\")\n MODULE_LICENSE(\"GPL v2\");\n MODULE_VERSION(DRV_VERSION);\n \n+static const struct net_device_ops iavf_netdev_ops;\n struct workqueue_struct *iavf_wq;\n \n /**\n@@ -1659,6 +1662,249 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)\n \treturn -EAGAIN;\n }\n \n+/**\n+ * iavf_startup - first step of driver startup\n+ * @adapter: board private structure\n+ *\n+ * Function process __IAVF_STARTUP driver state.\n+ * When success the state is changed to __IAVF_INIT_VERSION_CHECK\n+ * when fails it returns -EAGAIN\n+ **/\n+static int iavf_startup(struct iavf_adapter *adapter)\n+{\n+\tstruct pci_dev *pdev = adapter->pdev;\n+\tstruct iavf_hw *hw = &adapter->hw;\n+\tint err;\n+\n+\tWARN_ON(adapter->state != __IAVF_STARTUP);\n+\n+\t/* driver loaded, probe complete */\n+\tadapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;\n+\tadapter->flags &= ~IAVF_FLAG_RESET_PENDING;\n+\terr = iavf_set_mac_type(hw);\n+\tif (err) {\n+\t\tdev_err(&pdev->dev, \"Failed to set MAC type (%d)\\n\", err);\n+\t\tgoto err;\n+\t}\n+\n+\terr = iavf_check_reset_complete(hw);\n+\tif (err) {\n+\t\tdev_info(&pdev->dev, \"Device is still in reset (%d), retrying\\n\",\n+\t\t\t err);\n+\t\tgoto err;\n+\t}\n+\thw->aq.num_arq_entries = IAVF_AQ_LEN;\n+\thw->aq.num_asq_entries = IAVF_AQ_LEN;\n+\thw->aq.arq_buf_size = IAVF_MAX_AQ_BUF_SIZE;\n+\thw->aq.asq_buf_size = IAVF_MAX_AQ_BUF_SIZE;\n+\n+\terr = iavf_init_adminq(hw);\n+\tif (err) {\n+\t\tdev_err(&pdev->dev, \"Failed to init Admin Queue (%d)\\n\", err);\n+\t\tgoto err;\n+\t}\n+\terr = iavf_send_api_ver(adapter);\n+\tif (err) {\n+\t\tdev_err(&pdev->dev, \"Unable to send to PF (%d)\\n\", err);\n+\t\tiavf_shutdown_adminq(hw);\n+\t\tgoto err;\n+\t}\n+\tadapter->state = __IAVF_INIT_VERSION_CHECK;\n+err:\n+\treturn err;\n+}\n+\n+/**\n+ * iavf_init_version_check - second step of driver startup\n+ * @adapter: board private structure\n+ *\n+ * Function process __IAVF_INIT_VERSION_CHECK driver state.\n+ * When success the state is changed to __IAVF_INIT_GET_RESOURCES\n+ * when fails it returns -EAGAIN\n+ **/\n+static int iavf_init_version_check(struct iavf_adapter *adapter)\n+{\n+\tstruct iavf_hw *hw = &adapter->hw;\n+\tstruct pci_dev *pdev = adapter->pdev;\n+\tint err = -EAGAIN;\n+\n+\tWARN_ON(adapter->state != __IAVF_INIT_VERSION_CHECK);\n+\n+\tif (!iavf_asq_done(hw)) {\n+\t\tdev_err(&pdev->dev, \"Admin queue command never completed\\n\");\n+\t\tiavf_shutdown_adminq(hw);\n+\t\tadapter->state = __IAVF_STARTUP;\n+\t\tgoto err;\n+\t}\n+\n+\t/* aq msg sent, awaiting reply */\n+\terr = iavf_verify_api_ver(adapter);\n+\tif (err) {\n+\t\tif (err == IAVF_ERR_ADMIN_QUEUE_NO_WORK)\n+\t\t\terr = iavf_send_api_ver(adapter);\n+\t\telse\n+\t\t\tdev_err(&pdev->dev, \"Unsupported PF API version %d.%d, expected %d.%d\\n\",\n+\t\t\t\tadapter->pf_version.major,\n+\t\t\t\tadapter->pf_version.minor,\n+\t\t\t\tVIRTCHNL_VERSION_MAJOR,\n+\t\t\t\tVIRTCHNL_VERSION_MINOR);\n+\t\tgoto err;\n+\t}\n+\terr = iavf_send_vf_config_msg(adapter);\n+\tif (err) {\n+\t\tdev_err(&pdev->dev, \"Unable to send config request (%d)\\n\",\n+\t\t\terr);\n+\t\tgoto err;\n+\t}\n+\tadapter->state = __IAVF_INIT_GET_RESOURCES;\n+\n+err:\n+\treturn err;\n+}\n+\n+/**\n+ * iavf_init_get_resources - third step of driver startup\n+ * @adapter: board private structure\n+ *\n+ * Function process __IAVF_INIT_GET_RESOURCES driver state and\n+ * finishes driver initialization procedure.\n+ * When success the state is changed to __IAVF_DOWN\n+ * when fails it returns -EAGAIN\n+ **/\n+static int iavf_init_get_resources(struct iavf_adapter *adapter)\n+{\n+\tstruct net_device *netdev = adapter->netdev;\n+\tstruct iavf_hw *hw = &adapter->hw;\n+\tstruct pci_dev *pdev = adapter->pdev;\n+\tint err = 0, bufsz;\n+\n+\tWARN_ON(adapter->state != __IAVF_INIT_GET_RESOURCES);\n+\t/* aq msg sent, awaiting reply */\n+\tif (!adapter->vf_res) {\n+\t\tbufsz = sizeof(struct virtchnl_vf_resource) +\n+\t\t\t(IAVF_MAX_VF_VSI *\n+\t\t\tsizeof(struct virtchnl_vsi_resource));\n+\t\tadapter->vf_res = kzalloc(bufsz, GFP_KERNEL);\n+\t\tif (!adapter->vf_res)\n+\t\t\tgoto err;\n+\t}\n+\terr = iavf_get_vf_config(adapter);\n+\tif (err == IAVF_ERR_ADMIN_QUEUE_NO_WORK) {\n+\t\terr = iavf_send_vf_config_msg(adapter);\n+\t\tgoto err;\n+\t} else if (err == IAVF_ERR_PARAM) {\n+\t\t/* We only get ERR_PARAM if the device is in a very bad\n+\t\t * state or if we've been disabled for previous bad\n+\t\t * behavior. Either way, we're done now.\n+\t\t */\n+\t\tiavf_shutdown_adminq(hw);\n+\t\tdev_err(&pdev->dev, \"Unable to get VF config due to PF error condition, not retrying\\n\");\n+\t\treturn 0;\n+\t}\n+\tif (err) {\n+\t\tdev_err(&pdev->dev, \"Unable to get VF config (%d)\\n\", err);\n+\t\tgoto err_alloc;\n+\t}\n+\n+\tif (iavf_process_config(adapter))\n+\t\tgoto err_alloc;\n+\tadapter->current_op = VIRTCHNL_OP_UNKNOWN;\n+\n+\tadapter->flags |= IAVF_FLAG_RX_CSUM_ENABLED;\n+\n+\tnetdev->netdev_ops = &iavf_netdev_ops;\n+\tiavf_set_ethtool_ops(netdev);\n+\tnetdev->watchdog_timeo = 5 * HZ;\n+\n+\t/* MTU range: 68 - 9710 */\n+\tnetdev->min_mtu = ETH_MIN_MTU;\n+\tnetdev->max_mtu = IAVF_MAX_RXBUFFER - IAVF_PACKET_HDR_PAD;\n+\n+\tif (!is_valid_ether_addr(adapter->hw.mac.addr)) {\n+\t\tdev_info(&pdev->dev, \"Invalid MAC address %pM, using random\\n\",\n+\t\t\t adapter->hw.mac.addr);\n+\t\teth_hw_addr_random(netdev);\n+\t\tether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr);\n+\t} else {\n+\t\tadapter->flags |= IAVF_FLAG_ADDR_SET_BY_PF;\n+\t\tether_addr_copy(netdev->dev_addr, adapter->hw.mac.addr);\n+\t\tether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr);\n+\t}\n+\n+\tadapter->tx_desc_count = IAVF_DEFAULT_TXD;\n+\tadapter->rx_desc_count = IAVF_DEFAULT_RXD;\n+\terr = iavf_init_interrupt_scheme(adapter);\n+\tif (err)\n+\t\tgoto err_sw_init;\n+\tiavf_map_rings_to_vectors(adapter);\n+\tif (adapter->vf_res->vf_cap_flags &\n+\t\tVIRTCHNL_VF_OFFLOAD_WB_ON_ITR)\n+\t\tadapter->flags |= IAVF_FLAG_WB_ON_ITR_CAPABLE;\n+\n+\terr = iavf_request_misc_irq(adapter);\n+\tif (err)\n+\t\tgoto err_sw_init;\n+\n+\tnetif_carrier_off(netdev);\n+\tadapter->link_up = false;\n+\n+\t/* set the semaphore to prevent any callbacks after device registration\n+\t * up to time when state of driver will be set to __IAVF_DOWN\n+\t */\n+\trtnl_lock();\n+\tif (!adapter->netdev_registered) {\n+\t\terr = register_netdevice(netdev);\n+\t\tif (err) {\n+\t\t\trtnl_unlock();\n+\t\t\tgoto err_register;\n+\t\t}\n+\t}\n+\n+\tadapter->netdev_registered = true;\n+\n+\tnetif_tx_stop_all_queues(netdev);\n+\tif (CLIENT_ALLOWED(adapter)) {\n+\t\terr = iavf_lan_add_device(adapter);\n+\t\tif (err) {\n+\t\t\trtnl_unlock();\n+\t\t\tdev_info(&pdev->dev, \"Failed to add VF to client API service list: %d\\n\",\n+\t\t\t\t err);\n+\t\t}\n+\t}\n+\tdev_info(&pdev->dev, \"MAC address: %pM\\n\", adapter->hw.mac.addr);\n+\tif (netdev->features & NETIF_F_GRO)\n+\t\tdev_info(&pdev->dev, \"GRO is enabled\\n\");\n+\n+\tadapter->state = __IAVF_DOWN;\n+\tset_bit(__IAVF_VSI_DOWN, adapter->vsi.state);\n+\trtnl_unlock();\n+\n+\tiavf_misc_irq_enable(adapter);\n+\twake_up(&adapter->down_waitqueue);\n+\n+\tadapter->rss_key = kzalloc(adapter->rss_key_size, GFP_KERNEL);\n+\tadapter->rss_lut = kzalloc(adapter->rss_lut_size, GFP_KERNEL);\n+\tif (!adapter->rss_key || !adapter->rss_lut)\n+\t\tgoto err_mem;\n+\tif (RSS_AQ(adapter))\n+\t\tadapter->aq_required |= IAVF_FLAG_AQ_CONFIGURE_RSS;\n+\telse\n+\t\tiavf_init_rss(adapter);\n+\n+\treturn err;\n+err_mem:\n+\tiavf_free_rss(adapter);\n+err_register:\n+\tiavf_free_misc_irq(adapter);\n+err_sw_init:\n+\tiavf_reset_interrupt_capability(adapter);\n+err_alloc:\n+\tkfree(adapter->vf_res);\n+\tadapter->vf_res = NULL;\n+err:\n+\treturn err;\n+}\n+\n /**\n  * iavf_watchdog_task - Periodic call-back task\n  * @work: pointer to work_struct\n@@ -3364,207 +3610,32 @@ static void iavf_init_task(struct work_struct *work)\n \tstruct iavf_adapter *adapter = container_of(work,\n \t\t\t\t\t\t      struct iavf_adapter,\n \t\t\t\t\t\t      init_task.work);\n-\tstruct net_device *netdev = adapter->netdev;\n \tstruct iavf_hw *hw = &adapter->hw;\n-\tstruct pci_dev *pdev = adapter->pdev;\n-\tint err;\n \n \tswitch (adapter->state) {\n \tcase __IAVF_STARTUP:\n-\t\t/* driver loaded, probe complete */\n-\t\tadapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;\n-\t\tadapter->flags &= ~IAVF_FLAG_RESET_PENDING;\n-\t\terr = iavf_set_mac_type(hw);\n-\t\tif (err) {\n-\t\t\tdev_err(&pdev->dev, \"Failed to set MAC type (%d)\\n\",\n-\t\t\t\terr);\n-\t\t\tgoto err;\n-\t\t}\n-\t\terr = iavf_check_reset_complete(hw);\n-\t\tif (err) {\n-\t\t\tdev_info(&pdev->dev, \"Device is still in reset (%d), retrying\\n\",\n-\t\t\t\t err);\n-\t\t\tgoto err;\n-\t\t}\n-\t\thw->aq.num_arq_entries = IAVF_AQ_LEN;\n-\t\thw->aq.num_asq_entries = IAVF_AQ_LEN;\n-\t\thw->aq.arq_buf_size = IAVF_MAX_AQ_BUF_SIZE;\n-\t\thw->aq.asq_buf_size = IAVF_MAX_AQ_BUF_SIZE;\n-\n-\t\terr = iavf_init_adminq(hw);\n-\t\tif (err) {\n-\t\t\tdev_err(&pdev->dev, \"Failed to init Admin Queue (%d)\\n\",\n-\t\t\t\terr);\n-\t\t\tgoto err;\n-\t\t}\n-\t\terr = iavf_send_api_ver(adapter);\n-\t\tif (err) {\n-\t\t\tdev_err(&pdev->dev, \"Unable to send to PF (%d)\\n\", err);\n-\t\t\tiavf_shutdown_adminq(hw);\n-\t\t\tgoto err;\n-\t\t}\n-\t\tadapter->state = __IAVF_INIT_VERSION_CHECK;\n-\t\tgoto restart;\n+\t\tif (iavf_startup(adapter) < 0)\n+\t\t\tgoto init_failed;\n+\t\tbreak;\n \tcase __IAVF_INIT_VERSION_CHECK:\n-\t\tif (!iavf_asq_done(hw)) {\n-\t\t\tdev_err(&pdev->dev, \"Admin queue command never completed\\n\");\n-\t\t\tiavf_shutdown_adminq(hw);\n-\t\t\tadapter->state = __IAVF_STARTUP;\n-\t\t\tgoto err;\n-\t\t}\n-\n-\t\t/* aq msg sent, awaiting reply */\n-\t\terr = iavf_verify_api_ver(adapter);\n-\t\tif (err) {\n-\t\t\tif (err == IAVF_ERR_ADMIN_QUEUE_NO_WORK)\n-\t\t\t\terr = iavf_send_api_ver(adapter);\n-\t\t\telse\n-\t\t\t\tdev_err(&pdev->dev, \"Unsupported PF API version %d.%d, expected %d.%d\\n\",\n-\t\t\t\t\tadapter->pf_version.major,\n-\t\t\t\t\tadapter->pf_version.minor,\n-\t\t\t\t\tVIRTCHNL_VERSION_MAJOR,\n-\t\t\t\t\tVIRTCHNL_VERSION_MINOR);\n-\t\t\tgoto err;\n-\t\t}\n-\t\terr = iavf_send_vf_config_msg(adapter);\n-\t\tif (err) {\n-\t\t\tdev_err(&pdev->dev, \"Unable to send config request (%d)\\n\",\n-\t\t\t\terr);\n-\t\t\tgoto err;\n-\t\t}\n-\t\tadapter->state = __IAVF_INIT_GET_RESOURCES;\n-\t\tgoto restart;\n-\tcase __IAVF_INIT_GET_RESOURCES:\n-\t\t/* aq msg sent, awaiting reply */\n-\t\tif (!adapter->vf_res) {\n-\t\t\tadapter->vf_res = kzalloc(struct_size(adapter->vf_res,\n-\t\t\t\t\t\t  vsi_res, IAVF_MAX_VF_VSI),\n-\t\t\t\t\t\t  GFP_KERNEL);\n-\t\t\tif (!adapter->vf_res)\n-\t\t\t\tgoto err;\n-\t\t}\n-\t\terr = iavf_get_vf_config(adapter);\n-\t\tif (err == IAVF_ERR_ADMIN_QUEUE_NO_WORK) {\n-\t\t\terr = iavf_send_vf_config_msg(adapter);\n-\t\t\tgoto err;\n-\t\t} else if (err == IAVF_ERR_PARAM) {\n-\t\t\t/* We only get ERR_PARAM if the device is in a very bad\n-\t\t\t * state or if we've been disabled for previous bad\n-\t\t\t * behavior. Either way, we're done now.\n-\t\t\t */\n-\t\t\tiavf_shutdown_adminq(hw);\n-\t\t\tdev_err(&pdev->dev, \"Unable to get VF config due to PF error condition, not retrying\\n\");\n-\t\t\treturn;\n-\t\t}\n-\t\tif (err) {\n-\t\t\tdev_err(&pdev->dev, \"Unable to get VF config (%d)\\n\",\n-\t\t\t\terr);\n-\t\t\tgoto err_alloc;\n-\t\t}\n-\t\tadapter->state = __IAVF_INIT_SW;\n+\t\tif (iavf_init_version_check(adapter) < 0)\n+\t\t\tgoto init_failed;\n \t\tbreak;\n+\tcase __IAVF_INIT_GET_RESOURCES:\n+\t\tif (iavf_init_get_resources(adapter) < 0)\n+\t\t\tgoto init_failed;\n+\t\treturn;\n \tdefault:\n-\t\tgoto err_alloc;\n+\t\tgoto init_failed;\n \t}\n \n-\tif (iavf_process_config(adapter))\n-\t\tgoto err_alloc;\n-\tadapter->current_op = VIRTCHNL_OP_UNKNOWN;\n-\n-\tadapter->flags |= IAVF_FLAG_RX_CSUM_ENABLED;\n-\n-\tnetdev->netdev_ops = &iavf_netdev_ops;\n-\tiavf_set_ethtool_ops(netdev);\n-\tnetdev->watchdog_timeo = 5 * HZ;\n-\n-\t/* MTU range: 68 - 9710 */\n-\tnetdev->min_mtu = ETH_MIN_MTU;\n-\tnetdev->max_mtu = IAVF_MAX_RXBUFFER - IAVF_PACKET_HDR_PAD;\n-\n-\tif (!is_valid_ether_addr(adapter->hw.mac.addr)) {\n-\t\tdev_info(&pdev->dev, \"Invalid MAC address %pM, using random\\n\",\n-\t\t\t adapter->hw.mac.addr);\n-\t\teth_hw_addr_random(netdev);\n-\t\tether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr);\n-\t} else {\n-\t\tadapter->flags |= IAVF_FLAG_ADDR_SET_BY_PF;\n-\t\tether_addr_copy(netdev->dev_addr, adapter->hw.mac.addr);\n-\t\tether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr);\n-\t}\n-\n-\tqueue_delayed_work(iavf_wq, &adapter->watchdog_task, 1);\n-\n-\tadapter->tx_desc_count = IAVF_DEFAULT_TXD;\n-\tadapter->rx_desc_count = IAVF_DEFAULT_RXD;\n-\terr = iavf_init_interrupt_scheme(adapter);\n-\tif (err)\n-\t\tgoto err_sw_init;\n-\tiavf_map_rings_to_vectors(adapter);\n-\tif (adapter->vf_res->vf_cap_flags &\n-\t    VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)\n-\t\tadapter->flags |= IAVF_FLAG_WB_ON_ITR_CAPABLE;\n-\n-\terr = iavf_request_misc_irq(adapter);\n-\tif (err)\n-\t\tgoto err_sw_init;\n-\n-\tnetif_carrier_off(netdev);\n-\tadapter->link_up = false;\n-\n-\tif (!adapter->netdev_registered) {\n-\t\terr = register_netdev(netdev);\n-\t\tif (err)\n-\t\t\tgoto err_register;\n-\t}\n-\n-\tadapter->netdev_registered = true;\n-\n-\tnetif_tx_stop_all_queues(netdev);\n-\tif (CLIENT_ALLOWED(adapter)) {\n-\t\terr = iavf_lan_add_device(adapter);\n-\t\tif (err)\n-\t\t\tdev_info(&pdev->dev, \"Failed to add VF to client API service list: %d\\n\",\n-\t\t\t\t err);\n-\t}\n-\n-\tdev_info(&pdev->dev, \"MAC address: %pM\\n\", adapter->hw.mac.addr);\n-\tif (netdev->features & NETIF_F_GRO)\n-\t\tdev_info(&pdev->dev, \"GRO is enabled\\n\");\n-\n-\tadapter->state = __IAVF_DOWN;\n-\tset_bit(__IAVF_VSI_DOWN, adapter->vsi.state);\n-\tiavf_misc_irq_enable(adapter);\n-\twake_up(&adapter->down_waitqueue);\n-\n-\tadapter->rss_key = kzalloc(adapter->rss_key_size, GFP_KERNEL);\n-\tadapter->rss_lut = kzalloc(adapter->rss_lut_size, GFP_KERNEL);\n-\tif (!adapter->rss_key || !adapter->rss_lut)\n-\t\tgoto err_mem;\n-\n-\tif (RSS_AQ(adapter)) {\n-\t\tadapter->aq_required |= IAVF_FLAG_AQ_CONFIGURE_RSS;\n-\t\tmod_delayed_work(iavf_wq, &adapter->watchdog_task, 1);\n-\t} else {\n-\t\tiavf_init_rss(adapter);\n-\t}\n-\treturn;\n-restart:\n \tqueue_delayed_work(iavf_wq, &adapter->init_task,\n \t\t\t   msecs_to_jiffies(30));\n \treturn;\n-err_mem:\n-\tiavf_free_rss(adapter);\n-err_register:\n-\tiavf_free_misc_irq(adapter);\n-err_sw_init:\n-\tiavf_reset_interrupt_capability(adapter);\n-err_alloc:\n-\tkfree(adapter->vf_res);\n-\tadapter->vf_res = NULL;\n-err:\n-\t/* Things went into the weeds, so try again later */\n+init_failed:\n \tif (++adapter->aq_wait_count > IAVF_AQ_MAX_ERR) {\n-\t\tdev_err(&pdev->dev, \"Failed to communicate with PF; waiting before retry\\n\");\n+\t\tdev_err(&adapter->pdev->dev,\n+\t\t\t\"Failed to communicate with PF; waiting before retry\\n\");\n \t\tadapter->flags |= IAVF_FLAG_PF_COMMS_FAILED;\n \t\tiavf_shutdown_adminq(hw);\n \t\tadapter->state = __IAVF_STARTUP;\n",
    "prefixes": [
        "next",
        "S5",
        "iavf",
        "09/11"
    ]
}