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


Groups > linux.kernel > #1741179 > unrolled thread

[PATCH for-next 0/9] Bug fixes & Code improvements in hip06 and hip08 RoCE driver

Started by"Wei Hu (Xavier)" <xavier.huwei@huawei.com>
First post2017-09-28 06:40 +0200
Last post2017-09-29 04:10 +0200
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH for-next 0/9] Bug fixes & Code improvements in hip06 and hip08 RoCE driver "Wei Hu (Xavier)" <xavier.huwei@huawei.com> - 2017-09-28 06:40 +0200
    [PATCH for-next 7/9] RDMA/hns: Remove unnecessarily calling unregister_inetaddr_notifier function "Wei Hu (Xavier)" <xavier.huwei@huawei.com> - 2017-09-28 06:40 +0200
    [PATCH for-next 6/9] RDMA/hns: Add return statement when checking error in hns_roce_v1_mr_free_work_fn "Wei Hu (Xavier)" <xavier.huwei@huawei.com> - 2017-09-28 06:40 +0200
    [PATCH for-next 2/9] RDMA/hns: Factor out the code for checking sdb status into a new function "Wei Hu (Xavier)" <xavier.huwei@huawei.com> - 2017-09-28 06:40 +0200
      Re: [PATCH for-next 2/9] RDMA/hns: Factor out the code for checking  sdb status into a new function Leon Romanovsky <leon@kernel.org> - 2017-09-28 16:00 +0200
        Re: [PATCH for-next 2/9] RDMA/hns: Factor out the code for checking  sdb status into a new function "Wei Hu (Xavier)" <xavier.huwei@huawei.com> - 2017-09-29 04:10 +0200

#1741179 — [PATCH for-next 0/9] Bug fixes & Code improvements in hip06 and hip08 RoCE driver

From"Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date2017-09-28 06:40 +0200
Subject[PATCH for-next 0/9] Bug fixes & Code improvements in hip06 and hip08 RoCE driver
Message-ID<uuyCt-49t-3@gated-at.bofh.it>
This patch-set introduces some bug fixes and code improvements
for hip06 and hip08 RoCE driver. It includes a patch for fixing
the assign algorithm of qp_attr->max_rd_atomic and
qp_attr->max_dest_rd_atomic, three patches for static check errors,
one for setting attr mask, one for returning RoCE device ah_attr
type when querying qp, one for the abi structure between libhns and
hns_roce drvier, one for unregistering inet addr, and the last one
for command queue delay processing in hip08 driver.

Lijun Ou (8):
  RDMA/hns: Modify the value with rd&dest_rd of qp_attr
  RDMA/hns: Factor out the code for checking sdb status into a new
    function
  RDMA/hns: Add return statement when kzalloc return NULL in
    hns_roce_v1_recreate_lp_qp
  RDMA/hns: Set mask for destination qp field of qp context assignment
  RDMA/hns: Set rdma_ah_attr type for querying qp
  RDMA/hns: Remove unnecessarily calling unregister_inetaddr_notifier
    function
  RDMA/hns: Remove unused struct members in hns-abi.h
  RDMA/hns: Replace usleep_range with udelay when checking command
    status

Wei Hu (Xavier) (1):
  RDMA/hns: Add return statement when checking error in
    hns_roce_v1_mr_free_work_fn

 drivers/infiniband/hw/hns/hns_roce_device.h |   1 -
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c  | 117 ++++++++++++++++------------
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c  |   3 +-
 drivers/infiniband/hw/hns/hns_roce_main.c   |   1 -
 include/uapi/rdma/hns-abi.h                 |   2 -
 5 files changed, 69 insertions(+), 55 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1741180 — [PATCH for-next 7/9] RDMA/hns: Remove unnecessarily calling unregister_inetaddr_notifier function

From"Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date2017-09-28 06:40 +0200
Subject[PATCH for-next 7/9] RDMA/hns: Remove unnecessarily calling unregister_inetaddr_notifier function
Message-ID<uuyMa-4cw-31@gated-at.bofh.it>
In reply to#1741179
From: Lijun Ou <oulijun@huawei.com>

When the driver doesn't call register_inetaddr_notifier function, it need
not call unregister_inetaddr_notifier to unregister inet addr. This patch
fixes it.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_device.h | 1 -
 drivers/infiniband/hw/hns/hns_roce_main.c   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h
index 4f43c91..06f3dad 100644
--- a/drivers/infiniband/hw/hns/hns_roce_device.h
+++ b/drivers/infiniband/hw/hns/hns_roce_device.h
@@ -474,7 +474,6 @@ struct hns_roce_ib_iboe {
 	spinlock_t		lock;
 	struct net_device      *netdevs[HNS_ROCE_MAX_PORTS];
 	struct notifier_block	nb;
-	struct notifier_block	nb_inet;
 	u8			phy_port[HNS_ROCE_MAX_PORTS];
 };
 
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index 7a0c1e8..8fe8247 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -419,7 +419,6 @@ static void hns_roce_unregister_device(struct hns_roce_dev *hr_dev)
 {
 	struct hns_roce_ib_iboe *iboe = &hr_dev->iboe;
 
-	unregister_inetaddr_notifier(&iboe->nb_inet);
 	unregister_netdevice_notifier(&iboe->nb);
 	ib_unregister_device(&hr_dev->ib_dev);
 }
-- 
1.9.1

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


#1741181 — [PATCH for-next 6/9] RDMA/hns: Add return statement when checking error in hns_roce_v1_mr_free_work_fn

From"Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date2017-09-28 06:40 +0200
Subject[PATCH for-next 6/9] RDMA/hns: Add return statement when checking error in hns_roce_v1_mr_free_work_fn
Message-ID<uuyMa-4cw-35@gated-at.bofh.it>
In reply to#1741179
After the loop in hns_roce_v1_mr_free_work_fn function, it is possible that
the local variable named hr_qp is NULL, the operation "hr_qp->qpn" will
result in the exception. As a result, we add return statement when checking
error.

This patch fixes the smatch error as below:
drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1009 hns_roce_v1_mr_free_work_fn()
error: we previously assumed 'hr_qp' could be null

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 3496f39..c08822b 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -1004,6 +1004,11 @@ static void hns_roce_v1_mr_free_work_fn(struct work_struct *work)
 		}
 	}
 
+	if (!ne) {
+		dev_err(dev, "Reseved loop qp is absent!\n");
+		goto free_work;
+	}
+
 	do {
 		ret = hns_roce_v1_poll_cq(&mr_free_cq->ib_cq, ne, wc);
 		if (ret < 0) {
-- 
1.9.1

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


#1741182 — [PATCH for-next 2/9] RDMA/hns: Factor out the code for checking sdb status into a new function

From"Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date2017-09-28 06:40 +0200
Subject[PATCH for-next 2/9] RDMA/hns: Factor out the code for checking sdb status into a new function
Message-ID<uuyMa-4cw-33@gated-at.bofh.it>
In reply to#1741179
From: Lijun Ou <oulijun@huawei.com>

It mainly places the lines for checking send doorbell status
into a special functions. As a result, we can directly call it in
check_qp_db_process_status function and keep consistent indenting
style.

It fixes: 5f110ac4bed8 ("IB/hns: Fix for checkpatch.pl comment style)
The warning from static checker:
drivers/infiniband/hw/hns/hns_roce_hw_v1.c:3562 check_qp_db_process_status()
warn: inconsistent indenting

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 95 ++++++++++++++++--------------
 1 file changed, 51 insertions(+), 44 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 6e9acfd..95f5c88 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -3532,6 +3532,53 @@ int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
 		hns_roce_v1_q_qp(ibqp, qp_attr, qp_attr_mask, qp_init_attr);
 }
 
+static void hns_roce_check_sdb_status(struct hns_roce_dev *hr_dev,
+				      u32 *old_send, u32 *old_retry,
+				      u32 *tsp_st, u32 *success_flags)
+{
+	u32 sdb_retry_cnt;
+	u32 sdb_send_ptr;
+	u32 cur_cnt, old_cnt;
+	u32 send_ptr;
+
+	sdb_send_ptr = roce_read(hr_dev, ROCEE_SDB_SEND_PTR_REG);
+	sdb_retry_cnt =	roce_read(hr_dev, ROCEE_SDB_RETRY_CNT_REG);
+	cur_cnt = roce_get_field(sdb_send_ptr,
+				 ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
+				 ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S) +
+		  roce_get_field(sdb_retry_cnt,
+				 ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_M,
+				 ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_S);
+	if (!roce_get_bit(*tsp_st, ROCEE_CNT_CLR_CE_CNT_CLR_CE_S)) {
+		old_cnt = roce_get_field(*old_send,
+					 ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
+					 ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S) +
+			  roce_get_field(*old_retry,
+					 ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_M,
+					 ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_S);
+		if (cur_cnt - old_cnt > SDB_ST_CMP_VAL)
+			*success_flags = 1;
+	} else {
+		old_cnt = roce_get_field(*old_send,
+					 ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
+					 ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S);
+		if (cur_cnt - old_cnt > SDB_ST_CMP_VAL) {
+			*success_flags = 1;
+		} else {
+			send_ptr = roce_get_field(*old_send,
+					    ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
+					    ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S) +
+				   roce_get_field(sdb_retry_cnt,
+					    ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_M,
+					    ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_S);
+			roce_set_field(*old_send,
+				       ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
+				       ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S,
+				       send_ptr);
+		}
+	}
+}
+
 static int check_qp_db_process_status(struct hns_roce_dev *hr_dev,
 				      struct hns_roce_qp *hr_qp,
 				      u32 sdb_issue_ptr,
@@ -3539,12 +3586,10 @@ static int check_qp_db_process_status(struct hns_roce_dev *hr_dev,
 				      u32 *wait_stage)
 {
 	struct device *dev = &hr_dev->pdev->dev;
-	u32 sdb_retry_cnt, old_retry;
 	u32 sdb_send_ptr, old_send;
 	u32 success_flags = 0;
-	u32 cur_cnt, old_cnt;
 	unsigned long end;
-	u32 send_ptr;
+	u32 old_retry;
 	u32 inv_cnt;
 	u32 tsp_st;
 
@@ -3602,47 +3647,9 @@ static int check_qp_db_process_status(struct hns_roce_dev *hr_dev,
 
 				msleep(HNS_ROCE_V1_CHECK_DB_SLEEP_MSECS);
 
-				sdb_send_ptr = roce_read(hr_dev,
-							ROCEE_SDB_SEND_PTR_REG);
-				sdb_retry_cnt =	roce_read(hr_dev,
-						       ROCEE_SDB_RETRY_CNT_REG);
-				cur_cnt = roce_get_field(sdb_send_ptr,
-					ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
-					ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S) +
-					roce_get_field(sdb_retry_cnt,
-					ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_M,
-					ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_S);
-				if (!roce_get_bit(tsp_st,
-					ROCEE_CNT_CLR_CE_CNT_CLR_CE_S)) {
-					old_cnt = roce_get_field(old_send,
-					ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
-					ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S) +
-					roce_get_field(old_retry,
-					ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_M,
-					ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_S);
-					if (cur_cnt - old_cnt > SDB_ST_CMP_VAL)
-						success_flags = 1;
-				} else {
-					old_cnt = roce_get_field(old_send,
-					ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
-					ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S);
-					if (cur_cnt - old_cnt >
-					    SDB_ST_CMP_VAL) {
-						success_flags = 1;
-					} else {
-						send_ptr =
-							roce_get_field(old_send,
-					    ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
-					    ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S) +
-					    roce_get_field(sdb_retry_cnt,
-					    ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_M,
-					    ROCEE_SDB_RETRY_CNT_SDB_RETRY_CT_S);
-					    roce_set_field(old_send,
-					    ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_M,
-					    ROCEE_SDB_SEND_PTR_SDB_SEND_PTR_S,
-						send_ptr);
-					}
-				}
+				hns_roce_check_sdb_status(hr_dev, &old_send,
+							  &old_retry, &tsp_st,
+							  &success_flags);
 			} while (!success_flags);
 		}
 
-- 
1.9.1

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


#1741574 — Re: [PATCH for-next 2/9] RDMA/hns: Factor out the code for checking sdb status into a new function

FromLeon Romanovsky <leon@kernel.org>
Date2017-09-28 16:00 +0200
SubjectRe: [PATCH for-next 2/9] RDMA/hns: Factor out the code for checking sdb status into a new function
Message-ID<uuHw5-1ff-17@gated-at.bofh.it>
In reply to#1741182

[Multipart message — attachments visible in raw view] — view raw

On Thu, Sep 28, 2017 at 12:57:27PM +0800, Wei Hu (Xavier) wrote:
> From: Lijun Ou <oulijun@huawei.com>
>
> It mainly places the lines for checking send doorbell status
> into a special functions. As a result, we can directly call it in
> check_qp_db_process_status function and keep consistent indenting
> style.
>
> It fixes: 5f110ac4bed8 ("IB/hns: Fix for checkpatch.pl comment style)

You forgot " at the end of the line, and there is need to put fixes
(should be Fixes) in the line before Signed-off-by.

> The warning from static checker:
> drivers/infiniband/hw/hns/hns_roce_hw_v1.c:3562 check_qp_db_process_status()
> warn: inconsistent indenting
>
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
> Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 95 ++++++++++++++++--------------
>  1 file changed, 51 insertions(+), 44 deletions(-)
>

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


#1741898 — Re: [PATCH for-next 2/9] RDMA/hns: Factor out the code for checking sdb status into a new function

From"Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date2017-09-29 04:10 +0200
SubjectRe: [PATCH for-next 2/9] RDMA/hns: Factor out the code for checking sdb status into a new function
Message-ID<uuSUx-8te-9@gated-at.bofh.it>
In reply to#1741574

On 2017/9/28 21:50, Leon Romanovsky wrote:
> On Thu, Sep 28, 2017 at 12:57:27PM +0800, Wei Hu (Xavier) wrote:
>> From: Lijun Ou <oulijun@huawei.com>
>>
>> It mainly places the lines for checking send doorbell status
>> into a special functions. As a result, we can directly call it in
>> check_qp_db_process_status function and keep consistent indenting
>> style.
>>
>> It fixes: 5f110ac4bed8 ("IB/hns: Fix for checkpatch.pl comment style)
> You forgot " at the end of the line, and there is need to put fixes
> (should be Fixes) in the line before Signed-off-by.
Thanks, Leon
We will modify the statement(Fixes: xx)  and put it before signed-off-by 
in patch v2.

>> The warning from static checker:
>> drivers/infiniband/hw/hns/hns_roce_hw_v1.c:3562 check_qp_db_process_status()
>> warn: inconsistent indenting
>>
>> Signed-off-by: Lijun Ou <oulijun@huawei.com>
>> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
>> Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
>> ---
>>   drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 95 ++++++++++++++++--------------
>>   1 file changed, 51 insertions(+), 44 deletions(-)
>>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web