get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/750494/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 750494,
    "url": "http://patchwork.ozlabs.org/api/patches/750494/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170413142607.7364-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": "<20170413142607.7364-3-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2017-04-13T14:26:07",
    "name": "[v2,3/3] ixgbevf: Check for RSS key before setting value",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d4d1c1ff6402c57b275d0a50f262d7667f931e1c",
    "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/20170413142607.7364-3-anthony.l.nguyen@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/750494/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/750494/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 3w3lFl3515z9s2s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 14 Apr 2017 01:34:19 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id CC08689CD9;\n\tThu, 13 Apr 2017 15:34: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 GOTQ6aQ9DsZI; Thu, 13 Apr 2017 15:34:15 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4C0DA89CCB;\n\tThu, 13 Apr 2017 15:34:15 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 231381C0BC4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 15:34:13 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 60C472FFCD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 15:34:12 +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 bUW9UPxoFYjz for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 15:34:11 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 0262730D61\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 15:34:10 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Apr 2017 08:33:59 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.152.56])\n\tby fmsmga001.fm.intel.com with ESMTP; 13 Apr 2017 08:33: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,195,1488873600\"; d=\"scan'208\";\n\ta=\"1135071604\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 13 Apr 2017 07:26:07 -0700",
        "Message-Id": "<20170413142607.7364-3-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20170413142607.7364-1-anthony.l.nguyen@intel.com>",
        "References": "<20170413142607.7364-1-anthony.l.nguyen@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH v2 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\nv2: Changed return type for ixgbevf_init_rss_key() from bool to int since\nit can return -ENOMEM.\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..fbca9344 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 int 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": [
        "v2",
        "3/3"
    ]
}