On Wed, 2012-06-06 at 18:42 +0000, Hefty, Sean wrote:
> netperf uses the TCP_MAXSEG socket option.  Add support for it.
> Problem reported by Sridhar Samudrala <s...@us.ibm.com>
> 
> getsockopt returns the path MTU as the TCP_MAXSEG.  setsockopt
> currently ignores the value.
> 
> Signed-off-by: Sean Hefty <sean.he...@intel.com>

Acked-by: Sridhar Samudrala <s...@us.ibm.com>

> ---
>  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 majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to