components/open-fabrics/librdmacm/patches/005-librdmacm-fix-core-dump-in-rping-client-without-running-server.patch
author boris.chiu@oracle.com
Fri, 01 Apr 2016 15:20:17 -0700
changeset 5708 49b43e37ce26
permissions -rw-r--r--
PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates 21132063 Solaris OFUV tools/libs should handle EDR/FDR speed based cards properly 21845415 OFUV mad utilities and libraries need to be upgraded to OFED 3.18 21850735 OFUV verbs and mlx4 libraries need to be upgraded to OFED 3.18 21850928 OFUV librdmacm need to be upgraded to OFED 3.18 22213636 problem in UTILITY/OFUV_TOOLS 22219198 librdmacm: cmtime gets segmentation fault when given invalid argument with -b 22271413 ibnetdiscover has segmentation fault when link state is at 2 22641297 shared pd and fmr in solaris should be in sync with those in uek 22642557 Upgrading to OFED 3.18 requires bumping Solaris ABI version number 22652208 qperf needs to be upgraded to latest(0.4.9) 22689609 qperf returns failed to receive results: timed out for ud_bw tests 22826204 PSID ID string size in uverbs_ioctl.h should reflect kernel sizes (userland) 22912559 libsif needs to support OFED 3.18 22947813 test_verbs TEST_VERB_SRQ failed on PSIF
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5708
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     1
#This patch was developed both in-house and from outside. We plan to submit it
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     2
#upstream, but do not yet have a target date for doing so
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     3
# HG changeset patch
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     4
# Parent  68a7383fdd511ce1ea9a0dfc24404b3d74e67055
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     5
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     6
diff -r 68a7383fdd51 examples/rping.c
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     7
--- a/examples/rping.c	Tue Mar 15 19:57:38 2016 -0700
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     8
+++ b/examples/rping.c	Thu Mar 17 00:08:03 2016 -0700
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
     9
@@ -88,6 +88,7 @@
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    10
 	RDMA_READ_COMPLETE,
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    11
 	RDMA_WRITE_ADV,
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    12
 	RDMA_WRITE_COMPLETE,
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    13
+	CALLING_DISCONNECT,
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    14
 	DISCONNECTED,
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    15
 	ERROR
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    16
 };
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    17
@@ -290,6 +291,20 @@
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    18
 
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    19
 		if (wc.status) {
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    20
 			if (wc.status == IBV_WC_WR_FLUSH_ERR) {
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    21
+				/*
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    22
+				 * FLUSH Error can be polled before RDMA-CM
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    23
+				 * DISCONNECT is notified. Ensure that cb_state
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    24
+				 * is set appropriately in such a case.
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    25
+				 * sleep for sometime if Disconnect has not
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    26
+				 * been called. The FLUSH WR can be because
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    27
+				 * the remote end initiated the disconnect.
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    28
+				 */
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    29
+				if (!(cb->state == CALLING_DISCONNECT || cb->state == DISCONNECTED))
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    30
+					sleep(2);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    31
+
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    32
+				if (cb->state == DISCONNECTED)
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    33
+					return (0);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    34
+
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    35
 				flushed = 1;
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    36
 				continue;
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    37
 
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    38
@@ -824,7 +839,9 @@
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    39
 	}
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    40
 
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    41
 	rping_test_server(cb);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    42
+	cb->state = CALLING_DISCONNECT;
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    43
 	rdma_disconnect(cb->child_cm_id);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    44
+	pthread_cancel(cb->cqthread);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    45
 	pthread_join(cb->cqthread, NULL);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    46
 	rping_free_buffers(cb);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    47
 	rping_free_qp(cb);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    48
@@ -943,6 +960,7 @@
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    49
 
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    50
 	ret = 0;
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    51
 err3:
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    52
+	cb->state = CALLING_DISCONNECT;
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    53
 	rdma_disconnect(cb->child_cm_id);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    54
 	pthread_join(cb->cqthread, NULL);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    55
 	rdma_destroy_id(cb->child_cm_id);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    56
@@ -1122,6 +1140,7 @@
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    57
 
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    58
 	ret = 0;
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    59
 err4:
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    60
+	cb->state = CALLING_DISCONNECT;
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    61
 	rdma_disconnect(cb->cm_id);
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    62
 err3:
49b43e37ce26 PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates
boris.chiu@oracle.com
parents:
diff changeset
    63
 	pthread_join(cb->cqthread, NULL);