Commit 0bd9e6a9 authored by Sritej Velaga's avatar Sritej Velaga Committed by David S. Miller

qlcnic: set mtu lower limit

Setting mtu < 68 is not supported.
Signed-off-by: default avatarSritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aef3d898
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
#define FIRST_PAGE_GROUP_END 0x100000 #define FIRST_PAGE_GROUP_END 0x100000
#define P3_MAX_MTU (9600) #define P3_MAX_MTU (9600)
#define P3_MIN_MTU (68)
#define QLCNIC_MAX_ETHERHDR 32 /* This contains some padding */ #define QLCNIC_MAX_ETHERHDR 32 /* This contains some padding */
#define QLCNIC_P3_RX_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + ETH_DATA_LEN) #define QLCNIC_P3_RX_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + ETH_DATA_LEN)
......
...@@ -758,9 +758,9 @@ int qlcnic_change_mtu(struct net_device *netdev, int mtu) ...@@ -758,9 +758,9 @@ int qlcnic_change_mtu(struct net_device *netdev, int mtu)
struct qlcnic_adapter *adapter = netdev_priv(netdev); struct qlcnic_adapter *adapter = netdev_priv(netdev);
int rc = 0; int rc = 0;
if (mtu > P3_MAX_MTU) { if (mtu < P3_MIN_MTU || mtu > P3_MAX_MTU) {
dev_err(&adapter->netdev->dev, "mtu > %d bytes unsupported\n", dev_err(&adapter->netdev->dev, "%d bytes < mtu < %d bytes"
P3_MAX_MTU); " not supported\n", P3_MAX_MTU, P3_MIN_MTU);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment