From patchwork Fri Jan 25 12:19:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 10781299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B29717F0 for ; Fri, 25 Jan 2019 12:19:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 359ED2F59A for ; Fri, 25 Jan 2019 12:19:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 228472F1B9; Fri, 25 Jan 2019 12:19:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6D992F1B9 for ; Fri, 25 Jan 2019 12:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727210AbfAYMTX (ORCPT ); Fri, 25 Jan 2019 07:19:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:33634 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726049AbfAYMTW (ORCPT ); Fri, 25 Jan 2019 07:19:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CFF9AAE26; Fri, 25 Jan 2019 12:19:21 +0000 (UTC) From: Hannes Reinecke To: Himanshu Madhani Cc: "Martin K. Petersen" , Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH] qla2xxx: Fixup dual-protocol FCP connections Date: Fri, 25 Jan 2019 13:19:20 +0100 Message-Id: <20190125121920.119100-1-hare@suse.de> X-Mailer: git-send-email 2.16.4 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver is sending a PRLI to each target port with both, FCP _and_ NVMe enabled. The target is now free to respond with either of those types logged in. When evaluating the response we need to check which of the FC4 type had been logged in, and update the port properties accordingly. Not doing so will cause the port to be removed due to a property mismatch. Signed-off-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_init.c | 8 ++++++-- drivers/scsi/qla2xxx/qla_os.c | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index aeeb0144bd55..88279c4d4d5e 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1228,10 +1228,14 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) if (fcport->disc_state == DSC_DELETE_PEND) return; - if (fcport->fc4f_nvme) + if (fcport->fc4f_nvme && + (pd->current_login_state >> 4) == PDS_PRLI_COMPLETE) ls = pd->current_login_state >> 4; - else + else { + fcport->fc4_type = FC4_TYPE_FCP_SCSI; + fcport->fc4f_nvme = 0; ls = pd->current_login_state & 0xf; + } if (ea->sp->gen2 != fcport->login_gen) { /* target side must have changed it. */ diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index c6ef83d0d99b..93191e323d06 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4871,7 +4871,8 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) if (e->u.new_sess.fc4_type == FS_FC4TYPE_FCP) fcport->fc4_type = FC4_TYPE_FCP_SCSI; - if (e->u.new_sess.fc4_type == FS_FC4TYPE_NVME) { + if (vha->flags.nvme_enabled && + e->u.new_sess.fc4_type == FS_FC4TYPE_NVME) { fcport->fc4_type = FC4_TYPE_OTHER; fcport->fc4f_nvme = FC4_TYPE_NVME; }