Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1291784/?format=api
{ "id": 1291784, "url": "http://patchwork.ozlabs.org/api/patches/1291784/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200516005121.4963-7-anthony.l.nguyen@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": "<20200516005121.4963-7-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2020-05-16T00:51:13", "name": "[S45,07/15] ice: Add functions to rebuild host VLAN/MAC config for a VF", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "39de8a5cf9c2467aeb06934e37a00db9e00ed2fd", "submitter": { "id": 68875, "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api", "name": "Tony Nguyen", "email": "anthony.l.nguyen@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/20200516005121.4963-7-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 177330, "url": "http://patchwork.ozlabs.org/api/series/177330/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=177330", "date": "2020-05-16T00:51:18", "name": "[S45,01/15] ice: Refactor ice_ena_vf_mappings to split MSIX and queue mappings", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/177330/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1291784/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1291784/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 spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.136; helo=silver.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)", "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49P6H910Jsz9sTM\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 16 May 2020 10:54:13 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 792D622829;\n\tSat, 16 May 2020 00:54:11 +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 8VNUAPYVOjSe; Sat, 16 May 2020 00:54:05 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 83D6E227B1;\n\tSat, 16 May 2020 00:54:02 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id BD82B1BF9C6\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:53:58 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by fraxinus.osuosl.org (Postfix) with ESMTP id BA42087F7D\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:53:58 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id ZCYr82f84h3O for <intel-wired-lan@lists.osuosl.org>;\n Sat, 16 May 2020 00:53:58 +0000 (UTC)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by fraxinus.osuosl.org (Postfix) with ESMTPS id 32DF3880B7\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:53:56 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 May 2020 17:53:54 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by orsmga003.jf.intel.com with ESMTP; 15 May 2020 17:53:54 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "IronPort-SDR": [ "\n PBYBP1HJ3H4D+JGbOHXOSyTKMOzOpY9NQ2nXqQgPHSs7MLxYzjjAr9lJnnSx48eY/Nexa7u8iG\n WZJMGcBRG4ow==", "\n 1m2ycWpnA0DBe6CDzLlHfRgVNuTKFJQkEXU/tswfbK7iMP098e92WbQ4LzJd1ZZmpG5dsHRqgQ\n uJxnsiEuSHDA==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.73,397,1583222400\"; d=\"scan'208\";a=\"263360543\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 15 May 2020 17:51:13 -0700", "Message-Id": "<20200516005121.4963-7-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200516005121.4963-1-anthony.l.nguyen@intel.com>", "References": "<20200516005121.4963-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S45 07/15] ice: Add functions to rebuild\n host VLAN/MAC config for a VF", "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 <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <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 <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "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: Brett Creeley <brett.creeley@intel.com>\n\nWhen resetting a VF the VLAN and MAC filter configurations need to be\nreplayed. Add helper functions for this purpose.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 121 +++++++++++++-----\n 1 file changed, 89 insertions(+), 32 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 1599d89216a5..1212bf42c135 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -540,6 +540,82 @@ static int ice_calc_vf_first_vector_idx(struct ice_pf *pf, struct ice_vf *vf)\n \treturn pf->sriov_base_vector + vf->vf_id * pf->num_msix_per_vf;\n }\n \n+/**\n+ * ice_vf_rebuild_host_vlan_cfg - add VLAN 0 filter or rebuild the Port VLAN\n+ * @vf: VF to add MAC filters for\n+ *\n+ * Called after a VF VSI has been re-added/rebuilt during reset. The PF driver\n+ * always re-adds either a VLAN 0 or port VLAN based filter after reset.\n+ */\n+static int ice_vf_rebuild_host_vlan_cfg(struct ice_vf *vf)\n+{\n+\tstruct ice_vsi *vsi = vf->pf->vsi[vf->lan_vsi_idx];\n+\tstruct device *dev = ice_pf_to_dev(vf->pf);\n+\tu16 vlan_id = 0;\n+\tint err;\n+\n+\tif (vf->port_vlan_info) {\n+\t\terr = ice_vsi_manage_pvid(vsi, vf->port_vlan_info, true);\n+\t\tif (err) {\n+\t\t\tdev_err(dev, \"failed to configure port VLAN via VSI parameters for VF %u, error %d\\n\",\n+\t\t\t\tvf->vf_id, err);\n+\t\t\treturn err;\n+\t\t}\n+\n+\t\tvlan_id = vf->port_vlan_info & VLAN_VID_MASK;\n+\t}\n+\n+\t/* vlan_id will either be 0 or the port VLAN number */\n+\terr = ice_vsi_add_vlan(vsi, vlan_id, ICE_FWD_TO_VSI);\n+\tif (err) {\n+\t\tdev_err(dev, \"failed to add %s VLAN %u filter for VF %u, error %d\\n\",\n+\t\t\tvf->port_vlan_info ? \"port\" : \"\", vlan_id, vf->vf_id,\n+\t\t\terr);\n+\t\treturn err;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * ice_vf_rebuild_host_mac_cfg - add broadcast and the VF's perm_addr/LAA\n+ * @vf: VF to add MAC filters for\n+ *\n+ * Called after a VF VSI has been re-added/rebuilt during reset. The PF driver\n+ * always re-adds a broadcast filter and the VF's perm_addr/LAA after reset.\n+ */\n+static int ice_vf_rebuild_host_mac_cfg(struct ice_vf *vf)\n+{\n+\tstruct ice_vsi *vsi = vf->pf->vsi[vf->lan_vsi_idx];\n+\tstruct device *dev = ice_pf_to_dev(vf->pf);\n+\tenum ice_status status;\n+\tu8 broadcast[ETH_ALEN];\n+\n+\teth_broadcast_addr(broadcast);\n+\tstatus = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI);\n+\tif (status) {\n+\t\tdev_err(dev, \"failed to add broadcast MAC filter for VF %u, error %s\\n\",\n+\t\t\tvf->vf_id, ice_stat_str(status));\n+\t\treturn ice_status_to_errno(status);\n+\t}\n+\n+\tvf->num_mac++;\n+\n+\tif (is_valid_ether_addr(vf->dflt_lan_addr.addr)) {\n+\t\tstatus = ice_fltr_add_mac(vsi, vf->dflt_lan_addr.addr,\n+\t\t\t\t\t ICE_FWD_TO_VSI);\n+\t\tif (status) {\n+\t\t\tdev_err(dev, \"failed to add default unicast MAC filter %pM for VF %u, error %s\\n\",\n+\t\t\t\t&vf->dflt_lan_addr.addr[0], vf->vf_id,\n+\t\t\t\tice_stat_str(status));\n+\t\t\treturn ice_status_to_errno(status);\n+\t\t}\n+\t\tvf->num_mac++;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /**\n * ice_alloc_vsi_res - Setup VF VSI and its resources\n * @vf: pointer to the VF structure\n@@ -549,10 +625,9 @@ static int ice_calc_vf_first_vector_idx(struct ice_pf *pf, struct ice_vf *vf)\n static int ice_alloc_vsi_res(struct ice_vf *vf)\n {\n \tstruct ice_pf *pf = vf->pf;\n-\tu8 broadcast[ETH_ALEN];\n \tstruct ice_vsi *vsi;\n \tstruct device *dev;\n-\tint status = 0;\n+\tint ret;\n \n \tdev = ice_pf_to_dev(pf);\n \t/* first vector index is the VFs OICR index */\n@@ -567,38 +642,20 @@ static int ice_alloc_vsi_res(struct ice_vf *vf)\n \tvf->lan_vsi_idx = vsi->idx;\n \tvf->lan_vsi_num = vsi->vsi_num;\n \n-\t/* Check if port VLAN exist before, and restore it accordingly */\n-\tif (vf->port_vlan_info) {\n-\t\tice_vsi_manage_pvid(vsi, vf->port_vlan_info, true);\n-\t\tif (ice_vsi_add_vlan(vsi, vf->port_vlan_info & VLAN_VID_MASK,\n-\t\t\t\t ICE_FWD_TO_VSI))\n-\t\t\tdev_warn(ice_pf_to_dev(pf), \"Failed to add Port VLAN %d filter for VF %d\\n\",\n-\t\t\t\t vf->port_vlan_info & VLAN_VID_MASK, vf->vf_id);\n-\t} else {\n-\t\t/* set VLAN 0 filter by default when no port VLAN is\n-\t\t * enabled. If a port VLAN is enabled we don't want\n-\t\t * untagged broadcast/multicast traffic seen on the VF\n-\t\t * interface.\n-\t\t */\n-\t\tif (ice_vsi_add_vlan(vsi, 0, ICE_FWD_TO_VSI))\n-\t\t\tdev_warn(ice_pf_to_dev(pf), \"Failed to add VLAN 0 filter for VF %d, MDD events will trigger. Reset the VF, disable spoofchk, or enable 8021q module on the guest\\n\",\n-\t\t\t\t vf->vf_id);\n+\tret = ice_vf_rebuild_host_vlan_cfg(vf);\n+\tif (ret) {\n+\t\tdev_err(dev, \"failed to rebuild default MAC configuration for VF %d, error %d\\n\",\n+\t\t\tvf->vf_id, ret);\n+\t\tgoto ice_alloc_vsi_res_exit;\n \t}\n \n-\tif (is_valid_ether_addr(vf->dflt_lan_addr.addr)) {\n-\t\tstatus = ice_fltr_add_mac(vsi, vf->dflt_lan_addr.addr,\n-\t\t\t\t\t ICE_FWD_TO_VSI);\n-\t\tif (status)\n-\t\t\tgoto ice_alloc_vsi_res_exit;\n-\t}\n \n-\teth_broadcast_addr(broadcast);\n-\tstatus = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI);\n-\tif (status)\n-\t\tdev_err(dev, \"could not add mac filters error %d\\n\",\n-\t\t\tstatus);\n-\telse\n-\t\tvf->num_mac = 1;\n+\tret = ice_vf_rebuild_host_mac_cfg(vf);\n+\tif (ret) {\n+\t\tdev_err(dev, \"failed to rebuild default MAC configuration for VF %d, error %d\\n\",\n+\t\t\tvf->vf_id, ret);\n+\t\tgoto ice_alloc_vsi_res_exit;\n+\t}\n \n \t/* Clear this bit after VF initialization since we shouldn't reclaim\n \t * and reassign interrupts for synchronous or asynchronous VFR events.\n@@ -607,7 +664,7 @@ static int ice_alloc_vsi_res(struct ice_vf *vf)\n \t * more vectors.\n \t */\n ice_alloc_vsi_res_exit:\n-\treturn status;\n+\treturn ret;\n }\n \n /**\n", "prefixes": [ "S45", "07/15" ] }