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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 16:59:47 +0000 (17:59 +0100)
commite30fb85862cd4f4cde55b9212a73297446d652e4
tree1664ad2aac9e6ac6accde882193b056b73c91225
parent1b8331e7dbe2688b59c921a3bf53ec26b5cb2de6
IB/ipoib: Ensure that MTU isn't less than minimum permitted

[ Upstream commit 142a9c287613560edf5a03c8d142c8b6ebc1995b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/ulp/ipoib/ipoib_main.c