OSDN Git Service

IB/ipoib: Ensure that MTU isn't less than minimum permitted
authorMuhammad Sammar <muhammads@mellanox.com>
Tue, 28 Aug 2018 11:45:30 +0000 (14:45 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 6 Sep 2018 19:35:16 +0000 (13:35 -0600)
commit142a9c287613560edf5a03c8d142c8b6ebc1995b
tree8b1167864971972ae90d84e7a43da815748a1c55
parent6c75520f7e5a6a353f3b332509d205e213d05855
IB/ipoib: Ensure that MTU isn't less than minimum permitted

It is illegal to change MTU to a value lower than the minimum MTU
stated in ethernet spec. In addition to that we need to add 4 bytes
for encapsulation header (IPOIB_ENCAP_LEN).

Before "ifconfig ib0 mtu 0" command, succeeds while it obviously shouldn't.

Signed-off-by: Muhammad Sammar <muhammads@mellanox.com>
Reviewed-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/ulp/ipoib/ipoib_main.c