Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/599727/?format=api
{ "id": 599727, "url": "http://patchwork.ozlabs.org/api/patches/599727/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160318231119.25773.39536.stgit@localhost6.localdomain6/", "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": "<20160318231119.25773.39536.stgit@localhost6.localdomain6>", "list_archive_url": null, "date": "2016-03-18T23:11:19", "name": "[2/2] ixgbe: set vlan spoof checking unconditionally", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "5791ff9b872621c13b9894f733c6056445ec64b3", "submitter": { "id": 1670, "url": "http://patchwork.ozlabs.org/api/people/1670/?format=api", "name": "Tantilov, Emil S", "email": "emil.s.tantilov@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/20160318231119.25773.39536.stgit@localhost6.localdomain6/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/599727/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/599727/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id 3qRgvv0CbPz9s9W\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 19 Mar 2016 10:11:39 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5CAF7A5CCF;\n\tFri, 18 Mar 2016 23:11: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 Uwe2d6bU2a4Z; Fri, 18 Mar 2016 23:11:37 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 0535DA5C7C;\n\tFri, 18 Mar 2016 23:11:37 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 4D7B51BF9E4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Mar 2016 23:11:36 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 489D033B12\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Mar 2016 23:11:36 +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 vx7i0nEyyB0C for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Mar 2016 23:11:35 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby silver.osuosl.org (Postfix) with ESMTP id 5D71D33B11\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Mar 2016 23:11:35 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga104.fm.intel.com with ESMTP; 18 Mar 2016 16:11:35 -0700", "from estantil-desk3.jf.intel.com (HELO localhost6.localdomain6)\n\t([134.134.3.186])\n\tby fmsmga001.fm.intel.com with ESMTP; 18 Mar 2016 16:11:35 -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-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.24,357,1455004800\"; d=\"scan'208\";a=\"927341186\"", "From": "Emil Tantilov <emil.s.tantilov@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 18 Mar 2016 16:11:19 -0700", "Message-ID": "<20160318231119.25773.39536.stgit@localhost6.localdomain6>", "In-Reply-To": "<20160318225046.25773.35723.stgit@localhost6.localdomain6>", "References": "<20160318225046.25773.35723.stgit@localhost6.localdomain6>", "User-Agent": "StGit/0.17.1-4-g4a0c1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 2/2] ixgbe: set vlan spoof checking\n\tunconditionally", "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>", "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": "Previously the PF driver would only set VLAN spoof checking if\nthe VF had created vlans. This was done by setting and checking\na counter (vlan_count) whenever a vlan was created by the VF.\nHowever it is possible for the vlan_count to be !=0 while there are\nno VLANs assigned to the VF due to the count incrementing every\ntime a VLAN 0 is added on ifdown/up, which resulted in vlan spoofing\nalways being set for those VFs.\n\nThis patch cleans up the logic by unconditionally setting VLAN based on\nhow the VF is configured (via ip link set ethX vf Y spoofchk on/off).\nThis change also resolves an issue where the VLAN spoofing can remain\nset even after being disabled by the user due to the driver enabling\nVLAN spoof checking every time a VLAN is added to the VF, but would\nonly allow changes in the setting if vlan_count != 0.\n\nAlso default_vf_vlan_id and vlans_enabled were removed from the\nvf_data_storage structure since they are not being used in the driver.\n\nSigned-off-by: Emil Tantilov <emil.s.tantilov@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h | 3 ---\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 25 ++----------------------\n 2 files changed, 2 insertions(+), 26 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 4590fab..d9b220f 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -143,14 +143,11 @@ struct vf_data_storage {\n \tunsigned char vf_mac_addresses[ETH_ALEN];\n \tu16 vf_mc_hashes[IXGBE_MAX_VF_MC_ENTRIES];\n \tu16 num_vf_mc_hashes;\n-\tu16 default_vf_vlan_id;\n-\tu16 vlans_enabled;\n \tbool clear_to_send;\n \tbool pf_set_mac;\n \tu16 pf_vlan; /* When set, guest VLAN config not allowed. */\n \tu16 pf_qos;\n \tu16 tx_rate;\n-\tu16 vlan_count;\n \tu8 spoofchk_enabled;\n \tbool rss_query_enabled;\n \tu8 trusted;\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\nindex cb8b51b..e47785a 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n@@ -908,8 +908,6 @@ static int ixgbe_set_vf_vlan_msg(struct ixgbe_adapter *adapter,\n \tu32 add = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) >> IXGBE_VT_MSGINFO_SHIFT;\n \tu32 vid = (msgbuf[1] & IXGBE_VLVF_VLANID_MASK);\n \tu8 tcs = netdev_get_num_tc(adapter->netdev);\n-\tstruct ixgbe_hw *hw = &adapter->hw;\n-\tint err;\n \n \tif (adapter->vfinfo[vf].pf_vlan || tcs) {\n \t\te_warn(drv,\n@@ -923,19 +921,7 @@ static int ixgbe_set_vf_vlan_msg(struct ixgbe_adapter *adapter,\n \tif (!vid && !add)\n \t\treturn 0;\n \n-\terr = ixgbe_set_vf_vlan(adapter, add, vid, vf);\n-\tif (err)\n-\t\treturn err;\n-\n-\tif (adapter->vfinfo[vf].spoofchk_enabled)\n-\t\thw->mac.ops.set_vlan_anti_spoofing(hw, true, vf);\n-\n-\tif (add)\n-\t\tadapter->vfinfo[vf].vlan_count++;\n-\telse if (adapter->vfinfo[vf].vlan_count)\n-\t\tadapter->vfinfo[vf].vlan_count--;\n-\n-\treturn 0;\n+\treturn ixgbe_set_vf_vlan(adapter, add, vid, vf);\n }\n \n static int ixgbe_set_vf_macvlan_msg(struct ixgbe_adapter *adapter,\n@@ -1324,9 +1310,6 @@ static int ixgbe_enable_port_vlan(struct ixgbe_adapter *adapter, int vf,\n \n \tixgbe_set_vmvir(adapter, vlan, qos, vf);\n \tixgbe_set_vmolr(hw, vf, false);\n-\tif (adapter->vfinfo[vf].spoofchk_enabled)\n-\t\thw->mac.ops.set_vlan_anti_spoofing(hw, true, vf);\n-\tadapter->vfinfo[vf].vlan_count++;\n \n \t/* enable hide vlan on X550 */\n \tif (hw->mac.type >= ixgbe_mac_X550)\n@@ -1359,9 +1342,6 @@ static int ixgbe_disable_port_vlan(struct ixgbe_adapter *adapter, int vf)\n \tixgbe_set_vf_vlan(adapter, true, 0, vf);\n \tixgbe_clear_vmvir(adapter, vf);\n \tixgbe_set_vmolr(hw, vf, true);\n-\thw->mac.ops.set_vlan_anti_spoofing(hw, false, vf);\n-\tif (adapter->vfinfo[vf].vlan_count)\n-\t\tadapter->vfinfo[vf].vlan_count--;\n \n \t/* disable hide VLAN on X550 */\n \tif (hw->mac.type >= ixgbe_mac_X550)\n@@ -1539,8 +1519,7 @@ int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting)\n \thw->mac.ops.set_mac_anti_spoofing(hw, setting, vf);\n \n \t/* configure VLAN spoofing */\n-\tif (adapter->vfinfo[vf].vlan_count)\n-\t\thw->mac.ops.set_vlan_anti_spoofing(hw, setting, vf);\n+\thw->mac.ops.set_vlan_anti_spoofing(hw, setting, vf);\n \n \t/* Ensure LLDP and FC is set for Ethertype Antispoofing if we will be\n \t * calling set_ethertype_anti_spoofing for each VF in loop below\n", "prefixes": [ "2/2" ] }