From: Jeff Kirsher <jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org
Cc: linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jeff Kirsher
<jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
gospo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
devel-s9riP+hp16TNLxjTenLetw@public.gmane.org
Subject: [net-next-2.6 PATCH 5/5] fcoe: Use NETIF_F_FCOE_MTU flag to set up max frame size (lport->mfs)
Date: Wed, 22 Jul 2009 16:29:57 -0700 [thread overview]
Message-ID: <20090722232956.26937.24429.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090722232759.26937.78765.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
From: Yi Zou <yi.zou-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Add a define of FCOE_MTU as 2158 bytes and use FCOE_MTU when the LLD is found
to support NETIF_F_FCOE_MTU. The lport->mfs is then calculated out of the
2158 FCOE_MTU. Otherwise, we stick with the netdev->mtu, i.e., LAN MTU. Also,
change the notification on NETDEV_CHANGEMTU event to bypass changing mfs when
LAN MTU is changed if NETIF_F_FCOE_MTU is supported.
Signed-off-by: Yi Zou <yi.zou-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/scsi/fcoe/fcoe.c | 11 +++++++++--
drivers/scsi/fcoe/fcoe.h | 4 ++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 0a5609b..e0a885c 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -291,8 +291,13 @@ static int fcoe_netdev_config(struct fc_lport *lp, struct net_device *netdev)
* user-configured limit. If the MFS is too low, fcoe_link_ok()
* will return 0, so do this first.
*/
- mfs = fc->real_dev->mtu - (sizeof(struct fcoe_hdr) +
- sizeof(struct fcoe_crc_eof));
+ mfs = fc->real_dev->mtu;
+ if (fc->phys_dev->features & NETIF_F_FCOE_MTU) {
+ mfs = FCOE_MTU;
+ printk(KERN_DEBUG "fcoe:%s supports FCOE_MTU of %d bytes\n",
+ netdev->name, mfs);
+ }
+ mfs -= (sizeof(struct fcoe_hdr) + sizeof(struct fcoe_crc_eof));
if (fc_set_mfs(lp, mfs))
return -EINVAL;
@@ -1420,6 +1425,8 @@ static int fcoe_device_notification(struct notifier_block *notifier,
case NETDEV_CHANGE:
break;
case NETDEV_CHANGEMTU:
+ if (fc->phys_dev->features & NETIF_F_FCOE_MTU)
+ break;
mfs = fc->real_dev->mtu -
(sizeof(struct fcoe_hdr) +
sizeof(struct fcoe_crc_eof));
diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h
index 0d724fa..be9735d 100644
--- a/drivers/scsi/fcoe/fcoe.h
+++ b/drivers/scsi/fcoe/fcoe.h
@@ -64,6 +64,10 @@ do { \
printk(KERN_INFO "fcoe: %s" fmt, \
netdev->name, ##args);)
+/* Max MTU for FCoE: 14 (FCoE header) + 24 (FC header) + 2112 (max FC payload)
+ * + 4 (FC CRC) + 4 (FCoE trailer) = 2158 bytes */
+#define FCOE_MTU 2158
+
/*
* this percpu struct for fcoe
*/
next prev parent reply other threads:[~2009-07-22 23:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 23:28 [net-next-2.6 PATCH 1/5] vlan: adds fcoe offload related net_device_ops and updates fcoe_ddp_xid field Jeff Kirsher
[not found] ` <20090722232759.26937.78765.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-07-22 23:28 ` [net-next-2.6 PATCH 2/5] ixgbe: updates vlan feature flags to enable FCoE offloads on vlan interface Jeff Kirsher
2009-07-22 23:29 ` [net-next-2.6 PATCH 3/5] net: Add NETIF_F_FCOE_MTU to indicate support for a different MTU for FCoE Jeff Kirsher
2009-07-22 23:29 ` [net-next-2.6 PATCH 4/5] ixgbe: Add support for NETIF_F_FCOE_MTU to 82599 devices Jeff Kirsher
2009-07-22 23:29 ` Jeff Kirsher [this message]
2009-07-23 18:27 ` [Open-FCoE] [net-next-2.6 PATCH 5/5] fcoe: Use NETIF_F_FCOE_MTU flag to set up max frame size (lport->mfs) Robert Love
2009-07-23 18:40 ` David Miller
[not found] ` <20090723.114002.51085260.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-07-23 18:48 ` Robert Love
2009-07-26 16:44 ` David Miller
[not found] ` <20090726.094402.38463748.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-07-27 16:44 ` Zou, Yi
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=20090722232956.26937.24429.stgit@localhost.localdomain \
--to=jeffrey.t.kirsher-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devel-s9riP+hp16TNLxjTenLetw@public.gmane.org \
--cc=gospo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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).