From patchwork Wed Oct 2 12:25:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11170999 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 404A41747 for ; Wed, 2 Oct 2019 12:25:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15C3B21A4C for ; Wed, 2 Oct 2019 12:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570019136; bh=Wd2ZqlbtGVBYphmLFX9XaYvx2NCUTPSX7E/zoQHRU1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=a6posh5PNHugoUpGsuGEBHe11Xha6YzcVE+uD/ni5gllLYEIkV7i4M+Ox0CSu03Ua VVLVhdb7MGPB9zARW3m2hECfIgcVIkrkcA4mX1sYU+hrFdS4BcW5cg4rjRumUBtpe3 qOqxLTEn3VPyr35AnmwRsEJPnZg2gWByLmIXs8/Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725935AbfJBMZf (ORCPT ); Wed, 2 Oct 2019 08:25:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:59892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfJBMZf (ORCPT ); Wed, 2 Oct 2019 08:25:35 -0400 Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5052D21920; Wed, 2 Oct 2019 12:25:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570019134; bh=Wd2ZqlbtGVBYphmLFX9XaYvx2NCUTPSX7E/zoQHRU1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hLn4azveN9mLKgObLHuuWDCp3Krd73NxdZHbQ2USaoVAbfGyq3eqx2XlEjt4v9mhu Emrq6YH/192D8kGZxvcua5dd1BhhPTXBurTKbAdUmdtg5Ar/iE3xXSsT/UwM3e1SB2 +aoZjv4QZUkGSDKg5XBxLnb+a1+lbpLicq2pNo9w= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Erez Alfasi , Parav Pandit Subject: [PATCH rdma-next 1/4] RDMA/mlx5: Group boolean parameters to take less space Date: Wed, 2 Oct 2019 15:25:14 +0300 Message-Id: <20191002122517.17721-2-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191002122517.17721-1-leon@kernel.org> References: <20191002122517.17721-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky Clean the code to store all boolean parameters inside one variable. Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/mlx5_ib.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index 2ceaef3ea3fb..bf30d53d94dc 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h @@ -958,7 +958,10 @@ struct mlx5_ib_dev { /* serialize update of capability mask */ struct mutex cap_mask_mutex; - bool ib_active; + u8 ib_active:1; + u8 fill_delay:1; + u8 is_rep:1; + u8 lag_active:1; struct umr_common umrc; /* sync used page count stats */ @@ -967,7 +970,6 @@ struct mlx5_ib_dev { struct timer_list delay_timer; /* Prevents soft lock on massive reg MRs */ struct mutex slow_path_mutex; - int fill_delay; struct ib_odp_caps odp_caps; u64 odp_max_size; struct mlx5_ib_pf_eq odp_pf_eq; @@ -988,8 +990,6 @@ struct mlx5_ib_dev { struct mlx5_sq_bfreg fp_bfreg; struct mlx5_ib_delay_drop delay_drop; const struct mlx5_ib_profile *profile; - bool is_rep; - int lag_active; struct mlx5_ib_lb_state lb; u8 umr_fence; From patchwork Wed Oct 2 12:25:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11170993 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9575C1599 for ; Wed, 2 Oct 2019 12:25:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69F7521A4A for ; Wed, 2 Oct 2019 12:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570019126; bh=AS4zwuFwoep/SqEGDlUqpuLW0jqcZClkOMsEcfQBXJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zfzsw+Jjkj9PmuQ5LC8d7waCzQLTjw5tGxQwPWKG6So2AVL4Nyaf0OP4enVDoWLpZ K5AeYhyHShAE7RHgCtLDR84pKUg5qigamVvlj13RwKTpIdv0pTxnshuBkIBTfYzTDr 9FLp+Ji7p9W3T6V25peVKFg6eC1868emxaQ9WdF0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726178AbfJBMZZ (ORCPT ); Wed, 2 Oct 2019 08:25:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:59828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbfJBMZZ (ORCPT ); Wed, 2 Oct 2019 08:25:25 -0400 Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A4B9F21920; Wed, 2 Oct 2019 12:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570019125; bh=AS4zwuFwoep/SqEGDlUqpuLW0jqcZClkOMsEcfQBXJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5lGNWINTlFJC1UtrMiJztslw5su8J8s618DPlEtcLxG22iLxU3UaOwKS5T2jqOou bpyjQa+MW2FPsPAqMAe1efYg+wv2HHcbTVkT8kxN/yskuGL3OIQDH3O96vW5w/gPI3 cE62PVBzaRbHSc1UsG4X5uDixt6ocbMizrH4mJ0c= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Erez Alfasi , Parav Pandit Subject: [PATCH rdma-next 2/4] IB/mlx5: Remove unnecessary return statement Date: Wed, 2 Oct 2019 15:25:15 +0300 Message-Id: <20191002122517.17721-3-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191002122517.17721-1-leon@kernel.org> References: <20191002122517.17721-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Erez Alfasi There is no reason to call return at the end of function which returns void. Remove this unnecessary statement. Signed-off-by: Erez Alfasi Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/odp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c index 2e9b43061797..95cf0249b015 100644 --- a/drivers/infiniband/hw/mlx5/odp.c +++ b/drivers/infiniband/hw/mlx5/odp.c @@ -359,8 +359,6 @@ void mlx5_ib_internal_fill_odp_caps(struct mlx5_ib_dev *dev) MLX5_CAP_GEN(dev->mdev, umr_extended_translation_offset) && !MLX5_CAP_GEN(dev->mdev, umr_indirect_mkey_disabled)) caps->general_caps |= IB_ODP_SUPPORT_IMPLICIT; - - return; } static void mlx5_ib_page_fault_resume(struct mlx5_ib_dev *dev, From patchwork Wed Oct 2 12:25:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11170995 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C344A1599 for ; Wed, 2 Oct 2019 12:25:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9963A21A4C for ; Wed, 2 Oct 2019 12:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570019129; bh=oNFaSR3Inr1MFcGQ7RR6qO4j2SokI/gSfKfg0+ZhJJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DwS4rSF3QjRHOsYHEEi0VFvSZ8Lz9TFRG9kRcrBZNQcDaV/xKCOymGJG6xTCoduTi 4db2YD++o/6Nu3K1d9IVyQ8iM16JjqA3OOez6y1pea0qAv9vuxQDl30WN22JtBpanQ L7wB/Typ1tM4Cq1SW1T2RmcIJ72SRJKSwypMg878= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbfJBMZ3 (ORCPT ); Wed, 2 Oct 2019 08:25:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:59848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbfJBMZ3 (ORCPT ); Wed, 2 Oct 2019 08:25:29 -0400 Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E16F021920; Wed, 2 Oct 2019 12:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570019128; bh=oNFaSR3Inr1MFcGQ7RR6qO4j2SokI/gSfKfg0+ZhJJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pfy+2yHXGpIx4+V49XKktVSzIHaHmeISy0Z1HuvPWL+gbyp3u6vJbXchWVyCah32m mPxhQSR0GN2guprfqzPhtgCu7526iWbbcE66pmKTkDLVAWa414PnPN3986UkiLxlSG vnn9sksmnMgy59ynRR9rHzKSdoTonxy3B6de2pXM= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Erez Alfasi , Parav Pandit Subject: [PATCH rdma-next 3/4] IB/mlx5: Remove unnecessary else statement Date: Wed, 2 Oct 2019 15:25:16 +0300 Message-Id: <20191002122517.17721-4-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191002122517.17721-1-leon@kernel.org> References: <20191002122517.17721-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Erez Alfasi 'else' is not generally useful after a break or return. Remove this unnecessary statement. Signed-off-by: Erez Alfasi Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 831539419c30..b95c2b05f682 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -844,8 +844,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, resp_len = sizeof(resp.comp_mask) + sizeof(resp.response_length); if (uhw->outlen && uhw->outlen < resp_len) return -EINVAL; - else - resp.response_length = resp_len; + + resp.response_length = resp_len; if (uhw->inlen && !ib_is_udata_cleared(uhw, 0, uhw->inlen)) return -EINVAL; From patchwork Wed Oct 2 12:25:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 11170997 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A8B71747 for ; Wed, 2 Oct 2019 12:25:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D379E21A4C for ; Wed, 2 Oct 2019 12:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570019132; bh=ZkRlWJ/nqTMW7dVzOTjs9T7NWikdMThBZiyjvwzhryY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QDE+seJuWoSH1jAMaoNHeqtWTdaAD/6OPuQ4WNoFMESoiFy9L2OvrY4mfaGVL+lLC pAEEaRbru/10Q7bhuz141AeVqXJWscuNS1tMV0iIlBC7WqfX3qCbK5wDa8D0Ur6rdb RP8Fv+72e+CXz3X+iSI6QLSmSzZuayrttna0c564= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726043AbfJBMZc (ORCPT ); Wed, 2 Oct 2019 08:25:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:59870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbfJBMZc (ORCPT ); Wed, 2 Oct 2019 08:25:32 -0400 Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1CA6221920; Wed, 2 Oct 2019 12:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570019131; bh=ZkRlWJ/nqTMW7dVzOTjs9T7NWikdMThBZiyjvwzhryY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mm6Ob2ytDxZX67xeNW1abcU5yQWJCO9LDjXzn5Ao9y7VMNyTEpO5YN1d7oKUdOz/3 BZBqtRplvyO3xYYWj2uy6KRMinZTzLWoO5s1K3ZWzv3HwTyc0JOIpkyX2XN+W1IGog fwdGmxUPEZVSAQPLjPrjBx4/9REohetiZdRgozuo= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Erez Alfasi , Parav Pandit Subject: [PATCH rdma-next 4/4] IB/cm: Use container_of() instead of typecast Date: Wed, 2 Oct 2019 15:25:17 +0300 Message-Id: <20191002122517.17721-5-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191002122517.17721-1-leon@kernel.org> References: <20191002122517.17721-1-leon@kernel.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Parav Pandit Use container_of() macro to get to timewait info structure instead of typecasting. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index da10e6ccb43c..c0aa3a4b4cfd 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -246,7 +246,7 @@ struct cm_work { }; struct cm_timewait_info { - struct cm_work work; /* Must be first. */ + struct cm_work work; struct list_head list; struct rb_node remote_qp_node; struct rb_node remote_id_node; @@ -3434,7 +3434,7 @@ static int cm_timewait_handler(struct cm_work *work) struct cm_id_private *cm_id_priv; int ret; - timewait_info = (struct cm_timewait_info *)work; + timewait_info = container_of(work, struct cm_timewait_info, work); spin_lock_irq(&cm.lock); list_del(&timewait_info->list); spin_unlock_irq(&cm.lock);