netperf uses the TCP_MAXSEG socket option.  Add support for it.
Problem reported by Sridhar Samudrala <[email protected]>

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

Signed-off-by: Sean Hefty <[email protected]>
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to