From patchwork Thu May 21 17:55:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 6458011 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8887BC0433 for ; Thu, 21 May 2015 17:55:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA4302051D for ; Thu, 21 May 2015 17:55:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB32B20522 for ; Thu, 21 May 2015 17:55:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964811AbbEURzf (ORCPT ); Thu, 21 May 2015 13:55:35 -0400 Received: from mail-qk0-f174.google.com ([209.85.220.174]:33366 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964791AbbEURz3 (ORCPT ); Thu, 21 May 2015 13:55:29 -0400 Received: by qkgv12 with SMTP id v12so61625189qkg.0 for ; Thu, 21 May 2015 10:55:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=5mnQGhpIXmakQun3KhLA5wDxcVku+SPKIPoFPmdNGkI=; b=NlZ4DTieYxE9Smu4uoyN7mXs3FQGcXedZ4xk5FIgeEu7aJ1O3I1ljyG4Up021sMPWr LNUVHFQSvacyYdHFoOeA1BeIZzxPne5KVhLnImJe4fdZt5OSP0NpEPi4jq8GYMjm8JEH WnlLCyq/ha4V1sPA9mELRl0LAnRG3wq4HaVe5g5fXtJhoz6cjDiLAZzbxHRZHgOt0oa5 CEOLz5Af9wYotKS5nd7zsH04wvjPL9KT+4Du8W1XjpXLAa0Gbi8kcsBXFVE/Wp2itvVS ZxFEtei6pn9LfylQBTt8nLD9nBjUsUEBouiWPmdDD1nIMZtsQL1wmqKwsexZuFpfrLbA 7DkA== X-Gm-Message-State: ALoCoQl04jRAMHBGlniWmsJhBLQTE+Ce20PTfqkqvvXPSqaqy9dnmM3c2J/k1KGwqUStPUFU6+C4 X-Received: by 10.140.217.8 with SMTP id n8mr5582190qhb.7.1432230928324; Thu, 21 May 2015 10:55:28 -0700 (PDT) Received: from myfc17 (c-75-67-235-135.hsd1.nh.comcast.net. [75.67.235.135]) by mx.google.com with ESMTPSA id q11sm7595014qgd.49.2015.05.21.10.55.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 21 May 2015 10:55:27 -0700 (PDT) Date: Thu, 21 May 2015 13:55:23 -0400 From: james.smart@avagotech.com (James Smart) To: linux-scsi@vger.kernel.org Subject: [PATCH v2 08/15] lpfc: Fix discovery issue when changing from Pt2Pt to Fabric. Message-ID: <555e1c0b.ZFQTl9Hca03wl1vc%james.smart@avagotech.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix discovery issue when changing from Pt2Pt to Fabric. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hbadisc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index e93705d..0dfa566 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -4834,9 +4834,19 @@ lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, if (matchdid.un.b.id == ndlpdid.un.b.id) { if ((mydid.un.b.domain == matchdid.un.b.domain) && (mydid.un.b.area == matchdid.un.b.area)) { + /* This code is supposed to match the ID + * for a private loop device that is + * connect to fl_port. But we need to + * check that the port did not just go + * from pt2pt to fabric or we could end + * up matching ndlp->nlp_DID 000001 to + * fabric DID 0x20101 + */ if ((ndlpdid.un.b.domain == 0) && (ndlpdid.un.b.area == 0)) { - if (ndlpdid.un.b.id) + if (ndlpdid.un.b.id && + vport->phba->fc_topology == + LPFC_TOPOLOGY_LOOP) return 1; } return 0;