From: Amit Kumar Salecha <amit.salecha@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, ameen.rahman@qlogic.com,
anirban.chakraborty@qlogic.com,
Sritej Velaga <sritej.velaga@qlogic.com>
Subject: [PATCHv2 NEXT 8/8] qlcnic: set mtu lower limit
Date: Mon, 4 Oct 2010 07:20:16 -0700 [thread overview]
Message-ID: <1286202016-18026-9-git-send-email-amit.salecha@qlogic.com> (raw)
In-Reply-To: <1286202016-18026-1-git-send-email-amit.salecha@qlogic.com>
From: Sritej Velaga <sritej.velaga@qlogic.com>
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>
---
drivers/net/qlcnic/qlcnic.h | 1 +
drivers/net/qlcnic/qlcnic_hw.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 9d80171..42a2883 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -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)
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index 712cfab..9d3e16d 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -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;
}
--
1.6.3.3
next prev parent reply other threads:[~2010-10-04 14:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-04 14:20 [PATCHv2 NEXT 0/8]qlcnic: miscellaneous fixes Amit Kumar Salecha
2010-10-04 14:20 ` [PATCHv2 NEXT 1/8] qlcnic: fix internal loopback test Amit Kumar Salecha
2010-10-04 14:20 ` [PATCHv2 NEXT 2/8] qlcnic: fix eswitch stats Amit Kumar Salecha
2010-10-04 14:20 ` [PATCHv2 NEXT 3/8] qlcnic: fix diag register Amit Kumar Salecha
2010-10-04 14:20 ` [PATCHv2 NEXT 4/8] qlcnic: fix endianess for lro Amit Kumar Salecha
2010-10-04 14:20 ` [PATCHv2 NEXT 5/8] qlcnic: fix vlan TSO on big endian machine Amit Kumar Salecha
2010-10-04 14:20 ` [PATCHv2 NEXT 6/8] qlcnic: sparse warning fixes Amit Kumar Salecha
2010-10-04 14:20 ` [PATCHv2 NEXT 7/8] qlcnic: cleanup port mode setting Amit Kumar Salecha
2010-10-04 14:20 ` Amit Kumar Salecha [this message]
2010-10-05 1:44 ` [PATCH net-next] qlcnic: remove dead code Stephen Hemminger
2010-10-05 6:18 ` Anirban Chakraborty
2010-10-05 7:48 ` David Miller
2010-10-05 5:48 ` [PATCHv2 NEXT 0/8]qlcnic: miscellaneous fixes David Miller
[not found] <1286205297-23214-1-git-send-email-amit.salecha@qlogic.com>
2010-10-04 15:14 ` [PATCHv2 NEXT 8/8] qlcnic: set mtu lower limit Amit Kumar Salecha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1286202016-18026-9-git-send-email-amit.salecha@qlogic.com \
--to=amit.salecha@qlogic.com \
--cc=ameen.rahman@qlogic.com \
--cc=anirban.chakraborty@qlogic.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sritej.velaga@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).