Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/948156/?format=api
{ "id": 948156, "url": "http://patchwork.ozlabs.org/api/patches/948156/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180723231348.14838-13-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": "<20180723231348.14838-13-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2018-07-23T23:13:47", "name": "[12/13] ice: Make ice_vsi_kill_vlan return an error code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "6048620f3a3cb255377102b3018db0cc73bb6af7", "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/20180723231348.14838-13-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 57159, "url": "http://patchwork.ozlabs.org/api/series/57159/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=57159", "date": "2018-07-23T23:13:35", "name": "Feature updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/57159/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/948156/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/948156/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 AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 41ZHP34VJGz9s29\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 24 Jul 2018 09:13:59 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3E949843ED;\n\tMon, 23 Jul 2018 23:13:58 +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 oLTh5-oc8AKh; Mon, 23 Jul 2018 23:13:56 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id E077D844DA;\n\tMon, 23 Jul 2018 23:13:53 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5F1711CF309\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 23 Jul 2018 23:13:52 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 5CCFA22249\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 23 Jul 2018 23:13:52 +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 xza6k+moTM5l for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 23 Jul 2018 23:13:51 +0000 (UTC)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 56F4F21FFB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 23 Jul 2018 23:13:51 +0000 (UTC)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t23 Jul 2018 16:13:50 -0700", "from shasta.jf.intel.com ([10.166.241.10])\n\tby fmsmga006.fm.intel.com with ESMTP; 23 Jul 2018 16:13:50 -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.51,394,1526367600\"; d=\"scan'208\";a=\"248252746\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 23 Jul 2018 16:13:47 -0700", "Message-Id": "<20180723231348.14838-13-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.3", "In-Reply-To": "<20180723231348.14838-1-anirudh.venkataramanan@intel.com>", "References": "<20180723231348.14838-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH 12/13] ice: Make ice_vsi_kill_vlan return\n\tan error code", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "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": "Brett Creeley <brett.creeley@intel.com>", "MIME-Version": "1.0", "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\nPrior to this patch ice_vsi_kill_vlan has a void return value and we\nwere ignoring if it fails. Make ice_vsi_kill_vlan return an integer\nvalue so its return value can be checked and used to determine whether\nor not to update VLAN counts, structures, pruning bits.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> cleaned up commit message]\n---\n drivers/net/ethernet/intel/ice/ice_main.c | 94 ++++++++++++++++++++++++++++---\n 1 file changed, 85 insertions(+), 9 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex e1ec525138ac..cb1145515f98 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -349,6 +349,63 @@ static bool ice_vsi_fltr_changed(struct ice_vsi *vsi)\n \t test_bit(ICE_VSI_FLAG_VLAN_FLTR_CHANGED, vsi->flags);\n }\n \n+/**\n+ * ice_cfg_vlan_pruning - enable or disable VLAN pruning on the VSI\n+ * @vsi: VSI to enable or disable VLAN pruning on\n+ * @ena: set to true to enable VLAN pruning and false to disable it\n+ *\n+ * returns 0 if VSI is updated, negative otherwise\n+ */\n+static int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena)\n+{\n+\tstruct ice_vsi_ctx *ctxt;\n+\tstruct device *dev;\n+\tint status;\n+\n+\tif (!vsi)\n+\t\treturn -EINVAL;\n+\n+\tdev = &vsi->back->pdev->dev;\n+\tctxt = devm_kzalloc(dev, sizeof(*ctxt), GFP_KERNEL);\n+\tif (!ctxt)\n+\t\treturn -ENOMEM;\n+\n+\tctxt->info = vsi->info;\n+\n+\tif (ena) {\n+\t\tctxt->info.sec_flags |=\n+\t\t\tICE_AQ_VSI_SEC_TX_VLAN_PRUNE_ENA <<\n+\t\t\tICE_AQ_VSI_SEC_TX_PRUNE_ENA_S;\n+\t\tctxt->info.sw_flags2 |= ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA;\n+\t} else {\n+\t\tctxt->info.sec_flags &=\n+\t\t\t~(ICE_AQ_VSI_SEC_TX_VLAN_PRUNE_ENA <<\n+\t\t\t ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S);\n+\t\tctxt->info.sw_flags2 &= ~ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA;\n+\t}\n+\n+\tctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_SECURITY_VALID |\n+\t\t\t\t\t\tICE_AQ_VSI_PROP_SW_VALID);\n+\tctxt->vsi_num = vsi->vsi_num;\n+\tstatus = ice_aq_update_vsi(&vsi->back->hw, ctxt, NULL);\n+\tif (status) {\n+\t\tnetdev_err(vsi->netdev, \"%sabling VLAN pruning on VSI %d failed, err = %d, aq_err = %d\\n\",\n+\t\t\t ena ? \"Ena\" : \"Dis\", vsi->vsi_num, status,\n+\t\t\t vsi->back->hw.adminq.sq_last_status);\n+\t\tgoto err_out;\n+\t}\n+\n+\tvsi->info.sec_flags = ctxt->info.sec_flags;\n+\tvsi->info.sw_flags2 = ctxt->info.sw_flags2;\n+\n+\tdevm_kfree(dev, ctxt);\n+\treturn 0;\n+\n+err_out:\n+\tdevm_kfree(dev, ctxt);\n+\treturn -EIO;\n+}\n+\n /**\n * ice_vsi_sync_fltr - Update the VSI filter list to the HW\n * @vsi: ptr to the VSI\n@@ -3128,7 +3185,7 @@ static int ice_vlan_rx_add_vid(struct net_device *netdev,\n {\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_vsi *vsi = np->vsi;\n-\tint ret = 0;\n+\tint ret;\n \n \tif (vid >= VLAN_N_VID) {\n \t\tnetdev_err(netdev, \"VLAN id requested %d is out of range %d\\n\",\n@@ -3139,6 +3196,13 @@ static int ice_vlan_rx_add_vid(struct net_device *netdev,\n \tif (vsi->info.pvid)\n \t\treturn -EINVAL;\n \n+\t/* Enable VLAN pruning when VLAN 0 is added */\n+\tif (unlikely(!vid)) {\n+\t\tret = ice_cfg_vlan_pruning(vsi, true);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n+\n \t/* Add all VLAN ids including 0 to the switch filter. VLAN id 0 is\n \t * needed to continue allowing all untagged packets since VLAN prune\n \t * list is applied to all packets by the switch\n@@ -3155,16 +3219,19 @@ static int ice_vlan_rx_add_vid(struct net_device *netdev,\n * ice_vsi_kill_vlan - Remove VSI membership for a given VLAN\n * @vsi: the VSI being configured\n * @vid: VLAN id to be removed\n+ *\n+ * Returns 0 on success and negative on failure\n */\n-static void ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)\n+static int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)\n {\n \tstruct ice_fltr_list_entry *list;\n \tstruct ice_pf *pf = vsi->back;\n \tLIST_HEAD(tmp_add_list);\n+\tint status = 0;\n \n \tlist = devm_kzalloc(&pf->pdev->dev, sizeof(*list), GFP_KERNEL);\n \tif (!list)\n-\t\treturn;\n+\t\treturn -ENOMEM;\n \n \tlist->fltr_info.lkup_type = ICE_SW_LKUP_VLAN;\n \tlist->fltr_info.fwd_id.vsi_id = vsi->vsi_num;\n@@ -3176,11 +3243,14 @@ static void ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)\n \tINIT_LIST_HEAD(&list->list_entry);\n \tlist_add(&list->list_entry, &tmp_add_list);\n \n-\tif (ice_remove_vlan(&pf->hw, &tmp_add_list))\n+\tif (ice_remove_vlan(&pf->hw, &tmp_add_list)) {\n \t\tdev_err(&pf->pdev->dev, \"Error removing VLAN %d on vsi %i\\n\",\n \t\t\tvid, vsi->vsi_num);\n+\t\tstatus = -EIO;\n+\t}\n \n \tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n+\treturn status;\n }\n \n /**\n@@ -3196,19 +3266,25 @@ static int ice_vlan_rx_kill_vid(struct net_device *netdev,\n {\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_vsi *vsi = np->vsi;\n+\tint status;\n \n \tif (vsi->info.pvid)\n \t\treturn -EINVAL;\n \n-\t/* return code is ignored as there is nothing a user\n-\t * can do about failure to remove and a log message was\n-\t * already printed from the other function\n+\t/* Make sure ice_vsi_kill_vlan is successful before updating VLAN\n+\t * information\n \t */\n-\tice_vsi_kill_vlan(vsi, vid);\n+\tstatus = ice_vsi_kill_vlan(vsi, vid);\n+\tif (status)\n+\t\treturn status;\n \n \tclear_bit(vid, vsi->active_vlans);\n \n-\treturn 0;\n+\t/* Disable VLAN pruning when VLAN 0 is removed */\n+\tif (unlikely(!vid))\n+\t\tstatus = ice_cfg_vlan_pruning(vsi, false);\n+\n+\treturn status;\n }\n \n /**\n", "prefixes": [ "12/13" ] }