Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742426 > unrolled thread

[PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables

Started byAvinash Repaka <avinash.repaka@oracle.com>
First post2017-09-30 03:20 +0200
Last post2017-10-02 08:00 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables Avinash Repaka <avinash.repaka@oracle.com> - 2017-09-30 03:20 +0200
    Re: [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2017-09-30 03:40 +0200
    Re: [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr  variables David Miller <davem@davemloft.net> - 2017-10-02 08:00 +0200
      Re: [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr  variables David Miller <davem@davemloft.net> - 2017-10-02 08:00 +0200

#1742426 — [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables

FromAvinash Repaka <avinash.repaka@oracle.com>
Date2017-09-30 03:20 +0200
Subject[PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables
Message-ID<uveBH-5A0-7@gated-at.bofh.it>
This patch fixes the scope of has_fr and has_fmr variables as they are
needed only in rds_ib_add_one().

Signed-off-by: Avinash Repaka <avinash.repaka@oracle.com>
---
 net/rds/ib.c | 11 ++++++-----
 net/rds/ib.h |  2 --
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/rds/ib.c b/net/rds/ib.c
index a0954ac..36dd209 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -126,6 +126,7 @@ void rds_ib_dev_put(struct rds_ib_device *rds_ibdev)
 static void rds_ib_add_one(struct ib_device *device)
 {
 	struct rds_ib_device *rds_ibdev;
+	bool has_fr, has_fmr;
 
 	/* Only handle IB (no iWARP) devices */
 	if (device->node_type != RDMA_NODE_IB_CA)
@@ -143,11 +144,11 @@ static void rds_ib_add_one(struct ib_device *device)
 	rds_ibdev->max_wrs = device->attrs.max_qp_wr;
 	rds_ibdev->max_sge = min(device->attrs.max_sge, RDS_IB_MAX_SGE);
 
-	rds_ibdev->has_fr = (device->attrs.device_cap_flags &
-				  IB_DEVICE_MEM_MGT_EXTENSIONS);
-	rds_ibdev->has_fmr = (device->alloc_fmr && device->dealloc_fmr &&
-			    device->map_phys_fmr && device->unmap_fmr);
-	rds_ibdev->use_fastreg = (rds_ibdev->has_fr && !rds_ibdev->has_fmr);
+	has_fr = (device->attrs.device_cap_flags &
+		  IB_DEVICE_MEM_MGT_EXTENSIONS);
+	has_fmr = (device->alloc_fmr && device->dealloc_fmr &&
+		   device->map_phys_fmr && device->unmap_fmr);
+	rds_ibdev->use_fastreg = (has_fr && !has_fmr);
 
 	rds_ibdev->fmr_max_remaps = device->attrs.max_map_per_fmr?: 32;
 	rds_ibdev->max_1m_mrs = device->attrs.max_mr ?
diff --git a/net/rds/ib.h b/net/rds/ib.h
index bf48224..6ea6a27 100644
--- a/net/rds/ib.h
+++ b/net/rds/ib.h
@@ -215,8 +215,6 @@ struct rds_ib_device {
 	struct list_head	conn_list;
 	struct ib_device	*dev;
 	struct ib_pd		*pd;
-	bool                    has_fmr;
-	bool                    has_fr;
 	bool                    use_fastreg;
 
 	unsigned int		max_mrs;
-- 
2.4.11

[toc] | [next] | [standalone]


#1742440

FromSantosh Shilimkar <santosh.shilimkar@oracle.com>
Date2017-09-30 03:40 +0200
Message-ID<uveV3-5HO-1@gated-at.bofh.it>
In reply to#1742426
On 9/29/2017 6:13 PM, Avinash Repaka wrote:
> This patch fixes the scope of has_fr and has_fmr variables as they are
> needed only in rds_ib_add_one().
> 
> Signed-off-by: Avinash Repaka <avinash.repaka@oracle.com>
> ---
Indeed the final merge version actually didn't need
those across files. Change looks good to me. Thanks !!

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

[toc] | [prev] | [next] | [standalone]


#1742967 — Re: [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables

FromDavid Miller <davem@davemloft.net>
Date2017-10-02 08:00 +0200
SubjectRe: [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables
Message-ID<uw1VL-3t7-1@gated-at.bofh.it>
In reply to#1742426
From: Avinash Repaka <avinash.repaka@oracle.com>
Date: Fri, 29 Sep 2017 18:13:50 -0700

> This patch fixes the scope of has_fr and has_fmr variables as they are
> needed only in rds_ib_add_one().
> 
> Signed-off-by: Avinash Repaka <avinash.repaka@oracle.com>

Applied.

[toc] | [prev] | [next] | [standalone]


#1742969 — Re: [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables

FromDavid Miller <davem@davemloft.net>
Date2017-10-02 08:00 +0200
SubjectRe: [PATCH net] RDS: IB: Limit the scope of has_fr/has_fmr variables
Message-ID<uw1VM-3t7-9@gated-at.bofh.it>
In reply to#1742967
From: David Miller <davem@davemloft.net>
Date: Sun, 01 Oct 2017 22:54:19 -0700 (PDT)

> From: Avinash Repaka <avinash.repaka@oracle.com>
> Date: Fri, 29 Sep 2017 18:13:50 -0700
> 
>> This patch fixes the scope of has_fr and has_fmr variables as they are
>> needed only in rds_ib_add_one().
>> 
>> Signed-off-by: Avinash Repaka <avinash.repaka@oracle.com>
> 
> Applied.

Actually, reverted, this breaks the build.

net/rds/rdma_transport.c:38:10: fatal error: ib.h: No such file or directory
 #include "ib.h"

Although I can't see how in the world this patch is causing such
an error.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web