Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/703864/?format=api
{ "id": 703864, "url": "http://patchwork.ozlabs.org/api/patches/703864/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20161207220534.21018-1-jacob.e.keller@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": "<20161207220534.21018-1-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2016-12-07T22:05:34", "name": "[v2] i40e: don't allow i40e_vsi_(add|kill)_vlan to operate when VID<1", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c51bb55f8772adfcab53b5b2596e57c552e8cd17", "submitter": { "id": 9784, "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api", "name": "Jacob Keller", "email": "jacob.e.keller@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/20161207220534.21018-1-jacob.e.keller@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/703864/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/703864/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 3tYsxx68S1z9sD6\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 8 Dec 2016 09:05:41 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 54B7D865F0;\n\tWed, 7 Dec 2016 22:05:40 +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 Pe46ZqNk7nJR; Wed, 7 Dec 2016 22:05:39 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8B1F8865DD;\n\tWed, 7 Dec 2016 22:05:39 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 284811C01C5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 7 Dec 2016 22:05:38 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 217B687781\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 7 Dec 2016 22:05:38 +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 YO9uJIxKSMwq for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 7 Dec 2016 22:05:37 +0000 (UTC)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 647568777F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 7 Dec 2016 22:05:37 +0000 (UTC)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga102.jf.intel.com with ESMTP; 07 Dec 2016 14:05:36 -0800", "from jekeller-desk.amr.corp.intel.com ([10.166.35.174])\n\tby fmsmga004.fm.intel.com with ESMTP; 07 Dec 2016 14:05:36 -0800" ], "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.33,315,1477983600\"; d=\"scan'208\";a=\"200194758\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Wed, 7 Dec 2016 14:05:34 -0800", "Message-Id": "<20161207220534.21018-1-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.11.0.rc2.152.g4d04e67", "Subject": "[Intel-wired-lan] [PATCH v2] i40e: don't allow\n\ti40e_vsi_(add|kill)_vlan to operate when VID<1", "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": "Now that we have the separate i40e_(add|rm)_vlan_all_mac functions, we\nshould not be using the i40e_vsi_kill_vlan or i40e_vsi_add_vlan\nfunctions when PVID is set or when VID is less than 1. This allows us to\nremove some checks in i40e_vsi_add_vlan and ensures that callers which\nneed to handle VID=0 or VID=-1 don't accidentally invoke the VLAN mode\nhandling used to convert filters when entering VLAN mode. We also update\nthe functions to take u16 instead of s16 as well since they no longer\nexpect to be called with VID=I40E_VLAN_ANY.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nChange-ID: Ibddf44a8bb840dde8ceef2a4fdb92fd953b05a57\n---\nv2\n* Use !vid instead of !(vid > 0)\n\n drivers/net/ethernet/intel/i40e/i40e.h | 4 ++--\n drivers/net/ethernet/intel/i40e/i40e_main.c | 14 ++++++++++----\n 2 files changed, 12 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex ba8d30984bee..7f208f45a92e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -853,9 +853,9 @@ int i40e_close(struct net_device *netdev);\n int i40e_vsi_open(struct i40e_vsi *vsi);\n void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);\n int i40e_add_vlan_all_mac(struct i40e_vsi *vsi, s16 vid);\n-int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);\n+int i40e_vsi_add_vlan(struct i40e_vsi *vsi, u16 vid);\n void i40e_rm_vlan_all_mac(struct i40e_vsi *vsi, s16 vid);\n-void i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);\n+void i40e_vsi_kill_vlan(struct i40e_vsi *vsi, u16 vid);\n struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi,\n \t\t\t\t\t const u8 *macaddr);\n int i40e_del_mac_all_vlan(struct i40e_vsi *vsi, const u8 *macaddr);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 245e249fcecb..e9d409ad27d6 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -2563,12 +2563,15 @@ int i40e_add_vlan_all_mac(struct i40e_vsi *vsi, s16 vid)\n /**\n * i40e_vsi_add_vlan - Add vsi membership for given vlan\n * @vsi: the vsi being configured\n- * @vid: vlan id to be added (0 = untagged only , -1 = any)\n+ * @vid: vlan id to be added\n **/\n-int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)\n+int i40e_vsi_add_vlan(struct i40e_vsi *vsi, u16 vid)\n {\n \tint err;\n \n+\tif (!vid || vsi->info.pvid)\n+\t\treturn -EINVAL;\n+\n \t/* Locked once because all functions invoked below iterates list*/\n \tspin_lock_bh(&vsi->mac_filter_hash_lock);\n \terr = i40e_add_vlan_all_mac(vsi, vid);\n@@ -2611,10 +2614,13 @@ void i40e_rm_vlan_all_mac(struct i40e_vsi *vsi, s16 vid)\n /**\n * i40e_vsi_kill_vlan - Remove vsi membership for given vlan\n * @vsi: the vsi being configured\n- * @vid: vlan id to be removed (0 = untagged only , -1 = any)\n+ * @vid: vlan id to be removed\n **/\n-void i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)\n+void i40e_vsi_kill_vlan(struct i40e_vsi *vsi, u16 vid)\n {\n+\tif (!vid || vsi->info.pvid)\n+\t\treturn;\n+\n \tspin_lock_bh(&vsi->mac_filter_hash_lock);\n \ti40e_rm_vlan_all_mac(vsi, vid);\n \tspin_unlock_bh(&vsi->mac_filter_hash_lock);\n", "prefixes": [ "v2" ] }