diff mbox

Avoid possible hang on device removal

Message ID 1477428628-11504-1-git-send-email-mustafa.ismail@intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Ismail, Mustafa Oct. 25, 2016, 8:50 p.m. UTC
When we get an RDMA_CM_EVENT_DEVICE_REMOVAL the cm_thread will
exit and because flush errors are ignored the cb->sem may not get signaled.
So just signal on device removal event.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
---
 librdmacm/examples/rping.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Steve Wise Oct. 25, 2016, 8:56 p.m. UTC | #1
> 
> When we get an RDMA_CM_EVENT_DEVICE_REMOVAL the cm_thread will
> exit and because flush errors are ignored the cb->sem may not get signaled.
> So just signal on device removal event.
> 
> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>

Looks good.

Reviewed-by: Steve Wise <swise@opengridcomputing.com>

Also, this fixes a previous commit, so you could add this tag:

Fixes 612eae1f6fe3 ("rping: ignore flushed completions")

However that commit id is from the previous librdmacm repo...not sure how useful
it is?

Steve.



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe Oct. 25, 2016, 10:43 p.m. UTC | #2
On Tue, Oct 25, 2016 at 03:56:57PM -0500, Steve Wise wrote:
> Reviewed-by: Steve Wise <swise@opengridcomputing.com>
> 
> Also, this fixes a previous commit, so you could add this tag:
> 
> Fixes 612eae1f6fe3 ("rping: ignore flushed completions")
> 
> However that commit id is from the previous librdmacm repo...not
> sure how useful it is?

It still exists in the new repo, I'd include the fixes line.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise Oct. 26, 2016, 1:45 p.m. UTC | #3
> > Reviewed-by: Steve Wise <swise@opengridcomputing.com>
> >
> > Also, this fixes a previous commit, so you could add this tag:
> >
> > Fixes 612eae1f6fe3 ("rping: ignore flushed completions")
> >
> > However that commit id is from the previous librdmacm repo...not
> > sure how useful it is?
> 
> It still exists in the new repo, I'd include the fixes line.
> 
> Jason

Hey Jason, how do I see the history?

[root@stevo1 rdma-core]# git log --pretty=oneline --abbrev-commit
librdmacm/examples/rping.c
9024876 rdmacm: Use correct format specifier for size_t
400122e Be explicit about _GNU_SOURCE
663098b Rename librdmacm

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe Oct. 26, 2016, 4:03 p.m. UTC | #4
On Wed, Oct 26, 2016 at 08:45:33AM -0500, Steve Wise wrote:
> > > Reviewed-by: Steve Wise <swise@opengridcomputing.com>
> > >
> > > Also, this fixes a previous commit, so you could add this tag:
> > >
> > > Fixes 612eae1f6fe3 ("rping: ignore flushed completions")
> > >
> > > However that commit id is from the previous librdmacm repo...not
> > > sure how useful it is?
> > 
> > It still exists in the new repo, I'd include the fixes line.
> > 
> > Jason
> 
> Hey Jason, how do I see the history?
> 
> [root@stevo1 rdma-core]# git log --pretty=oneline --abbrev-commit
> librdmacm/examples/rping.c
> 9024876 rdmacm: Use correct format specifier for size_t
> 400122e Be explicit about _GNU_SOURCE
> 663098b Rename librdmacm

Add --follow

$ git log --follow --pretty=oneline --abbrev-commit librdmacm/examples/rping.c
44579aeb63ee Enable -Wwrite-strings
90248767130f rdmacm: Use correct format specifier for size_t
400122ef15bd Be explicit about _GNU_SOURCE
663098bfc3ac Rename librdmacm
171176797516 [v1, 1/1, librdmacm] examples/rping.c: fix unwanted abort during qp creation
c9ac6566b26c [librdmacm] examples: Use gai_strerror rather than perror for [rdma_]getaddrinfo failures
5c5bd081e37a rping: create persistent server threads in DETACHED state
612eae1f6fe3 rping: ignore flushed completions
5ae36aba6f95 rping: Fixes race, where ibv context was getting freed before memory was deregistered
b70a390d8bd8 rping: Fix server reporting error on exit
e57196c71ddd [5/5,librdmacm] rping: added checks to the return values functions
860b1a8784f1 rping: Reduce retry_count to fit in 3-bits
5658ff385e04 rping: Replace sprintf with snprintf to protect from buffer overflow
93635fa33b41 librdmacm/rping: Make sure CQ event thread exits before destroying the CQ
8c6aeb3e70bb RPING: Remove printf for FLUSH completion.
4e33a4109a62 librdmacm: returns errors from the library consistently
267c28a2f03b rping: add ipv6 support
ea9b03238b13 librdmacm/rping: allow specifying hostnames in place of IP addresses
163f48d410fa librdmacm/rping: fix duplicate usage message
308b811d8d6b librdmacm: implement address change event
1beed21b111e librdmacm/examples
[..]

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

Patch

diff --git a/librdmacm/examples/rping.c b/librdmacm/examples/rping.c
index ad38f6d..53c1525 100644
--- a/librdmacm/examples/rping.c
+++ b/librdmacm/examples/rping.c
@@ -224,6 +224,8 @@  static int rping_cma_event_handler(struct rdma_cm_id *cma_id,
 
 	case RDMA_CM_EVENT_DEVICE_REMOVAL:
 		fprintf(stderr, "cma detected device removal!!!!\n");
+		cb->state = ERROR;
+		sem_post(&cb->sem);
 		ret = -1;
 		break;