Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/480876/?format=api
{ "id": 480876, "url": "http://patchwork.ozlabs.org/api/patches/480876/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1433449442-31420-5-git-send-email-catherine.sullivan@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": "<1433449442-31420-5-git-send-email-catherine.sullivan@intel.com>", "list_archive_url": null, "date": "2015-06-04T20:23:58", "name": "[net-next,4/8] i40evf: handle big resets", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d0b6bf6bbe9975284cc6acbaeaaafc1a0b1a0c44", "submitter": { "id": 13931, "url": "http://patchwork.ozlabs.org/api/people/13931/?format=api", "name": "Catherine Sullivan", "email": "catherine.sullivan@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/1433449442-31420-5-git-send-email-catherine.sullivan@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/480876/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/480876/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.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" ], "Received": [ "from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id DA50014027F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 5 Jun 2015 06:22:28 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 338899653D;\n\tThu, 4 Jun 2015 20:22:28 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id BI7-R1ZAGGMO; Thu, 4 Jun 2015 20:22:27 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2AC8B96547;\n\tThu, 4 Jun 2015 20:22:27 +0000 (UTC)", "from silver.osuosl.org (silver.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id D73911C1F3C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 4 Jun 2015 20:22:25 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id D213E32DE6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 4 Jun 2015 20:22:25 +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 lPyvaZC5iMGs for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 4 Jun 2015 20:22:24 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby silver.osuosl.org (Postfix) with ESMTP id 90AD932A8E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 4 Jun 2015 20:22:24 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga103.fm.intel.com with ESMTP; 04 Jun 2015 13:22:24 -0700", "from catheri1-tigger.jf.intel.com ([134.134.176.92])\n\tby orsmga001.jf.intel.com with ESMTP; 04 Jun 2015 13:22:24 -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-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.13,554,1427785200\"; d=\"scan'208\";a=\"705514376\"", "From": "Catherine Sullivan <catherine.sullivan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 4 Jun 2015 16:23:58 -0400", "Message-Id": "<1433449442-31420-5-git-send-email-catherine.sullivan@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1433449442-31420-1-git-send-email-catherine.sullivan@intel.com>", "References": "<1433449442-31420-1-git-send-email-catherine.sullivan@intel.com>", "Subject": "[Intel-wired-lan] [intel-wired-lan][net-next PATCH 4/8] i40evf:\n\thandle big resets", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "From: Mitch Williams <mitch.a.williams@intel.com>\n\nThe most common type of reset that the VF will encounter is a PF reset\nthat cascades down into a VF reset for each VF. In this case, the VF\nwill always be assigned the same VSI and recovery is fairly simple.\n\nHowever, in the case of 'bigger' resets, such as a Core or EMP reset,\nwhen the device is reinitialized, it's probable that the VF will NOT get\nthe same VSI. When this happens, the VF will not be able to recover, as\nit will continue to request resources for its original VSI.\n\nAdd an extra state to the admin queue state machine so that the driver\ncan re-request its configuration information at runtime. During reset\nrecovery, set this bit in the aq_required field, and fetch the (possibly\nnew) configuration information before attempting to bring the driver\nback up. Since the driver doesn't know what kind of reset it has\nencountered, this step is done even for a PF reset, but it doesn't hurt\nanything - it just gets the same VSI back.\n\nSigned-off-by: Mitch Williams <mitch.a.williams@intel.com>\nChange-ID: I915d59ffb40375215117362f4ac7a37811aba748\n---\n drivers/net/ethernet/intel/i40evf/i40evf.h | 2 +\n drivers/net/ethernet/intel/i40evf/i40evf_main.c | 109 +++++++++++++--------\n .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 30 +++++-\n 3 files changed, 95 insertions(+), 46 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex 9961e17..c741181 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -234,6 +234,7 @@ struct i40evf_adapter {\n #define I40EVF_FLAG_AQ_CONFIGURE_QUEUES\t\t(u32)(1 << 6)\n #define I40EVF_FLAG_AQ_MAP_VECTORS\t\t(u32)(1 << 7)\n #define I40EVF_FLAG_AQ_HANDLE_RESET\t\t(u32)(1 << 8)\n+#define I40EVF_FLAG_AQ_GET_CONFIG\t\t(u32)(1 << 10)\n \n \t/* OS defined structs */\n \tstruct net_device *netdev;\n@@ -273,6 +274,7 @@ extern const char i40evf_driver_version[];\n \n int i40evf_up(struct i40evf_adapter *adapter);\n void i40evf_down(struct i40evf_adapter *adapter);\n+int i40evf_process_config(struct i40evf_adapter *adapter);\n void i40evf_reinit_locked(struct i40evf_adapter *adapter);\n void i40evf_reset(struct i40evf_adapter *adapter);\n void i40evf_set_ethtool_ops(struct net_device *netdev);\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex 27f01c6..e2b7bf6 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -1370,6 +1370,10 @@ static void i40evf_watchdog_task(struct work_struct *work)\n \t\t}\n \t\tgoto watchdog_done;\n \t}\n+\tif (adapter->aq_required & I40EVF_FLAG_AQ_GET_CONFIG) {\n+\t\ti40evf_send_vf_config_msg(adapter);\n+\t\tgoto watchdog_done;\n+\t}\n \n \tif (adapter->aq_required & I40EVF_FLAG_AQ_DISABLE_QUEUES) {\n \t\ti40evf_disable_queues(adapter);\n@@ -1592,7 +1596,8 @@ continue_reset:\n \t\tdev_info(&adapter->pdev->dev, \"Failed to init adminq: %d\\n\",\n \t\t\t err);\n \n-\ti40evf_map_queues(adapter);\n+\tadapter->aq_required = I40EVF_FLAG_AQ_GET_CONFIG;\n+\tadapter->aq_required |= I40EVF_FLAG_AQ_MAP_VECTORS;\n \n \t/* re-add all MAC filters */\n \tlist_for_each_entry(f, &adapter->mac_filter_list, list) {\n@@ -1602,7 +1607,7 @@ continue_reset:\n \tlist_for_each_entry(f, &adapter->vlan_filter_list, list) {\n \t\tf->add = true;\n \t}\n-\tadapter->aq_required = I40EVF_FLAG_AQ_ADD_MAC_FILTER;\n+\tadapter->aq_required |= I40EVF_FLAG_AQ_ADD_MAC_FILTER;\n \tadapter->aq_required |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER;\n \tclear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);\n \n@@ -1999,6 +2004,62 @@ static int i40evf_check_reset_complete(struct i40e_hw *hw)\n }\n \n /**\n+ * i40evf_process_config - Process the config information we got from the PF\n+ * @adapter: board private structure\n+ *\n+ * Verify that we have a valid config struct, and set up our netdev features\n+ * and our VSI struct.\n+ **/\n+int i40evf_process_config(struct i40evf_adapter *adapter)\n+{\n+\tstruct net_device *netdev = adapter->netdev;\n+\tint i;\n+\n+\t/* got VF config message back from PF, now we can parse it */\n+\tfor (i = 0; i < adapter->vf_res->num_vsis; i++) {\n+\t\tif (adapter->vf_res->vsi_res[i].vsi_type == I40E_VSI_SRIOV)\n+\t\t\tadapter->vsi_res = &adapter->vf_res->vsi_res[i];\n+\t}\n+\tif (!adapter->vsi_res) {\n+\t\tdev_err(&adapter->pdev->dev, \"No LAN VSI found\\n\");\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tif (adapter->vf_res->vf_offload_flags\n+\t & I40E_VIRTCHNL_VF_OFFLOAD_VLAN) {\n+\t\tnetdev->vlan_features = netdev->features;\n+\t\tnetdev->features |= NETIF_F_HW_VLAN_CTAG_TX |\n+\t\t\t\t NETIF_F_HW_VLAN_CTAG_RX |\n+\t\t\t\t NETIF_F_HW_VLAN_CTAG_FILTER;\n+\t}\n+\tnetdev->features |= NETIF_F_HIGHDMA |\n+\t\t\t NETIF_F_SG |\n+\t\t\t NETIF_F_IP_CSUM |\n+\t\t\t NETIF_F_SCTP_CSUM |\n+\t\t\t NETIF_F_IPV6_CSUM |\n+\t\t\t NETIF_F_TSO |\n+\t\t\t NETIF_F_TSO6 |\n+\t\t\t NETIF_F_RXCSUM |\n+\t\t\t NETIF_F_GRO;\n+\n+\t/* copy netdev features into list of user selectable features */\n+\tnetdev->hw_features |= netdev->features;\n+\tnetdev->hw_features &= ~NETIF_F_RXCSUM;\n+\n+\tadapter->vsi.id = adapter->vsi_res->vsi_id;\n+\n+\tadapter->vsi.back = adapter;\n+\tadapter->vsi.base_vector = 1;\n+\tadapter->vsi.work_limit = I40E_DEFAULT_IRQ_WORK;\n+\tadapter->vsi.rx_itr_setting = (I40E_ITR_DYNAMIC |\n+\t\t\t\t ITR_REG_TO_USEC(I40E_ITR_RX_DEF));\n+\tadapter->vsi.tx_itr_setting = (I40E_ITR_DYNAMIC |\n+\t\t\t\t ITR_REG_TO_USEC(I40E_ITR_TX_DEF));\n+\tadapter->vsi.netdev = adapter->netdev;\n+\treturn 0;\n+}\n+\n+/**\n * i40evf_init_task - worker thread to perform delayed initialization\n * @work: pointer to work_struct containing our data\n *\n@@ -2018,7 +2079,7 @@ static void i40evf_init_task(struct work_struct *work)\n \tstruct net_device *netdev = adapter->netdev;\n \tstruct i40e_hw *hw = &adapter->hw;\n \tstruct pci_dev *pdev = adapter->pdev;\n-\tint i, err, bufsz;\n+\tint err, bufsz;\n \n \tswitch (adapter->state) {\n \tcase __I40EVF_STARTUP:\n@@ -2104,42 +2165,15 @@ static void i40evf_init_task(struct work_struct *work)\n \tdefault:\n \t\tgoto err_alloc;\n \t}\n-\t/* got VF config message back from PF, now we can parse it */\n-\tfor (i = 0; i < adapter->vf_res->num_vsis; i++) {\n-\t\tif (adapter->vf_res->vsi_res[i].vsi_type == I40E_VSI_SRIOV)\n-\t\t\tadapter->vsi_res = &adapter->vf_res->vsi_res[i];\n-\t}\n-\tif (!adapter->vsi_res) {\n-\t\tdev_err(&pdev->dev, \"No LAN VSI found\\n\");\n+\tif (i40evf_process_config(adapter))\n \t\tgoto err_alloc;\n-\t}\n+\tadapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;\n \n \tadapter->flags |= I40EVF_FLAG_RX_CSUM_ENABLED;\n \n \tnetdev->netdev_ops = &i40evf_netdev_ops;\n \ti40evf_set_ethtool_ops(netdev);\n \tnetdev->watchdog_timeo = 5 * HZ;\n-\tnetdev->features |= NETIF_F_HIGHDMA |\n-\t\t\t NETIF_F_SG |\n-\t\t\t NETIF_F_IP_CSUM |\n-\t\t\t NETIF_F_SCTP_CSUM |\n-\t\t\t NETIF_F_IPV6_CSUM |\n-\t\t\t NETIF_F_TSO |\n-\t\t\t NETIF_F_TSO6 |\n-\t\t\t NETIF_F_RXCSUM |\n-\t\t\t NETIF_F_GRO;\n-\n-\tif (adapter->vf_res->vf_offload_flags\n-\t & I40E_VIRTCHNL_VF_OFFLOAD_VLAN) {\n-\t\tnetdev->vlan_features = netdev->features;\n-\t\tnetdev->features |= NETIF_F_HW_VLAN_CTAG_TX |\n-\t\t\t\t NETIF_F_HW_VLAN_CTAG_RX |\n-\t\t\t\t NETIF_F_HW_VLAN_CTAG_FILTER;\n-\t}\n-\n-\t/* copy netdev features into list of user selectable features */\n-\tnetdev->hw_features |= netdev->features;\n-\tnetdev->hw_features &= ~NETIF_F_RXCSUM;\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@@ -2170,17 +2204,6 @@ static void i40evf_init_task(struct work_struct *work)\n \n \tnetif_carrier_off(netdev);\n \n-\tadapter->vsi.id = adapter->vsi_res->vsi_id;\n-\tadapter->vsi.seid = adapter->vsi_res->vsi_id; /* dummy */\n-\tadapter->vsi.back = adapter;\n-\tadapter->vsi.base_vector = 1;\n-\tadapter->vsi.work_limit = I40E_DEFAULT_IRQ_WORK;\n-\tadapter->vsi.rx_itr_setting = (I40E_ITR_DYNAMIC |\n-\t\t\t\t ITR_REG_TO_USEC(I40E_ITR_RX_DEF));\n-\tadapter->vsi.tx_itr_setting = (I40E_ITR_DYNAMIC |\n-\t\t\t\t ITR_REG_TO_USEC(I40E_ITR_TX_DEF));\n-\tadapter->vsi.netdev = adapter->netdev;\n-\n \tif (!adapter->netdev_registered) {\n \t\terr = register_netdev(netdev);\n \t\tif (err)\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\nindex 61e0905..a37d56b 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n@@ -145,8 +145,24 @@ out:\n **/\n int i40evf_send_vf_config_msg(struct i40evf_adapter *adapter)\n {\n-\treturn i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_GET_VF_RESOURCES,\n-\t\t\t\t NULL, 0);\n+\tu32 caps;\n+\n+\tadapter->current_op = I40E_VIRTCHNL_OP_GET_VF_RESOURCES;\n+\tadapter->aq_required &= ~I40EVF_FLAG_AQ_GET_CONFIG;\n+\tcaps = I40E_VIRTCHNL_VF_OFFLOAD_L2 |\n+\t I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ |\n+\t I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG |\n+\t I40E_VIRTCHNL_VF_OFFLOAD_VLAN;\n+\tadapter->current_op = I40E_VIRTCHNL_OP_GET_VF_RESOURCES;\n+\tadapter->aq_required &= ~I40EVF_FLAG_AQ_GET_CONFIG;\n+\tif (PF_IS_V11(adapter))\n+\t\treturn i40evf_send_pf_msg(adapter,\n+\t\t\t\t\t I40E_VIRTCHNL_OP_GET_VF_RESOURCES,\n+\t\t\t\t\t (u8 *)&caps, sizeof(caps));\n+\telse\n+\t\treturn i40evf_send_pf_msg(adapter,\n+\t\t\t\t\t I40E_VIRTCHNL_OP_GET_VF_RESOURCES,\n+\t\t\t\t\t NULL, 0);\n }\n \n /**\n@@ -729,6 +745,15 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,\n \t\tadapter->current_stats = *stats;\n \t\t}\n \t\tbreak;\n+\tcase I40E_VIRTCHNL_OP_GET_VF_RESOURCES: {\n+\t\tu16 len = sizeof(struct i40e_virtchnl_vf_resource) +\n+\t\t\t I40E_MAX_VF_VSI *\n+\t\t\t sizeof(struct i40e_virtchnl_vsi_resource);\n+\t\tmemcpy(adapter->vf_res, msg, min(msglen, len));\n+\t\ti40e_vf_parse_hw_config(&adapter->hw, adapter->vf_res);\n+\t\ti40evf_process_config(adapter);\n+\t\t}\n+\t\tbreak;\n \tcase I40E_VIRTCHNL_OP_ENABLE_QUEUES:\n \t\t/* enable transmits */\n \t\ti40evf_irq_enable(adapter, true);\n@@ -740,7 +765,6 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,\n \t\ti40evf_free_all_rx_resources(adapter);\n \t\tbreak;\n \tcase I40E_VIRTCHNL_OP_VERSION:\n-\tcase I40E_VIRTCHNL_OP_GET_VF_RESOURCES:\n \tcase I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP:\n \t\t/* Don't display an error if we get these out of sequence.\n \t\t * If the firmware needed to get kicked, we'll get these and\n", "prefixes": [ "net-next", "4/8" ] }