Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1291746/?format=api
{ "id": 1291746, "url": "http://patchwork.ozlabs.org/api/patches/1291746/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200516003644.4658-4-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": "<20200516003644.4658-4-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2020-05-16T00:36:33", "name": "[S43,04/15] ice: Check if unicast MAC exists before setting VF MAC", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "863442a0b906dcffdcac5b0b3b4e3e4af3cb3b7a", "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/20200516003644.4658-4-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 177325, "url": "http://patchwork.ozlabs.org/api/series/177325/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=177325", "date": "2020-05-16T00:36:39", "name": "[S43,01/15] ice: Call ice_aq_set_mac_cfg", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/177325/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1291746/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1291746/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.137; helo=fraxinus.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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 49P5yF0yGvz9sTC\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 16 May 2020 10:39:33 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 9EB7E87F8B;\n\tSat, 16 May 2020 00:39:31 +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 Yx06fHJjX6OG; Sat, 16 May 2020 00:39:30 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 8358C881FE;\n\tSat, 16 May 2020 00:39:29 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by ash.osuosl.org (Postfix) with ESMTP id E0D681BF2B9\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:39:22 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by whitealder.osuosl.org (Postfix) with ESMTP id DB76F87740\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:39:22 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id lS3DZ0QUVk8f for <intel-wired-lan@lists.osuosl.org>;\n Sat, 16 May 2020 00:39:19 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by whitealder.osuosl.org (Postfix) with ESMTPS id 70EAC877E0\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:39:19 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 May 2020 17:39:18 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by FMSMGA003.fm.intel.com with ESMTP; 15 May 2020 17:39:18 -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 FM6TVyiPZDL/4fgCpT7BvdZf8zul6NnqYDKsnQP8oEcxo0+7u0lvwx9O53shWv1ZNWLY8rWScA\n FMZH1o/hNVBw==", "\n mcyTN9FzvHjxWnoU0IVyQ+B68eLFFUlfrTs7WiLg1Wq/xP8SBynqd9cXuG8cVhcZTFYUaAIxIs\n lzq9Ac/BplWQ==" ], "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=\"307560859\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 15 May 2020 17:36:33 -0700", "Message-Id": "<20200516003644.4658-4-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200516003644.4658-1-anthony.l.nguyen@intel.com>", "References": "<20200516003644.4658-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S43 04/15] ice: Check if unicast MAC\n exists before setting VF MAC", "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\nCurrently if a unicast MAC is set via ndo_set_vf_mac, the PF driver will\nset the VF's dflt_lan_addr.addr once some basic checks have passed. The\nVF is then reset. During reset the PF driver will attempt to program the\nVF's MAC from the dflt_lan_addr.addr field. This fails when the MAC\nalready exists on the PF's switch.\n\nThis is causing the VF to be completely disabled until removing/enabling\nany VFs via sysfs.\n\nFix this by checking if the unicast MAC exists before triggering a VF\nreset directly in ndo_set_vf_mac. Also, add a check if the unicast MAC\nis set to the same value as before and return 0 if that is the case.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\n---\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 43 +++++++++++++++++++\n 1 file changed, 43 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 2e6c81555668..6ea3d15e1a6d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -3648,6 +3648,39 @@ ice_get_vf_cfg(struct net_device *netdev, int vf_id, struct ifla_vf_info *ivi)\n \treturn 0;\n }\n \n+/**\n+ * ice_unicast_mac_exists - check if the unicast MAC exists on the PF's switch\n+ * @pf: PF used to reference the switch's rules\n+ * @umac: unicast MAC to compare against existing switch rules\n+ *\n+ * Return true on the first/any match, else return false\n+ */\n+static bool ice_unicast_mac_exists(struct ice_pf *pf, u8 *umac)\n+{\n+\tstruct ice_sw_recipe *mac_recipe_list =\n+\t\t&pf->hw.switch_info->recp_list[ICE_SW_LKUP_MAC];\n+\tstruct ice_fltr_mgmt_list_entry *list_itr;\n+\tstruct list_head *rule_head;\n+\tstruct mutex *rule_lock; /* protect MAC filter list access */\n+\n+\trule_head = &mac_recipe_list->filt_rules;\n+\trule_lock = &mac_recipe_list->filt_rule_lock;\n+\n+\tmutex_lock(rule_lock);\n+\tlist_for_each_entry(list_itr, rule_head, list_entry) {\n+\t\tu8 *existing_mac = &list_itr->fltr_info.l_data.mac.mac_addr[0];\n+\n+\t\tif (ether_addr_equal(existing_mac, umac)) {\n+\t\t\tmutex_unlock(rule_lock);\n+\t\t\treturn true;\n+\t\t}\n+\t}\n+\n+\tmutex_unlock(rule_lock);\n+\n+\treturn false;\n+}\n+\n /**\n * ice_set_vf_mac\n * @netdev: network interface device structure\n@@ -3671,10 +3704,20 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)\n \t}\n \n \tvf = &pf->vf[vf_id];\n+\t/* nothing left to do, unicast MAC already set */\n+\tif (ether_addr_equal(vf->dflt_lan_addr.addr, mac))\n+\t\treturn 0;\n+\n \tret = ice_check_vf_ready_for_cfg(vf);\n \tif (ret)\n \t\treturn ret;\n \n+\tif (ice_unicast_mac_exists(pf, mac)) {\n+\t\tnetdev_err(netdev, \"Unicast MAC %pM already exists on this PF. Preventing setting VF %u unicast MAC address to %pM\\n\",\n+\t\t\t mac, vf_id, mac);\n+\t\treturn -EINVAL;\n+\t}\n+\n \t/* copy MAC into dflt_lan_addr and trigger a VF reset. The reset\n \t * flow will use the updated dflt_lan_addr and add a MAC filter\n \t * using ice_add_mac. Also set pf_set_mac to indicate that the PF has\n", "prefixes": [ "S43", "04/15" ] }