public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next 0/3] Several fixes for hns
@ 2018-02-06 12:34 Lijun Ou
       [not found] ` <1517920459-93900-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Lijun Ou @ 2018-02-06 12:34 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, jgg-VPRAkNaXOzVWk0Htik3J/w
  Cc: leon-DgEjT+Ai2ygdnm+yROfE0A, linux-rdma-u79uwXL29TY76Z2rM5mHXA

This patchset include three fixes for hns driver. the first patch
mainly matched with IB protocol. the second patch fix the bug
with freeing memory by __get_free_pages. the last patch mainly
fix the bug when changed the hw mac address.

Lijun Ou (2):
  RDMA/hns: Fix a bug with modifying mac address
  RDMA/hns: Use free_pages function instead of free_page

Yixian Liu (1):
  RDMA/hns: Fix QP state judgement before receiving work requests

 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +-
 drivers/infiniband/hw/hns/hns_roce_main.c  | 3 ++-
 drivers/infiniband/hw/hns/hns_roce_mr.c    | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH for-next 1/3] RDMA/hns: Fix a bug with modifying mac address
       [not found] ` <1517920459-93900-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2018-02-06 12:34   ` Lijun Ou
       [not found]     ` <1517920459-93900-2-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  2018-02-06 12:34   ` [PATCH for-next 2/3] RDMA/hns: Fix QP state judgement before receiving work requests Lijun Ou
  2018-02-06 12:34   ` [PATCH for-next 3/3] RDMA/hns: Use free_pages function instead of free_page Lijun Ou
  2 siblings, 1 reply; 6+ messages in thread
From: Lijun Ou @ 2018-02-06 12:34 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, jgg-VPRAkNaXOzVWk0Htik3J/w
  Cc: leon-DgEjT+Ai2ygdnm+yROfE0A, linux-rdma-u79uwXL29TY76Z2rM5mHXA

When modifying mac address, it will trigger hns_roce_del_gid
function and can't delete the default gid matched the index
because the attribute of gid is null.

Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/hns/hns_roce_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index eb9a69f..6f39afb 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -100,6 +100,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
 			    unsigned int index, void **context)
 {
 	struct hns_roce_dev *hr_dev = to_hr_dev(device);
+	const struct ib_gid_attr zattr;
 	union ib_gid zgid = { {0} };
 	u8 port = port_num - 1;
 	unsigned long flags;
@@ -110,7 +111,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
 
 	spin_lock_irqsave(&hr_dev->iboe.lock, flags);
 
-	ret = hr_dev->hw->set_gid(hr_dev, port, index, &zgid, NULL);
+	ret = hr_dev->hw->set_gid(hr_dev, port, index, &zgid, &zattr);
 
 	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH for-next 2/3] RDMA/hns: Fix QP state judgement before receiving work requests
       [not found] ` <1517920459-93900-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  2018-02-06 12:34   ` [PATCH for-next 1/3] RDMA/hns: Fix a bug with modifying mac address Lijun Ou
@ 2018-02-06 12:34   ` Lijun Ou
  2018-02-06 12:34   ` [PATCH for-next 3/3] RDMA/hns: Use free_pages function instead of free_page Lijun Ou
  2 siblings, 0 replies; 6+ messages in thread
From: Lijun Ou @ 2018-02-06 12:34 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, jgg-VPRAkNaXOzVWk0Htik3J/w
  Cc: leon-DgEjT+Ai2ygdnm+yROfE0A, linux-rdma-u79uwXL29TY76Z2rM5mHXA

From: Yixian Liu <liuyixian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

The QP can accept receive work requests only when the QP is
in the states that allow them to be submitted.

This patch updates the QP state judgement based on the
specification.

Signed-off-by: Yixian Liu <liuyixian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index db2ff35..0aa7483 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -509,7 +509,7 @@ static int hns_roce_v2_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
 	spin_lock_irqsave(&hr_qp->rq.lock, flags);
 	ind = hr_qp->rq.head & (hr_qp->rq.wqe_cnt - 1);
 
-	if (hr_qp->state == IB_QPS_RESET || hr_qp->state == IB_QPS_ERR) {
+	if (hr_qp->state == IB_QPS_RESET) {
 		spin_unlock_irqrestore(&hr_qp->rq.lock, flags);
 		*bad_wr = wr;
 		return -EINVAL;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH for-next 3/3] RDMA/hns: Use free_pages function instead of free_page
       [not found] ` <1517920459-93900-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  2018-02-06 12:34   ` [PATCH for-next 1/3] RDMA/hns: Fix a bug with modifying mac address Lijun Ou
  2018-02-06 12:34   ` [PATCH for-next 2/3] RDMA/hns: Fix QP state judgement before receiving work requests Lijun Ou
@ 2018-02-06 12:34   ` Lijun Ou
  2 siblings, 0 replies; 6+ messages in thread
From: Lijun Ou @ 2018-02-06 12:34 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, jgg-VPRAkNaXOzVWk0Htik3J/w
  Cc: leon-DgEjT+Ai2ygdnm+yROfE0A, linux-rdma-u79uwXL29TY76Z2rM5mHXA

It need to use free_pages function for free the memory allocated
by __get_free_pages function.

Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/hns/hns_roce_mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c
index da86a811..f7256d8 100644
--- a/drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/drivers/infiniband/hw/hns/hns_roce_mr.c
@@ -933,7 +933,7 @@ int hns_roce_ib_umem_write_mtt(struct hns_roce_dev *hr_dev,
 		ret = hns_roce_write_mtt(hr_dev, mtt, n, i, pages);
 
 out:
-	free_page((unsigned long) pages);
+	free_pages((unsigned long) pages, order);
 	return ret;
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH for-next 1/3] RDMA/hns: Fix a bug with modifying mac address
       [not found]     ` <1517920459-93900-2-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2018-02-06 15:53       ` Jason Gunthorpe
       [not found]         ` <20180206155338.GG1288-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Jason Gunthorpe @ 2018-02-06 15:53 UTC (permalink / raw)
  To: Lijun Ou
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Feb 06, 2018 at 08:34:17PM +0800, Lijun Ou wrote:
> When modifying mac address, it will trigger hns_roce_del_gid
> function and can't delete the default gid matched the index
> because the attribute of gid is null.
> 
> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>  drivers/infiniband/hw/hns/hns_roce_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
> index eb9a69f..6f39afb 100644
> +++ b/drivers/infiniband/hw/hns/hns_roce_main.c
> @@ -100,6 +100,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
>  			    unsigned int index, void **context)
>  {
>  	struct hns_roce_dev *hr_dev = to_hr_dev(device);
> +	const struct ib_gid_attr zattr;

That is uninited stack memory, need a = {}

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH for-next 1/3] RDMA/hns: Fix a bug with modifying mac address
       [not found]         ` <20180206155338.GG1288-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2018-02-08  0:58           ` oulijun
  0 siblings, 0 replies; 6+ messages in thread
From: oulijun @ 2018-02-08  0:58 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

在 2018/2/6 23:53, Jason Gunthorpe 写道:
> On Tue, Feb 06, 2018 at 08:34:17PM +0800, Lijun Ou wrote:
>> When modifying mac address, it will trigger hns_roce_del_gid
>> function and can't delete the default gid matched the index
>> because the attribute of gid is null.
>>
>> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>>  drivers/infiniband/hw/hns/hns_roce_main.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
>> index eb9a69f..6f39afb 100644
>> +++ b/drivers/infiniband/hw/hns/hns_roce_main.c
>> @@ -100,6 +100,7 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
>>  			    unsigned int index, void **context)
>>  {
>>  	struct hns_roce_dev *hr_dev = to_hr_dev(device);
>> +	const struct ib_gid_attr zattr;
> 
> That is uninited stack memory, need a = {}
> 
> Jason
> 
> 
Thanks, I have sent the patch V2.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-08  0:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-06 12:34 [PATCH for-next 0/3] Several fixes for hns Lijun Ou
     [not found] ` <1517920459-93900-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-02-06 12:34   ` [PATCH for-next 1/3] RDMA/hns: Fix a bug with modifying mac address Lijun Ou
     [not found]     ` <1517920459-93900-2-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-02-06 15:53       ` Jason Gunthorpe
     [not found]         ` <20180206155338.GG1288-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-02-08  0:58           ` oulijun
2018-02-06 12:34   ` [PATCH for-next 2/3] RDMA/hns: Fix QP state judgement before receiving work requests Lijun Ou
2018-02-06 12:34   ` [PATCH for-next 3/3] RDMA/hns: Use free_pages function instead of free_page Lijun Ou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox