Skip to contentSkip to conversation

sunvnet: ldc_connect() should not return EINVAL when handshake is in progress.

PATCH In review Sowmini Varadhan 2 participants 2 messages Jul 31, 2014 – Aug 1, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunvnet: ldc_connect() should not return EINVAL when handshake is in progress.

The LDC handshake could have been asynchronously triggered after ldc_bind() enables the ldc_rx() receive interrupt-handler (and thus intercepts incoming control packets)
and before vio_port_up() calls ldc_connect(). If that is the case, ldc_connect() should return 0 and let the state-machine progress.

---
 arch/sparc/kernel/ldc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/ldc.c +1 -1
index e01d75d..66dacd5 100644
@@ -1336,7 +1336,7 @@ int ldc_connect(struct ldc_channel *lp)
 	if (!(lp->flags & LDC_FLAG_ALLOCED_QUEUES) ||
 	    !(lp->flags & LDC_FLAG_REGISTERED_QUEUES) ||
 	    lp->hs_state != LDC_HS_OPEN)
-		err = -EINVAL;
+		err = ((lp->hs_state > LDC_HS_OPEN) ? 0 : -EINVAL);
 	else
 		err = start_handshake(lp);
 
Signature · 1 line
1.8.4.2
maintainer
#1 lore raw

From: Sowmini Varadhan <[email protected]>
Date: Thu, 31 Jul 2014 10:31:26 -0400

Quoted 10 lines

The LDC handshake could have been asynchronously triggered after ldc_bind() enables the ldc_rx() receive interrupt-handler (and thus intercepts incoming control packets)
and before vio_port_up() calls ldc_connect(). If that is the case, ldc_connect() should return 0 and let the state-machine progress.

This is a sparc architecture change, not a networking one.

Please submit it to the appropriate mailing list, as per the top-level MAINTAINERS file.

Thanks.