All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-rc 0/4] RXE fixes for 4.8
@ 2016-09-05 12:09 Leon Romanovsky
       [not found] ` <1473077359-11546-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-05 12:09 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hi Doug,

Please find the following four patches from Yonatan which
fixes numerous issues in RXE code.

Thanks,

Yonatan Cohen (4):
  IB/rxe: Fix kernel panic in udp_setup_tunnel
  IB/rxe: Fix duplicate atomic request handling
  IB/rxe: Fix race condition between requester and completer
  IB/rxe: Fix kmem_cache leak

 drivers/infiniband/sw/rxe/rxe.c      | 14 +++++++--
 drivers/infiniband/sw/rxe/rxe_comp.c | 13 ++++++++
 drivers/infiniband/sw/rxe/rxe_net.c  | 45 ++++++++++++++++++----------
 drivers/infiniband/sw/rxe/rxe_net.h  |  3 +-
 drivers/infiniband/sw/rxe/rxe_req.c  | 57 ++++++++++++++++++++++++++++--------
 drivers/infiniband/sw/rxe/rxe_resp.c | 11 +++----
 6 files changed, 106 insertions(+), 37 deletions(-)

--
2.7.4

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

* [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found] ` <1473077359-11546-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2016-09-05 12:09   ` Leon Romanovsky
       [not found]     ` <1473077359-11546-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
       [not found]     ` <CAJ3xEMiBpGRy-JGuJ=P4eUF5zyz+2bm43F-jqPHtwm=3Uz9YYA@mail.gmail.com>
  2016-09-05 12:09   ` [PATCH rdma-rc 2/4] IB/rxe: Fix duplicate atomic request handling Leon Romanovsky
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-05 12:09 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yonatan Cohen

From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Disable creation of a UDP socket for ipv6
when CONFIG_IPV6 is not enabeld.
Since udp_sock_create6() returns 0 when CONFIG_IPV6 is not set

[   46.888632] IP: [<c220705a>] setup_udp_tunnel_sock+0x6/0x4f
[   46.891355] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
[   46.893918] Oops: 0002 [#1] PREEMPT
[   46.896014] CPU: 0 PID: 1 Comm: swapper Not tainted 4.7.0-rc4-00001-g8700e3e #1
[   46.900280] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
[   46.904905] task: cf06c040 ti: cf05e000 task.ti: cf05e000
[   46.907854] EIP: 0060:[<c220705a>] EFLAGS: 00210246 CPU: 0
[   46.911137] EIP is at setup_udp_tunnel_sock+0x6/0x4f
[   46.914070] EAX: 00000044 EBX: 00000001 ECX: cf05fef0 EDX: ca8142e0
[   46.917236] ESI: c2c4505b EDI: cf05fef0 EBP: cf05fed0 ESP: cf05fed0
[   46.919836]  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
[   46.922046] CR0: 80050033 CR2: 000001fc CR3: 02cec000 CR4: 000006b0
[   46.924550] Stack:
[   46.926014]  cf05ff10 c1fd4657 ca8142e0 0000000a 00000000 00000000 0000b712 00000008
[   46.931274]  00000000 6bb5bd01 c1fd48de 00000000 00000000 cf05ff1c 00000000 00000000
[   46.936122]  cf05ff1c c1fd4bdf 00000000 cf05ff28 c2c4507b ffffffff cf05ff88 c2bf1c74
[   46.942350] Call Trace:
[   46.944403]  [<c1fd4657>] rxe_setup_udp_tunnel+0x8f/0x99
[   46.947689]  [<c1fd48de>] ? net_to_rxe+0x4e/0x4e
[   46.950567]  [<c1fd4bdf>] rxe_net_init+0xe/0xa4
[   46.953147]  [<c2c4507b>] rxe_module_init+0x20/0x4c
[   46.955448]  [<c2bf1c74>] do_one_initcall+0x89/0x113
[   46.957797]  [<c2bf15eb>] ? set_debug_rodata+0xf/0xf
[   46.959966]  [<c2bf1dbc>] ? kernel_init_freeable+0xbe/0x15b
[   46.962262]  [<c2bf1ddc>] kernel_init_freeable+0xde/0x15b
[   46.964418]  [<c232eb54>] kernel_init+0x8/0xd0
[   46.966618]  [<c2333122>] ret_from_kernel_thread+0xe/0x24
[   46.969592]  [<c232eb4c>] ? rest_init+0x6f/0x6f

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe.c     | 14 ++++++++++--
 drivers/infiniband/sw/rxe/rxe_net.c | 45 ++++++++++++++++++++++++-------------
 drivers/infiniband/sw/rxe/rxe_net.h |  3 ++-
 3 files changed, 43 insertions(+), 19 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
index 55f0e8f..08e09d9 100644
--- a/drivers/infiniband/sw/rxe/rxe.c
+++ b/drivers/infiniband/sw/rxe/rxe.c
@@ -362,12 +362,22 @@ static int __init rxe_module_init(void)
 		return err;
 	}
 
-	err = rxe_net_init();
+	err = rxe_net_ipv4_init();
 	if (err) {
-		pr_err("rxe: unable to init\n");
+		pr_err("rxe: unable to init ipv4 tunnel\n");
 		rxe_cache_exit();
 		return err;
 	}
+
+#if IS_ENABLED(CONFIG_IPV6)
+	err = rxe_net_ipv6_init();
+	if (err) {
+		pr_err("rxe: unable to init ipv6 tunnel\n");
+		rxe_cache_exit();
+		return err;
+	}
+#endif
+
 	pr_info("rxe: loaded\n");
 
 	return 0;
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 0b8d2ea..e0866b4 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -249,8 +249,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
 	memset(&udp_cfg, 0, sizeof(udp_cfg));
 
 	if (ipv6) {
-		udp_cfg.family = AF_INET6;
-		udp_cfg.ipv6_v6only = 1;
+	udp_cfg.family = AF_INET6;
+	udp_cfg.ipv6_v6only = 1;
 	} else {
 		udp_cfg.family = AF_INET;
 	}
@@ -662,33 +662,22 @@ static struct notifier_block rxe_net_notifier = {
 	.notifier_call = rxe_notify,
 };
 
-int rxe_net_init(void)
+int rxe_net_ipv4_init(void)
 {
 	int err;
 
 	spin_lock_init(&dev_list_lock);
 
-	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
-			htons(ROCE_V2_UDP_DPORT), true);
-	if (IS_ERR(recv_sockets.sk6)) {
-		recv_sockets.sk6 = NULL;
-		pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
-		return -1;
-	}
-
 	recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net,
-			htons(ROCE_V2_UDP_DPORT), false);
+						htons(ROCE_V2_UDP_DPORT), false);
 	if (IS_ERR(recv_sockets.sk4)) {
-		rxe_release_udp_tunnel(recv_sockets.sk6);
 		recv_sockets.sk4 = NULL;
-		recv_sockets.sk6 = NULL;
 		pr_err("rxe: Failed to create IPv4 UDP tunnel\n");
 		return -1;
 	}
 
 	err = register_netdevice_notifier(&rxe_net_notifier);
 	if (err) {
-		rxe_release_udp_tunnel(recv_sockets.sk6);
 		rxe_release_udp_tunnel(recv_sockets.sk4);
 		pr_err("rxe: Failed to rigister netdev notifier\n");
 	}
@@ -696,11 +685,35 @@ int rxe_net_init(void)
 	return err;
 }
 
+int rxe_net_ipv6_init(void)
+{
+	int err;
+
+	spin_lock_init(&dev_list_lock);
+
+	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
+						htons(ROCE_V2_UDP_DPORT), true);
+	if (IS_ERR(recv_sockets.sk6)) {
+		recv_sockets.sk6 = NULL;
+		pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
+		return -1;
+	}
+
+	err = register_netdevice_notifier(&rxe_net_notifier);
+	if (err) {
+		rxe_release_udp_tunnel(recv_sockets.sk6);
+		pr_err("rxe: Failed to rigister netdev notifier\n");
+	}
+
+	return err;
+}
+
 void rxe_net_exit(void)
 {
+#if IS_ENABLED(CONFIG_IPV6)
 	if (recv_sockets.sk6)
 		rxe_release_udp_tunnel(recv_sockets.sk6);
-
+#endif
 	if (recv_sockets.sk4)
 		rxe_release_udp_tunnel(recv_sockets.sk4);
 
diff --git a/drivers/infiniband/sw/rxe/rxe_net.h b/drivers/infiniband/sw/rxe/rxe_net.h
index 7b06f76..b8e3284 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.h
+++ b/drivers/infiniband/sw/rxe/rxe_net.h
@@ -47,7 +47,8 @@ extern struct rxe_recv_sockets recv_sockets;
 
 struct rxe_dev *rxe_net_add(struct net_device *ndev);
 
-int rxe_net_init(void);
+int rxe_net_ipv4_init(void);
+int rxe_net_ipv6_init(void);
 void rxe_net_exit(void);
 
 #endif /* RXE_NET_H */
-- 
2.7.4

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

* [PATCH rdma-rc 2/4] IB/rxe: Fix duplicate atomic request handling
       [not found] ` <1473077359-11546-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  2016-09-05 12:09   ` [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel Leon Romanovsky
@ 2016-09-05 12:09   ` Leon Romanovsky
  2016-09-05 12:09   ` [PATCH rdma-rc 3/4] IB/rxe: Fix race condition between requester and completer Leon Romanovsky
  2016-09-05 12:09   ` [PATCH rdma-rc 4/4] IB/rxe: Fix kmem_cache leak Leon Romanovsky
  3 siblings, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-05 12:09 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yonatan Cohen

From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

When handling ack for atomic opcodes like "fetch&add"
or "cmp&swp", the method send_atomic_ack() saves the ack
before sending it, in case it gets lost and never reach the
requester. In which case the method duplicate_request()
will need to find it using the duplicated request.psn.
But send_atomic_ack() used a wrong psn value and thus
the above ack was never found.
This fix uses the ack.psn to locate the ack in case
its needed.
This fix also copies the ack packet to the skb's control buffer
since duplicate_request() will need it when calling rxe_xmit_packet()

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_resp.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index ebb03b4..3e0f0f2 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -972,11 +972,13 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
 	free_rd_atomic_resource(qp, res);
 	rxe_advance_resp_resource(qp);
 
+	memcpy(SKB_TO_PKT(skb), &ack_pkt, sizeof(skb->cb));
+
 	res->type = RXE_ATOMIC_MASK;
 	res->atomic.skb = skb;
-	res->first_psn = qp->resp.psn;
-	res->last_psn = qp->resp.psn;
-	res->cur_psn = qp->resp.psn;
+	res->first_psn = ack_pkt.psn;
+	res->last_psn  = ack_pkt.psn;
+	res->cur_psn   = ack_pkt.psn;
 
 	rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb_copy);
 	if (rc) {
@@ -1116,8 +1118,7 @@ static enum resp_states duplicate_request(struct rxe_qp *qp,
 				rc = RESPST_CLEANUP;
 				goto out;
 			}
-			bth_set_psn(SKB_TO_PKT(skb_copy),
-				    qp->resp.psn - 1);
+
 			/* Resend the result. */
 			rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp,
 					     pkt, skb_copy);
-- 
2.7.4

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

* [PATCH rdma-rc 3/4] IB/rxe: Fix race condition between requester and completer
       [not found] ` <1473077359-11546-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  2016-09-05 12:09   ` [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel Leon Romanovsky
  2016-09-05 12:09   ` [PATCH rdma-rc 2/4] IB/rxe: Fix duplicate atomic request handling Leon Romanovsky
@ 2016-09-05 12:09   ` Leon Romanovsky
  2016-09-05 12:09   ` [PATCH rdma-rc 4/4] IB/rxe: Fix kmem_cache leak Leon Romanovsky
  3 siblings, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-05 12:09 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yonatan Cohen

From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

rxe_requester() is sending a pkt with rxe_xmit_packet() and
then calls rxe_update() to update the wqe and qp's psn values.
But sometimes the response is received before the requester
had time to update the wqe in which case the completer
acts on errornous wqe values.
This fix updates the wqe and qp before actually sending
the request and rolls back when xmit fails.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_req.c | 57 ++++++++++++++++++++++++++++---------
 1 file changed, 44 insertions(+), 13 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index 33b2d9d..13a848a 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -511,24 +511,21 @@ static int fill_packet(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
 }
 
 static void update_wqe_state(struct rxe_qp *qp,
-			     struct rxe_send_wqe *wqe,
-			     struct rxe_pkt_info *pkt,
-			     enum wqe_state *prev_state)
+		struct rxe_send_wqe *wqe,
+		struct rxe_pkt_info *pkt)
 {
-	enum wqe_state prev_state_ = wqe->state;
-
 	if (pkt->mask & RXE_END_MASK) {
 		if (qp_type(qp) == IB_QPT_RC)
 			wqe->state = wqe_state_pending;
 	} else {
 		wqe->state = wqe_state_processing;
 	}
-
-	*prev_state = prev_state_;
 }
 
-static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
-			 struct rxe_pkt_info *pkt, int payload)
+static void update_wqe_psn(struct rxe_qp *qp,
+			   struct rxe_send_wqe *wqe,
+			   struct rxe_pkt_info *pkt,
+			   int payload)
 {
 	/* number of packets left to send including current one */
 	int num_pkt = (wqe->dma.resid + payload + qp->mtu - 1) / qp->mtu;
@@ -546,9 +543,34 @@ static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
 		qp->req.psn = (wqe->first_psn + num_pkt) & BTH_PSN_MASK;
 	else
 		qp->req.psn = (qp->req.psn + 1) & BTH_PSN_MASK;
+}
 
-	qp->req.opcode = pkt->opcode;
+static void save_state(struct rxe_send_wqe *wqe,
+		       struct rxe_qp *qp,
+		       struct rxe_send_wqe *rollback_wqe,
+		       struct rxe_qp *rollback_qp)
+{
+	rollback_wqe->state     = wqe->state;
+	rollback_wqe->first_psn = wqe->first_psn;
+	rollback_wqe->last_psn  = wqe->last_psn;
+	rollback_qp->req.psn    = qp->req.psn;
+}
 
+static void rollback_state(struct rxe_send_wqe *wqe,
+			   struct rxe_qp *qp,
+			   struct rxe_send_wqe *rollback_wqe,
+			   struct rxe_qp *rollback_qp)
+{
+	wqe->state     = rollback_wqe->state;
+	wqe->first_psn = rollback_wqe->first_psn;
+	wqe->last_psn  = rollback_wqe->last_psn;
+	qp->req.psn    = rollback_qp->req.psn;
+}
+
+static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
+			 struct rxe_pkt_info *pkt, int payload)
+{
+	qp->req.opcode = pkt->opcode;
 
 	if (pkt->mask & RXE_END_MASK)
 		qp->req.wqe_index = next_index(qp->sq.queue, qp->req.wqe_index);
@@ -571,7 +593,8 @@ int rxe_requester(void *arg)
 	int mtu;
 	int opcode;
 	int ret;
-	enum wqe_state prev_state;
+	struct rxe_qp rollback_qp;
+	struct rxe_send_wqe rollback_wqe;
 
 next_wqe:
 	if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR))
@@ -688,13 +711,21 @@ next_wqe:
 		goto err;
 	}
 
-	update_wqe_state(qp, wqe, &pkt, &prev_state);
+	/*
+	 * To prevent a race on wqe access between requester and completer,
+	 * wqe members state and psn need to be set before calling
+	 * rxe_xmit_packet().
+	 * Otherwise, completer might initiate an unjustified retry flow.
+	 */
+	save_state(wqe, qp, &rollback_wqe, &rollback_qp);
+	update_wqe_state(qp, wqe, &pkt);
+	update_wqe_psn(qp, wqe, &pkt, payload);
 	ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb);
 	if (ret) {
 		qp->need_req_skb = 1;
 		kfree_skb(skb);
 
-		wqe->state = prev_state;
+		rollback_state(wqe, qp, &rollback_wqe, &rollback_qp);
 
 		if (ret == -EAGAIN) {
 			rxe_run_task(&qp->req.task, 1);
-- 
2.7.4

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

* [PATCH rdma-rc 4/4] IB/rxe: Fix kmem_cache leak
       [not found] ` <1473077359-11546-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-09-05 12:09   ` [PATCH rdma-rc 3/4] IB/rxe: Fix race condition between requester and completer Leon Romanovsky
@ 2016-09-05 12:09   ` Leon Romanovsky
  3 siblings, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-05 12:09 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yonatan Cohen

From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Decrement qp reference when handling error path
in completer to prevent kmem_cache leak.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/sw/rxe/rxe_comp.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c
index 36f67de..1c59ef2 100644
--- a/drivers/infiniband/sw/rxe/rxe_comp.c
+++ b/drivers/infiniband/sw/rxe/rxe_comp.c
@@ -689,7 +689,14 @@ int rxe_completer(void *arg)
 					qp->req.need_retry = 1;
 					rxe_run_task(&qp->req.task, 1);
 				}
+
+				if (pkt) {
+					rxe_drop_ref(pkt->qp);
+					kfree_skb(skb);
+				}
+
 				goto exit;
+
 			} else {
 				wqe->status = IB_WC_RETRY_EXC_ERR;
 				state = COMPST_ERROR;
@@ -716,6 +723,12 @@ int rxe_completer(void *arg)
 		case COMPST_ERROR:
 			do_complete(qp, wqe);
 			rxe_qp_error(qp);
+
+			if (pkt) {
+				rxe_drop_ref(pkt->qp);
+				kfree_skb(skb);
+			}
+
 			goto exit;
 		}
 	}
-- 
2.7.4

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

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]     ` <1473077359-11546-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2016-09-05 13:24       ` Yuval Shaia
       [not found]         ` <20160905132402.GA14607-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
  2016-09-05 13:32       ` Doug Ledford
  1 sibling, 1 reply; 14+ messages in thread
From: Yuval Shaia @ 2016-09-05 13:24 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yonatan Cohen

On Mon, Sep 05, 2016 at 03:09:16PM +0300, Leon Romanovsky wrote:
> From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> Disable creation of a UDP socket for ipv6
> when CONFIG_IPV6 is not enabeld.
> Since udp_sock_create6() returns 0 when CONFIG_IPV6 is not set
> 
> [   46.888632] IP: [<c220705a>] setup_udp_tunnel_sock+0x6/0x4f
> [   46.891355] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
> [   46.893918] Oops: 0002 [#1] PREEMPT
> [   46.896014] CPU: 0 PID: 1 Comm: swapper Not tainted 4.7.0-rc4-00001-g8700e3e #1
> [   46.900280] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
> [   46.904905] task: cf06c040 ti: cf05e000 task.ti: cf05e000
> [   46.907854] EIP: 0060:[<c220705a>] EFLAGS: 00210246 CPU: 0
> [   46.911137] EIP is at setup_udp_tunnel_sock+0x6/0x4f
> [   46.914070] EAX: 00000044 EBX: 00000001 ECX: cf05fef0 EDX: ca8142e0
> [   46.917236] ESI: c2c4505b EDI: cf05fef0 EBP: cf05fed0 ESP: cf05fed0
> [   46.919836]  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
> [   46.922046] CR0: 80050033 CR2: 000001fc CR3: 02cec000 CR4: 000006b0
> [   46.924550] Stack:
> [   46.926014]  cf05ff10 c1fd4657 ca8142e0 0000000a 00000000 00000000 0000b712 00000008
> [   46.931274]  00000000 6bb5bd01 c1fd48de 00000000 00000000 cf05ff1c 00000000 00000000
> [   46.936122]  cf05ff1c c1fd4bdf 00000000 cf05ff28 c2c4507b ffffffff cf05ff88 c2bf1c74
> [   46.942350] Call Trace:
> [   46.944403]  [<c1fd4657>] rxe_setup_udp_tunnel+0x8f/0x99
> [   46.947689]  [<c1fd48de>] ? net_to_rxe+0x4e/0x4e
> [   46.950567]  [<c1fd4bdf>] rxe_net_init+0xe/0xa4
> [   46.953147]  [<c2c4507b>] rxe_module_init+0x20/0x4c
> [   46.955448]  [<c2bf1c74>] do_one_initcall+0x89/0x113
> [   46.957797]  [<c2bf15eb>] ? set_debug_rodata+0xf/0xf
> [   46.959966]  [<c2bf1dbc>] ? kernel_init_freeable+0xbe/0x15b
> [   46.962262]  [<c2bf1ddc>] kernel_init_freeable+0xde/0x15b
> [   46.964418]  [<c232eb54>] kernel_init+0x8/0xd0
> [   46.966618]  [<c2333122>] ret_from_kernel_thread+0xe/0x24
> [   46.969592]  [<c232eb4c>] ? rest_init+0x6f/0x6f
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
>  drivers/infiniband/sw/rxe/rxe.c     | 14 ++++++++++--
>  drivers/infiniband/sw/rxe/rxe_net.c | 45 ++++++++++++++++++++++++-------------
>  drivers/infiniband/sw/rxe/rxe_net.h |  3 ++-
>  3 files changed, 43 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
> index 55f0e8f..08e09d9 100644
> --- a/drivers/infiniband/sw/rxe/rxe.c
> +++ b/drivers/infiniband/sw/rxe/rxe.c
> @@ -362,12 +362,22 @@ static int __init rxe_module_init(void)
>  		return err;
>  	}
>  
> -	err = rxe_net_init();
> +	err = rxe_net_ipv4_init();
>  	if (err) {
> -		pr_err("rxe: unable to init\n");
> +		pr_err("rxe: unable to init ipv4 tunnel\n");
>  		rxe_cache_exit();
>  		return err;
>  	}
> +
> +#if IS_ENABLED(CONFIG_IPV6)
> +	err = rxe_net_ipv6_init();
> +	if (err) {
> +		pr_err("rxe: unable to init ipv6 tunnel\n");
> +		rxe_cache_exit();
> +		return err;
> +	}
> +#endif
> +
>  	pr_info("rxe: loaded\n");
>  
>  	return 0;
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> index 0b8d2ea..e0866b4 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -249,8 +249,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
>  	memset(&udp_cfg, 0, sizeof(udp_cfg));
>  
>  	if (ipv6) {
> -		udp_cfg.family = AF_INET6;
> -		udp_cfg.ipv6_v6only = 1;
> +	udp_cfg.family = AF_INET6;
> +	udp_cfg.ipv6_v6only = 1;
>  	} else {
>  		udp_cfg.family = AF_INET;
>  	}
> @@ -662,33 +662,22 @@ static struct notifier_block rxe_net_notifier = {
>  	.notifier_call = rxe_notify,
>  };
>  
> -int rxe_net_init(void)
> +int rxe_net_ipv4_init(void)
>  {
>  	int err;
>  
>  	spin_lock_init(&dev_list_lock);
>  
> -	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> -			htons(ROCE_V2_UDP_DPORT), true);
> -	if (IS_ERR(recv_sockets.sk6)) {
> -		recv_sockets.sk6 = NULL;
> -		pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
> -		return -1;
> -	}
> -
>  	recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net,
> -			htons(ROCE_V2_UDP_DPORT), false);
> +						htons(ROCE_V2_UDP_DPORT), false);
>  	if (IS_ERR(recv_sockets.sk4)) {
> -		rxe_release_udp_tunnel(recv_sockets.sk6);
>  		recv_sockets.sk4 = NULL;
> -		recv_sockets.sk6 = NULL;
>  		pr_err("rxe: Failed to create IPv4 UDP tunnel\n");
>  		return -1;
>  	}
>  
>  	err = register_netdevice_notifier(&rxe_net_notifier);
>  	if (err) {
> -		rxe_release_udp_tunnel(recv_sockets.sk6);
>  		rxe_release_udp_tunnel(recv_sockets.sk4);
>  		pr_err("rxe: Failed to rigister netdev notifier\n");
>  	}
> @@ -696,11 +685,35 @@ int rxe_net_init(void)
>  	return err;
>  }
>  
> +int rxe_net_ipv6_init(void)
> +{
> +	int err;
> +
> +	spin_lock_init(&dev_list_lock);
> +
> +	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> +						htons(ROCE_V2_UDP_DPORT), true);
> +	if (IS_ERR(recv_sockets.sk6)) {
> +		recv_sockets.sk6 = NULL;
> +		pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
> +		return -1;
> +	}
> +
> +	err = register_netdevice_notifier(&rxe_net_notifier);
> +	if (err) {
> +		rxe_release_udp_tunnel(recv_sockets.sk6);
> +		pr_err("rxe: Failed to rigister netdev notifier\n");
> +	}
> +
> +	return err;
> +}
> +

Can this be also in IS_ENABLED(CONFIG_IPV6) scope?

>  void rxe_net_exit(void)
>  {
> +#if IS_ENABLED(CONFIG_IPV6)
>  	if (recv_sockets.sk6)
>  		rxe_release_udp_tunnel(recv_sockets.sk6);
> -
> +#endif
>  	if (recv_sockets.sk4)
>  		rxe_release_udp_tunnel(recv_sockets.sk4);
>  
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.h b/drivers/infiniband/sw/rxe/rxe_net.h
> index 7b06f76..b8e3284 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.h
> +++ b/drivers/infiniband/sw/rxe/rxe_net.h
> @@ -47,7 +47,8 @@ extern struct rxe_recv_sockets recv_sockets;
>  
>  struct rxe_dev *rxe_net_add(struct net_device *ndev);
>  
> -int rxe_net_init(void);
> +int rxe_net_ipv4_init(void);
> +int rxe_net_ipv6_init(void);

Can this be also in IS_ENABLED(CONFIG_IPV6) scope?

>  void rxe_net_exit(void);
>  
>  #endif /* RXE_NET_H */
> -- 
> 2.7.4
> 
> --
> 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
--
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] 14+ messages in thread

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]     ` <1473077359-11546-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  2016-09-05 13:24       ` Yuval Shaia
@ 2016-09-05 13:32       ` Doug Ledford
       [not found]         ` <e0399c1c-567c-4996-a454-4ebefbe6e665-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  1 sibling, 1 reply; 14+ messages in thread
From: Doug Ledford @ 2016-09-05 13:32 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yonatan Cohen


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

On 9/5/2016 8:09 AM, Leon Romanovsky wrote:
> From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 

> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> index 0b8d2ea..e0866b4 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -249,8 +249,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
>  	memset(&udp_cfg, 0, sizeof(udp_cfg));
>  
>  	if (ipv6) {
> -		udp_cfg.family = AF_INET6;
> -		udp_cfg.ipv6_v6only = 1;
> +	udp_cfg.family = AF_INET6;
> +	udp_cfg.ipv6_v6only = 1;
>  	} else {
>  		udp_cfg.family = AF_INET;
>  	}

Is my mailer displaying this wrong, or is this hunk just intentionally
introducing indent breakage?


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

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]         ` <20160905132402.GA14607-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
@ 2016-09-05 14:03           ` Leon Romanovsky
  0 siblings, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-05 14:03 UTC (permalink / raw)
  To: Yuval Shaia
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yonatan Cohen

[-- Attachment #1: Type: text/plain, Size: 7102 bytes --]

On Mon, Sep 05, 2016 at 04:24:02PM +0300, Yuval Shaia wrote:
> On Mon, Sep 05, 2016 at 03:09:16PM +0300, Leon Romanovsky wrote:
> > From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >
> > Disable creation of a UDP socket for ipv6
> > when CONFIG_IPV6 is not enabeld.
> > Since udp_sock_create6() returns 0 when CONFIG_IPV6 is not set
> >
> > [   46.888632] IP: [<c220705a>] setup_udp_tunnel_sock+0x6/0x4f
> > [   46.891355] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
> > [   46.893918] Oops: 0002 [#1] PREEMPT
> > [   46.896014] CPU: 0 PID: 1 Comm: swapper Not tainted 4.7.0-rc4-00001-g8700e3e #1
> > [   46.900280] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
> > [   46.904905] task: cf06c040 ti: cf05e000 task.ti: cf05e000
> > [   46.907854] EIP: 0060:[<c220705a>] EFLAGS: 00210246 CPU: 0
> > [   46.911137] EIP is at setup_udp_tunnel_sock+0x6/0x4f
> > [   46.914070] EAX: 00000044 EBX: 00000001 ECX: cf05fef0 EDX: ca8142e0
> > [   46.917236] ESI: c2c4505b EDI: cf05fef0 EBP: cf05fed0 ESP: cf05fed0
> > [   46.919836]  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
> > [   46.922046] CR0: 80050033 CR2: 000001fc CR3: 02cec000 CR4: 000006b0
> > [   46.924550] Stack:
> > [   46.926014]  cf05ff10 c1fd4657 ca8142e0 0000000a 00000000 00000000 0000b712 00000008
> > [   46.931274]  00000000 6bb5bd01 c1fd48de 00000000 00000000 cf05ff1c 00000000 00000000
> > [   46.936122]  cf05ff1c c1fd4bdf 00000000 cf05ff28 c2c4507b ffffffff cf05ff88 c2bf1c74
> > [   46.942350] Call Trace:
> > [   46.944403]  [<c1fd4657>] rxe_setup_udp_tunnel+0x8f/0x99
> > [   46.947689]  [<c1fd48de>] ? net_to_rxe+0x4e/0x4e
> > [   46.950567]  [<c1fd4bdf>] rxe_net_init+0xe/0xa4
> > [   46.953147]  [<c2c4507b>] rxe_module_init+0x20/0x4c
> > [   46.955448]  [<c2bf1c74>] do_one_initcall+0x89/0x113
> > [   46.957797]  [<c2bf15eb>] ? set_debug_rodata+0xf/0xf
> > [   46.959966]  [<c2bf1dbc>] ? kernel_init_freeable+0xbe/0x15b
> > [   46.962262]  [<c2bf1ddc>] kernel_init_freeable+0xde/0x15b
> > [   46.964418]  [<c232eb54>] kernel_init+0x8/0xd0
> > [   46.966618]  [<c2333122>] ret_from_kernel_thread+0xe/0x24
> > [   46.969592]  [<c232eb4c>] ? rest_init+0x6f/0x6f
> >
> > Fixes: 8700e3e7c485 ("Soft RoCE driver")
> > Signed-off-by: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > ---
> >  drivers/infiniband/sw/rxe/rxe.c     | 14 ++++++++++--
> >  drivers/infiniband/sw/rxe/rxe_net.c | 45 ++++++++++++++++++++++++-------------
> >  drivers/infiniband/sw/rxe/rxe_net.h |  3 ++-
> >  3 files changed, 43 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
> > index 55f0e8f..08e09d9 100644
> > --- a/drivers/infiniband/sw/rxe/rxe.c
> > +++ b/drivers/infiniband/sw/rxe/rxe.c
> > @@ -362,12 +362,22 @@ static int __init rxe_module_init(void)
> >  		return err;
> >  	}
> >
> > -	err = rxe_net_init();
> > +	err = rxe_net_ipv4_init();
> >  	if (err) {
> > -		pr_err("rxe: unable to init\n");
> > +		pr_err("rxe: unable to init ipv4 tunnel\n");
> >  		rxe_cache_exit();
> >  		return err;
> >  	}
> > +
> > +#if IS_ENABLED(CONFIG_IPV6)
> > +	err = rxe_net_ipv6_init();
> > +	if (err) {
> > +		pr_err("rxe: unable to init ipv6 tunnel\n");
> > +		rxe_cache_exit();
> > +		return err;
> > +	}
> > +#endif
> > +
> >  	pr_info("rxe: loaded\n");
> >
> >  	return 0;
> > diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> > index 0b8d2ea..e0866b4 100644
> > --- a/drivers/infiniband/sw/rxe/rxe_net.c
> > +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> > @@ -249,8 +249,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
> >  	memset(&udp_cfg, 0, sizeof(udp_cfg));
> >
> >  	if (ipv6) {
> > -		udp_cfg.family = AF_INET6;
> > -		udp_cfg.ipv6_v6only = 1;
> > +	udp_cfg.family = AF_INET6;
> > +	udp_cfg.ipv6_v6only = 1;
> >  	} else {
> >  		udp_cfg.family = AF_INET;
> >  	}
> > @@ -662,33 +662,22 @@ static struct notifier_block rxe_net_notifier = {
> >  	.notifier_call = rxe_notify,
> >  };
> >
> > -int rxe_net_init(void)
> > +int rxe_net_ipv4_init(void)
> >  {
> >  	int err;
> >
> >  	spin_lock_init(&dev_list_lock);
> >
> > -	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> > -			htons(ROCE_V2_UDP_DPORT), true);
> > -	if (IS_ERR(recv_sockets.sk6)) {
> > -		recv_sockets.sk6 = NULL;
> > -		pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
> > -		return -1;
> > -	}
> > -
> >  	recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net,
> > -			htons(ROCE_V2_UDP_DPORT), false);
> > +						htons(ROCE_V2_UDP_DPORT), false);
> >  	if (IS_ERR(recv_sockets.sk4)) {
> > -		rxe_release_udp_tunnel(recv_sockets.sk6);
> >  		recv_sockets.sk4 = NULL;
> > -		recv_sockets.sk6 = NULL;
> >  		pr_err("rxe: Failed to create IPv4 UDP tunnel\n");
> >  		return -1;
> >  	}
> >
> >  	err = register_netdevice_notifier(&rxe_net_notifier);
> >  	if (err) {
> > -		rxe_release_udp_tunnel(recv_sockets.sk6);
> >  		rxe_release_udp_tunnel(recv_sockets.sk4);
> >  		pr_err("rxe: Failed to rigister netdev notifier\n");
> >  	}
> > @@ -696,11 +685,35 @@ int rxe_net_init(void)
> >  	return err;
> >  }
> >
> > +int rxe_net_ipv6_init(void)
> > +{
> > +	int err;
> > +
> > +	spin_lock_init(&dev_list_lock);
> > +
> > +	recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
> > +						htons(ROCE_V2_UDP_DPORT), true);
> > +	if (IS_ERR(recv_sockets.sk6)) {
> > +		recv_sockets.sk6 = NULL;
> > +		pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
> > +		return -1;
> > +	}
> > +
> > +	err = register_netdevice_notifier(&rxe_net_notifier);
> > +	if (err) {
> > +		rxe_release_udp_tunnel(recv_sockets.sk6);
> > +		pr_err("rxe: Failed to rigister netdev notifier\n");
> > +	}
> > +
> > +	return err;
> > +}
> > +
>
> Can this be also in IS_ENABLED(CONFIG_IPV6) scope?
>
> >  void rxe_net_exit(void)
> >  {
> > +#if IS_ENABLED(CONFIG_IPV6)
> >  	if (recv_sockets.sk6)
> >  		rxe_release_udp_tunnel(recv_sockets.sk6);
> > -
> > +#endif
> >  	if (recv_sockets.sk4)
> >  		rxe_release_udp_tunnel(recv_sockets.sk4);
> >
> > diff --git a/drivers/infiniband/sw/rxe/rxe_net.h b/drivers/infiniband/sw/rxe/rxe_net.h
> > index 7b06f76..b8e3284 100644
> > --- a/drivers/infiniband/sw/rxe/rxe_net.h
> > +++ b/drivers/infiniband/sw/rxe/rxe_net.h
> > @@ -47,7 +47,8 @@ extern struct rxe_recv_sockets recv_sockets;
> >
> >  struct rxe_dev *rxe_net_add(struct net_device *ndev);
> >
> > -int rxe_net_init(void);
> > +int rxe_net_ipv4_init(void);
> > +int rxe_net_ipv6_init(void);
>
> Can this be also in IS_ENABLED(CONFIG_IPV6) scope?

In current implementation it should.
I personally would implement these config checks in rxe_net_ipv6_init()
function and not outside.

>
> >  void rxe_net_exit(void);
> >
> >  #endif /* RXE_NET_H */
> > --
> > 2.7.4
> >
> > --
> > 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]         ` <e0399c1c-567c-4996-a454-4ebefbe6e665-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2016-09-05 14:04           ` Leon Romanovsky
  0 siblings, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-05 14:04 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Yonatan Cohen

[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]

On Mon, Sep 05, 2016 at 09:32:42AM -0400, Doug Ledford wrote:
> On 9/5/2016 8:09 AM, Leon Romanovsky wrote:
> > From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >
>
> > diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> > index 0b8d2ea..e0866b4 100644
> > --- a/drivers/infiniband/sw/rxe/rxe_net.c
> > +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> > @@ -249,8 +249,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
> >  	memset(&udp_cfg, 0, sizeof(udp_cfg));
> >
> >  	if (ipv6) {
> > -		udp_cfg.family = AF_INET6;
> > -		udp_cfg.ipv6_v6only = 1;
> > +	udp_cfg.family = AF_INET6;
> > +	udp_cfg.ipv6_v6only = 1;
> >  	} else {
> >  		udp_cfg.family = AF_INET;
> >  	}
>
> Is my mailer displaying this wrong, or is this hunk just intentionally
> introducing indent breakage?

You are right, it is unintentionally. I'll repost.

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




[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]       ` <CAJ3xEMiBpGRy-JGuJ=P4eUF5zyz+2bm43F-jqPHtwm=3Uz9YYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-09-05 19:21         ` Or Gerlitz
       [not found]           ` <CAJ3xEMidqQRMqP6u+SJSJVbq0weREAtAJN=eXsA_zzS0KnQ_7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Or Gerlitz @ 2016-09-05 19:21 UTC (permalink / raw)
  To: Yonatan Cohen
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky

> On Mon, Sep 5, 2016 at 3:09 PM, Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>>
>> From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>
>> Disable creation of a UDP socket for ipv6
>> when CONFIG_IPV6 is not enabeld.
>> Since udp_sock_create6() returns 0 when CONFIG_IPV6 is not set
>>
>> [   46.888632] IP: [<c220705a>] setup_udp_tunnel_sock+0x6/0x4f
>> [   46.891355] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
>> [   46.893918] Oops: 0002 [#1] PREEMPT
>> [   46.896014] CPU: 0 PID: 1 Comm: swapper Not tainted
>> 4.7.0-rc4-00001-g8700e3e #1
>> [   46.900280] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
>> Debian-1.8.2-1 04/01/2014
>> [   46.904905] task: cf06c040 ti: cf05e000 task.ti: cf05e000
>> [   46.907854] EIP: 0060:[<c220705a>] EFLAGS: 00210246 CPU: 0
>> [   46.911137] EIP is at setup_udp_tunnel_sock+0x6/0x4f
>> [   46.914070] EAX: 00000044 EBX: 00000001 ECX: cf05fef0 EDX: ca8142e0
>> [   46.917236] ESI: c2c4505b EDI: cf05fef0 EBP: cf05fed0 ESP: cf05fed0
>> [   46.919836]  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
>> [   46.922046] CR0: 80050033 CR2: 000001fc CR3: 02cec000 CR4: 000006b0
>> [   46.924550] Stack:
>> [   46.926014]  cf05ff10 c1fd4657 ca8142e0 0000000a 00000000 00000000
>> 0000b712 00000008
>> [   46.931274]  00000000 6bb5bd01 c1fd48de 00000000 00000000 cf05ff1c
>> 00000000 00000000
>> [   46.936122]  cf05ff1c c1fd4bdf 00000000 cf05ff28 c2c4507b ffffffff
>> cf05ff88 c2bf1c74
>> [   46.942350] Call Trace:
>> [   46.944403]  [<c1fd4657>] rxe_setup_udp_tunnel+0x8f/0x99
>> [   46.947689]  [<c1fd48de>] ? net_to_rxe+0x4e/0x4e
>> [   46.950567]  [<c1fd4bdf>] rxe_net_init+0xe/0xa4
>> [   46.953147]  [<c2c4507b>] rxe_module_init+0x20/0x4c
>> [   46.955448]  [<c2bf1c74>] do_one_initcall+0x89/0x113
>> [   46.957797]  [<c2bf15eb>] ? set_debug_rodata+0xf/0xf
>> [   46.959966]  [<c2bf1dbc>] ? kernel_init_freeable+0xbe/0x15b
>> [   46.962262]  [<c2bf1ddc>] kernel_init_freeable+0xde/0x15b
>> [   46.964418]  [<c232eb54>] kernel_init+0x8/0xd0
>> [   46.966618]  [<c2333122>] ret_from_kernel_thread+0xe/0x24
>> [   46.969592]  [<c232eb4c>] ? rest_init+0x6f/0x6f

Hi Yoni, in this case, the trace contributes practically nothing to the
driver and kernel maintainers, please remove it.
--
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] 14+ messages in thread

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]           ` <CAJ3xEMidqQRMqP6u+SJSJVbq0weREAtAJN=eXsA_zzS0KnQ_7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-09-06  5:05             ` Leon Romanovsky
       [not found]               ` <20160906050518.GJ21847-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-06  5:05 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Yonatan Cohen, Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 3105 bytes --]

On Mon, Sep 05, 2016 at 10:21:15PM +0300, Or Gerlitz wrote:
> > On Mon, Sep 5, 2016 at 3:09 PM, Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> >>
> >> From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >>
> >> Disable creation of a UDP socket for ipv6
> >> when CONFIG_IPV6 is not enabeld.
> >> Since udp_sock_create6() returns 0 when CONFIG_IPV6 is not set
> >>
> >> [   46.888632] IP: [<c220705a>] setup_udp_tunnel_sock+0x6/0x4f
> >> [   46.891355] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
> >> [   46.893918] Oops: 0002 [#1] PREEMPT
> >> [   46.896014] CPU: 0 PID: 1 Comm: swapper Not tainted
> >> 4.7.0-rc4-00001-g8700e3e #1
> >> [   46.900280] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> >> Debian-1.8.2-1 04/01/2014
> >> [   46.904905] task: cf06c040 ti: cf05e000 task.ti: cf05e000
> >> [   46.907854] EIP: 0060:[<c220705a>] EFLAGS: 00210246 CPU: 0
> >> [   46.911137] EIP is at setup_udp_tunnel_sock+0x6/0x4f
> >> [   46.914070] EAX: 00000044 EBX: 00000001 ECX: cf05fef0 EDX: ca8142e0
> >> [   46.917236] ESI: c2c4505b EDI: cf05fef0 EBP: cf05fed0 ESP: cf05fed0
> >> [   46.919836]  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
> >> [   46.922046] CR0: 80050033 CR2: 000001fc CR3: 02cec000 CR4: 000006b0
> >> [   46.924550] Stack:
> >> [   46.926014]  cf05ff10 c1fd4657 ca8142e0 0000000a 00000000 00000000
> >> 0000b712 00000008
> >> [   46.931274]  00000000 6bb5bd01 c1fd48de 00000000 00000000 cf05ff1c
> >> 00000000 00000000
> >> [   46.936122]  cf05ff1c c1fd4bdf 00000000 cf05ff28 c2c4507b ffffffff
> >> cf05ff88 c2bf1c74
> >> [   46.942350] Call Trace:
> >> [   46.944403]  [<c1fd4657>] rxe_setup_udp_tunnel+0x8f/0x99
> >> [   46.947689]  [<c1fd48de>] ? net_to_rxe+0x4e/0x4e
> >> [   46.950567]  [<c1fd4bdf>] rxe_net_init+0xe/0xa4
> >> [   46.953147]  [<c2c4507b>] rxe_module_init+0x20/0x4c
> >> [   46.955448]  [<c2bf1c74>] do_one_initcall+0x89/0x113
> >> [   46.957797]  [<c2bf15eb>] ? set_debug_rodata+0xf/0xf
> >> [   46.959966]  [<c2bf1dbc>] ? kernel_init_freeable+0xbe/0x15b
> >> [   46.962262]  [<c2bf1ddc>] kernel_init_freeable+0xde/0x15b
> >> [   46.964418]  [<c232eb54>] kernel_init+0x8/0xd0
> >> [   46.966618]  [<c2333122>] ret_from_kernel_thread+0xe/0x24
> >> [   46.969592]  [<c232eb4c>] ? rest_init+0x6f/0x6f
>
> Hi Yoni, in this case, the trace contributes practically nothing to the
> driver and kernel maintainers, please remove it.

Hi Or,

I like your self-confident.

In this case, I asked from Yoni to add this call trace for a number of
reasons:
1. We got this call stack from external user and he wants to know that
it is fixed.
2. I'm looking on the oops posted to the list to get better
understanding if such cases exist in other places too.
3. We are in late -rc stage and kernel trace shows that it is real issue
which justifies late acceptance/pull request.

Thanks

> --
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]               ` <20160906050518.GJ21847-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-09-06  6:06                 ` Or Gerlitz
       [not found]                   ` <CAJ3xEMiuuCTGiWbefAFLRYART4h8YypsvGqxT69cTpkbrDdx1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Or Gerlitz @ 2016-09-06  6:06 UTC (permalink / raw)
  To: Leon Romanovsky, Yonatan Cohen
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Sep 6, 2016 at 8:05 AM, Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> On Mon, Sep 05, 2016 at 10:21:15PM +0300, Or Gerlitz wrote:

>> Hi Yoni, in this case, the trace contributes practically nothing to the
>> driver and kernel maintainers, please remove it.

> 1. We got this call stack from external user and he wants to know that
> it is fixed.

good to know, Yoni - we should give them credit! add Reported-by: line
after your author S.O.B line

> 2. I'm looking on the oops posted to the list to get better
> understanding if such cases exist in other places too.

for both (1) and (2) you can put the track trace after the --- line of
the submitted patch,
such that when the maintainer does git am, we don't carry that forever
in the kernel logs.

> 3. We are in late -rc stage and kernel trace shows that it is real issue
> which justifies late acceptance/pull request.

You can solve it with two words "kernel crash" in the change log

The crash originates from small wrongish behaviour of the rxe driver, not from
sophisticated and complex bug. The crash trace doesn't contribute
anything to future
maintainship of the driver and/or the IB subsystem.

> I like your self-confident.
> In this case, I asked from Yoni to add this call trace for a number of reasons:

$ ./scripts/get_maintainer.pl drivers/infiniband/sw/rxe

Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> (supporter:SOFT-ROCE DRIVER (rxe))
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> (supporter:INFINIBAND SUBSYSTEM)
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> (supporter:INFINIBAND SUBSYSTEM)
Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (supporter:INFINIBAND SUBSYSTEM)
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org (open list:SOFT-ROCE DRIVER (rxe))
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org (open list)
--
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] 14+ messages in thread

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]                   ` <CAJ3xEMiuuCTGiWbefAFLRYART4h8YypsvGqxT69cTpkbrDdx1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-09-06  8:59                     ` Leon Romanovsky
       [not found]                       ` <20160906085943.GL21847-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Leon Romanovsky @ 2016-09-06  8:59 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Yonatan Cohen, Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

On Tue, Sep 06, 2016 at 09:06:46AM +0300, Or Gerlitz wrote:
> On Tue, Sep 6, 2016 at 8:05 AM, Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> > On Mon, Sep 05, 2016 at 10:21:15PM +0300, Or Gerlitz wrote:
>
> >> Hi Yoni, in this case, the trace contributes practically nothing to the
> >> driver and kernel maintainers, please remove it.
>
> > 1. We got this call stack from external user and he wants to know that
> > it is fixed.
>
> good to know, Yoni - we should give them credit! add Reported-by: line
> after your author S.O.B line

Internally, It was asked too, and we decided to skip it.
It is uncommon to put jenkins bot name.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel
       [not found]                       ` <20160906085943.GL21847-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-09-06  9:21                         ` Or Gerlitz
  0 siblings, 0 replies; 14+ messages in thread
From: Or Gerlitz @ 2016-09-06  9:21 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Yonatan Cohen, Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Sep 6, 2016 at 11:59 AM, Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> On Tue, Sep 06, 2016 at 09:06:46AM +0300, Or Gerlitz wrote:
>> On Tue, Sep 6, 2016 at 8:05 AM, Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
>> > On Mon, Sep 05, 2016 at 10:21:15PM +0300, Or Gerlitz wrote:
>>
>> >> Hi Yoni, in this case, the trace contributes practically nothing to the
>> >> driver and kernel maintainers, please remove it.
>>
>> > 1. We got this call stack from external user and he wants to know that
>> > it is fixed.
>>
>> good to know, Yoni - we should give them credit! add Reported-by: line
>> after your author S.O.B line
>
> Internally, It was asked too, and we decided to skip it.
> It is uncommon to put jenkins bot name.

I couldn't realize from your email that it was a robot finding that
and not a human, you
can skip the robot name or creditize the person that read the robot's
email, if this is
the author of the patch, no need for double credit.
--
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] 14+ messages in thread

end of thread, other threads:[~2016-09-06  9:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-05 12:09 [PATCH rdma-rc 0/4] RXE fixes for 4.8 Leon Romanovsky
     [not found] ` <1473077359-11546-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-05 12:09   ` [PATCH rdma-rc 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel Leon Romanovsky
     [not found]     ` <1473077359-11546-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-05 13:24       ` Yuval Shaia
     [not found]         ` <20160905132402.GA14607-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
2016-09-05 14:03           ` Leon Romanovsky
2016-09-05 13:32       ` Doug Ledford
     [not found]         ` <e0399c1c-567c-4996-a454-4ebefbe6e665-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-09-05 14:04           ` Leon Romanovsky
     [not found]     ` <CAJ3xEMiBpGRy-JGuJ=P4eUF5zyz+2bm43F-jqPHtwm=3Uz9YYA@mail.gmail.com>
     [not found]       ` <CAJ3xEMiBpGRy-JGuJ=P4eUF5zyz+2bm43F-jqPHtwm=3Uz9YYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-05 19:21         ` Or Gerlitz
     [not found]           ` <CAJ3xEMidqQRMqP6u+SJSJVbq0weREAtAJN=eXsA_zzS0KnQ_7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-06  5:05             ` Leon Romanovsky
     [not found]               ` <20160906050518.GJ21847-2ukJVAZIZ/Y@public.gmane.org>
2016-09-06  6:06                 ` Or Gerlitz
     [not found]                   ` <CAJ3xEMiuuCTGiWbefAFLRYART4h8YypsvGqxT69cTpkbrDdx1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-06  8:59                     ` Leon Romanovsky
     [not found]                       ` <20160906085943.GL21847-2ukJVAZIZ/Y@public.gmane.org>
2016-09-06  9:21                         ` Or Gerlitz
2016-09-05 12:09   ` [PATCH rdma-rc 2/4] IB/rxe: Fix duplicate atomic request handling Leon Romanovsky
2016-09-05 12:09   ` [PATCH rdma-rc 3/4] IB/rxe: Fix race condition between requester and completer Leon Romanovsky
2016-09-05 12:09   ` [PATCH rdma-rc 4/4] IB/rxe: Fix kmem_cache leak Leon Romanovsky

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.