diff options
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_fcoe.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 0eec4e092554..aab55e24cb7b 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -661,31 +661,6 @@ static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev) | |||
661 | return 0; | 661 | return 0; |
662 | } | 662 | } |
663 | 663 | ||
664 | static int bnx2fc_mfs_update(struct fc_lport *lport) | ||
665 | { | ||
666 | struct fcoe_port *port = lport_priv(lport); | ||
667 | struct bnx2fc_hba *hba = port->priv; | ||
668 | struct net_device *netdev = hba->netdev; | ||
669 | u32 mfs; | ||
670 | u32 max_mfs; | ||
671 | |||
672 | mfs = netdev->mtu - (sizeof(struct fcoe_hdr) + | ||
673 | sizeof(struct fcoe_crc_eof)); | ||
674 | max_mfs = BNX2FC_MAX_PAYLOAD + sizeof(struct fc_frame_header); | ||
675 | BNX2FC_HBA_DBG(lport, "mfs = %d, max_mfs = %d\n", mfs, max_mfs); | ||
676 | if (mfs > max_mfs) | ||
677 | mfs = max_mfs; | ||
678 | |||
679 | /* Adjust mfs to be a multiple of 256 bytes */ | ||
680 | mfs = (((mfs - sizeof(struct fc_frame_header)) / BNX2FC_MIN_PAYLOAD) * | ||
681 | BNX2FC_MIN_PAYLOAD); | ||
682 | mfs = mfs + sizeof(struct fc_frame_header); | ||
683 | |||
684 | BNX2FC_HBA_DBG(lport, "Set MFS = %d\n", mfs); | ||
685 | if (fc_set_mfs(lport, mfs)) | ||
686 | return -EINVAL; | ||
687 | return 0; | ||
688 | } | ||
689 | static void bnx2fc_link_speed_update(struct fc_lport *lport) | 664 | static void bnx2fc_link_speed_update(struct fc_lport *lport) |
690 | { | 665 | { |
691 | struct fcoe_port *port = lport_priv(lport); | 666 | struct fcoe_port *port = lport_priv(lport); |
@@ -754,7 +729,7 @@ static int bnx2fc_net_config(struct fc_lport *lport) | |||
754 | !hba->phys_dev->ethtool_ops->get_pauseparam) | 729 | !hba->phys_dev->ethtool_ops->get_pauseparam) |
755 | return -EOPNOTSUPP; | 730 | return -EOPNOTSUPP; |
756 | 731 | ||
757 | if (bnx2fc_mfs_update(lport)) | 732 | if (fc_set_mfs(lport, BNX2FC_MFS)) |
758 | return -EINVAL; | 733 | return -EINVAL; |
759 | 734 | ||
760 | skb_queue_head_init(&port->fcoe_pending_queue); | 735 | skb_queue_head_init(&port->fcoe_pending_queue); |
@@ -825,14 +800,6 @@ static void bnx2fc_indicate_netevent(void *context, unsigned long event) | |||
825 | if (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state)) | 800 | if (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state)) |
826 | printk(KERN_ERR "indicate_netevent: "\ | 801 | printk(KERN_ERR "indicate_netevent: "\ |
827 | "adapter is not UP!!\n"); | 802 | "adapter is not UP!!\n"); |
828 | /* fall thru to update mfs if MTU has changed */ | ||
829 | case NETDEV_CHANGEMTU: | ||
830 | BNX2FC_HBA_DBG(lport, "NETDEV_CHANGEMTU event\n"); | ||
831 | bnx2fc_mfs_update(lport); | ||
832 | mutex_lock(&lport->lp_mutex); | ||
833 | list_for_each_entry(vport, &lport->vports, list) | ||
834 | bnx2fc_mfs_update(vport); | ||
835 | mutex_unlock(&lport->lp_mutex); | ||
836 | break; | 803 | break; |
837 | 804 | ||
838 | case NETDEV_DOWN: | 805 | case NETDEV_DOWN: |