Hello Sasha,
Following the issue I raised yesterday ([ofa-general] ibsim:
sim_read_pkt: write failed: Resource temporarily unavailable - pkt
dropped), I wrote a small patch that fixes the issue (in attachment).
All my tests are now running fine with this patch. Please let me know if
you have any comments ;-)
Cheers,
Vincent
diff --git a/ibsim/ibsim.c b/ibsim/ibsim.c
index e4ab6bc..2b8b6f8 100644
--- a/ibsim/ibsim.c
+++ b/ibsim/ibsim.c
@@ -497,7 +497,10 @@ static int sim_read_pkt(int fd, int client)
size, sizeof(struct sim_request), dcl->id, dcl->fd);
// reply
- ret = write(dcl->fd, buf, size);
+ do {
+ ret = write(dcl->fd, buf, size);
+ } while ((errno == EAGAIN) && (ret == -1));
+
if (ret == size)
return 0;
diff --git a/ibsim/sim_mad.c b/ibsim/sim_mad.c
index 0ac2c1e..79a6f42 100644
--- a/ibsim/sim_mad.c
+++ b/ibsim/sim_mad.c
@@ -1324,7 +1324,10 @@ int send_trap(Port * port, int trapnum)
fflush(stdout);
}
- ret = write(cl->fd, &req, sizeof(req));
+ do {
+ ret = write(cl->fd, &req, sizeof(req));
+ } while ((errno == EAGAIN) && (ret == -1));
+
if (ret == sizeof(req))
return 0;
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general