The max FC payload is 2112 bytes, therefore the FCoE specific MTU is: 14(FCoE header)+24+2112+4(FC header, payload, crc)+4(FCoE EOF)=2158 bytes.
In this patch, we will use the lport->seq_offload flag as an indication for enabling the baby jumbo frame for FCoE with an MTU of 2158 bytes when FCoE offload is turned on. Note that seq_offload is on iff NETIF_F_FSO is set and it is the LLD's job to make sure the receive buffer is allocated big enough to support baby jumbo frame for FCoE. This patch is expected to be applied to openfc/fcoe-features.git Signed-off-by: Yi Zou <[email protected]> --- drivers/scsi/fcoe/fcoe.c | 22 +++++++++------------- drivers/scsi/fcoe/fcoe.h | 2 ++ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 0a5609b..6f66a10 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -286,16 +286,6 @@ static int fcoe_netdev_config(struct fc_lport *lp, struct net_device *netdev) return -EOPNOTSUPP; } - /* - * Determine max frame size based on underlying device and optional - * 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)); - if (fc_set_mfs(lp, mfs)) - return -EINVAL; - /* offload features support */ if (fc->real_dev->features & NETIF_F_SG) lp->sg_supp = 1; @@ -320,6 +310,13 @@ static int fcoe_netdev_config(struct fc_lport *lp, struct net_device *netdev) FCOE_NETDEV_DBG(netdev, "Supports LRO for max xid 0x%x\n", lp->lro_xid); } + /* Determine max frame size. When offload is enabled, assume LLD + * supports the mtu of 2158 bytes to accomodate 2112 FC payload */ + mfs = (lp->seq_offload ? FCOE_MTU : fc->real_dev->mtu) - + sizeof(struct fcoe_hdr) - sizeof(struct fcoe_crc_eof); + if (fc_set_mfs(lp, mfs)) + return -EINVAL; + skb_queue_head_init(&fc->fcoe_pending_queue); fc->fcoe_pending_queue_active = 0; setup_timer(&fc->timer, fcoe_queue_timer, (unsigned long)lp); @@ -1420,9 +1417,8 @@ static int fcoe_device_notification(struct notifier_block *notifier, case NETDEV_CHANGE: break; case NETDEV_CHANGEMTU: - mfs = fc->real_dev->mtu - - (sizeof(struct fcoe_hdr) + - sizeof(struct fcoe_crc_eof)); + mfs = (lp->seq_offload ? FCOE_MTU : fc->real_dev->mtu) - + sizeof(struct fcoe_hdr) - sizeof(struct fcoe_crc_eof); if (mfs >= FC_MIN_MAX_FRAME) fc_set_mfs(lp, mfs); break; diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h index 0d724fa..ebab762 100644 --- a/drivers/scsi/fcoe/fcoe.h +++ b/drivers/scsi/fcoe/fcoe.h @@ -40,6 +40,8 @@ #define FCOE_MIN_XID 0x0001 /* the min xid supported by fcoe_sw */ #define FCOE_MAX_XID 0x07ef /* the max xid supported by fcoe_sw */ +#define FCOE_MTU 2158 /* 14 + 24 + 2112 + 4 + 4 = 2158 */ + unsigned int fcoe_debug_logging; module_param_named(debug_logging, fcoe_debug_logging, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels"); _______________________________________________ devel mailing list [email protected] http://www.open-fcoe.org/mailman/listinfo/devel
