Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195709
b: refs/heads/master
c: 5e4f8fe
h: refs/heads/master
i:
  195707: 1c53593
v: v3
  • Loading branch information
Robert Love authored and James Bottomley committed May 17, 2010
1 parent fef9661 commit 134bbf1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d29510a2968f87eaf455c606cd8802b6f8a0774b
refs/heads/master: 5e4f8fe7b58f4da5043b7f219fe9193cddd9262e
42 changes: 29 additions & 13 deletions trunk/drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static int fcoe_rcv(struct sk_buff *, struct net_device *,
static int fcoe_percpu_receive_thread(void *);
static void fcoe_clean_pending_queue(struct fc_lport *);
static void fcoe_percpu_clean(struct fc_lport *);
static int fcoe_link_speed_update(struct fc_lport *);
static int fcoe_link_ok(struct fc_lport *);

static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *);
Expand Down Expand Up @@ -631,6 +632,8 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev)
port->fcoe_pending_queue_active = 0;
setup_timer(&port->timer, fcoe_queue_timer, (unsigned long)lport);

fcoe_link_speed_update(lport);

if (!lport->vport) {
/*
* Use NAA 1&2 (FC-FS Rev. 2.0, Sec. 15) to generate WWNN/WWPN:
Expand Down Expand Up @@ -1829,6 +1832,9 @@ static int fcoe_device_notification(struct notifier_block *notifier,
FCOE_NETDEV_DBG(netdev, "Unknown event %ld "
"from netdev netlink\n", event);
}

fcoe_link_speed_update(lport);

if (link_possible && !fcoe_link_ok(lport))
fcoe_ctlr_link_up(&fcoe->ctlr);
else if (fcoe_ctlr_link_down(&fcoe->ctlr)) {
Expand Down Expand Up @@ -2128,26 +2134,19 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
}

/**
* fcoe_link_ok() - Check if the link is OK for a local port
* @lport: The local port to check link on
*
* Any permanently-disqualifying conditions have been previously checked.
* This also updates the speed setting, which may change with link for 100/1000.
*
* This function should probably be checking for PAUSE support at some point
* in the future. Currently Per-priority-pause is not determinable using
* ethtool, so we shouldn't be restrictive until that problem is resolved.
*
* Returns: 0 if link is OK for use by FCoE.
* fcoe_link_speed_update() - Update the supported and actual link speeds
* @lport: The local port to update speeds for
*
* Returns: 0 if the ethtool query was successful
* -1 if the ethtool query failed
*/
int fcoe_link_ok(struct fc_lport *lport)
int fcoe_link_speed_update(struct fc_lport *lport)
{
struct fcoe_port *port = lport_priv(lport);
struct net_device *netdev = port->fcoe->netdev;
struct ethtool_cmd ecmd = { ETHTOOL_GSET };

if (netif_oper_up(netdev) && !dev_ethtool_get_settings(netdev, &ecmd)) {
if (!dev_ethtool_get_settings(netdev, &ecmd)) {
lport->link_supported_speeds &=
~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT);
if (ecmd.supported & (SUPPORTED_1000baseT_Half |
Expand All @@ -2166,6 +2165,23 @@ int fcoe_link_ok(struct fc_lport *lport)
return -1;
}

/**
* fcoe_link_ok() - Check if the link is OK for a local port
* @lport: The local port to check link on
*
* Returns: 0 if link is UP and OK, -1 if not
*
*/
int fcoe_link_ok(struct fc_lport *lport)
{
struct fcoe_port *port = lport_priv(lport);
struct net_device *netdev = port->fcoe->netdev;

if (netif_oper_up(netdev))
return 0;
return -1;
}

/**
* fcoe_percpu_clean() - Clear all pending skbs for an local port
* @lport: The local port whose skbs are to be cleared
Expand Down

0 comments on commit 134bbf1

Please sign in to comment.