26 Oct, 2010

3 commits

  • A previous patch attempted to validate the destination
    MAC address of a FCoE frame by checking that MAC
    address against the received port's MAC address. The
    implementation seems fine on the surface, but any
    VN_Ports added using the NPIV feature will have their
    own MAC addresses and these MACs were not being checked,
    which prevented any NPIV VN_Ports from receiving frames.

    In other words, the following patch has broken NPIV.

    519e5135e2537c9dbc1cbcc0891b0a936ff5dcd2
    [SCSI] fcoe: adds src and dest mac address
    checking for fcoe frames

    Part of the offending patch is correct, but the part
    that broke NPIV was attempting to satisfy FC-BB-5
    section D.5, 2.1-

    (discard frames that) "contain a destination MAC
    address/destination N_Port_ID pair that was not
    assigned by an FCF to one of the VN_Ports on the ENode"

    The language does _not_ say to compare the destination
    FC-MAP/destination N_Port_ID, but instead to compare
    the destination MAC address/destination N_Port_ID.

    >From the FC-BB-5 specification,

    "A properly formed FPMA is one in which the 24 most
    significant bits equal the Fabric’s FC-MAP value and
    the least significant 24 bits equal the N_Port_ID
    assigned to the VN_Port by the FCF."

    This means that we need to compare the FC Frame's
    destination FCID against the embedded FCID in the
    destination MAC address. This patch checks the lower
    24 bits of the destination MAC address against
    destination FCID in the Fibre Channel frame.

    For MAC validation the first line of defense is the
    hardware MAC filtering. Each VN_Port will have a
    unicast MAC addresses added to the hardware's
    filtering table. The Ethernet driver should drop any
    MACs not destined for a programmed MAC. This patch
    adds a second line of defense that very specfically
    compares an element in the FC frame against an element
    in the Ethernet header, which is appropriate for the
    FCoE layer.

    Many alternative approaches were considered, including
    a LLD callback from libfc. The second most reasonable
    approach seemed to be walking the list of NPIV ports
    and check each of their MAC addresses against the
    destination MAC address of the received frame. The
    problem with this approach was that it is likely that
    performance would suffer with the more NPIV ports added
    to the system since every received frame would need to
    walk this list, comparing each entry's MAC.

    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Robert Love
     
  • Fix: When FIP frame is received, function fcoe_ctlr_vn_recv calls function
    fcoe_ctlr_vn_parse which does memset for addr (&buf.rdata) which leads to
    memory corruption. Code was trying to treat "buf" as struct but it was defined
    as union. Fix is to change from union to struct for "buf" in function fcoe_ctlr_vn_recv.

    Technical Details: N/A

    Signed-off-by: Kiran Patil
    Acked-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Kiran Patil
     
  • Since sometimes current FIP_MODE_AUTO mode falls back to non-FIP
    mode while DCB link still getting ready in fabric mode with
    its peer switch, it falls back after few libfc flogi retries
    and that is not we want while working with FIP enabled
    switches in FABRIC mode, therefore sets default as FIP_MODE_FABRIC
    as discussed and agreed before in this mail thread
    http://www.open-fcoe.org/pipermail/devel/2010-August/010511.html

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev
     

05 Aug, 2010

2 commits

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (48 commits)
    Documentation: update broken web addresses.
    fix comment typo "choosed" -> "chosen"
    hostap:hostap_hw.c Fix typo in comment
    Fix spelling contorller -> controller in comments
    Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> Fault
    fs/Kconfig: Fix typo Userpace -> Userspace
    Removing dead MACH_U300_BS26
    drivers/infiniband: Remove unnecessary casts of private_data
    fs/ocfs2: Remove unnecessary casts of private_data
    libfc: use ARRAY_SIZE
    scsi: bfa: use ARRAY_SIZE
    drm: i915: use ARRAY_SIZE
    drm: drm_edid: use ARRAY_SIZE
    synclink: use ARRAY_SIZE
    block: cciss: use ARRAY_SIZE
    comment typo fixes: charater => character
    fix comment typos concerning "challenge"
    arm: plat-spear: fix typo in kerneldoc
    reiserfs: typo comment fix
    update email address
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (276 commits)
    [SCSI] zfcp: Trigger logging in the FCP channel on qdio error conditions
    [SCSI] zfcp: Introduce experimental support for DIF/DIX
    [SCSI] zfcp: Enable data division support for FCP devices
    [SCSI] zfcp: Prevent access on uninitialized memory.
    [SCSI] zfcp: Post events through FC transport class
    [SCSI] zfcp: Cleanup QDIO attachment and improve processing.
    [SCSI] zfcp: Cleanup function parameters for sbal value.
    [SCSI] zfcp: Use correct width for timer_interval field
    [SCSI] zfcp: Remove SCSI device when removing unit
    [SCSI] zfcp: Use memdup_user and kstrdup
    [SCSI] zfcp: Fix retry after failed "open port" erp action
    [SCSI] zfcp: Fail erp after timeout
    [SCSI] zfcp: Use forced_reopen in terminate_rport_io callback
    [SCSI] zfcp: Register SCSI devices after successful fc_remote_port_add
    [SCSI] zfcp: Do not try "forced close" when port is already closed
    [SCSI] zfcp: Do not unblock rport from REOPEN_PORT_FORCED
    [SCSI] sd: add support for runtime PM
    [SCSI] implement runtime Power Management
    [SCSI] convert to the new PM framework
    [SCSI] Unify SAM_ and SAM_STAT_ macros
    ...

    Linus Torvalds
     

28 Jul, 2010

22 commits

  • This check prevents FCF selection in NPV mode due to zero fabric name
    in that case and in turn flogi fails. Though NPV mode should not have
    this zero and should be fixed there also but spec also does not require
    initiator to ensure that fabric name must be non-zero, therefore dropping
    this check to get flogi working in NPV mode.

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • This reverts commit cc0136c2e9c10e889cb36e39710c0eb10707b396.

    That commit introduced vlan id info to WWPN but WWPN needs to
    remain static as an unique port identifier in the fabric, therefore
    variable fabric vlan id info doesn't need to be coded inside WWPN.

    After this revert, port arg to fcoe_wwn_from_mac is always zero
    but still leaving it as-is okay to later allow users to use NAA 2
    scheme with this additional port arg.

    Note with this patch, existing zoning using WWPN would require
    re-zoning this time only and later no more re-zoning due to any
    vlan id changes.

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • Currently, when FCoE netdev feature flags are toggled by the LLD, lport's
    corresponding flags are not updated. This causes the fc_fcp to still try to
    offload the I/O. This patch adds support of NETDEV_FEAT_CHANGE event in fcoe
    netdev device notification callback so we can update the lport offload flags
    appropriately.

    Signed-off-by: Yi Zou
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Yi Zou
     
  • Incoming requests shouldn't require a local exchange if we're
    just going to reply with one or two frames and don't expect
    anything further. Don't allocate exchanges for such requests
    until requested by the upper-layer protocol.

    The sequence is always NULL for new requests, so remove
    that as an argument to request handlers.

    Also change the first argument to lport->tt.seq_els_rsp_send
    from the sequence pointer to the received frame pointer, to
    supply the exchange IDs and destination ID info.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • Add module parameter create_vn2vn that behaves like the create
    parameter except that the new instance is created in FIP vn2vn mode.

    This can be replaced once we change create to allow modifying
    per-instance attributes before starting the instance.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • In VN2VN mode, map_dest means to use the default VN2VN OUI.
    Change code that uses the default FCoE OUI to use the one
    set in the fcoe_ctlr struct.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • When sending a FLOGI LS_ACC, which we only do in point-to-multipoint
    mode, the MAC descriptor should have the granted MAC set to
    0x0efd00 || D_ID.

    When sending an LS_RJT, there should be no MAC descriptor.

    When sending either an LS_ACC or LS_RJT, the subcode should indicate
    an reply, not a request.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • The FC-BB-6 committee is proposing a new FIP usage model called
    VN_port to VN_port mode. It allows VN_ports to discover each other
    over a loss-free L2 Ethernet without any FCF or Fibre-channel fabric
    services. This is point-to-multipoint. There is also a variant
    of this called point-to-point which provides for making sure there
    is just one pair of ports operating over the Ethernet fabric.

    We add these new states: VNMP_START, _PROBE1, _PROBE2, _CLAIM, and _UP.
    These usually go quickly in that sequence. After waiting a random
    amount of time up to 100 ms in START, we select a pseudo-random
    proposed locally-unique port ID and send out probes in states PROBE1
    and PROBE2, 100 ms apart. If no probe responses are heard, we
    proceed to CLAIM state 400 ms later and send a claim notification.
    We wait another 400 ms to receive claim responses, which give us
    a list of the other nodes on the network, including their FC-4
    capabilities. After another 400 ms we go to VNMP_UP state and
    should start interoperating with any of the nodes for whic we
    receivec claim responses. More details are in the spec.j

    Add the new mode as FIP_MODE_VN2VN. The driver must specify
    explicitly that it wants to operate in this mode. There is
    no automatic detection between point-to-multipoint and fabric
    mode, and the local port initialization is affected, so it isn't
    anticipated that there will ever be any such automatic switchover.

    It may eventually be possible to have both fabric and VN2VN
    modes on the same L2 network, which may be done by two separate
    local VN_ports (lports).

    When in VN2VN mode, FIP replaces libfc's fabric-oriented discovery
    module with its own simple code that adds remote ports as they
    are discovered from incoming claim notifications and responses.
    These hooks are placed by fcoe_disc_init().

    A linear list of discovered vn_ports is maintained under the
    fcoe_ctlr struct. It is expected to be short for now, and
    accessed infrequently. It is kept under RCU for lock-ordering
    reasons. The lport and/or rport mutexes may be held when we
    need to lookup a fcoe_vnport during an ELS send.

    Change fcoe_ctlr_encaps() to lookup the destination vn_port in
    the list of peers for the destination MAC address of the
    FIP-encapsulated frame.

    Add a new function fcoe_disc_init() to initialize just the
    discovery portion of libfcoe for VN2VN mode.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • Enhancement: add debug messages at all state transitions.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • There are three modes that libfcoe currently supports, and a new one
    is coming. Change the fcoe_ctlr_init() interface to add the mode
    desired. This should not change any functionality.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • It turns out most of the FIP work is now done from worker threads
    or process context now, so there's no need to use a spin lock.

    Change to use mutex instead of spin lock and delayed_work instead
    of a timer.

    This will make it nicer for the VN_port to VN_port feature that
    will interact more with the libfc layers requiring that
    spinlocks not be held.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • This is per FC-BB-5 Annex-D recommendation and per that
    if address checking fails then drop the frame.

    FIP code paths are already doing this so only needed for fcoe
    frames.

    The src address checking is limited to only fip mode since
    this might break non-fip mode used in p2p due to used OUI
    based addressing in some p2p code paths, going forward FIP
    will be the only mode, therefore limited this to only FIP
    mode so that it won't break non-fip p2p mode for now.

    -v2
    Removes FCOE packet type checking since fcoe_rcv is
    registered to receive only FCoE type packets from netdev
    and it is already checked by netdev.

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • The fc_fabric_logoff and fc_fabric_login are redundant
    here after recently added fcoe_ctlr_link_down/up to
    these functions, therefore this patch removes logoff
    and login to only use link down and up here. This works
    best for their current usages with fcoe DCB link down or up.

    This also works well to avoid EIO errors when fcoe DCB link
    goes down as lport state moves out of ready quickly from
    fcoe_ctlr_link_down and that allows re-queuing timed out IOs
    for this case also.

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • As per FC-BB-5 rev.2, section 7.8.7.1, strict ordering of FIP descriptors
    is required for ELS requests. Also, look for missing and duplicate critical
    descriptors.

    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • Clear virtual link for NPIV ports is now handled by resetting
    the matching vnport.

    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • As per FC-BB-5 rev 2, section 7.8.6.2, malformed FIP frame shall be
    discarded. Drop discovery adv, ELS and CLV's with duplicate critical
    descriptors.

    [Resending after incorporating Joe's review comments]

    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • Allow the D flag (indicating that keep-alives are not needed) to
    be updated dynamically from received FIP advertisements.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • keep alives are disabled due to fd_flags set and also
    stop updating keep alive values in that case.

    Update select fcf time only if fcf is not already selected or
    select time is not already determined from parse adv, and then
    have select time cleared only once after fcf is selected.

    Changed deadline check to time_after_eq() from time_after()
    since now next timeout will be on exact 2.5 times FKA followed
    by first advertisement.

    Signed-off-by: Vasu Dev
    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • [This patch has several improvements to the code in
    the fip timers. It hasn't been tested yet.
    I'm sending it out for review. Vasu, perhaps you can
    merge this with your patch and test it together.]

    The current code allows an advertisement to be used
    even if it has been 3 times the FCF keep-alive
    advertisement period (FKA) since one was received from
    that FCF. The spec. calls for 2.5 times FKA.

    Fix this and make sure we detect missed keep-alives promptly.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • Host does not send discovery solicitation messages if Disc. Adv
    from FCF are dropped. It restarts sending solicitation only
    after receiving a Discovery Adv. from FCF. Fix is to restart
    solicitation immediately after CVL processing.

    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • Avoid infinite loop while processing FIP ELS or discovery
    advertisement with non-critical descriptors.

    Signed-off-by: Bhanu Prakash Gollapudi
    Acked-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     
  • A check in fcoe_ctlr_send_keep_alive() returns if there's no
    port_id for the local port. This could miss a keep alive if
    we just did a host reset and have logged off and will log back in.

    Return only if we are doing the port keep alive, in which case
    we need to be logged in.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     

08 Jul, 2010

1 commit

  • There is a small possibility that a reader gets incorrect values on 32
    bit arches. SNMP applications could catch incorrect counters when a
    32bit high part is changed by another stats consumer/provider.

    One way to solve this is to add a rtnl_link_stats64 param to all
    ndo_get_stats64() methods, and also add such a parameter to
    dev_get_stats().

    Rule is that we are not allowed to use dev->stats64 as a temporary
    storage for 64bit stats, but a caller provided area (usually on stack)

    Old drivers (only providing get_stats() method) need no changes.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

17 Jun, 2010

2 commits


25 May, 2010

1 commit


21 May, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (182 commits)
    [SCSI] aacraid: add an ifdef'd device delete case instead of taking the device offline
    [SCSI] aacraid: prohibit access to array container space
    [SCSI] aacraid: add support for handling ATA pass-through commands.
    [SCSI] aacraid: expose physical devices for models with newer firmware
    [SCSI] aacraid: respond automatically to volumes added by config tool
    [SCSI] fcoe: fix fcoe module ref counting
    [SCSI] libfcoe: FIP Keep-Alive messages for VPorts are sent with incorrect port_id and wwn
    [SCSI] libfcoe: Fix incorrect MAC address clearing
    [SCSI] fcoe: fix a circular locking issue with rtnl and sysfs mutex
    [SCSI] libfc: Move the port_id into lport
    [SCSI] fcoe: move link speed checking into its own routine
    [SCSI] libfc: Remove extra pointer check
    [SCSI] libfc: Remove unused fc_get_host_port_type
    [SCSI] fcoe: fixes wrong error exit in fcoe_create
    [SCSI] libfc: set seq_id for incoming sequence
    [SCSI] qla2xxx: Updates to ISP82xx support.
    [SCSI] qla2xxx: Optionally disable target reset.
    [SCSI] qla2xxx: ensure flash operation and host reset via sg_reset are mutually exclusive
    [SCSI] qla2xxx: Silence bogus warning by gcc for wrap and did.
    [SCSI] qla2xxx: T10 DIF support added.
    ...

    Linus Torvalds
     

17 May, 2010

8 commits

  • Currently fcoe module ref count is used for tracking
    active fcoe instances, it means each fcoe instance create
    increments the count while destroy dec the count.

    The dec is done only if fcoe instance is destroyed from
    /sysfs but not if destroyed due to NETDEV_UNREGISTER event.
    So this patch moves only module_put doing dec to common
    fcoe_if_destroy function, so that dec would occur on ever
    fcoe instance destroy.

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • All VNports are sending FIP Keep-Alive messages with port_id and wwpn of the parent host instead of it's own port_id and wwpn. Standard FIP descriptor type 11 indicates to send own port_id and port_name.

    Signed-off-by: Kaladhar Musunuru
    Acked-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Kaladhar Musunuru
     
  • Fix typo in memset. Incorrect length parameter to memset resulting non-zero MAC address in FPMA messages.

    Signed-off-by: Kaladhar Musunuru
    Acked-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Kaladhar Musunuru
     
  • Currently rtnl mutex is grabbed during fcoe create, destroy, enable
    and disable operations while sysfs s_active read mutex is already
    held, but simultaneously other networking events could try grabbing
    write s_active mutex while rtnl is already held and that is causing
    circular lock warning, its detailed log pasted at end.

    In this log, the rtnl was held before write s_active during device
    renaming but there are more such cases as Joe reported another
    instance with tg3 open at:-
    http://www.open-fcoe.org/pipermail/devel/2010-February/008263.html

    This patch fixes this issue by not waiting for rtnl mutex during
    fcoe ops, that means if rtnl mutex is not immediately available
    then restart_syscall() to allow others waiting in line to
    grab s_active along with rtnl mutex to finish their work first
    under these mutex.

    Currently rtnl mutex was grabbed twice during fcoe_destroy call flow,
    second grab was from fcoe_if_destroy called from fcoe_destroy after
    dropping rtnl mutex before calling fcoe_if_destroy, so instead made
    fcoe_if_destroy always called with rtnl mutex held to have this mutex
    grabbed only once in this code path.

    However left matching rtnl_unlock as-is in its original place as it was
    dropped there for good reason since very next call causes synchronous
    fip worker flush and if rtnl mutex is still held before flush
    then that would cause new circular warning between fip->recv_work and
    rtnl mutex, I've added detailed comment for this on fcoe_if_destroy
    calling and rtnl muxtes unlocking.

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.33.1linux-stable-2.6.33 #1
    -------------------------------------------------------
    fcoemon/18823 is trying to acquire lock:
    (fcoe_config_mutex){+.+.+.}, at: [] fcoe_create+0x27/0x4f7
    [fcoe]

    but task is already holding lock:
    (s_active){++++.+}, at: [] sysfs_get_active_two+0x31/0x48

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #2 (s_active){++++.+}:
    [] __lock_acquire+0xb73/0xd2b
    [] lock_acquire+0xcd/0xf1
    [] sysfs_deactivate+0x8b/0xe0
    [] sysfs_addrm_finish+0x36/0x55
    [] sysfs_hash_and_remove+0x53/0x6a
    [] sysfs_remove_link+0x21/0x23
    [] device_rename+0x99/0xcb
    [] dev_change_name+0xd5/0x1d2
    [] dev_ifsioc+0x201/0x2ac
    [] dev_ioctl+0x521/0x632
    [] sock_do_ioctl+0x3d/0x47
    [] sock_ioctl+0x213/0x222
    [] vfs_ioctl+0x32/0xa6
    [] do_vfs_ioctl+0x490/0x4d6
    [] sys_ioctl+0x56/0x79
    [] system_call_fastpath+0x16/0x1b

    -> #1 (rtnl_mutex){+.+.+.}:
    [] __lock_acquire+0xb73/0xd2b
    [] lock_acquire+0xcd/0xf1
    [] __mutex_lock_common+0x4b/0x383
    [] mutex_lock_nested+0x3e/0x43
    [] rtnl_lock+0x17/0x19
    [] register_netdevice_notifier+0x1e/0x19b
    [] 0xffffffffa02580c1
    [] do_one_initcall+0x5e/0x15e
    [] sys_init_module+0xd8/0x23a
    [] system_call_fastpath+0x16/0x1b

    -> #0 (fcoe_config_mutex){+.+.+.}:
    [] __lock_acquire+0xa1d/0xd2b
    [] lock_acquire+0xcd/0xf1
    [] __mutex_lock_common+0x4b/0x383
    [] mutex_lock_nested+0x3e/0x43
    [] fcoe_create+0x27/0x4f7 [fcoe]
    [] param_attr_store+0x27/0x35
    [] module_attr_store+0x26/0x2a
    [] sysfs_write_file+0x108/0x144
    [] vfs_write+0xae/0x10b
    [] sys_write+0x4a/0x6e
    [] system_call_fastpath+0x16/0x1b

    other info that might help us debug this:

    3 locks held by fcoemon/18823:
    #0: (&buffer->mutex){+.+.+.}, at: []
    sysfs_write_file+0x3c/0x144
    #1: (s_active){++++.+}, at: []
    sysfs_get_active_two+0x24/0x48
    #2: (s_active){++++.+}, at: []
    sysfs_get_active_two+0x31/0x48

    stack backtrace:
    Pid: 18823, comm: fcoemon Tainted: G W 2.6.33.1linux-stable-2.6.33 #1
    Call Trace:
    [] print_circular_bug+0xa8/0xb6
    [] __lock_acquire+0xa1d/0xd2b
    [] ? fcoe_create+0x27/0x4f7 [fcoe]
    [] lock_acquire+0xcd/0xf1
    [] ? fcoe_create+0x27/0x4f7 [fcoe]
    [] ? fcoe_create+0x27/0x4f7 [fcoe]
    [] __mutex_lock_common+0x4b/0x383
    [] ? fcoe_create+0x27/0x4f7 [fcoe]
    [] ? cpu_clock+0x43/0x5e
    [] ? lockstat_clock+0x11/0x13
    [] ? lock_release_holdtime+0x2c/0x127
    [] ? sysfs_get_active_two+0x31/0x48
    [] mutex_lock_nested+0x3e/0x43
    [] fcoe_create+0x27/0x4f7 [fcoe]
    [] param_attr_store+0x27/0x35
    [] module_attr_store+0x26/0x2a
    [] sysfs_write_file+0x108/0x144
    [] vfs_write+0xae/0x10b
    [] ? trace_hardirqs_on_caller+0x125/0x150
    [] sys_write+0x4a/0x6e
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • This patch creates a port_id member in struct fc_lport.
    This allows libfc to just deal with fc_lport instances
    instead of calling into the fc_host to get the port_id.

    This change helps in only using symbols necessary for
    operation from the libfc structures. libfc still needs
    to change the fc_host_port_id() if the port_id changes
    so the presentation layer (scsi_transport_fc) can provide
    the user with the correct value, but libfc shouldn't
    rely on the presentation layer for operational values.

    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Robert Love
     
  • It doesn't make sense to update the link speed in the is_link_ok()
    routine. Move it to it's own routine and acquire the device speed
    when we're configuring the device initially as well as if there are
    any netdev events received.

    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Robert Love
     
  • The fcf pointer is checked again after this verification
    making the first check redundant. Remote the first check.

    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Robert Love
     
  • fcoe_create exits using out_nodev label when module is not
    yet LIVE but this exit path unlocks the rtnl_lock though
    rtnl lock was not held in this case.

    So this patch replaces out_nodev with out_nomod to exit
    w/o unlocking rtnl_lock.

    Signed-off-by: Vasu Dev
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Vasu Dev