[Pkg-ofed-commits] [libfabric] 01/123: usnic: Fix reassembly bug in EP_RDM.

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Sat Oct 22 12:28:22 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 61e1974c29cb0d4e61b2e6c4b4f2dbb27e750807
Author: Ben Turrubiates <bturrubi at cisco.com>
Date:   Thu Aug 27 13:52:30 2015 -0700

    usnic: Fix reassembly bug in EP_RDM.
    
    This resolves a segmenting issue in the usNIC implementation of EP_RDM
    where the buffer position isn't updated and newer segments overwrite
    memory from earlier segments.
    
    Signed-off-by: Ben Turrubiates <bturrubi at cisco.com>
---
 prov/usnic/src/usdf_rdm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/prov/usnic/src/usdf_rdm.c b/prov/usnic/src/usdf_rdm.c
index 9ca2334..9a21fad 100644
--- a/prov/usnic/src/usdf_rdm.c
+++ b/prov/usnic/src/usdf_rdm.c
@@ -446,6 +446,7 @@ usdf_rdm_recv(struct fid_ep *fep, void *buf, size_t len,
 	rqe->rd_cur_ptr = buf;
 	rqe->rd_iov_resid = len;
 	rqe->rd_length = 0;
+	rqe->rd_resid = len;
 	USDF_DBG_SYS(EP_DATA, "RECV post rqe=%p len=%lu\n", rqe, len);
 
 	TAILQ_INSERT_TAIL(&rx->r.rdm.rx_posted_rqe, rqe, rd_link);
@@ -1462,6 +1463,7 @@ usdf_rdm_handle_recv(struct usdf_domain *udp, struct usd_completion *comp)
 	uint8_t *rqe_ptr;
 	size_t cur_iov;
 	size_t iov_resid;
+	size_t rd_resid;
 	size_t rxlen;
 	size_t copylen;
 
@@ -1506,12 +1508,14 @@ usdf_rdm_handle_recv(struct usdf_domain *udp, struct usd_completion *comp)
 	rqe_ptr = (uint8_t *)rqe->rd_cur_ptr;
 	iov_resid = rqe->rd_iov_resid;
 	cur_iov = rqe->rd_cur_iov;
+	rd_resid = rqe->rd_resid;
 	while (rxlen > 0) {
 		copylen = MIN(rxlen, iov_resid);
 		memcpy(rqe_ptr, rx_ptr, copylen);
 		rx_ptr += copylen;
 		rxlen -= copylen;
 		iov_resid -= copylen;
+		rd_resid -= copylen;
 		if (iov_resid == 0) {
 			if (cur_iov == rqe->rd_last_iov) {
 				break;
@@ -1524,6 +1528,11 @@ usdf_rdm_handle_recv(struct usdf_domain *udp, struct usd_completion *comp)
 		}
 	}
 
+	rqe->rd_cur_ptr = rqe_ptr;
+	rqe->rd_iov_resid = iov_resid;
+	rqe->rd_cur_iov = cur_iov;
+	rqe->rd_resid = rd_resid;
+
 	if (rxlen > 0) {
 		rqe->rd_length -= rxlen;
 /* printf("RQE truncated XXX\n"); */

-- 
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