IB/ipath: Fix maximum MTU reporting
Although our chip supports 4K MTUs, our driver doesn't yet support this feature, so limit the maximum MTU to 2K until we get support for 4K MTUs implemented. Signed-off-by: Robert Walsh <robert.walsh@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
Родитель
380bf5d38f
Коммит
e7340f0442
|
@ -257,9 +257,14 @@ static ssize_t atomic_port_info_read(struct file *file, char __user *buf,
|
||||||
/* Notimpl InitType (actually, an SMA decision) */
|
/* Notimpl InitType (actually, an SMA decision) */
|
||||||
/* VLHighLimit is 0 (only one VL) */
|
/* VLHighLimit is 0 (only one VL) */
|
||||||
; /* VLArbitrationHighCap is 0 (only one VL) */
|
; /* VLArbitrationHighCap is 0 (only one VL) */
|
||||||
|
/*
|
||||||
|
* Note: the chips support a maximum MTU of 4096, but the driver
|
||||||
|
* hasn't implemented this feature yet, so set the maximum
|
||||||
|
* to 2048.
|
||||||
|
*/
|
||||||
portinfo[10] = /* VLArbitrationLowCap is 0 (only one VL) */
|
portinfo[10] = /* VLArbitrationLowCap is 0 (only one VL) */
|
||||||
/* InitTypeReply is SMA decision */
|
/* InitTypeReply is SMA decision */
|
||||||
(5 << 16) /* MTUCap 4096 */
|
(4 << 16) /* MTUCap 2048 */
|
||||||
| (7 << 13) /* VLStallCount */
|
| (7 << 13) /* VLStallCount */
|
||||||
| (0x1f << 8) /* HOQLife */
|
| (0x1f << 8) /* HOQLife */
|
||||||
| (1 << 4)
|
| (1 << 4)
|
||||||
|
|
|
@ -310,7 +310,12 @@ static int init_chip_first(struct ipath_devdata *dd,
|
||||||
val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiosize);
|
val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiosize);
|
||||||
dd->ipath_piosize2k = val & ~0U;
|
dd->ipath_piosize2k = val & ~0U;
|
||||||
dd->ipath_piosize4k = val >> 32;
|
dd->ipath_piosize4k = val >> 32;
|
||||||
dd->ipath_ibmtu = 4096; /* default to largest legal MTU */
|
/*
|
||||||
|
* Note: the chips support a maximum MTU of 4096, but the driver
|
||||||
|
* hasn't implemented this feature yet, so set the initial value
|
||||||
|
* to 2048.
|
||||||
|
*/
|
||||||
|
dd->ipath_ibmtu = 2048;
|
||||||
val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiobufcnt);
|
val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiobufcnt);
|
||||||
dd->ipath_piobcnt2k = val & ~0U;
|
dd->ipath_piobcnt2k = val & ~0U;
|
||||||
dd->ipath_piobcnt4k = val >> 32;
|
dd->ipath_piobcnt4k = val >> 32;
|
||||||
|
|
|
@ -292,7 +292,12 @@ static int recv_subn_get_portinfo(struct ib_smp *smp,
|
||||||
/* pip->vl_arb_high_cap; // only one VL */
|
/* pip->vl_arb_high_cap; // only one VL */
|
||||||
/* pip->vl_arb_low_cap; // only one VL */
|
/* pip->vl_arb_low_cap; // only one VL */
|
||||||
/* InitTypeReply = 0 */
|
/* InitTypeReply = 0 */
|
||||||
pip->inittypereply_mtucap = IB_MTU_4096;
|
/*
|
||||||
|
* Note: the chips support a maximum MTU of 4096, but the driver
|
||||||
|
* hasn't implemented this feature yet, so set the maximum value
|
||||||
|
* to 2048.
|
||||||
|
*/
|
||||||
|
pip->inittypereply_mtucap = IB_MTU_2048;
|
||||||
// HCAs ignore VLStallCount and HOQLife
|
// HCAs ignore VLStallCount and HOQLife
|
||||||
/* pip->vlstallcnt_hoqlife; */
|
/* pip->vlstallcnt_hoqlife; */
|
||||||
pip->operationalvl_pei_peo_fpi_fpo = 0x10; /* OVLs = 1 */
|
pip->operationalvl_pei_peo_fpi_fpo = 0x10; /* OVLs = 1 */
|
||||||
|
|
|
@ -507,8 +507,13 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
|
||||||
attr->port_num > ibqp->device->phys_port_cnt)
|
attr->port_num > ibqp->device->phys_port_cnt)
|
||||||
goto inval;
|
goto inval;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: the chips support a maximum MTU of 4096, but the driver
|
||||||
|
* hasn't implemented this feature yet, so don't allow Path MTU
|
||||||
|
* values greater than 2048.
|
||||||
|
*/
|
||||||
if (attr_mask & IB_QP_PATH_MTU)
|
if (attr_mask & IB_QP_PATH_MTU)
|
||||||
if (attr->path_mtu > IB_MTU_4096)
|
if (attr->path_mtu > IB_MTU_2048)
|
||||||
goto inval;
|
goto inval;
|
||||||
|
|
||||||
if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC)
|
if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC)
|
||||||
|
|
|
@ -1051,7 +1051,12 @@ static int ipath_query_port(struct ib_device *ibdev,
|
||||||
props->max_vl_num = 1; /* VLCap = VL0 */
|
props->max_vl_num = 1; /* VLCap = VL0 */
|
||||||
props->init_type_reply = 0;
|
props->init_type_reply = 0;
|
||||||
|
|
||||||
props->max_mtu = IB_MTU_4096;
|
/*
|
||||||
|
* Note: the chips support a maximum MTU of 4096, but the driver
|
||||||
|
* hasn't implemented this feature yet, so set the maximum value
|
||||||
|
* to 2048.
|
||||||
|
*/
|
||||||
|
props->max_mtu = IB_MTU_2048;
|
||||||
switch (dev->dd->ipath_ibmtu) {
|
switch (dev->dd->ipath_ibmtu) {
|
||||||
case 4096:
|
case 4096:
|
||||||
mtu = IB_MTU_4096;
|
mtu = IB_MTU_4096;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче