Revision: 2291
Author:
regra...@gmail.com
Date: Fri Nov 7 16:57:12 2014 UTC
Log: Fixes corner case where triggered operations over UDP would fail
if the triggered operation was to a target that was not
currently "connected"
https://code.google.com/p/portals4/source/detail?r=2291
Modified:
/trunk/src/ib/ptl_buf.h
/trunk/src/ib/ptl_ct.c
/trunk/src/ib/ptl_init.c
=======================================
--- /trunk/src/ib/ptl_buf.h Wed Oct 2 21:26:45 2013 UTC
+++ /trunk/src/ib/ptl_buf.h Fri Nov 7 16:57:12 2014 UTC
@@ -276,6 +276,7 @@
#if WITH_RUDP
int in_progress;
#endif
+ int i_am_prog_thread;
} udp;
#endif
=======================================
--- /trunk/src/ib/ptl_ct.c Thu Nov 14 20:18:55 2013 UTC
+++ /trunk/src/ib/ptl_ct.c Fri Nov 7 16:57:12 2014 UTC
@@ -488,6 +488,7 @@
buf_t *buf = list_entry(l, buf_t, list);
if (buf->type == BUF_INIT) {
+ ptl_info("check for init BUF triggering\n");
if (ct->info.interrupt) {
list_del(l);
atomic_dec(&ct->list_size);
@@ -506,7 +507,11 @@
atomic_dec(&ct->list_size);
PTL_FASTLOCK_UNLOCK(&ct->lock);
-
+
+ ptl_info("CT Triggered, initiating operation\n");
+#if WITH_TRANSPORT_UDP
+ buf->udp.i_am_prog_thread = 1;
+#endif
err = process_init(buf);
if (unlikely(err))
ptl_warn("Error in processing initiator traffic\n");
@@ -542,6 +547,7 @@
}
#endif
} else {
+ ptl_info("check for BUF triggering\n");
assert(buf->type == BUF_TRIGGERED);
if (ct->info.interrupt) {
list_del(l);
=======================================
--- /trunk/src/ib/ptl_init.c Wed May 28 20:03:11 2014 UTC
+++ /trunk/src/ib/ptl_init.c Fri Nov 7 16:57:12 2014 UTC
@@ -416,7 +416,17 @@
#if WITH_TRANSPORT_IB || WITH_TRANSPORT_UDP
- pthread_cond_wait(&conn->move_wait, &conn->mutex);
+#if WITH_TRANSPORT_UDP
+ if (buf->udp.i_am_prog_thread == 1){
+ while (conn->state < CONN_STATE_CONNECTED)
+ progress_thread_udp(ni);
+ }
+ else{
+#endif
+ pthread_cond_wait(&conn->move_wait, &conn->mutex);
+#if WITH_TRANSPORT_UDP
+ }
+#endif
#endif
pthread_mutex_unlock(&conn->mutex);
@@ -464,6 +474,7 @@
req_hdr_t *hdr = (req_hdr_t *) buf->data;
ni_t *ni = obj_to_ni(buf);
hdr->h1.physical = !!(ni->options & PTL_NI_PHYSICAL);
+
}
#endif