Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1086494/?format=api
{ "id": 1086494, "url": "http://patchwork.ozlabs.org/api/patches/1086494/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190416173503.29847-2-anirudh.venkataramanan@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": "<20190416173503.29847-2-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-04-16T17:34:50", "name": "[S21,01/14] ice: Introduce ice_init_mac_fltr and move ice_napi_del", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "9e6652210a11f6efe3f65bf1da4048550dfc9667", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@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/20190416173503.29847-2-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 103110, "url": "http://patchwork.ozlabs.org/api/series/103110/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=103110", "date": "2019-04-16T17:34:49", "name": "Fixes and feature updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/103110/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1086494/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1086494/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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 44kCFb0wKKz9s55\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Apr 2019 03:35:47 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B0B3B8704C;\n\tTue, 16 Apr 2019 17:35:45 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id L4Rwc3krZweA; Tue, 16 Apr 2019 17:35:43 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A624F86E88;\n\tTue, 16 Apr 2019 17:35:43 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 703B71C162B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:39 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id BFACD23223\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:39 +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 iLSVGNgLPXYj for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:36 +0000 (UTC)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 883BA2206D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:36 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Apr 2019 10:35:36 -0700", "from shasta.jf.intel.com ([10.166.244.191])\n\tby fmsmga001.fm.intel.com with ESMTP; 16 Apr 2019 10:35:36 -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", "X-IronPort-AV": "E=Sophos;i=\"5.60,358,1549958400\"; d=\"scan'208\";a=\"165278535\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 16 Apr 2019 10:34:50 -0700", "Message-Id": "<20190416173503.29847-2-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190416173503.29847-1-anirudh.venkataramanan@intel.com>", "References": "<20190416173503.29847-1-anirudh.venkataramanan@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S21 01/14] ice: Introduce\n\tice_init_mac_fltr and move ice_napi_del", "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>", "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: Tony Nguyen <anthony.l.nguyen@intel.com>\n\nConsolidate adding unicast and broadcast MAC filters in a single new\nfunction ice_init_mac_fltr.\n\nMove ice_napi_del to ice_lib.c\n\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> rewrote commit message]\n---\n drivers/net/ethernet/intel/ice/ice_lib.c | 15 +++\n drivers/net/ethernet/intel/ice/ice_lib.h | 2 +\n drivers/net/ethernet/intel/ice/ice_main.c | 106 +++++++++++++---------\n 3 files changed, 79 insertions(+), 44 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 8db9427d863f..230f733817d0 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2733,6 +2733,21 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi)\n \t}\n }\n \n+/**\n+ * ice_napi_del - Remove NAPI handler for the VSI\n+ * @vsi: VSI for which NAPI handler is to be removed\n+ */\n+void ice_napi_del(struct ice_vsi *vsi)\n+{\n+\tint v_idx;\n+\n+\tif (!vsi->netdev)\n+\t\treturn;\n+\n+\tice_for_each_q_vector(vsi, v_idx)\n+\t\tnetif_napi_del(&vsi->q_vectors[v_idx]->napi);\n+}\n+\n /**\n * ice_vsi_release - Delete a VSI and free its resources\n * @vsi: the VSI being removed\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h\nindex 3605b7ca9120..e223767755cb 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.h\n@@ -49,6 +49,8 @@ struct ice_vsi *\n ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,\n \t enum ice_vsi_type type, u16 vf_id);\n \n+void ice_napi_del(struct ice_vsi *vsi);\n+\n int ice_vsi_release(struct ice_vsi *vsi);\n \n void ice_vsi_close(struct ice_vsi *vsi);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 0bcc8402a5ee..da62a901b355 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -108,6 +108,67 @@ static void ice_check_for_hang_subtask(struct ice_pf *pf)\n \t}\n }\n \n+/**\n+ * ice_init_mac_fltr - Set initial MAC filters\n+ * @pf: board private structure\n+ *\n+ * Set initial set of mac filters for PF VSI; configure filters for permanent\n+ * address and broadcast address. If an error is encountered, netdevice will be\n+ * unregistered.\n+ */\n+static int ice_init_mac_fltr(struct ice_pf *pf)\n+{\n+\tLIST_HEAD(tmp_add_list);\n+\tu8 broadcast[ETH_ALEN];\n+\tstruct ice_vsi *vsi;\n+\tint status;\n+\n+\tvsi = ice_find_vsi_by_type(pf, ICE_VSI_PF);\n+\tif (!vsi)\n+\t\treturn -EINVAL;\n+\n+\t/* To add a MAC filter, first add the MAC to a list and then\n+\t * pass the list to ice_add_mac.\n+\t */\n+\n+\t /* Add a unicast MAC filter so the VSI can get its packets */\n+\tstatus = ice_add_mac_to_list(vsi, &tmp_add_list,\n+\t\t\t\t vsi->port_info->mac.perm_addr);\n+\tif (status)\n+\t\tgoto unregister;\n+\n+\t/* VSI needs to receive broadcast traffic, so add the broadcast\n+\t * MAC address to the list as well.\n+\t */\n+\teth_broadcast_addr(broadcast);\n+\tstatus = ice_add_mac_to_list(vsi, &tmp_add_list, broadcast);\n+\tif (status)\n+\t\tgoto free_mac_list;\n+\n+\t/* Program MAC filters for entries in tmp_add_list */\n+\tstatus = ice_add_mac(&pf->hw, &tmp_add_list);\n+\tif (status)\n+\t\tstatus = -ENOMEM;\n+\n+free_mac_list:\n+\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n+\n+unregister:\n+\t/* We aren't useful with no MAC filters, so unregister if we\n+\t * had an error\n+\t */\n+\tif (status && vsi->netdev->reg_state == NETREG_REGISTERED) {\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"Could not add MAC filters error %d. Unregistering device\\n\",\n+\t\t\tstatus);\n+\t\tunregister_netdev(vsi->netdev);\n+\t\tfree_netdev(vsi->netdev);\n+\t\tvsi->netdev = NULL;\n+\t}\n+\n+\treturn status;\n+}\n+\n /**\n * ice_add_mac_to_sync_list - creates list of MAC addresses to be synced\n * @netdev: the net device on which the sync is happening\n@@ -1649,21 +1710,6 @@ static int ice_req_irq_msix_misc(struct ice_pf *pf)\n \treturn 0;\n }\n \n-/**\n- * ice_napi_del - Remove NAPI handler for the VSI\n- * @vsi: VSI for which NAPI handler is to be removed\n- */\n-static void ice_napi_del(struct ice_vsi *vsi)\n-{\n-\tint v_idx;\n-\n-\tif (!vsi->netdev)\n-\t\treturn;\n-\n-\tice_for_each_q_vector(vsi, v_idx)\n-\t\tnetif_napi_del(&vsi->q_vectors[v_idx]->napi);\n-}\n-\n /**\n * ice_napi_add - register NAPI handler for the VSI\n * @vsi: VSI for which NAPI handler is to be registered\n@@ -1900,8 +1946,6 @@ ice_vlan_rx_kill_vid(struct net_device *netdev, __always_unused __be16 proto,\n */\n static int ice_setup_pf_sw(struct ice_pf *pf)\n {\n-\tLIST_HEAD(tmp_add_list);\n-\tu8 broadcast[ETH_ALEN];\n \tstruct ice_vsi *vsi;\n \tint status = 0;\n \n@@ -1926,38 +1970,12 @@ static int ice_setup_pf_sw(struct ice_pf *pf)\n \t */\n \tice_napi_add(vsi);\n \n-\t/* To add a MAC filter, first add the MAC to a list and then\n-\t * pass the list to ice_add_mac.\n-\t */\n-\n-\t /* Add a unicast MAC filter so the VSI can get its packets */\n-\tstatus = ice_add_mac_to_list(vsi, &tmp_add_list,\n-\t\t\t\t vsi->port_info->mac.perm_addr);\n+\tstatus = ice_init_mac_fltr(pf);\n \tif (status)\n \t\tgoto unroll_napi_add;\n \n-\t/* VSI needs to receive broadcast traffic, so add the broadcast\n-\t * MAC address to the list as well.\n-\t */\n-\teth_broadcast_addr(broadcast);\n-\tstatus = ice_add_mac_to_list(vsi, &tmp_add_list, broadcast);\n-\tif (status)\n-\t\tgoto free_mac_list;\n-\n-\t/* program MAC filters for entries in tmp_add_list */\n-\tstatus = ice_add_mac(&pf->hw, &tmp_add_list);\n-\tif (status) {\n-\t\tdev_err(&pf->pdev->dev, \"Could not add MAC filters\\n\");\n-\t\tstatus = -ENOMEM;\n-\t\tgoto free_mac_list;\n-\t}\n-\n-\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n \treturn status;\n \n-free_mac_list:\n-\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n-\n unroll_napi_add:\n \tif (vsi) {\n \t\tice_napi_del(vsi);\n", "prefixes": [ "S21", "01/14" ] }