diff options
author | Robert Walsh <robert.walsh@qlogic.com> | 2007-06-18 17:24:35 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-09 23:12:25 -0400 |
commit | e7340f04426416a6655ffaead4651bfb9e1b0848 (patch) | |
tree | 1ce7d3c405bc9e4ea69871e40504b057eeb30e66 | |
parent | 380bf5d38f3cc2799ed2fae554f7af1c4b0ed35b (diff) |
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>
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_fs.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_init_chip.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_mad.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_qp.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_verbs.c | 7 |
5 files changed, 30 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c index ebd5c7bd2cdb..40cf1bc90d74 100644 --- a/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/drivers/infiniband/hw/ipath/ipath_fs.c | |||
@@ -257,9 +257,14 @@ static ssize_t atomic_port_info_read(struct file *file, char __user *buf, | |||
257 | /* Notimpl InitType (actually, an SMA decision) */ | 257 | /* Notimpl InitType (actually, an SMA decision) */ |
258 | /* VLHighLimit is 0 (only one VL) */ | 258 | /* VLHighLimit is 0 (only one VL) */ |
259 | ; /* VLArbitrationHighCap is 0 (only one VL) */ | 259 | ; /* VLArbitrationHighCap is 0 (only one VL) */ |
260 | /* | ||
261 | * Note: the chips support a maximum MTU of 4096, but the driver | ||
262 | * hasn't implemented this feature yet, so set the maximum | ||
263 | * to 2048. | ||
264 | */ | ||
260 | portinfo[10] = /* VLArbitrationLowCap is 0 (only one VL) */ | 265 | portinfo[10] = /* VLArbitrationLowCap is 0 (only one VL) */ |
261 | /* InitTypeReply is SMA decision */ | 266 | /* InitTypeReply is SMA decision */ |
262 | (5 << 16) /* MTUCap 4096 */ | 267 | (4 << 16) /* MTUCap 2048 */ |
263 | | (7 << 13) /* VLStallCount */ | 268 | | (7 << 13) /* VLStallCount */ |
264 | | (0x1f << 8) /* HOQLife */ | 269 | | (0x1f << 8) /* HOQLife */ |
265 | | (1 << 4) | 270 | | (1 << 4) |
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c index ee839346a3a4..bdfda6221744 100644 --- a/drivers/infiniband/hw/ipath/ipath_init_chip.c +++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c | |||
@@ -310,7 +310,12 @@ static int init_chip_first(struct ipath_devdata *dd, | |||
310 | val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiosize); | 310 | val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiosize); |
311 | dd->ipath_piosize2k = val & ~0U; | 311 | dd->ipath_piosize2k = val & ~0U; |
312 | dd->ipath_piosize4k = val >> 32; | 312 | dd->ipath_piosize4k = val >> 32; |
313 | dd->ipath_ibmtu = 4096; /* default to largest legal MTU */ | 313 | /* |
314 | * Note: the chips support a maximum MTU of 4096, but the driver | ||
315 | * hasn't implemented this feature yet, so set the initial value | ||
316 | * to 2048. | ||
317 | */ | ||
318 | dd->ipath_ibmtu = 2048; | ||
314 | val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiobufcnt); | 319 | val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiobufcnt); |
315 | dd->ipath_piobcnt2k = val & ~0U; | 320 | dd->ipath_piobcnt2k = val & ~0U; |
316 | dd->ipath_piobcnt4k = val >> 32; | 321 | dd->ipath_piobcnt4k = val >> 32; |
diff --git a/drivers/infiniband/hw/ipath/ipath_mad.c b/drivers/infiniband/hw/ipath/ipath_mad.c index 25908b02fbe5..2e9e161bfd0a 100644 --- a/drivers/infiniband/hw/ipath/ipath_mad.c +++ b/drivers/infiniband/hw/ipath/ipath_mad.c | |||
@@ -292,7 +292,12 @@ static int recv_subn_get_portinfo(struct ib_smp *smp, | |||
292 | /* pip->vl_arb_high_cap; // only one VL */ | 292 | /* pip->vl_arb_high_cap; // only one VL */ |
293 | /* pip->vl_arb_low_cap; // only one VL */ | 293 | /* pip->vl_arb_low_cap; // only one VL */ |
294 | /* InitTypeReply = 0 */ | 294 | /* InitTypeReply = 0 */ |
295 | pip->inittypereply_mtucap = IB_MTU_4096; | 295 | /* |
296 | * Note: the chips support a maximum MTU of 4096, but the driver | ||
297 | * hasn't implemented this feature yet, so set the maximum value | ||
298 | * to 2048. | ||
299 | */ | ||
300 | pip->inittypereply_mtucap = IB_MTU_2048; | ||
296 | // HCAs ignore VLStallCount and HOQLife | 301 | // HCAs ignore VLStallCount and HOQLife |
297 | /* pip->vlstallcnt_hoqlife; */ | 302 | /* pip->vlstallcnt_hoqlife; */ |
298 | pip->operationalvl_pei_peo_fpi_fpo = 0x10; /* OVLs = 1 */ | 303 | pip->operationalvl_pei_peo_fpi_fpo = 0x10; /* OVLs = 1 */ |
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index bfef08ecd342..9e07abba8aa7 100644 --- a/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/drivers/infiniband/hw/ipath/ipath_qp.c | |||
@@ -507,8 +507,13 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
507 | attr->port_num > ibqp->device->phys_port_cnt) | 507 | attr->port_num > ibqp->device->phys_port_cnt) |
508 | goto inval; | 508 | goto inval; |
509 | 509 | ||
510 | /* | ||
511 | * Note: the chips support a maximum MTU of 4096, but the driver | ||
512 | * hasn't implemented this feature yet, so don't allow Path MTU | ||
513 | * values greater than 2048. | ||
514 | */ | ||
510 | if (attr_mask & IB_QP_PATH_MTU) | 515 | if (attr_mask & IB_QP_PATH_MTU) |
511 | if (attr->path_mtu > IB_MTU_4096) | 516 | if (attr->path_mtu > IB_MTU_2048) |
512 | goto inval; | 517 | goto inval; |
513 | 518 | ||
514 | if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) | 519 | if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) |
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c index bb70845279b8..980b64add321 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs.c | |||
@@ -1051,7 +1051,12 @@ static int ipath_query_port(struct ib_device *ibdev, | |||
1051 | props->max_vl_num = 1; /* VLCap = VL0 */ | 1051 | props->max_vl_num = 1; /* VLCap = VL0 */ |
1052 | props->init_type_reply = 0; | 1052 | props->init_type_reply = 0; |
1053 | 1053 | ||
1054 | props->max_mtu = IB_MTU_4096; | 1054 | /* |
1055 | * Note: the chips support a maximum MTU of 4096, but the driver | ||
1056 | * hasn't implemented this feature yet, so set the maximum value | ||
1057 | * to 2048. | ||
1058 | */ | ||
1059 | props->max_mtu = IB_MTU_2048; | ||
1055 | switch (dev->dd->ipath_ibmtu) { | 1060 | switch (dev->dd->ipath_ibmtu) { |
1056 | case 4096: | 1061 | case 4096: |
1057 | mtu = IB_MTU_4096; | 1062 | mtu = IB_MTU_4096; |