sock/vpp: do not continue if buf writed is less than provided

According to the implementation of VPP, the vppcom_session_write() may
cannot write all provided buffer, and we shouldn't continue in this
case, just like usage of vppcom_session_read().

Change-Id: I419efc2812e3aa261a75ddbd3f7cfec60a5376d3
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447540
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
wuzhouhui 2019-03-10 16:16:52 +08:00 committed by Jim Harris
parent 1c96c421eb
commit 900f0c978b

View File

@ -436,6 +436,9 @@ spdk_vpp_sock_writev(struct spdk_sock *_sock, struct iovec *iov, int iovcnt)
}
} else {
total += rc;
if (rc < iov[i].iov_len) {
break;
}
}
}
return total;