[Pkg-ofed-commits] [libfabric] 65/123: prov/sockets: FI_PEEK operation is always asynchronous

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Sat Oct 22 12:28:31 UTC 2016


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to annotated tag v1.1.1
in repository libfabric.

commit 35373fb71e1505714ea60d1a9f0c1472e8d20c04
Author: Jithin Jose <jithin.jose at intel.com>
Date:   Tue Sep 15 13:14:27 2015 -0700

    prov/sockets: FI_PEEK operation is always asynchronous
    
    Signed-off-by: Jithin Jose <jithin.jose at intel.com>
---
 man/fi_tagged.3.md               |  4 ++--
 prov/sockets/src/sock_progress.c | 22 ++++++++++++----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/man/fi_tagged.3.md b/man/fi_tagged.3.md
index 64ca51f..92840d3 100644
--- a/man/fi_tagged.3.md
+++ b/man/fi_tagged.3.md
@@ -272,8 +272,8 @@ The following flags may be used with fi_trecvmsg.
   allocated buffering enabled (see fi_rx_attr total_buffered_recv).
   Unlike standard receive operations, a receive operation with the FI_PEEK
   flag set does not remain queued with the provider until the peek completes
-  successfully.  If no data is available, the FI_PEEK receive will complete
-  with a status of FI_ENOMSG.
+  successfully.  If no data is available, the FI_PEEK receive will result in
+  a completion queue error entry with err field set to FI_ENOMSG.
 
   If a peek request locates a matching message, the operation will complete
   successfully.  The returned completion data will indicate the meta-data
diff --git a/prov/sockets/src/sock_progress.c b/prov/sockets/src/sock_progress.c
index 2bfb263..eba70f2 100644
--- a/prov/sockets/src/sock_progress.c
+++ b/prov/sockets/src/sock_progress.c
@@ -1159,7 +1159,6 @@ ssize_t sock_rx_peek_recv(struct sock_rx_ctx *rx_ctx, fi_addr_t addr,
 			  uint64_t tag, uint64_t ignore, void *context, 
 			  uint64_t flags, uint8_t is_tagged)
 {
-	ssize_t ret = 0;
 	struct sock_rx_entry *rx_buffered;
 	struct sock_pe_entry pe_entry;
 
@@ -1168,16 +1167,18 @@ ssize_t sock_rx_peek_recv(struct sock_rx_ctx *rx_ctx, fi_addr_t addr,
 					(rx_ctx->attr.caps & FI_DIRECTED_RECV) ?
 						 addr : FI_ADDR_UNSPEC, 
 						 tag, ignore, is_tagged);
+
+	memset(&pe_entry, 0, sizeof pe_entry);
+	pe_entry.comp = &rx_ctx->comp;
+	pe_entry.context = (uintptr_t)context;
+	pe_entry.flags = (flags | FI_MSG | FI_RECV);
+	if (is_tagged)
+		pe_entry.flags |= FI_TAGGED;
+
 	if (rx_buffered) {
-		memset(&pe_entry, 0, sizeof pe_entry);
-		pe_entry.comp = &rx_ctx->comp;
 		pe_entry.data_len = rx_buffered->total_len;
 		pe_entry.tag = rx_buffered->tag;
-		pe_entry.context = rx_buffered->context = (uintptr_t)context;
-		pe_entry.flags = (flags | FI_MSG | FI_RECV);
-		if (is_tagged)
-			pe_entry.flags |= FI_TAGGED;
-		
+		rx_buffered->context = (uintptr_t)context;
 		if (flags & FI_CLAIM)
 			rx_buffered->is_claimed = 1;
 		
@@ -1187,10 +1188,11 @@ ssize_t sock_rx_peek_recv(struct sock_rx_ctx *rx_ctx, fi_addr_t addr,
 		}
 		sock_pe_report_rx_completion(&pe_entry);
 	} else {
-		ret = -FI_ENOMSG;
+		sock_cq_report_error(rx_ctx->comp.recv_cq, &pe_entry, 0, 
+				     FI_ENOMSG, -FI_ENOMSG, NULL);
 	}
 	fastlock_release(&rx_ctx->lock);
-	return ret;
+	return 0;
 }
 
 ssize_t sock_rx_claim_recv(struct sock_rx_ctx *rx_ctx, void *context, uint64_t flags, 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/libfabric.git



More information about the Pkg-ofed-commits mailing list