On Mon, Oct 09, 2017 at 09:34:33AM -0400, Doug Ledford wrote: > On Thu, 2017-09-21 at 02:20 +0000, Parav Pandit wrote: > > > From: linux-rdma-owner@xxxxxxxxxxxxxxx [mailto:linux-rdma- > > > owner@xxxxxxxxxxxxxxx] On Behalf Of Roland Dreier > > > Sent: Wednesday, September 20, 2017 7:39 PM > > > To: linux-rdma@xxxxxxxxxxxxxxx > > > Subject: Is ib_mtu iboe_get_mtu() slightly off? > > > > > > We have: > > > > > > static inline enum ib_mtu iboe_get_mtu(int mtu) { > > > /* > > > * reduce IB headers from effective IBoE MTU. 28 stands for > > > * atomic header which is the biggest possible header after > > > BTH > > > */ > > > mtu = mtu - IB_GRH_BYTES - IB_BTH_BYTES - 28; > > > ... > > > > > > 28 bytes is the size of the AtomicETH header. But couldn't we have > > > a packet > > > with both AtomicETH and XRCETH (4 more bytes)? > > > > XRCETH + AtomicETH is possible. > > Additionally I guess 4 bytes of ICRC is missing too in calculation. > > Since no one rolled a patch for this, I did. > Doug, Parav created, I waited for our shared code. https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?h=rdma-next&id=51ed6735dd59008aea4d7308416ed994b277f168 commit 51ed6735dd59008aea4d7308416ed994b277f168 Author: Parav Pandit <parav@xxxxxxxxxxxx> Date: Thu Oct 5 10:33:12 2017 -0500 IB/core: Take into account optional XRC header and mandatory ICRC for RoCE MTU This fix considers optional XRC header size and mandatory ICRC 4 bytes in calculation of path MTU, by considering additional 8 bytes, path MTU calculation is more accurate. Link: https://www.spinics.net/lists/linux-rdma/msg54558.html Fixes: 3c86aa70bf67 ("RDMA/cm: Add RDMA CM support for IBoE devices") Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx> Reviewed-by: Daniel Jurgens <danielj@xxxxxxxxxxxx> Reported-by: Roland Dreier <roland@xxxxxxxxxxxxxxx> Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx> Thanks
Attachment:
signature.asc
Description: PGP signature