DORMANTno replies

[PATCH 2/4] librdamcm/rsocket: Handle TCP_MAXSEG socket option

From: Hefty, Sean <hidden>
Date: 2012-06-06 18:42:02
Subsystem: the rest · Maintainer: Linus Torvalds

netperf uses the TCP_MAXSEG socket option.  Add support for it.
Problem reported by Sridhar Samudrala [off-list ref]

getsockopt returns the path MTU as the TCP_MAXSEG.  setsockopt
currently ignores the value.

Signed-off-by: Sean Hefty <redacted>
---
 src/rsocket.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/rsocket.c b/src/rsocket.c
index 8f20b4a..2fd106a 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -1716,6 +1716,9 @@ int rsetsockopt(int socket, int level, int optname,
 			opt_on = *(int *) optval;
 			ret = 0;
 			break;
+		case TCP_MAXSEG:
+			ret = 0;
+			break;
 		default:
 			break;
 		}
@@ -1802,6 +1805,12 @@ int rgetsockopt(int socket, int level, int optname,
 			*((int *) optval) = !!(rs->tcp_opts & (1 << optname));
 			*optlen = sizeof(int);
 			break;
+		case TCP_MAXSEG:
+			*((int *) optval) = (rs->cm_id && rs->cm_id->route.num_paths) ?
+					    1 << (7 + rs->cm_id->route.path_rec->mtu) :
+					    2048;
+			*optlen = sizeof(int);
+			break;
 		default:
 			ret = ENOTSUP;
 			break;


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help