All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] RXE improvements
@ 2016-11-23 17:39 Andrew Boyer
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

These patches provide a series of small improvements to the
RXE driver related to loopback, retries, error handling, and
zero-byte operations.

Changes since v1:
  - Edit commit messages as suggested
  - Remove saddr buffer from stack as suggested
  - Split reference leak patch into two as suggested

Andrew Boyer (8):
  IB/rxe: Remove buffer used for printing IP address
  IB/rxe: Advance the consumer pointer before posting the CQE
  IB/rxe: Don't update the response PSN unless it's going forwards
  IB/rxe: Unblock loopback by moving skb_out increment
  IB/rxe: Add support for zero-byte operations
  IB/rxe: Add support for IB_CQ_REPORT_MISSED_EVENTS
  IB/rxe: Fix ref leak in rxe_create_qp()
  IB/rxe: Fix ref leak in duplicate_request()

 drivers/infiniband/sw/rxe/rxe_comp.c  |  5 +++--
 drivers/infiniband/sw/rxe/rxe_loc.h   |  2 --
 drivers/infiniband/sw/rxe/rxe_mr.c    |  3 +++
 drivers/infiniband/sw/rxe/rxe_net.c   |  2 ++
 drivers/infiniband/sw/rxe/rxe_recv.c  | 11 +++++------
 drivers/infiniband/sw/rxe/rxe_resp.c  | 22 ++++++++++++++++++----
 drivers/infiniband/sw/rxe/rxe_verbs.c | 17 +++++++++++++----
 7 files changed, 44 insertions(+), 18 deletions(-)

-- 
1.8.3.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] 13+ messages in thread

* [PATCH v2 1/8] IB/rxe: Remove buffer used for printing IP address
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
@ 2016-11-23 17:39   ` Andrew Boyer
       [not found]     ` <1479922764-13091-2-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
  2016-11-23 17:39   ` [PATCH v2 2/8] IB/rxe: Advance the consumer pointer before posting the CQE Andrew Boyer
                     ` (7 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

Avoid smashing the stack when an ICRC error occurs on an IPv6 network.

Signed-off-by: Andrew Boyer <andrew.boyer-8PEkshWhKlo@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_recv.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c
index 46f0628..252b4d6 100644
--- a/drivers/infiniband/sw/rxe/rxe_recv.c
+++ b/drivers/infiniband/sw/rxe/rxe_recv.c
@@ -391,16 +391,15 @@ int rxe_rcv(struct sk_buff *skb)
 			     payload_size(pkt));
 	calc_icrc = cpu_to_be32(~calc_icrc);
 	if (unlikely(calc_icrc != pack_icrc)) {
-		char saddr[sizeof(struct in6_addr)];
-
 		if (skb->protocol == htons(ETH_P_IPV6))
-			sprintf(saddr, "%pI6", &ipv6_hdr(skb)->saddr);
+			pr_warn_ratelimited("bad ICRC from %pI6c\n",
+					    &ipv6_hdr(skb)->saddr);
 		else if (skb->protocol == htons(ETH_P_IP))
-			sprintf(saddr, "%pI4", &ip_hdr(skb)->saddr);
+			pr_warn_ratelimited("bad ICRC from %pI4\n",
+					    &ip_hdr(skb)->saddr);
 		else
-			sprintf(saddr, "unknown");
+			pr_warn_ratelimited("bad ICRC from unknown\n");
 
-		pr_warn_ratelimited("bad ICRC from %s\n", saddr);
 		goto drop;
 	}
 
-- 
1.8.3.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] 13+ messages in thread

* [PATCH v2 2/8] IB/rxe: Advance the consumer pointer before posting the CQE
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
  2016-11-23 17:39   ` [PATCH v2 1/8] IB/rxe: Remove buffer used for printing IP address Andrew Boyer
@ 2016-11-23 17:39   ` Andrew Boyer
  2016-11-23 17:39   ` [PATCH v2 3/8] IB/rxe: Don't update the response PSN unless it's going forwards Andrew Boyer
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

A simple userspace application might poll the CQ, find a completion,
and then attempt to post a new WQE to the SQ. A spurious error can
occur if the userspace application detects a full SQ in the instant
before the kernel is able to advance the SQ consumer pointer.

This is noticeable when using single-entry SQs with ibv_rc_pingpong
if lots of kernel and userspace library debugging is enabled.

Signed-off-by: Andrew Boyer <andrew.boyer-8PEkshWhKlo@public.gmane.org>
Reviewed-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_comp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c
index 6c5e29d..d46c49b 100644
--- a/drivers/infiniband/sw/rxe/rxe_comp.c
+++ b/drivers/infiniband/sw/rxe/rxe_comp.c
@@ -420,11 +420,12 @@ static void do_complete(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
 	    (wqe->wr.send_flags & IB_SEND_SIGNALED) ||
 	    (qp->req.state == QP_STATE_ERROR)) {
 		make_send_cqe(qp, wqe, &cqe);
+		advance_consumer(qp->sq.queue);
 		rxe_cq_post(qp->scq, &cqe, 0);
+	} else {
+		advance_consumer(qp->sq.queue);
 	}
 
-	advance_consumer(qp->sq.queue);
-
 	/*
 	 * we completed something so let req run again
 	 * if it is trying to fence
-- 
1.8.3.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] 13+ messages in thread

* [PATCH v2 3/8] IB/rxe: Don't update the response PSN unless it's going forwards
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
  2016-11-23 17:39   ` [PATCH v2 1/8] IB/rxe: Remove buffer used for printing IP address Andrew Boyer
  2016-11-23 17:39   ` [PATCH v2 2/8] IB/rxe: Advance the consumer pointer before posting the CQE Andrew Boyer
@ 2016-11-23 17:39   ` Andrew Boyer
  2016-11-23 17:39   ` [PATCH v2 4/8] IB/rxe: Unblock loopback by moving skb_out increment Andrew Boyer
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

A client might post a read followed by a send. The partner receives
and acknowledges both transactions, posting an RCQ entry for the
send, but something goes wrong with the read ACK. When the client
retries the read, the partner's responder processes the duplicate
read but incorrectly resets the PSN to the value preceding the
original send. When the duplicate send arrives, the responder cannot
tell that it is a duplicate, so the responder generates a duplicate
RCQ entry, confusing the client.

Signed-off-by: Andrew Boyer <andrew.boyer-8PEkshWhKlo@public.gmane.org>
Reviewed-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_resp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index dd3d88a..cb3fd4c 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -742,7 +742,8 @@ static enum resp_states read_reply(struct rxe_qp *qp,
 	} else {
 		qp->resp.res = NULL;
 		qp->resp.opcode = -1;
-		qp->resp.psn = res->cur_psn;
+		if (psn_compare(res->cur_psn, qp->resp.psn) >= 0)
+			qp->resp.psn = res->cur_psn;
 		state = RESPST_CLEANUP;
 	}
 
-- 
1.8.3.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] 13+ messages in thread

* [PATCH v2 4/8] IB/rxe: Unblock loopback by moving skb_out increment
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-11-23 17:39   ` [PATCH v2 3/8] IB/rxe: Don't update the response PSN unless it's going forwards Andrew Boyer
@ 2016-11-23 17:39   ` Andrew Boyer
  2016-11-23 17:39   ` [PATCH v2 5/8] IB/rxe: Add support for zero-byte operations Andrew Boyer
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

skb_out is decremented in rxe_skb_tx_dtor(), which is not called in the
loopback() path. Move the increment to the send() path rather than
rxe_xmit_packet().

Signed-off-by: Andrew Boyer <andrew.boyer-8PEkshWhKlo@public.gmane.org>
Acked-by: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_loc.h | 2 --
 drivers/infiniband/sw/rxe/rxe_net.c | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
index 73849a5a..efe4c6a 100644
--- a/drivers/infiniband/sw/rxe/rxe_loc.h
+++ b/drivers/infiniband/sw/rxe/rxe_loc.h
@@ -266,8 +266,6 @@ static inline int rxe_xmit_packet(struct rxe_dev *rxe, struct rxe_qp *qp,
 		return err;
 	}
 
-	atomic_inc(&qp->skb_out);
-
 	if ((qp_type(qp) != IB_QPT_RC) &&
 	    (pkt->mask & RXE_END_MASK)) {
 		pkt->wqe->state = wqe_state_done;
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index ffff5a5..332ce52 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -455,6 +455,8 @@ static int send(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
 		return -EAGAIN;
 	}
 
+	if (pkt->qp)
+		atomic_inc(&pkt->qp->skb_out);
 	kfree_skb(skb);
 
 	return 0;
-- 
1.8.3.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] 13+ messages in thread

* [PATCH v2 5/8] IB/rxe: Add support for zero-byte operations
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-11-23 17:39   ` [PATCH v2 4/8] IB/rxe: Unblock loopback by moving skb_out increment Andrew Boyer
@ 2016-11-23 17:39   ` Andrew Boyer
  2016-11-23 17:39   ` [PATCH v2 6/8] IB/rxe: Add support for IB_CQ_REPORT_MISSED_EVENTS Andrew Boyer
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

The last_psn algorithm fails in the zero-byte case: it calculates
first_psn = N, last_psn = N-1. This makes the operation unretryable since
the res structure will fail the (first_psn <= psn <= last_psn) test in
find_resource().

While here, use BTH_PSN_MASK to mask the calculated last_psn.

Signed-off-by: Andrew Boyer <andrew.boyer-8PEkshWhKlo@public.gmane.org>
Reviewed-by: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_mr.c   |  3 +++
 drivers/infiniband/sw/rxe/rxe_resp.c | 18 +++++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
index 1869152..d0faca2 100644
--- a/drivers/infiniband/sw/rxe/rxe_mr.c
+++ b/drivers/infiniband/sw/rxe/rxe_mr.c
@@ -355,6 +355,9 @@ int rxe_mem_copy(struct rxe_mem *mem, u64 iova, void *addr, int length,
 	size_t			offset;
 	u32			crc = crcp ? (*crcp) : 0;
 
+	if (length == 0)
+		return 0;
+
 	if (mem->type == RXE_MEM_TYPE_DMA) {
 		u8 *src, *dest;
 
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index cb3fd4c..a5e9ce3 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -444,6 +444,13 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
 		return RESPST_EXECUTE;
 	}
 
+	/* A zero-byte op is not required to set an addr or rkey. */
+	if ((pkt->mask & (RXE_READ_MASK | RXE_WRITE_OR_SEND)) &&
+	    (pkt->mask & RXE_RETH_MASK) &&
+	    reth_len(pkt) == 0) {
+		return RESPST_EXECUTE;
+	}
+
 	va	= qp->resp.va;
 	rkey	= qp->resp.rkey;
 	resid	= qp->resp.resid;
@@ -680,9 +687,14 @@ static enum resp_states read_reply(struct rxe_qp *qp,
 		res->read.va_org	= qp->resp.va;
 
 		res->first_psn		= req_pkt->psn;
-		res->last_psn		= req_pkt->psn +
-					  (reth_len(req_pkt) + mtu - 1) /
-					  mtu - 1;
+
+		if (reth_len(req_pkt)) {
+			res->last_psn	= (req_pkt->psn +
+					   (reth_len(req_pkt) + mtu - 1) /
+					   mtu - 1) & BTH_PSN_MASK;
+		} else {
+			res->last_psn	= res->first_psn;
+		}
 		res->cur_psn		= req_pkt->psn;
 
 		res->read.resid		= qp->resp.resid;
-- 
1.8.3.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] 13+ messages in thread

* [PATCH v2 6/8] IB/rxe: Add support for IB_CQ_REPORT_MISSED_EVENTS
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
                     ` (4 preceding siblings ...)
  2016-11-23 17:39   ` [PATCH v2 5/8] IB/rxe: Add support for zero-byte operations Andrew Boyer
@ 2016-11-23 17:39   ` Andrew Boyer
  2016-11-23 17:39   ` [PATCH v2 7/8] IB/rxe: Fix ref leak in rxe_create_qp() Andrew Boyer
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

Peek at the CQ after arming it so that we can return a hint.
This avoids missed completions due to a race between posting
CQEs and arming the CQ.

For example, CM teardown waits on MAD requests to complete with
ib_cq_poll_work(). Without this fix, the last completion might be
left on the CQ, hanging the kthread doing the teardown.

The console backtraces look like this:

[ 4199.911284] Call Trace:
[ 4199.911401]  [<ffffffff9657fe95>] schedule+0x35/0x80
[ 4199.911556]  [<ffffffff965830df>] schedule_timeout+0x22f/0x2c0
[ 4199.911727]  [<ffffffff9657f7a8>] ? __schedule+0x368/0xa20
[ 4199.911891]  [<ffffffff96580903>] wait_for_completion+0xb3/0x130
[ 4199.912067]  [<ffffffff960a17e0>] ? wake_up_q+0x70/0x70
[ 4199.912243]  [<ffffffffc074a06d>] cm_destroy_id+0x13d/0x450 [ib_cm]
[ 4199.912422]  [<ffffffff961615d5>] ? printk+0x57/0x73
[ 4199.912578]  [<ffffffffc074a390>] ib_destroy_cm_id+0x10/0x20 [ib_cm]
[ 4199.912759]  [<ffffffffc076098c>] rdma_destroy_id+0xac/0x340 [rdma_cm]
[ 4199.912941]  [<ffffffffc076f2cc>] 0xffffffffc076f2cc

Signed-off-by: Andrew Boyer <andrew.boyer-8PEkshWhKlo@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_verbs.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index 19841c8..de39b0a 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -1007,11 +1007,19 @@ static int rxe_peek_cq(struct ib_cq *ibcq, int wc_cnt)
 static int rxe_req_notify_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
 {
 	struct rxe_cq *cq = to_rcq(ibcq);
+	unsigned long irq_flags;
+	int ret = 0;
 
+	spin_lock_irqsave(&cq->cq_lock, irq_flags);
 	if (cq->notify != IB_CQ_NEXT_COMP)
 		cq->notify = flags & IB_CQ_SOLICITED_MASK;
 
-	return 0;
+	if ((flags & IB_CQ_REPORT_MISSED_EVENTS) && !queue_empty(cq->queue))
+		ret = 1;
+
+	spin_unlock_irqrestore(&cq->cq_lock, irq_flags);
+
+	return ret;
 }
 
 static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access)
-- 
1.8.3.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] 13+ messages in thread

* [PATCH v2 7/8] IB/rxe: Fix ref leak in rxe_create_qp()
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
                     ` (5 preceding siblings ...)
  2016-11-23 17:39   ` [PATCH v2 6/8] IB/rxe: Add support for IB_CQ_REPORT_MISSED_EVENTS Andrew Boyer
@ 2016-11-23 17:39   ` Andrew Boyer
  2016-11-23 17:39   ` [PATCH v2 8/8] IB/rxe: Fix ref leak in duplicate_request() Andrew Boyer
  2016-11-23 17:59   ` [PATCH v2 0/8] RXE improvements Moni Shoua
  8 siblings, 0 replies; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

The udata->inlen error path needs to clean up the ref
added by rxe_alloc().

Signed-off-by: Andrew Boyer <andrew.boyer-8PEkshWhKlo@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_verbs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index de39b0a..071430c 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -564,7 +564,7 @@ static struct ib_qp *rxe_create_qp(struct ib_pd *ibpd,
 	if (udata) {
 		if (udata->inlen) {
 			err = -EINVAL;
-			goto err1;
+			goto err2;
 		}
 		qp->is_user = 1;
 	}
@@ -573,12 +573,13 @@ static struct ib_qp *rxe_create_qp(struct ib_pd *ibpd,
 
 	err = rxe_qp_from_init(rxe, qp, pd, init, udata, ibpd);
 	if (err)
-		goto err2;
+		goto err3;
 
 	return &qp->ibqp;
 
-err2:
+err3:
 	rxe_drop_index(qp);
+err2:
 	rxe_drop_ref(qp);
 err1:
 	return ERR_PTR(err);
-- 
1.8.3.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] 13+ messages in thread

* [PATCH v2 8/8] IB/rxe: Fix ref leak in duplicate_request()
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
                     ` (6 preceding siblings ...)
  2016-11-23 17:39   ` [PATCH v2 7/8] IB/rxe: Fix ref leak in rxe_create_qp() Andrew Boyer
@ 2016-11-23 17:39   ` Andrew Boyer
  2016-11-23 17:59   ` [PATCH v2 0/8] RXE improvements Moni Shoua
  8 siblings, 0 replies; 13+ messages in thread
From: Andrew Boyer @ 2016-11-23 17:39 UTC (permalink / raw)
  To: monis-VPRAkNaXOzVWk0Htik3J/w, yonatanc-VPRAkNaXOzVWk0Htik3J/w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Andrew Boyer

A ref was added after the call to skb_clone().

Signed-off-by: Andrew Boyer <andrew.boyer-8PEkshWhKlo@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_resp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index a5e9ce3..8643797 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -1145,6 +1145,7 @@ static enum resp_states duplicate_request(struct rxe_qp *qp,
 					     pkt, skb_copy);
 			if (rc) {
 				pr_err("Failed resending result. This flow is not handled - skb ignored\n");
+				rxe_drop_ref(qp);
 				kfree_skb(skb_copy);
 				rc = RESPST_CLEANUP;
 				goto out;
-- 
1.8.3.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] 13+ messages in thread

* Re: [PATCH v2 1/8] IB/rxe: Remove buffer used for printing IP address
       [not found]     ` <1479922764-13091-2-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
@ 2016-11-23 17:48       ` Moni Shoua
  0 siblings, 0 replies; 13+ messages in thread
From: Moni Shoua @ 2016-11-23 17:48 UTC (permalink / raw)
  To: Andrew Boyer; +Cc: Yonatan Cohen, linux-rdma

> diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c
> index 46f0628..252b4d6 100644
> --- a/drivers/infiniband/sw/rxe/rxe_recv.c
> +++ b/drivers/infiniband/sw/rxe/rxe_recv.c
> @@ -391,16 +391,15 @@ int rxe_rcv(struct sk_buff *skb)
>                              payload_size(pkt));
>         calc_icrc = cpu_to_be32(~calc_icrc);
>         if (unlikely(calc_icrc != pack_icrc)) {
> -               char saddr[sizeof(struct in6_addr)];
> -
>                 if (skb->protocol == htons(ETH_P_IPV6))
> -                       sprintf(saddr, "%pI6", &ipv6_hdr(skb)->saddr);
> +                       pr_warn_ratelimited("bad ICRC from %pI6c\n",
> +                                           &ipv6_hdr(skb)->saddr);
>                 else if (skb->protocol == htons(ETH_P_IP))
> -                       sprintf(saddr, "%pI4", &ip_hdr(skb)->saddr);
> +                       pr_warn_ratelimited("bad ICRC from %pI4\n",
> +                                           &ip_hdr(skb)->saddr);
>                 else
> -                       sprintf(saddr, "unknown");
> +                       pr_warn_ratelimited("bad ICRC from unknown\n");
>
> -               pr_warn_ratelimited("bad ICRC from %s\n", saddr);
>                 goto drop;
>         }

Have you considered Bart's suggestion to use  %pIS instead of %pI4 and %pI6
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1067964305df
--
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] 13+ messages in thread

* Re: [PATCH v2 0/8] RXE improvements
       [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
                     ` (7 preceding siblings ...)
  2016-11-23 17:39   ` [PATCH v2 8/8] IB/rxe: Fix ref leak in duplicate_request() Andrew Boyer
@ 2016-11-23 17:59   ` Moni Shoua
       [not found]     ` <CAG9sBKMkoCbeCO6SgPZrW-x0rBNTQUaar+wAqeVDTLeoT8HfHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  8 siblings, 1 reply; 13+ messages in thread
From: Moni Shoua @ 2016-11-23 17:59 UTC (permalink / raw)
  To: Andrew Boyer; +Cc: Yonatan Cohen, linux-rdma

> Andrew Boyer (8):
>   IB/rxe: Remove buffer used for printing IP address
>   IB/rxe: Advance the consumer pointer before posting the CQE
>   IB/rxe: Don't update the response PSN unless it's going forwards
>   IB/rxe: Unblock loopback by moving skb_out increment
>   IB/rxe: Add support for zero-byte operations
>   IB/rxe: Add support for IB_CQ_REPORT_MISSED_EVENTS
>   IB/rxe: Fix ref leak in rxe_create_qp()
>   IB/rxe: Fix ref leak in duplicate_request()

Thanks for the series.

Please see comment in response for the first patch but except that

Acked-by: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

for everything else
--
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] 13+ messages in thread

* Re: [PATCH v2 0/8] RXE improvements
       [not found]     ` <CAG9sBKMkoCbeCO6SgPZrW-x0rBNTQUaar+wAqeVDTLeoT8HfHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-12-05 13:58       ` Boyer, Andrew
       [not found]         ` <D46ADB9D.7D50%Andrew.Boyer-mb1K0bWo544@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Boyer, Andrew @ 2016-12-05 13:58 UTC (permalink / raw)
  To: Moni Shoua; +Cc: Yonatan Cohen, linux-rdma, Bart Van Assche

On 11/23/16, 12:59 PM, "monisonlists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org on behalf of Moni Shoua"
<monisonlists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org on behalf of monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:

>> Andrew Boyer (8):
>>   IB/rxe: Remove buffer used for printing IP address
>>   IB/rxe: Advance the consumer pointer before posting the CQE
>>   IB/rxe: Don't update the response PSN unless it's going forwards
>>   IB/rxe: Unblock loopback by moving skb_out increment
>>   IB/rxe: Add support for zero-byte operations
>>   IB/rxe: Add support for IB_CQ_REPORT_MISSED_EVENTS
>>   IB/rxe: Fix ref leak in rxe_create_qp()
>>   IB/rxe: Fix ref leak in duplicate_request()
>
>Thanks for the series.
>
>Please see comment in response for the first patch but except that
>
>Acked-by: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
>for everything else

Hello Moni,
I saw the comment from Bart in response to the first patch, but I prefer
it this way because of how much other code is required to take advantage
of %pIS. If you want it changed to %pIS, we can do that, though. What
would you prefer?

-Andrew

--
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] 13+ messages in thread

* Re: [PATCH v2 0/8] RXE improvements
       [not found]         ` <D46ADB9D.7D50%Andrew.Boyer-mb1K0bWo544@public.gmane.org>
@ 2016-12-12 21:40           ` Doug Ledford
  0 siblings, 0 replies; 13+ messages in thread
From: Doug Ledford @ 2016-12-12 21:40 UTC (permalink / raw)
  To: Boyer, Andrew, Moni Shoua; +Cc: Yonatan Cohen, linux-rdma, Bart Van Assche


[-- Attachment #1.1: Type: text/plain, Size: 1490 bytes --]

On 12/5/2016 8:58 AM, Boyer, Andrew wrote:
> On 11/23/16, 12:59 PM, "monisonlists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org on behalf of Moni Shoua"
> <monisonlists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org on behalf of monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> 
>>> Andrew Boyer (8):
>>>   IB/rxe: Remove buffer used for printing IP address
>>>   IB/rxe: Advance the consumer pointer before posting the CQE
>>>   IB/rxe: Don't update the response PSN unless it's going forwards
>>>   IB/rxe: Unblock loopback by moving skb_out increment
>>>   IB/rxe: Add support for zero-byte operations
>>>   IB/rxe: Add support for IB_CQ_REPORT_MISSED_EVENTS
>>>   IB/rxe: Fix ref leak in rxe_create_qp()
>>>   IB/rxe: Fix ref leak in duplicate_request()
>>
>> Thanks for the series.
>>
>> Please see comment in response for the first patch but except that
>>
>> Acked-by: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>
>> for everything else
> 
> Hello Moni,
> I saw the comment from Bart in response to the first patch, but I prefer
> it this way because of how much other code is required to take advantage
> of %pIS. If you want it changed to %pIS, we can do that, though. What
> would you prefer?

Hi Andrew,

I took these as they are.  If someone wants to update the code to use
%pIS, it will need to be as an incremental patch.  Thanks.


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

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

end of thread, other threads:[~2016-12-12 21:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-23 17:39 [PATCH v2 0/8] RXE improvements Andrew Boyer
     [not found] ` <1479922764-13091-1-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
2016-11-23 17:39   ` [PATCH v2 1/8] IB/rxe: Remove buffer used for printing IP address Andrew Boyer
     [not found]     ` <1479922764-13091-2-git-send-email-andrew.boyer-8PEkshWhKlo@public.gmane.org>
2016-11-23 17:48       ` Moni Shoua
2016-11-23 17:39   ` [PATCH v2 2/8] IB/rxe: Advance the consumer pointer before posting the CQE Andrew Boyer
2016-11-23 17:39   ` [PATCH v2 3/8] IB/rxe: Don't update the response PSN unless it's going forwards Andrew Boyer
2016-11-23 17:39   ` [PATCH v2 4/8] IB/rxe: Unblock loopback by moving skb_out increment Andrew Boyer
2016-11-23 17:39   ` [PATCH v2 5/8] IB/rxe: Add support for zero-byte operations Andrew Boyer
2016-11-23 17:39   ` [PATCH v2 6/8] IB/rxe: Add support for IB_CQ_REPORT_MISSED_EVENTS Andrew Boyer
2016-11-23 17:39   ` [PATCH v2 7/8] IB/rxe: Fix ref leak in rxe_create_qp() Andrew Boyer
2016-11-23 17:39   ` [PATCH v2 8/8] IB/rxe: Fix ref leak in duplicate_request() Andrew Boyer
2016-11-23 17:59   ` [PATCH v2 0/8] RXE improvements Moni Shoua
     [not found]     ` <CAG9sBKMkoCbeCO6SgPZrW-x0rBNTQUaar+wAqeVDTLeoT8HfHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-05 13:58       ` Boyer, Andrew
     [not found]         ` <D46ADB9D.7D50%Andrew.Boyer-mb1K0bWo544@public.gmane.org>
2016-12-12 21:40           ` Doug Ledford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.