Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/750177/?format=api
{ "id": 750177, "url": "http://patchwork.ozlabs.org/api/patches/750177/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170412202107.55834-1-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": "<20170412202107.55834-1-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2017-04-12T20:21:05", "name": "[1/3] ixgbe: Check for RSS key before setting value", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ae897fdc55656605e7384443ce6d093264d80bd0", "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/20170412202107.55834-1-anthony.l.nguyen@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/750177/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/750177/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 3w3H9q0fXNz9s7d\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 13 Apr 2017 07:29:18 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 05A97897A4;\n\tWed, 12 Apr 2017 21:29:17 +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 dstS+W5i6HZG; Wed, 12 Apr 2017 21:29:15 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4CF2189795;\n\tWed, 12 Apr 2017 21:29:15 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 90C891C0346\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 12 Apr 2017 21:29:14 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8E1EA89796\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 12 Apr 2017 21:29:14 +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 lV8-MdAYtIj2 for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 12 Apr 2017 21:29:13 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id A61188969C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 12 Apr 2017 21:29:13 +0000 (UTC)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Apr 2017 14:28:59 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.152.56])\n\tby fmsmga004.fm.intel.com with ESMTP; 12 Apr 2017 14:28:59 -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.37,191,1488873600\"; d=\"scan'208\";a=\"247903297\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 12 Apr 2017 13:21:05 -0700", "Message-Id": "<20170412202107.55834-1-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.9.3", "Subject": "[Intel-wired-lan] [PATCH 1/3] ixgbe: Check for RSS key before\n\tsetting value", "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": "The RSS key is being repopulated every time the interface is brought up\nregardless of whether there is an existing value. If the user sets the RSS\nkey and the interface is brought up (e.g. reset), the user specified RSS\nkey will be overwritten.\n\nThis patch changes the rss_key to a pointer so we can check to see if the\nkey has been populated and preserve it accordingly.\n\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 +-\n drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 +---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 30 ++++++++++++++++++++++--\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 2 +-\n 4 files changed, 31 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex e8cd449..d2df10b 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -769,7 +769,7 @@ struct ixgbe_adapter {\n \tu8 rss_indir_tbl[IXGBE_MAX_RETA_ENTRIES];\n \n #define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */\n-\tu32 rss_key[IXGBE_RSS_KEY_SIZE / sizeof(u32)];\n+\tu32 *rss_key;\n };\n \n static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\nindex b0fd2f5..7e5e336 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n@@ -2967,9 +2967,7 @@ static int ixgbe_rss_indir_tbl_max(struct ixgbe_adapter *adapter)\n \n static u32 ixgbe_get_rxfh_key_size(struct net_device *netdev)\n {\n-\tstruct ixgbe_adapter *adapter = netdev_priv(netdev);\n-\n-\treturn sizeof(adapter->rss_key);\n+\treturn IXGBE_RSS_KEY_SIZE;\n }\n \n static u32 ixgbe_rss_indir_size(struct net_device *netdev)\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 750b204..e5a8ae6 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -3638,6 +3638,28 @@ void ixgbe_store_key(struct ixgbe_adapter *adapter)\n }\n \n /**\n+ * ixgbe_init_rss_key - Initialize adapter RSS key\n+ * @adapter: device handle\n+ *\n+ * Allocates and initializes the RSS key if it is not allocated.\n+ **/\n+static inline int ixgbe_init_rss_key(struct ixgbe_adapter *adapter)\n+{\n+\tu32 *rss_key;\n+\n+\tif (!adapter->rss_key) {\n+\t\trss_key = kzalloc(IXGBE_RSS_KEY_SIZE, GFP_KERNEL);\n+\t\tif (unlikely(!rss_key))\n+\t\t\treturn -ENOMEM;\n+\n+\t\tnetdev_rss_key_fill(rss_key, IXGBE_RSS_KEY_SIZE);\n+\t\tadapter->rss_key = rss_key;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n * ixgbe_store_reta - Write the RETA table to HW\n * @adapter: device handle\n *\n@@ -3739,7 +3761,7 @@ static void ixgbe_setup_vfreta(struct ixgbe_adapter *adapter)\n \t/* Fill out hash function seeds */\n \tfor (i = 0; i < 10; i++)\n \t\tIXGBE_WRITE_REG(hw, IXGBE_PFVFRSSRK(i, pf_pool),\n-\t\t\t\tadapter->rss_key[i]);\n+\t\t\t\t*(adapter->rss_key + i));\n \n \t/* Fill out the redirection table */\n \tfor (i = 0, j = 0; i < 64; i++, j++) {\n@@ -3800,7 +3822,6 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)\n \tif (adapter->flags2 & IXGBE_FLAG2_RSS_FIELD_IPV6_UDP)\n \t\trss_field |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP;\n \n-\tnetdev_rss_key_fill(adapter->rss_key, sizeof(adapter->rss_key));\n \tif ((hw->mac.type >= ixgbe_mac_X550) &&\n \t (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) {\n \t\tunsigned int pf_pool = adapter->num_vfs;\n@@ -6014,6 +6035,9 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter,\n \tif (!adapter->mac_table)\n \t\treturn -ENOMEM;\n \n+\tif (ixgbe_init_rss_key(adapter))\n+\t\treturn -ENOMEM;\n+\n \t/* Set MAC specific capability flags and exceptions */\n \tswitch (hw->mac.type) {\n \tcase ixgbe_mac_82598EB:\n@@ -10400,6 +10424,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tiounmap(adapter->io_addr);\n \tkfree(adapter->jump_tables[0]);\n \tkfree(adapter->mac_table);\n+\tkfree(adapter->rss_key);\n err_ioremap:\n \tdisable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);\n \tfree_netdev(netdev);\n@@ -10484,6 +10509,7 @@ static void ixgbe_remove(struct pci_dev *pdev)\n \t}\n \n \tkfree(adapter->mac_table);\n+\tkfree(adapter->rss_key);\n \tdisable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);\n \tfree_netdev(netdev);\n \ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\nindex c45de53..56d8c7e 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n@@ -1113,7 +1113,7 @@ static int ixgbe_get_vf_rss_key(struct ixgbe_adapter *adapter,\n \t\treturn -EOPNOTSUPP;\n \t}\n \n-\tmemcpy(rss_key, adapter->rss_key, sizeof(adapter->rss_key));\n+\tmemcpy(rss_key, adapter->rss_key, IXGBE_RSS_KEY_SIZE);\n \n \treturn 0;\n }\n", "prefixes": [ "1/3" ] }