From 826d801009fb3c82832f2d92149446cce354bf61 Mon Sep 17 00:00:00 2001 From: Dave Olson Date: Wed, 16 Apr 2008 21:01:12 -0700 Subject: IB/ipath: Enable 4KB MTU Enable use of 4KB MTU. Since the driver uses more pinned memory for receive buffers when the 4KB MTU is enabled, whether or not the fabric supports that MTU, add a "mtu4096" module parameter that can be used to limit the MTU to 2KB when it is known that 4KB MTUs can't be used anyway. Signed-off-by: Dave Olson Signed-off-by: Roland Dreier --- drivers/infiniband/hw/ipath/ipath_file_ops.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/infiniband/hw/ipath/ipath_file_ops.c') diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c index 219b62d32eed..cddf29b9554e 100644 --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c @@ -219,7 +219,12 @@ static int ipath_get_base_info(struct file *fp, kinfo->spi_pioalign = dd->ipath_palign; kinfo->spi_qpair = IPATH_KD_QP; - kinfo->spi_piosize = dd->ipath_ibmaxlen; + /* + * user mode PIO buffers are always 2KB, even when 4KB can + * be received, and sent via the kernel; this is ibmaxlen + * for 2K MTU. + */ + kinfo->spi_piosize = dd->ipath_piosize2k - 2 * sizeof(u32); kinfo->spi_mtu = dd->ipath_ibmaxlen; /* maxlen, not ibmtu */ kinfo->spi_port = pd->port_port; kinfo->spi_subport = subport_fp(fp); -- cgit v1.2.3