From: Shannon Nelson Date: Thu, 27 Aug 2020 23:00:19 +0000 (-0700) Subject: ionic: set MTU floor at ETH_MIN_MTU X-Git-Tag: v5.10-rc1~107^2~419^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eba8760948ba04a0909e9c40d552d7fbc6bfb7d3;p=thirdparty%2Fkernel%2Flinux.git ionic: set MTU floor at ETH_MIN_MTU The NIC might tell us its minimum MTU, but let's be sure not to use something smaller than ETH_MIN_MTU. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 26988ad7ec979..235215c28f299 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2079,7 +2079,8 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index lif->identity = lid; lif->lif_type = IONIC_LIF_TYPE_CLASSIC; ionic_lif_identify(ionic, lif->lif_type, lif->identity); - lif->netdev->min_mtu = le32_to_cpu(lif->identity->eth.min_frame_size); + lif->netdev->min_mtu = max_t(unsigned int, ETH_MIN_MTU, + le32_to_cpu(lif->identity->eth.min_frame_size)); lif->netdev->max_mtu = le32_to_cpu(lif->identity->eth.max_frame_size) - ETH_HLEN - VLAN_HLEN;