Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/650500/?format=api
{ "id": 650500, "url": "http://patchwork.ozlabs.org/api/patches/650500/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160719232331.31422-3-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": "<20160719232331.31422-3-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2016-07-19T23:23:30", "name": "[v1,2/3] i40e: fix broken i40e_config_rss_aq function", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "e6376923473dbab29e7a1eb074701daa15d6b5ee", "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/20160719232331.31422-3-jacob.e.keller@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/650500/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/650500/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\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 3rvGM368lfz9sxb\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Jul 2016 09:23:43 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 304EE896F5;\n\tTue, 19 Jul 2016 23:23:42 +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 2VlTgAb2ET7S; Tue, 19 Jul 2016 23:23:39 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2C531896DA;\n\tTue, 19 Jul 2016 23:23:39 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8C0F41C0D7B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 19 Jul 2016 23:23:36 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8886A8B6C4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 19 Jul 2016 23:23:36 +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 qtgHKGYVXFVC for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 19 Jul 2016 23:23:34 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D0B628B63F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 19 Jul 2016 23:23:34 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga101.fm.intel.com with ESMTP; 19 Jul 2016 16:23:34 -0700", "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([134.134.3.116])\n\tby orsmga003.jf.intel.com with ESMTP; 19 Jul 2016 16:23:34 -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.28,391,1464678000\"; d=\"scan'208\";a=\"849516168\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Tue, 19 Jul 2016 16:23:30 -0700", "Message-Id": "<20160719232331.31422-3-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.9.0.rc1.405.g81f467e", "In-Reply-To": "<20160719232331.31422-1-jacob.e.keller@intel.com>", "References": "<20160719232331.31422-1-jacob.e.keller@intel.com>", "Subject": "[Intel-wired-lan] [PATCH v1 2/3] i40e: fix broken\n\ti40e_config_rss_aq function", "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": "X722 hardware requires using the admin queue to configure RSS. This\nfunction was previously re-written in commit e69ff813af35 (\"i40e: rework\nthe functions to configure RSS with similar parameters\").\nHowever, the previous refactor did not work correctly for a few reasons\n\n(a) it does not check whether seed is NULL before using it, resulting in\na NULL pointer dereference\n\n[ 402.954721] BUG: unable to handle kernel NULL pointer dereference at (null)\n[ 402.955568] IP: [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e]\n[ 402.956402] PGD ad610067 PUD accc0067 PMD 0\n[ 402.957235] Oops: 0000 [#1] SMP\n[ 402.958064] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_filter ebtable_\nbroute bridge stp llc ebtable_nat ebtables ip6table_mangle ip6table_raw ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv\n6 ip6table_security ip6table_filter ip6_tables iptable_mangle iptable_raw iptable_nat nf_conntrack_ipv4_ nf_defrag_ipv4_ nf_nat_ip\nv4_ nf_nat nf_conntrack iptable_security intel_rapl i86_kg_temp_thermal coretemp kvm_intel kvm irqbypass crct10dif_clMl crc32_\npclMl ghash_clMlni_intel iTCO_wdt iTCO_vendor_support shpchp sb_edac dcdbas pcspkr joydev ipmi_devintf wmi edac_core ipmi_ssif\n acpi_ad acpi_ower_meter ipmi_si ipmi_msghandler mei_me nfsd lpc_ich mei ioatdma tpm_tis auth_rpcgss tpm nfs_acl lockd grace s\nunrpc ifs nngag200 i2c_algo_bit drm_kms_helper ttm drm iigbe bnx2x i40e dca mdio ptp pps_core libcrc32c fjes crc32c_intel\n[ 402.965563] CPU: 22 PID: 2461 Conm: ethtool Not tainted 4.6.0-rc7_1.2-ABNidQ+ #20\n[ 402.966719] Hardware name: Dell Inc. PowerEdge R720/0C4Y3R, BIOS 2.5.2 01/28/2015\n[ 402.967862] task: ffff880219b51dc0 ti: ffff8800b3408000 task.ti: ffff8800b3408000\n[ 402.969046] RIP: 0010:[<ffffffffa0090ccf>] [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e]\n[ 402.970339] RSP: 0018:ffff8800b340ba90 EFLAGS: 00010246\n[ 402.971616] RAX: 0000000000000000 RBX: ffff88042ec14000 RCX: 0000000000000200\n[ 402.972961] RDX: ffff880428eb9200 RSI: 0000000000000000 RDI: ffff88042ec14000\n[ 402.974312] RBP: ffff8800b340baf8 R08: ffff880237ada8f0 R09: ffff880428eb9200\n[ 402.975709] R10: ffff880428eb9200 R11: 0000000000000000 R12: ffff88042ec2e000\n[ 402.977104] R13: ffff88042ec2e000 R14: ffff88042ec14000 R15: ffff88022ea00800\n[ 402.978541] FS: 00007f84fd054700(0000) GS:ffff880237ac0000(0000) knlGS:0000000000000000\n[ 402.980003] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n[ 402.981508] CR2: 0000000000000000 CR3: 000000003289e000 CR4: 00000000000406e0\n[ 402.983028] Stack:\n[ 402.984578] 0000000002000200 0000000000000000 ffff88023ffeda68 ffff88023ffef000\n[ 402.986187] 0000000000000268 ffff8800b340bbf8 ffff88023ffedd80 0000000088ce4f1d\n[ 402.987844] ffff88042ec14000 ffff88022ea00800 ffff88042ec2e000 ffff88042ec14000\n[ 402.989509] Call Trace:\n[ 402.991200] [<ffffffffa009636f>] i40e_config_rss+0x11f/0x1c0 [i40e]\n[ 402.992924] [<ffffffffa00a1ae0>] i40e_set_rifh+0ic0/0x130 [i40e]\n[ 402.994684] [<ffffffff816d54b7>] ethtool_set_rifh+0x1f7/0x300\n[ 402.996446] [<ffffffff8136d02b>] ? cred_has_capability+0io6b/0x100\n[ 402.998203] [<ffffffff8136d102>] ? selinux_capable+0x12/0x20\n[ 402.999968] [<ffffffff8136277b>] ? security_capable+0x4b/0x70\n[ 403.001707] [<ffffffff816d6da3>] dev_ethtool+0x1423/0x2290\n[ 403.003461] [<ffffffff816eab41>] dev_ioctl+0x191/0io630\n[ 403.005186] [<ffffffff811cf80a>] ? lru_cache_add+0x3a/0i80\n[ 403.006942] [<ffffffff817f2a8e>] ? _raw_spin_unlock+0ie/0x20\n[ 403.008691] [<ffffffff816adb95>] sock_do_ioctl+0x45/0i50\n[ 403.010421] [<ffffffff816ae229>] sock_ioctl+0x209/0x2d0\n[ 403.012173] [<ffffffff81262194>] do_vfs_ioctl+0u4/0io6c0\n[ 403.013911] [<ffffffff81262829>] SyS_ioctl+0x79/0x90\n[ 403.015710] [<ffffffff817f2e72>] entry_SYSCALL_64_fastpath+0x1a/0u4\n[ 403.017500] Code: 90 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 89 fb 48 83 ec 40 4c 8b a7 e0 05 00 00 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 <48> 8b 06 41 0f b7 bc 24 f2 0f 00 00 48 89 45 9c 48 8b 46 08 48\n[ 403.021454] RIP [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e]\n[ 403.023395] RSP <ffff8800b340ba90>\n[ 403.025271] CR2: 0000000000000000\n[ 403.027169] ---[ end trace 64561b528cf61cf0 ]---\n\n(b) it does not even bother to use the passed in *lut parameter which\ndefines the requested lookup table. Instead it uses its own round robin\ntable.\n\nFix these issues by re-writing it to be similar to i40e_config_rss_reg\nand i40e_get_rss_aq.\n\nFixes: e69ff813af35 (\"i40e: rework the functions to configure RSS with similar parameters\", 2015-10-21)\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 57 ++++++++++++-----------------\n 1 file changed, 23 insertions(+), 34 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex d482443d01de..7617ee4a86b0 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -7953,45 +7953,34 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf)\n static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed,\n \t\t\t u8 *lut, u16 lut_size)\n {\n-\tstruct i40e_aqc_get_set_rss_key_data rss_key;\n \tstruct i40e_pf *pf = vsi->back;\n \tstruct i40e_hw *hw = &pf->hw;\n-\tbool pf_lut = false;\n-\tu8 *rss_lut;\n-\tint ret, i;\n+\tint ret = 0;\n \n-\tmemcpy(&rss_key, seed, sizeof(rss_key));\n-\n-\trss_lut = kzalloc(pf->rss_table_size, GFP_KERNEL);\n-\tif (!rss_lut)\n-\t\treturn -ENOMEM;\n-\n-\t/* Populate the LUT with max no. of queues in round robin fashion */\n-\tfor (i = 0; i < vsi->rss_table_size; i++)\n-\t\trss_lut[i] = i % vsi->rss_size;\n-\n-\tret = i40e_aq_set_rss_key(hw, vsi->id, &rss_key);\n-\tif (ret) {\n-\t\tdev_info(&pf->pdev->dev,\n-\t\t\t \"Cannot set RSS key, err %s aq_err %s\\n\",\n-\t\t\t i40e_stat_str(&pf->hw, ret),\n-\t\t\t i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));\n-\t\tgoto config_rss_aq_out;\n+\tif (seed) {\n+\t\tstruct i40e_aqc_get_set_rss_key_data *seed_dw =\n+\t\t\t(struct i40e_aqc_get_set_rss_key_data *)seed;\n+\t\tret = i40e_aq_set_rss_key(hw, vsi->id, seed_dw);\n+\t\tif (ret) {\n+\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t \"Cannot set RSS key, err %s aq_err %s\\n\",\n+\t\t\t\t i40e_stat_str(hw, ret),\n+\t\t\t\t i40e_aq_str(hw, hw->aq.asq_last_status));\n+\t\t\treturn ret;\n+\t\t}\n \t}\n+\tif (lut) {\n+\t\tbool pf_lut = vsi->type == I40E_VSI_MAIN ? true : false;\n \n-\tif (vsi->type == I40E_VSI_MAIN)\n-\t\tpf_lut = true;\n-\n-\tret = i40e_aq_set_rss_lut(hw, vsi->id, pf_lut, rss_lut,\n-\t\t\t\t vsi->rss_table_size);\n-\tif (ret)\n-\t\tdev_info(&pf->pdev->dev,\n-\t\t\t \"Cannot set RSS lut, err %s aq_err %s\\n\",\n-\t\t\t i40e_stat_str(&pf->hw, ret),\n-\t\t\t i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));\n-\n-config_rss_aq_out:\n-\tkfree(rss_lut);\n+\t\tret = i40e_aq_set_rss_lut(hw, vsi->id, pf_lut, lut, lut_size);\n+\t\tif (ret) {\n+\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t \"Cannot set RSS lut, err %s aq_err %s\\n\",\n+\t\t\t\t i40e_stat_str(hw, ret),\n+\t\t\t\t i40e_aq_str(hw, hw->aq.asq_last_status));\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n \treturn ret;\n }\n \n", "prefixes": [ "v1", "2/3" ] }