Skip to content

Commit

Permalink
qlcnic: set mtu lower limit
Browse files Browse the repository at this point in the history
Setting mtu < 68 is not supported.

Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sritej Velaga authored and David S. Miller committed Oct 5, 2010
1 parent aef3d89 commit 0bd9e6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions drivers/net/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
#define FIRST_PAGE_GROUP_END 0x100000

#define P3_MAX_MTU (9600)
#define P3_MIN_MTU (68)
#define QLCNIC_MAX_ETHERHDR 32 /* This contains some padding */

#define QLCNIC_P3_RX_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + ETH_DATA_LEN)
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/qlcnic/qlcnic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,9 +758,9 @@ int qlcnic_change_mtu(struct net_device *netdev, int mtu)
struct qlcnic_adapter *adapter = netdev_priv(netdev);
int rc = 0;

if (mtu > P3_MAX_MTU) {
dev_err(&adapter->netdev->dev, "mtu > %d bytes unsupported\n",
P3_MAX_MTU);
if (mtu < P3_MIN_MTU || mtu > P3_MAX_MTU) {
dev_err(&adapter->netdev->dev, "%d bytes < mtu < %d bytes"
" not supported\n", P3_MAX_MTU, P3_MIN_MTU);
return -EINVAL;
}

Expand Down

0 comments on commit 0bd9e6a

Please sign in to comment.