diff options
author | Dave Olson <dave.olson@qlogic.com> | 2008-04-17 00:01:12 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-04-17 00:01:12 -0400 |
commit | 826d801009fb3c82832f2d92149446cce354bf61 (patch) | |
tree | 564534dee75be00b019b78b130ec6eb7e5a81e7d /drivers/infiniband/hw/ipath/ipath_init_chip.c | |
parent | 5d1ce03dd335abaef50dc615137cac2a22c5cee0 (diff) |
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 <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_init_chip.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_init_chip.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c index 5428affa9102..f0d7848d9bb1 100644 --- a/drivers/infiniband/hw/ipath/ipath_init_chip.c +++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c | |||
@@ -155,24 +155,13 @@ static int bringup_link(struct ipath_devdata *dd) | |||
155 | dd->ipath_control); | 155 | dd->ipath_control); |
156 | 156 | ||
157 | /* | 157 | /* |
158 | * Note that prior to try 14 or 15 of IB, the credit scaling | 158 | * set initial max size pkt IBC will send, including ICRC; it's the |
159 | * wasn't working, because it was swapped for writes with the | 159 | * PIO buffer size in dwords, less 1; also see ipath_set_mtu() |
160 | * 1 bit default linkstate field | ||
161 | */ | 160 | */ |
161 | val = (dd->ipath_ibmaxlen >> 2) + 1; | ||
162 | ibc = val << dd->ibcc_mpl_shift; | ||
162 | 163 | ||
163 | /* ignore pbc and align word */ | 164 | /* flowcontrolwatermark is in units of KBytes */ |
164 | val = dd->ipath_piosize2k - 2 * sizeof(u32); | ||
165 | /* | ||
166 | * for ICRC, which we only send in diag test pkt mode, and we | ||
167 | * don't need to worry about that for mtu | ||
168 | */ | ||
169 | val += 1; | ||
170 | /* | ||
171 | * Set the IBC maxpktlength to the size of our pio buffers the | ||
172 | * maxpktlength is in words. This is *not* the IB data MTU. | ||
173 | */ | ||
174 | ibc = (val / sizeof(u32)) << INFINIPATH_IBCC_MAXPKTLEN_SHIFT; | ||
175 | /* in KB */ | ||
176 | ibc |= 0x5ULL << INFINIPATH_IBCC_FLOWCTRLWATERMARK_SHIFT; | 165 | ibc |= 0x5ULL << INFINIPATH_IBCC_FLOWCTRLWATERMARK_SHIFT; |
177 | /* | 166 | /* |
178 | * How often flowctrl sent. More or less in usecs; balance against | 167 | * How often flowctrl sent. More or less in usecs; balance against |
@@ -295,12 +284,9 @@ static int init_chip_first(struct ipath_devdata *dd, | |||
295 | val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiosize); | 284 | val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiosize); |
296 | dd->ipath_piosize2k = val & ~0U; | 285 | dd->ipath_piosize2k = val & ~0U; |
297 | dd->ipath_piosize4k = val >> 32; | 286 | dd->ipath_piosize4k = val >> 32; |
298 | /* | 287 | if (dd->ipath_piosize4k == 0 && ipath_mtu4096) |
299 | * Note: the chips support a maximum MTU of 4096, but the driver | 288 | ipath_mtu4096 = 0; /* 4KB not supported by this chip */ |
300 | * hasn't implemented this feature yet, so set the initial value | 289 | dd->ipath_ibmtu = ipath_mtu4096 ? 4096 : 2048; |
301 | * to 2048. | ||
302 | */ | ||
303 | dd->ipath_ibmtu = 2048; | ||
304 | val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiobufcnt); | 290 | val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_sendpiobufcnt); |
305 | dd->ipath_piobcnt2k = val & ~0U; | 291 | dd->ipath_piobcnt2k = val & ~0U; |
306 | dd->ipath_piobcnt4k = val >> 32; | 292 | dd->ipath_piobcnt4k = val >> 32; |