[Open-FCoE] [PATCH 0/9] libfc: split transport and libfc remote port allocation

Joe Eykholt jeykholt at cisco.com
Wed Jul 8 00:12:11 UTC 2009


This is a resubmission with a minor fix affecting patches 4 and 5.

The problem was that a test for rport non-NULL in fc_els_fill()
ELS_LOGO case should be changed to check rdata.
If rdata was NULL, rport would not be NULL, since
PRIV_TO_RPORT(NULL) returns -sizeof(rport), and that would 
cause a segfault.  That was a problem in the old patch 4, now
fixed.  Patch 5 changes fc_els_fill() to take the FC_ID as an
argument and that avoids the problem.

Here's the original description:

The following series changes the way remote ports are handled in
libfc.  

Before this series, the transport struct fc_rport is allocated with
space for struct fc_rport_libfc_priv, and fc_rport is the primary
interface to the remote port, target discovery, and FCP components.

Since fc_remote_port_add() could not be called before the port_name
and node_name were known, we created "rogue" rports in fc_rport.c and
later converted them to "real" transport rports.

This was racy, however, because while waiting for the real rport to
be created, we could receive requests from the peer or an RSCN 
concerning the "rogue" rport and it is difficult to analyze and resolve
all of the state-related issues.

After this series, struct fc_rport_libfc_priv is sill allocated with
the real rport for use in FCP, but the remote port and target discovery
components will use a new separately-allocated struct fc_rport_priv.

This is partly in preparation for more changes to the discovery 
and remote port components.

---

Joe Eykholt (9):
      libfc: don't create dummy (rogue) remote ports
      libfc: rename rport event CREATED to READY
      libfc: rearrange code in fc_rport_work
      libfc: make rport structure optional
      libfc: change elsct to use FC_ID instead of rdata
      libfc: make fc_rport_priv the primary rport interface.
      libfc: fix RPORT_TO_PRIV and PRIV_TO_RPORT() macros.
      libfc: change interface for rport_create
      libfc: prepare to split off struct fc_rport_priv from fc_rport_libfc_priv


 drivers/scsi/libfc/fc_disc.c  |  208 +++++---------
 drivers/scsi/libfc/fc_elsct.c |   11 -
 drivers/scsi/libfc/fc_fcp.c   |    2 
 drivers/scsi/libfc/fc_lport.c |   80 +++---
 drivers/scsi/libfc/fc_rport.c |  589 ++++++++++++++++++++---------------------
 include/scsi/fc_encode.h      |   25 --
 include/scsi/libfc.h          |   88 +++---
 7 files changed, 453 insertions(+), 550 deletions(-)

-- 
Joe Eykholt



More information about the devel mailing list