From patchwork Mon Sep 12 06:28:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 9325747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A70AB6048B for ; Mon, 12 Sep 2016 06:28:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D28128A4F for ; Mon, 12 Sep 2016 06:28:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 808F928B66; Mon, 12 Sep 2016 06:28:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D901C28A4F for ; Mon, 12 Sep 2016 06:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754396AbcILG2q (ORCPT ); Mon, 12 Sep 2016 02:28:46 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:36431 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753421AbcILG2p (ORCPT ); Mon, 12 Sep 2016 02:28:45 -0400 Received: by mail-oi0-f65.google.com with SMTP id o7so1800047oif.3 for ; Sun, 11 Sep 2016 23:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zEk9cluRJd374sNEnNXCQXRwaQvovJE2y/jhR64V/Z0=; b=TjTRfT37Hqf2MkpU33BMYKwV2dOaF2nAiFOdKmhTUBxptvwLsSmDRyOFfq1JCMrRcQ PJ4TBiXb8OP6aetfC8uBk3D+YSWWVQmbZZDH7FC74Jk6bkkgToXpsBemgeeEDdAj6LGW ZPwEpKQV1hXJEbMbLcMj8uBlg9cwUaZvfgUsxTlKCPWfbNCUxB9nFUqmyu4LmaEKyfr1 fHsKvkGrXAMOiRV8rYe1EE5kjNrcf4qfxNBivcahfEWZEafIeZC39Aot0UvWwy87EdR2 74kxPugbqphzPGu/+IjvmUzsMPvm+pkkHjXy1E1neLGBlheSZR3uATw/CLH1UHUPfNEm sGcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zEk9cluRJd374sNEnNXCQXRwaQvovJE2y/jhR64V/Z0=; b=Ga87bJ5hnitqKpXNhU1DfVJW26DKVYaiT9j3LVP1UGEmt1xJr0pUW20/WIX6foFQds ToguwZYxWfmoPjXkVm5MP6cgkzcnVX+D/FKukby246kRZujJtBI5VqwYGeSHGk4QJZtu UxthnZMoOujgcdGaIO63yta5QUzZOleb2JnjPC+lXGY9mJXJ6rrPNzYqEm5wms65alVD h3iX49x6+fWRlgi3sed5vJXNbf5EhSiYwRaO1NayLHfXHJ6BLyaic9uc/LrJvLtY+NTl ZEm9yXMzrZezkoWamz0YjAtbnerzhgbKHg1Z5QLCj9WT+Apjgc2HKeBiESKRMrFJKEEg GROA== X-Gm-Message-State: AE9vXwPIx8ewsIAFrZ2pXRH5mX8A+6EFpXv0LWoy0OKwbu9reUHjyDKkYsDtNsNv8EL/RKw7LX4zCA/fqPewAg== X-Received: by 10.157.44.252 with SMTP id e57mr12680355otd.84.1473661711430; Sun, 11 Sep 2016 23:28:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.118.68 with HTTP; Sun, 11 Sep 2016 23:28:30 -0700 (PDT) In-Reply-To: <20160911071542.GH6415@leon.nu> References: <1473232990-22766-1-git-send-email-dchang@suse.com> <20160908140752.GN18398@leon.nu> <20160909025527.GC3042@linux-kyyb.suse> <20160910074719.GG6415@leon.nu> <20160911071542.GH6415@leon.nu> From: Or Gerlitz Date: Mon, 12 Sep 2016 09:28:30 +0300 Message-ID: Subject: Re: [PATCH] IB/mlx5: Fix decision to avoid using MAD_IFC command in ISSI > 0 mode To: Leon Romanovsky , Noa Osherovich Cc: "linux-rdma@vger.kernel.org" , David Chang Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Sep 11, 2016 at 10:15 AM, Leon Romanovsky wrote: > Hi David, > Please find this UNTESTED patch. We will do formal testing during the > coming work week and will properly submit it for inclusion for 4.8. From 9147fabc9b189e09a982de8ac30f01f04468f6ce Mon Sep 17 00:00:00 2001 From: Noa Osherovich Date: Sun, 11 Sep 2016 10:00:27 +0300 Subject: [PATCH rdma-rc] IB/mlx5: Enable MAD_IFC commands for IB ports only MAD_IFC command is supported only for physical function (PF) drivers and only when physical port is IB. The lack of check if port is IB caused to following trace to appear. The word drivers isn't accurate. The change log doesn't say enough on the nature of the fix. You can say "MAD_IFC command is supported only for physical function (PF) and when the port link type is IB, enforce that" [ 8.456327] mlx5_core 0000:03:00.0: firmware version: 12.12.780 does the FW version matters here or the bug/fix apply for all GA FWs that support IB SRIOV and ETH (Roce)? ... [ 10.417421] mlx5_ib: Mellanox Connect-IB Infiniband driver v2.2-1 (Feb 2014) [ 10.419282] ------------[ cut here ]------------ [ 10.419291] WARNING: CPU: 2 PID: 2517 at ../drivers/infiniband/core/cache.c:702 ib_cache_gid_set_default_gid+0x2f8/0x340 [ib_core] This trace teaches us nothing. If you really want to keep it here, say something what the trace means () [ 10.419386] CPU: 2 PID: 2517 Comm: modprobe Tainted: G X 4.4.19-1-default #1 [ 10.419387] Hardware name: Dell Inc. PowerEdge R730xd/072T6D, BIOS2.1.7 06/16/2016 [ 10.419389] 0000000000000000 ffffffff8130d740 0000000000000000 ffffffffa04e0300 [ 10.419395] ffffffff8107c121 [ 10.419400] ffff88017bfe0000 ffff88003712b9e0 ffff88045ad905c0 [ 10.419401] 0000000000000001 fffffffffffffffc ffffffffa04d8a58 0000000000000000 [ 10.419406] Call Trace: [ 10.419415] [] dump_trace+0x59/0x310 [ 10.419419] [] show_stack_log_lvl+0xea/0x170 [ 10.419421] [] show_stack+0x21/0x40 [ 10.419426] [] dump_stack+0x5c/0x7c [ 10.419431] [] warn_slowpath_common+0x81/0xb0 [ 10.419436] [] ib_cache_gid_set_default_gid+0x2f8/0x340 [ib_core] [ 10.419449] [] add_netdev_ips+0x9d/0xa0 [ib_core] [ 10.419456] [] enum_all_gids_of_dev_cb+0x7b/0xb0 [ib_core] [ 10.419461] [] ib_enum_roce_netdev+0xdd/0x100 [ib_core] [ 10.419466] [] roce_rescan_device+0x1d/0x20 [ib_core] [ 10.419470] [] ib_cache_setup_one+0x23b/0x3d0 [ib_core] [ 10.419475] [] ib_register_device+0x2bb/0x4f0 [ib_core] [ 10.419483] [] mlx5_ib_add+0xaaf/0x12e0 [mlx5_ib] [ 10.419492] [] mlx5_add_device+0x41/0xa0 [mlx5_core] [ 10.419498] [] mlx5_register_interface+0x65/0xa0 [mlx5_core] [ 10.419502] [] mlx5_ib_init+0x30/0x42 [mlx5_ib] [ 10.419506] [] do_one_initcall+0xc8/0x1f0 [ 10.419510] [] do_init_module+0x5a/0x1d7 [ 10.419514] [] load_module+0x1366/0x1c50 [ 10.419518] [] SYSC_finit_module+0x70/0xa0 [ 10.419523] [] entry_SYSCALL_64_fastpath+0x12/0x6d [ 10.420681] DWARF2 unwinder stuck at entry_SYSCALL_64_fastpath+0x12/0x6d [ 10.420682] Leftover inexact backtrace: [ 10.420684] ---[ end trace fc8ccb16c9d8e28a ]--- say here what commit/s you are fixing, add Fixes: line -- I assume this bug is here before 4.8-rc1 so the fix needs to go anyway to stable kernels. As we're close to rc6, its better to push the patch for rdma-next (4.9) and later carry it back to stable. Reported-by: David Chang Signed-off-by: Noa Osherovich Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) enum { -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 8150ea3..0480b64 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -288,7 +288,9 @@ __be16 mlx5_get_roce_udp_sport(struct mlx5_ib_dev *dev, u8 port_num, static int mlx5_use_mad_ifc(struct mlx5_ib_dev *dev) { - return !MLX5_CAP_GEN(dev->mdev, ib_virt); + if (MLX5_CAP_GEN(dev->mdev, port_type) == MLX5_CAP_PORT_TYPE_IB) + return !MLX5_CAP_GEN(dev->mdev, ib_virt); + return 0; }