public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <robert.w.love@intel.com>
To: linux-scsi@vger.kernel.org
Cc: Kiran Patil <kiran.patil@intel.com>
Subject: [PATCH v2 02/12] libfc: Enhancement to RPORT state machine applicable only for VN2VN mode
Date: Mon, 20 Jun 2011 16:58:59 -0700	[thread overview]
Message-ID: <20110620235859.1777.44756.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110620235848.1777.5168.stgit@localhost6.localdomain6>

From: Kiran Patil <kiran.patil@intel.com>

Problem: Existing RPORT state machine continues witg FLOGI/PLOGI process
only after it receices beacon from other end. Once claiming stage is over
(either clain notify or clain repose), beacon is sent and state machine
enters into operational mode where it initiates the rlogin process (FLOGI/PLOGI)
to the peer but before this rlogin is initiated, exitsing implementation
checks if it received beacon from other end, it beacon is not received yet,
rlogin process is not initiated. Other end initiates FLOGI but peer end keeps
on rejecting FLOGI, hence after 3 retries other end deletes associated rport,
then sends a beacon. Once the beacon is received, peer end now initiates rlogin
to the peer end but since associated rport is deleted FLOGI is neither accepted
nor the reject response send out because rport is deleted. Hence unable to proceed
withg FLOGI/PLOGI process and fails to establish VN2VN connection.

Fix: VN2VN spec is not standard yet but based on exitsing collateral on T11, it appears
that, both end shall send beacon and enter into 'operational mode' without
explictly waiting for beacon from other end. Fix is to allow the RPORT login
process as long as respective RPORT is created (as part of claim notification /
claim response) even though state of RPORT is INIT. Means don't wait for beacon
from peer end, if peer end initiates FLOGI (means peer end exist and responding).

Notes: This patch is preparing the FCoE stack for target wrt offload. This is generic
patch and harmless even if applied on storage initiator because 'else if' condition
of function 'fcoe_oem_found' shall evaluate to TRUE only for targets.

Dependencies: None

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
 drivers/scsi/libfc/fc_rport.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 49e1ccc..3b66937 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -801,6 +801,20 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport,
 
 	switch (rdata->rp_state) {
 	case RPORT_ST_INIT:
+		/*
+		 * If received the FLOGI request on RPORT which is INIT state
+		 * (means not transition to FLOGI either fc_rport timeout
+		 * function didn;t trigger or this end hasn;t received
+		 * beacon yet from other end. In that case only, allow RPORT
+		 * state machine to continue, otherwise fall through which
+		 * causes the code to send reject response.
+		 * NOTE; Not checking for FIP->state such as VNMP_UP or
+		 * VNMP_CLAIM because if FIP state is not one of those,
+		 * RPORT wouldn;t have created and 'rport_lookup' would have
+		 * failed anyway in that case.
+		 */
+		if (lport->point_to_multipoint)
+			break;
 	case RPORT_ST_DELETE:
 		mutex_unlock(&rdata->rp_mutex);
 		rjt_data.reason = ELS_RJT_FIP;


  parent reply	other threads:[~2011-06-20 23:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20 23:58 [PATCH v2 00/12] libfc, libfcoe and fcoe updates for scsi-misc Robert Love
2011-06-20 23:58 ` [PATCH v2 01/12] tcm_fc: Fix warning in file tfc_io Robert Love
2011-06-20 23:58 ` Robert Love [this message]
2011-06-20 23:59 ` [PATCH v2 03/12] libfc, tcm_fc: add ddp_targ() to libfc function template to supprot FCoE DDP in target mode Robert Love
2011-06-20 23:59 ` [PATCH v2 04/12] fcoe: support ndo_fcoe_ddp_target() for DDP in FCoE targe Robert Love
2011-06-20 23:59 ` [PATCH v2 05/12] fcoe: Unable to select the exchangeID from offload pool for storage targets Robert Love
2011-06-20 23:59 ` [PATCH v2 06/12] fcoe: Round-robin based selection of CPU for post-processing of incoming commands Robert Love
2011-06-20 23:59 ` [PATCH v2 07/12] fcoe: Amends previous patch, Round-robin based selection of CPU for post processing of incoming request for FCoE target Robert Love
2011-06-20 23:59 ` [PATCH v2 08/12] libfc:Fix for exchange/seq loopup failure when FCoE stack is used as target and connected to windows initaitor Robert Love
2011-06-20 23:59 ` [PATCH v2 09/12] tcm_fc: Fix ft_send_tm-bug and drop ft_get_lun_for_cmd usage Robert Love
2011-06-22 18:37   ` Nicholas A. Bellinger
2011-06-22 21:38     ` Kiran Patil
2011-06-22 23:30   ` [PATCH] " Kiran Patil
2011-06-23  2:47     ` Nicholas A. Bellinger
2011-06-20 23:59 ` [PATCH v2 10/12] tcm_fc: Fixing reference counting problem which was causing ft_sess to be deleted Robert Love
2011-06-20 23:59 ` [PATCH v2 11/12] libfc: post reset event on lport reset Robert Love
2011-06-20 23:59 ` [PATCH v2 12/12] fcoe: Rearrange fcoe port and NPIV port cleanup Robert Love

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110620235859.1777.44756.stgit@localhost6.localdomain6 \
    --to=robert.w.love@intel.com \
    --cc=kiran.patil@intel.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox