From: Amir Vadai <amirv@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>,
Amir Vadai <amirv@mellanox.com>,
Eugenia Emantayev <eugenia@mellanox.co.il>,
Eugenia Emantayev <eugenia@mellanox.com>,
Jack Morgenstein <jackm@dev.mellanox.com>
Subject: [PATCH net-next 3/3] net/mlx4_en: set correct MTU in SRIOV
Date: Thu, 11 Apr 2013 14:56:42 +0300 [thread overview]
Message-ID: <1365681402-19445-4-git-send-email-amirv@mellanox.com> (raw)
In-Reply-To: <1365681402-19445-1-git-send-email-amirv@mellanox.com>
From: Eugenia Emantayev <eugenia@mellanox.co.il>
When setting MTU in SRIOV mode add ETH, VLAN and FCS header length
to the maximum MTU obtained from QUERY_DEV_CAP.
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/port.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 10c57c8..4b6aad3 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -32,6 +32,7 @@
#include <linux/errno.h>
#include <linux/if_ether.h>
+#include <linux/if_vlan.h>
#include <linux/export.h>
#include <linux/mlx4/cmd.h>
@@ -517,7 +518,8 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
/* Mtu is configured as the max MTU among all the
* the functions on the port. */
mtu = be16_to_cpu(gen_context->mtu);
- mtu = min_t(int, mtu, dev->caps.eth_mtu_cap[port]);
+ mtu = min_t(int, mtu, dev->caps.eth_mtu_cap[port] +
+ ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
prev_mtu = slave_st->mtu[port];
slave_st->mtu[port] = mtu;
if (mtu > master->max_mtu[port])
--
1.7.8.2
next prev parent reply other threads:[~2013-04-11 12:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 11:56 [PATCH net-next 0/3] Mellanox Ethernet driver updates 2013-04-11 Amir Vadai
2013-04-11 11:56 ` [PATCH net-next 1/3] net/mlx4_core: Add helper function to translate B0 steering rules to DMFS Amir Vadai
2013-04-11 11:56 ` [PATCH net-next 2/3] net/mlx4_core: Translate guest " Amir Vadai
2013-04-11 11:56 ` Amir Vadai [this message]
2013-04-11 20:13 ` [PATCH net-next 0/3] Mellanox Ethernet driver updates 2013-04-11 David Miller
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=1365681402-19445-4-git-send-email-amirv@mellanox.com \
--to=amirv@mellanox.com \
--cc=davem@davemloft.net \
--cc=eugenia@mellanox.co.il \
--cc=eugenia@mellanox.com \
--cc=jackm@dev.mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.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).