aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/pensando
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2020-08-27 16:00:19 -0700
committerDavid S. Miller <davem@davemloft.net>2020-08-28 08:01:29 -0700
commiteba8760948ba04a0909e9c40d552d7fbc6bfb7d3 (patch)
tree076da95864741d683cd318b40e9070450531a43a /drivers/net/ethernet/pensando
parentMerge branch 'Enable-Fiber-on-DP83822-PHY' (diff)
downloadlinux-dev-eba8760948ba04a0909e9c40d552d7fbc6bfb7d3.tar.xz
linux-dev-eba8760948ba04a0909e9c40d552d7fbc6bfb7d3.zip
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 <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_lif.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index 26988ad7ec97..235215c28f29 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;