SOCKET set TCP_NODELAY on iscsi->fd
This will set TCP_NODELAY on the socket connection to the target. This is the first step to improve latency. For systems supporting TCP_CORK we plan to add a cork around certain PDUs e.g. DATA-Out, but this needs further testing. Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
@@ -283,6 +283,12 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (set_tcp_sockopt(iscsi->fd, TCP_NODELAY, 1) != 0) {
|
||||||
|
ISCSI_LOG(iscsi,1,"failed to set TCP_NODELAY sockopt: %s",strerror(errno));
|
||||||
|
} else {
|
||||||
|
ISCSI_LOG(iscsi,3,"TCP_NODELAY set to 1");
|
||||||
|
}
|
||||||
|
|
||||||
if (connect(iscsi->fd, ai->ai_addr, socksize) != 0
|
if (connect(iscsi->fd, ai->ai_addr, socksize) != 0
|
||||||
&& errno != EINPROGRESS) {
|
&& errno != EINPROGRESS) {
|
||||||
iscsi_set_error(iscsi, "Connect failed with errno : "
|
iscsi_set_error(iscsi, "Connect failed with errno : "
|
||||||
|
|||||||
Reference in New Issue
Block a user