Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/750178/?format=api
{ "id": 750178, "url": "http://patchwork.ozlabs.org/api/patches/750178/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170412202107.55834-3-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-3-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2017-04-12T20:21:07", "name": "[3/3] ixgbevf: Check for RSS key before setting value", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a9332881c4b59b50a2d4d82df61b930ef21d4798", "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-3-anthony.l.nguyen@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/750178/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/750178/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 3w3H9s1dDqz9s7d\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 13 Apr 2017 07:29:20 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 85BD58969C;\n\tWed, 12 Apr 2017 21:29:19 +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 UQwyGJYl+IOB; Wed, 12 Apr 2017 21:29:18 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A588B897A5;\n\tWed, 12 Apr 2017 21:29:18 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id B9E5E1C0346\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 B89088969C\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 wY-UovAzXzlb for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 12 Apr 2017 21:29:14 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 28B8189795\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 12 Apr 2017 21:29:14 +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:29:03 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.152.56])\n\tby fmsmga004.fm.intel.com with ESMTP; 12 Apr 2017 14:29:03 -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=\"247903358\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 12 Apr 2017 13:21:07 -0700", "Message-Id": "<20170412202107.55834-3-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.9.3", "In-Reply-To": "<20170412202107.55834-1-anthony.l.nguyen@intel.com>", "References": "<20170412202107.55834-1-anthony.l.nguyen@intel.com>", "Subject": "[Intel-wired-lan] [PATCH 3/3] ixgbevf: 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/ixgbevf/ethtool.c | 3 ++-\n drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 2 +-\n drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 33 +++++++++++++++++++++--\n 3 files changed, 34 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c\nindex 43b70cd..ff9d05f 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c\n@@ -855,7 +855,8 @@ static int ixgbevf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,\n \n \tif (adapter->hw.mac.type >= ixgbe_mac_X550_vf) {\n \t\tif (key)\n-\t\t\tmemcpy(key, adapter->rss_key, sizeof(adapter->rss_key));\n+\t\t\tmemcpy(key, adapter->rss_key,\n+\t\t\t ixgbevf_get_rxfh_key_size(netdev));\n \n \t\tif (indir) {\n \t\t\tint i;\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\nindex a8cbc2d..581f44b 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n@@ -319,7 +319,7 @@ struct ixgbevf_adapter {\n \tspinlock_t mbx_lock;\n \tunsigned long last_reset;\n \n-\tu32 rss_key[IXGBEVF_VFRSSRK_REGS];\n+\tu32 *rss_key;\n \tu8 rss_indir_tbl[IXGBEVF_X550_VFRETA_SIZE];\n };\n \ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex d478858..f2cc728 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -1661,6 +1661,28 @@ static void ixgbevf_rx_desc_queue_enable(struct ixgbevf_adapter *adapter,\n \t\t reg_idx);\n }\n \n+/**\n+ * ixgbevf_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 bool ixgbevf_init_rss_key(struct ixgbevf_adapter *adapter)\n+{\n+\tu32 *rss_key;\n+\n+\tif (!adapter->rss_key) {\n+\t\trss_key = kzalloc(IXGBEVF_RSS_HASH_KEY_SIZE, GFP_KERNEL);\n+\t\tif (unlikely(!rss_key))\n+\t\t\treturn -ENOMEM;\n+\n+\t\tnetdev_rss_key_fill(rss_key, IXGBEVF_RSS_HASH_KEY_SIZE);\n+\t\tadapter->rss_key = rss_key;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static void ixgbevf_setup_vfmrqc(struct ixgbevf_adapter *adapter)\n {\n \tstruct ixgbe_hw *hw = &adapter->hw;\n@@ -1669,9 +1691,8 @@ static void ixgbevf_setup_vfmrqc(struct ixgbevf_adapter *adapter)\n \tu8 i, j;\n \n \t/* Fill out hash function seeds */\n-\tnetdev_rss_key_fill(adapter->rss_key, sizeof(adapter->rss_key));\n \tfor (i = 0; i < IXGBEVF_VFRSSRK_REGS; i++)\n-\t\tIXGBE_WRITE_REG(hw, IXGBE_VFRSSRK(i), adapter->rss_key[i]);\n+\t\tIXGBE_WRITE_REG(hw, IXGBE_VFRSSRK(i), *(adapter->rss_key + i));\n \n \tfor (i = 0, j = 0; i < IXGBEVF_X550_VFRETA_SIZE; i++, j++) {\n \t\tif (j == rss_i)\n@@ -2612,6 +2633,12 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter)\n \n \thw->mbx.ops.init_params(hw);\n \n+\tif (hw->mac.type >= ixgbe_mac_X550_vf) {\n+\t\terr = ixgbevf_init_rss_key(adapter);\n+\t\tif (err)\n+\t\t\tgoto out;\n+\t}\n+\n \t/* assume legacy case in which PF would only give VF 2 queues */\n \thw->mac.max_tx_queues = 2;\n \thw->mac.max_rx_queues = 2;\n@@ -4142,6 +4169,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n err_sw_init:\n \tixgbevf_reset_interrupt_capability(adapter);\n \tiounmap(adapter->io_addr);\n+\tkfree(adapter->rss_key);\n err_ioremap:\n \tdisable_dev = !test_and_set_bit(__IXGBEVF_DISABLED, &adapter->state);\n \tfree_netdev(netdev);\n@@ -4188,6 +4216,7 @@ static void ixgbevf_remove(struct pci_dev *pdev)\n \n \thw_dbg(&adapter->hw, \"Remove complete\\n\");\n \n+\tkfree(adapter->rss_key);\n \tdisable_dev = !test_and_set_bit(__IXGBEVF_DISABLED, &adapter->state);\n \tfree_netdev(netdev);\n \n", "prefixes": [ "3/3" ] }