Re: [PATCH] [PATCH 08/21] IB/hfi1: Adjust default MTU to be 10KB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 12, 2016 at 11:17:09AM -0700, Dennis Dalessandro wrote:
> From: Sebastian Sanchez <sebastian.sanchez@xxxxxxxxx>
> 
> Increasing the default MTU size to 10KB improves performance
> for PSM. Change the default MTU to 10KB but constrain
> Verbs MTU to 8KB. Also update default MTU module parameter
> description to be HFI1_DEFAULT_MAX_MTU.
> 
> Reviewed-by: Dean Luick <dean.luick@xxxxxxxxx>
> Reviewed-by: Mitko Haralanov <mitko.haralanov@xxxxxxxxx>
> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxx>
> Reviewed-by: Jubin John <jubin.john@xxxxxxxxx>
> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@xxxxxxxxx>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>
> ---
>  drivers/staging/rdma/hfi1/driver.c |    3 ++-
>  drivers/staging/rdma/hfi1/hfi.h    |    4 ++--
>  drivers/staging/rdma/hfi1/qp.c     |    6 +++++-
>  3 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/rdma/hfi1/driver.c b/drivers/staging/rdma/hfi1/driver.c
> index 34511e5..700c6fa 100644
> --- a/drivers/staging/rdma/hfi1/driver.c
> +++ b/drivers/staging/rdma/hfi1/driver.c
> @@ -75,7 +75,8 @@ DEFINE_MUTEX(hfi1_mutex);	/* general driver use */
>  
>  unsigned int hfi1_max_mtu = HFI1_DEFAULT_MAX_MTU;
>  module_param_named(max_mtu, hfi1_max_mtu, uint, S_IRUGO);
> -MODULE_PARM_DESC(max_mtu, "Set max MTU bytes, default is 8192");
> +MODULE_PARM_DESC(max_mtu, "Set max MTU bytes, default is " __stringify(
> +		 HFI1_DEFAULT_MAX_MTU));
>  
>  unsigned int hfi1_cu = 1;
>  module_param_named(cu, hfi1_cu, uint, S_IRUGO);
> diff --git a/drivers/staging/rdma/hfi1/hfi.h b/drivers/staging/rdma/hfi1/hfi.h
> index ac553f1..ff04593 100644
> --- a/drivers/staging/rdma/hfi1/hfi.h
> +++ b/drivers/staging/rdma/hfi1/hfi.h
> @@ -455,9 +455,9 @@ struct rvt_sge_state;
>  #define HLS_UP (HLS_UP_INIT | HLS_UP_ARMED | HLS_UP_ACTIVE)
>  
>  /* use this MTU size if none other is given */
> -#define HFI1_DEFAULT_ACTIVE_MTU 8192
> +#define HFI1_DEFAULT_ACTIVE_MTU 10240
>  /* use this MTU size as the default maximum */
> -#define HFI1_DEFAULT_MAX_MTU 8192
> +#define HFI1_DEFAULT_MAX_MTU 10240
>  /* default partition key */
>  #define DEFAULT_PKEY 0xffff
>  
> diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c
> index 29a5ad2..e68d08a 100644
> --- a/drivers/staging/rdma/hfi1/qp.c
> +++ b/drivers/staging/rdma/hfi1/qp.c
> @@ -167,8 +167,12 @@ static inline int opa_mtu_enum_to_int(int mtu)
>   */
>  static inline int verbs_mtu_enum_to_int(struct ib_device *dev, enum ib_mtu mtu)
>  {
> -	int val = opa_mtu_enum_to_int((int)mtu);
> +	int val;
>  
> +	/* Constraining 10KB packets to 8KB packets */
> +	if (mtu == (enum ib_mtu)OPA_MTU_10240)
> +		mtu = OPA_MTU_8192;
> +	val = opa_mtu_enum_to_int((int)mtu);

Just spotted my attention,
Curious names, castings and type conversions.

>  	if (val > 0)
>  		return val;
>  	return ib_mtu_enum_to_int(mtu);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux