From patchwork Wed Dec 18 23:57:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D03C414F6 for ; Wed, 18 Dec 2019 23:58:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4DB9222C2 for ; Wed, 18 Dec 2019 23:58:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O//oC6th" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726609AbfLRX6X (ORCPT ); Wed, 18 Dec 2019 18:58:23 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40197 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfLRX6X (ORCPT ); Wed, 18 Dec 2019 18:58:23 -0500 Received: by mail-wm1-f65.google.com with SMTP id t14so3779360wmi.5 for ; Wed, 18 Dec 2019 15:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lrMO+X0pnVDmR5NsLnBgTuH6R3oc5OogPrLSBAvgVYA=; b=O//oC6thZJZzBefefDJ1pXqQjYDFdJri/LX/k38KeIFtEyVAxgf87plW8YAG4CxGm7 9mA6aLCATiE4c55LqiXZNfpwAxooE8pwD13M+8wmclAtSItxG8zIeV4R8RQ2o9rFaj5O Vw+w9hyE/cS+tWIcGHhI2gsL87nwu+ca9iygZPadiBEbpxH109jUWKd1OQ9YaVmjvJLp 6XCycCuGRuEP+/r8GaS8LqSLNYs7K38rJsfjFwidTfVxBmAtNKItItwzJjupqjOqVDN2 QCh1d4OZdZhBQohWzNjEzvM78pxJWjvXkNudNa+AL7SNZ6JCBrlQS0S5XR6dtl+mq9LO 2oMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lrMO+X0pnVDmR5NsLnBgTuH6R3oc5OogPrLSBAvgVYA=; b=tHc4ij1+R6MCcg3hXtMmmMNBSUVVAecOlKASUODt/pp7mVamteaPHKa3zM5WVpRxTT olgiOpEmIx2wP4gosV69/7mVe/kkYoGXT9JOVG0cxqzYsUi9SEK/o8mNt3ry362ftR1h tUEgn3dwhLEWI4DB/x4gqhbXK3OFN78y9Q0dmbzcIwSb78IxXDbghG3UPVoV3vs1FvNl iSmaqc+yvEVN/ViaVOYkWtimMwoyEWEb8/B8+atKl5M2vxWTTCb28YxVLZhYRWS9B3Cm aOu9XdcBbaeS1w3yy4d3+IKfDkGVytcfAM88xh8QJ6IzyZ0//1eK2+BQlsMUZFv1BY3g v4hA== X-Gm-Message-State: APjAAAUoaGGchoqtcKjg2hrULd0wPT5pnea1+fe+RZ3p+jwSI/3X7aeb W/Ctba4Wt5ry2OD+/fMHAtLs4nZg X-Google-Smtp-Source: APXvYqz+u7ezjXUx+aEX3sJNl2699VRpcPoZwEk931urL11UuCFGY7j+OOup/ddgMQWOgDPNkU3h4g== X-Received: by 2002:a7b:cc97:: with SMTP id p23mr6642290wma.89.1576713499728; Wed, 18 Dec 2019 15:58:19 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:19 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 01/10] lpfc: Fix incomplete NVME discovery when target Date: Wed, 18 Dec 2019 15:57:59 -0800 Message-Id: <20191218235808.31922-2-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org NVMe device re-discovery does not complete. Dev_loss_tmo messages seen on initiator after recovery from a link disturbance. The Failing case is the following: When the driver (as a NVME target) receives a PLOGI, the driver initiates an "unreg rpi" mailbox command. While the mailbox command is in progress, the driver requests that an ACC be sent to the initiator. The target's ACC is received by the initiator and the initiator then transmits a PLOGI. The driver receives the PLOGI prior to receiving the completion for the PLOGI response WQE that sent the ACC. (Different delivery sources from the hw so the race is very possible). Given the PLOGI is prior to the ACC completion (signifying PLOGI exchange complete), the driver LS_RJT's the PRLI. The "unreg rpi" mailbox then completes. Since PRLI has been received, the driver transmits a PLOGI to restart discovery, which the initiator then ACC's. If the driver processes the (re)PLOGI ACC prior to the completing the handling for the earlier ACC it sent the intiators original PLOGI, there is no state change for completion of the (re)PLOGI. The ndlp remains in "PLOGI Sent" and the initiator continues sending PRLI's which are rejected by the target until timeout or retry is reached. Fix by: when in target mode, defer sending an ACC for the received PLOGI until unreg RPI completes. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nportdisc.c | 108 +++++++++++++++++++++++++++++++++---- 1 file changed, 99 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index ae4359013846..1c46e3adbda2 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -308,7 +308,7 @@ lpfc_defer_pt2pt_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *link_mbox) mb->mbxStatus); mempool_free(login_mbox, phba->mbox_mem_pool); mempool_free(link_mbox, phba->mbox_mem_pool); - lpfc_sli_release_iocbq(phba, save_iocb); + kfree(save_iocb); return; } @@ -325,7 +325,61 @@ lpfc_defer_pt2pt_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *link_mbox) } mempool_free(link_mbox, phba->mbox_mem_pool); - lpfc_sli_release_iocbq(phba, save_iocb); + kfree(save_iocb); +} + +/** + * lpfc_defer_tgt_acc - Progress SLI4 target rcv PLOGI handler + * @phba: Pointer to HBA context object. + * @pmb: Pointer to mailbox object. + * + * This function provides the unreg rpi mailbox completion handler for a tgt. + * The routine frees the memory resources associated with the completed + * mailbox command and transmits the ELS ACC. + * + * This routine is only called if we are SLI4, acting in target + * mode and the remote NPort issues the PLOGI after link up. + **/ +void +lpfc_defer_acc_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) +{ + struct lpfc_vport *vport = pmb->vport; + struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; + LPFC_MBOXQ_t *mbox = pmb->context3; + struct lpfc_iocbq *piocb = NULL; + int rc; + + if (mbox) { + pmb->context3 = NULL; + piocb = mbox->context3; + mbox->context3 = NULL; + } + + /* + * Complete the unreg rpi mbx request, and update flags. + * This will also restart any deferred events. + */ + lpfc_nlp_get(ndlp); + lpfc_sli4_unreg_rpi_cmpl_clr(phba, pmb); + + if (!piocb) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY | LOG_ELS, + "4578 PLOGI ACC fail\n"); + if (mbox) + mempool_free(mbox, phba->mbox_mem_pool); + goto out; + } + + rc = lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, piocb, ndlp, mbox); + if (rc) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY | LOG_ELS, + "4579 PLOGI ACC fail %x\n", rc); + if (mbox) + mempool_free(mbox, phba->mbox_mem_pool); + } + kfree(piocb); +out: + lpfc_nlp_put(ndlp); } static int @@ -345,6 +399,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, struct lpfc_iocbq *save_iocb; struct ls_rjt stat; uint32_t vid, flag; + u16 rpi; int rc, defer_acc; memset(&stat, 0, sizeof (struct ls_rjt)); @@ -488,7 +543,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, link_mbox->vport = vport; link_mbox->ctx_ndlp = ndlp; - save_iocb = lpfc_sli_get_iocbq(phba); + save_iocb = kzalloc(sizeof(*save_iocb), GFP_KERNEL); if (!save_iocb) goto out; /* Save info from cmd IOCB used in rsp */ @@ -513,7 +568,36 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, goto out; /* Registering an existing RPI behaves differently for SLI3 vs SLI4 */ - if (phba->sli_rev == LPFC_SLI_REV4) + if (phba->nvmet_support && !defer_acc) { + link_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!link_mbox) + goto out; + + /* As unique identifiers such as iotag would be overwritten + * with those from the cmdiocb, allocate separate temporary + * storage for the copy. + */ + save_iocb = kzalloc(sizeof(*save_iocb), GFP_KERNEL); + if (!save_iocb) + goto out; + + /* Unreg RPI is required for SLI4. */ + rpi = phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]; + lpfc_unreg_login(phba, vport->vpi, rpi, link_mbox); + link_mbox->vport = vport; + link_mbox->ctx_ndlp = ndlp; + link_mbox->mbox_cmpl = lpfc_defer_acc_rsp; + + if (((ndlp->nlp_DID & Fabric_DID_MASK) != Fabric_DID_MASK) && + (!(vport->fc_flag & FC_OFFLINE_MODE))) + ndlp->nlp_flag |= NLP_UNREG_INP; + + /* Save info from cmd IOCB used in rsp */ + memcpy(save_iocb, cmdiocb, sizeof(*save_iocb)); + + /* Delay sending ACC till unreg RPI completes. */ + defer_acc = 1; + } else if (phba->sli_rev == LPFC_SLI_REV4) lpfc_unreg_rpi(vport, ndlp); rc = lpfc_reg_rpi(phba, vport->vpi, icmd->un.rcvels.remoteID, @@ -553,6 +637,9 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, if ((vport->port_type == LPFC_NPIV_PORT && vport->cfg_restrict_login)) { + /* no deferred ACC */ + kfree(save_iocb); + /* In order to preserve RPIs, we want to cleanup * the default RPI the firmware created to rcv * this ELS request. The only way to do this is @@ -571,8 +658,12 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, } if (defer_acc) { /* So the order here should be: - * Issue CONFIG_LINK mbox - * CONFIG_LINK cmpl + * SLI3 pt2pt + * Issue CONFIG_LINK mbox + * CONFIG_LINK cmpl + * SLI4 tgt + * Issue UNREG RPI mbx + * UNREG RPI cmpl * Issue PLOGI ACC * PLOGI ACC cmpl * Issue REG_LOGIN mbox @@ -596,10 +687,9 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, out: if (defer_acc) lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, - "4577 pt2pt discovery failure: %p %p %p\n", + "4577 discovery failure: %p %p %p\n", save_iocb, link_mbox, login_mbox); - if (save_iocb) - lpfc_sli_release_iocbq(phba, save_iocb); + kfree(save_iocb); if (link_mbox) mempool_free(link_mbox, phba->mbox_mem_pool); if (login_mbox) From patchwork Wed Dec 18 23:58:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302455 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADA56138C for ; Wed, 18 Dec 2019 23:58:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B06B21D7D for ; Wed, 18 Dec 2019 23:58:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uFAfZExO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726623AbfLRX6Y (ORCPT ); Wed, 18 Dec 2019 18:58:24 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46714 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbfLRX6X (ORCPT ); Wed, 18 Dec 2019 18:58:23 -0500 Received: by mail-wr1-f67.google.com with SMTP id z7so4100145wrl.13 for ; Wed, 18 Dec 2019 15:58:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tBzoLDfsGDQQ26HQ8iwBTSmaqU98MBum7xIMsbjIVjw=; b=uFAfZExO+DNXpGSlFmZ/utGMaLN8E1xB2NQsqDZ2eEBgpzx7hIM/GbyueToDJiEcDd 2RBAz5kuR+TE/fAmQm2MM2iPlL3jK4x8VEpQzOCSLT5num8CUMNTOWGRZ5bgYZg3NAQE tWkWrtjoSw+6lNeeKGn8FqtJkel0Y7I2sD5p2CPbjV+/V3iF1mWtgAGpt7BeGJu4waSH wXea1OLXKxEdLlmwMYyYjdx30panElUa0TNRtx9+pot/MunZ1IyNo+5ubNrYisUioVxL FLNdHL8L7iWU4RpJQNqHzLorT/hHJ7OcDHDLTOehgFRkc+kl6zdBdLmsG/zZ4MHl6iQe 9oDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tBzoLDfsGDQQ26HQ8iwBTSmaqU98MBum7xIMsbjIVjw=; b=bsspZ7yGkjdCRrBx94if4C1UVA4KmGmEYBLzqWKH6BnXyDO+caUu4pDSjRThTQPGMY HTfryXrEbph0hwmNVZ1BlEOEtCNXWyKP0/CJ2DABwPTqWGdF1q9ofQKo0KOrVSR0zaDv nwKHBxMwKx35qCHcKEaFnVpG0jutCEE0fn0QKk527Bukrc51SNyerO9Lj3FcRMy+yRlM cEGNzl15vcwe39ahzZFK6bZUWcp5hiAVAgL1ndynUEZ7cpLjmKQLq8DtuwwJFSFlNE88 NS9lRulXRwTri3nGh6wR0qOjnZfq5jIK/ZJsF2+CIRtHd8k0fxXo8lD6H/kdn3UXfiuI GnUQ== X-Gm-Message-State: APjAAAXAh2iHouUoF9l2YEu0/rm+BR00+q3AcVOZy57JVAo5xmTOHKfH AQBWE8LvX9XcXrSSbP054DTsYAem X-Google-Smtp-Source: APXvYqzhLWN7kBjH/xpFNJo8AiTA/UshT5Bx54cAvmoRK2pPgZCazIRUnYlQ619km8lD8lJLhPoq/A== X-Received: by 2002:a5d:6349:: with SMTP id b9mr6038286wrw.346.1576713501403; Wed, 18 Dec 2019 15:58:21 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:20 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 02/10] lpfc: Fix: Rework setting of fdmi symbolic node name registration Date: Wed, 18 Dec 2019 15:58:00 -0800 Message-Id: <20191218235808.31922-3-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch reworks the fdmi symbolic node name data for the following two issues: - Correcting extraneous periods following the DV and HN fdmi data fields. - Avoiding buffer overflow issues when formatting the data. The fix to the fist issue is to just remove the characters. The fix to the second issue has all data being staged in temporary storage before being moved to the real buffer. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 99c9bb249758..1b4dbb28fb41 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -1493,33 +1493,35 @@ int lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, size_t size) { - char fwrev[FW_REV_STR_SIZE]; - int n; + char fwrev[FW_REV_STR_SIZE] = {0}; + char tmp[MAXHOSTNAMELEN] = {0}; - lpfc_decode_firmware_rev(vport->phba, fwrev, 0); + memset(symbol, 0, size); - n = scnprintf(symbol, size, "Emulex %s", vport->phba->ModelName); - if (size < n) - return n; + scnprintf(tmp, sizeof(tmp), "Emulex %s", vport->phba->ModelName); + if (strlcat(symbol, tmp, size) >= size) + goto buffer_done; - n += scnprintf(symbol + n, size - n, " FV%s", fwrev); - if (size < n) - return n; + lpfc_decode_firmware_rev(vport->phba, fwrev, 0); + scnprintf(tmp, sizeof(tmp), " FV%s", fwrev); + if (strlcat(symbol, tmp, size) >= size) + goto buffer_done; - n += scnprintf(symbol + n, size - n, " DV%s.", - lpfc_release_version); - if (size < n) - return n; + scnprintf(tmp, sizeof(tmp), " DV%s", lpfc_release_version); + if (strlcat(symbol, tmp, size) >= size) + goto buffer_done; - n += scnprintf(symbol + n, size - n, " HN:%s.", - init_utsname()->nodename); - if (size < n) - return n; + scnprintf(tmp, sizeof(tmp), " HN:%s", init_utsname()->nodename); + if (strlcat(symbol, tmp, size) >= size) + goto buffer_done; /* Note :- OS name is "Linux" */ - n += scnprintf(symbol + n, size - n, " OS:%s", - init_utsname()->sysname); - return n; + scnprintf(tmp, sizeof(tmp), " OS:%s", init_utsname()->sysname); + strlcat(symbol, tmp, size); + +buffer_done: + return strnlen(symbol, size); + } static uint32_t From patchwork Wed Dec 18 23:58:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302457 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4BB714F6 for ; Wed, 18 Dec 2019 23:58:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3291222C2 for ; Wed, 18 Dec 2019 23:58:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rDNFYNp7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726633AbfLRX6Z (ORCPT ); Wed, 18 Dec 2019 18:58:25 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37227 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfLRX6Z (ORCPT ); Wed, 18 Dec 2019 18:58:25 -0500 Received: by mail-wm1-f67.google.com with SMTP id f129so3796721wmf.2 for ; Wed, 18 Dec 2019 15:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j3AYhR6iXywWYQ/K9jqjM0MdVWjyW/M1px4KFelLlME=; b=rDNFYNp7ctg5oSsCtX/MMucIw9vv+INwBg23zEaV0G1+w8BxgASsuvh7pvFX8w+ZOB gzEaVJQpGFHEQF7ZE+qLo0mk6aHvo/YJe4wT9Jvv1eV/IUWW2p5Fr5Vxn9uuU8OLZGH8 5qlmdOnFLSdNinLxG4m04/Tosx1rt0ZIV/olViFvHpnC0u1jfLUEFPbsdt2WcdeurB/r 7oH0fwFRfvg7YjR0Eey2C0NHsddWhJMIPDx7oMHAeOnDDdr/h7wdpb2ijLKJ/lAmn90U N2TustW8TsqcA2hz0E4iDjFIbECjivOFkVwnTH6d1WFs2xgV/jB2KywiYDpOLEWK1bB+ WkMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=j3AYhR6iXywWYQ/K9jqjM0MdVWjyW/M1px4KFelLlME=; b=RPJ0V0IoBjIvLfnjhAr373c0xrTZYHUTlYTwD21KpBs7vbKXFnetQEC2ry0r/aE4/D RgSU9TNiomokYu1DMX9AfYVspNVY9WpORTqh7UEBl8x4goa5n5wwbOiMvW7mfh7IBBMh 9VxXjUI2Xk4ji5KKtpOZgc7R8W3qdyqfFue8CGwtegyUxSti8owctJbmgJU6WibjqhNp acwDEQ7vA8wvo7oSFxoBLc4iDQNVtAxUWYIDitzYE+8w2rs5T7gKcKhIuvDhAZTpdFQD G1YJ3dawvmB3EZPhaYpNbxDPBF0soaM1q5CiEFrRqykUIwt94OElFrfj2S3AOBio+xI3 SYxQ== X-Gm-Message-State: APjAAAX0kDRutSbZkPFMVrcl99XywCTKgfYYgoz3iVt1EUy5y/DSUY5m eLBOYtxk2yiqW3xT2v0dtQC8b8/i X-Google-Smtp-Source: APXvYqzDQn8crWdCY5gWx0hwd0WIbUNRV/Qju1rTXAKqQaDc/MBNH6xi79GEwhZyTRZTp6kwVey6dg== X-Received: by 2002:a7b:c00c:: with SMTP id c12mr6268921wmb.174.1576713503054; Wed, 18 Dec 2019 15:58:23 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:22 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 03/10] lpfc: Fix missing check for CSF in Write Object Mbox Rsp Date: Wed, 18 Dec 2019 15:58:01 -0800 Message-Id: <20191218235808.31922-4-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org When the WriteObject mailbox response has change_status set to is 0x2 (Firmware Reset) or 0x04 (Port Migration Reset), the CSF field should also be checked to see if a fw reset is sufficient to enable all new features in the updated firmware image. If not, a fw reset would start the new firmware, but with a feature level equal to existing firmware. To enable the new features, a chip reset/pci slot reset would be required. Check the CSF bit when change_status is 0x2 or 0x4 to know whether to perform a pci bus reset or fw reset. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hw4.h | 3 +++ drivers/scsi/lpfc/lpfc_sli.c | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 25cdcbc2b02f..9a064b96e570 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h @@ -3925,6 +3925,9 @@ struct lpfc_mbx_wr_object { #define LPFC_CHANGE_STATUS_FW_RESET 0x02 #define LPFC_CHANGE_STATUS_PORT_MIGRATION 0x04 #define LPFC_CHANGE_STATUS_PCI_RESET 0x05 +#define lpfc_wr_object_csf_SHIFT 8 +#define lpfc_wr_object_csf_MASK 0x00000001 +#define lpfc_wr_object_csf_WORD word5 } response; } u; }; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index c82b5792da98..12319f63cb45 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -19449,7 +19449,7 @@ lpfc_wr_object(struct lpfc_hba *phba, struct list_head *dmabuf_list, struct lpfc_mbx_wr_object *wr_object; LPFC_MBOXQ_t *mbox; int rc = 0, i = 0; - uint32_t shdr_status, shdr_add_status, shdr_change_status; + uint32_t shdr_status, shdr_add_status, shdr_change_status, shdr_csf; uint32_t mbox_tmo; struct lpfc_dmabuf *dmabuf; uint32_t written = 0; @@ -19506,6 +19506,16 @@ lpfc_wr_object(struct lpfc_hba *phba, struct list_head *dmabuf_list, if (check_change_status) { shdr_change_status = bf_get(lpfc_wr_object_change_status, &wr_object->u.response); + + if (shdr_change_status == LPFC_CHANGE_STATUS_FW_RESET || + shdr_change_status == LPFC_CHANGE_STATUS_PORT_MIGRATION) { + shdr_csf = bf_get(lpfc_wr_object_csf, + &wr_object->u.response); + if (shdr_csf) + shdr_change_status = + LPFC_CHANGE_STATUS_PCI_RESET; + } + switch (shdr_change_status) { case (LPFC_CHANGE_STATUS_PHYS_DEV_RESET): lpfc_printf_log(phba, KERN_INFO, LOG_INIT, From patchwork Wed Dec 18 23:58:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302459 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0812C14F6 for ; Wed, 18 Dec 2019 23:58:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF5D421582 for ; Wed, 18 Dec 2019 23:58:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JPMkfn8l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbfLRX61 (ORCPT ); Wed, 18 Dec 2019 18:58:27 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43549 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfLRX61 (ORCPT ); Wed, 18 Dec 2019 18:58:27 -0500 Received: by mail-wr1-f67.google.com with SMTP id d16so4117523wre.10 for ; Wed, 18 Dec 2019 15:58:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O49Ag5VRDsphU4yxE3eesJgJKoIZb9gFWDdaiuAHDUQ=; b=JPMkfn8lL3Vj5Z5YxSgqps6EYFSCaIwuMTms4X5M3QkEJyZaGRFBK52Hgh5kWxFSUH UPWBsCpGakjuPIHvRmX2toRw0XEJMr/WNnqEhkHdzYqt7m/k6AIsezuLKfCKNFqFtCJ0 6EKPif2bTC6cT9dSIVVBTmnqsianakFvybMovd/uTKhCTMjWsr9HBc3VXT4bcJMoGjWk Jie68P+jmIK8h0t9wDDUUf+FIPynFKelEd41rBqK2CnCGafVCXVRh0nkgPPb3x3oeJ4I +P4VzY/YM5dXLyC1YU1HSR/Ebc6Q17XqCdrYghTLyCGRUTEEU4kEW0kEyXB2epPgd0/R m6jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O49Ag5VRDsphU4yxE3eesJgJKoIZb9gFWDdaiuAHDUQ=; b=FUngjsZKbz38gMto4a9auTlpfkhZ+8wcqe1aXWo5PTU+TuSuWw17PpK6rjB9lGK7qR EeDf6IsusEF39OtQKB4VEtDkhYLXRdBTKwRensJyPxvcM1o+Ft0lTdL6/C6MIuefDcYU 0gY4PIqpS+GZa5r2VNODZZ7oeqtPNS81Przx2cFii0AE3yFeAgRV9BGmio9D445eqxz9 CGeg0/m4wCwcAvS3SYZ0+OzQkuD7Eo3rBCpSlDIyWNFxh8s/dbpGtHVDJsTcnCVRduNv bg1ADhDBaAAnWUZnRFjIafYfn6JK8gPErn5b1mPmum8LgPTmUkTFSEWgP8b55hX3jMxh aveA== X-Gm-Message-State: APjAAAUlL+39iHMyCsCkgO/leGn/D0uje71kT9dHDbapB9tg8SVTeiuF jFB6l67XHlYWg5Xkp/LRjLAmKrg8 X-Google-Smtp-Source: APXvYqw3afF4PdaWr4KNOKAM41Rzq7g17zuxHzOsvRjR04F5a/Hrx5mbISP9SKvJNHF2+UhBHmQajg== X-Received: by 2002:adf:81e3:: with SMTP id 90mr5725742wra.23.1576713504690; Wed, 18 Dec 2019 15:58:24 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:24 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 04/10] lpfc: Fix Fabric hostname registration if system hostname changes Date: Wed, 18 Dec 2019 15:58:02 -0800 Message-Id: <20191218235808.31922-5-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org There are reports of multiple ports on the same system displaying different hostnames in fabric FDMI displays. Currently, the driver registers the hostname at initialization and obtains the hostname via init_utsname()->nodename queried at the time the FC link comes up. Unfortunately, if the machine hostname is updated after initialization, such as via DHCP or admin command, the value registered initially will be incorrect. Fix by having the driver save the hostname that was registered with FDMI. The driver then runs a heartbeat action that will check the hostname. If the name changes, reregister the FMDI data. The hostname is used in RSNN_NN, FDMI RPA and FDMI RHBA. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h | 2 ++ drivers/scsi/lpfc/lpfc_crtn.h | 2 +- drivers/scsi/lpfc/lpfc_ct.c | 48 +++++++++++++++++++++++++++++++--------- drivers/scsi/lpfc/lpfc_hbadisc.c | 5 +++++ drivers/scsi/lpfc/lpfc_init.c | 2 +- 5 files changed, 46 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 935f98804198..04d73e2be373 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1223,6 +1223,8 @@ struct lpfc_hba { #define LPFC_POLL_HB 1 /* slowpath heartbeat */ #define LPFC_POLL_FASTPATH 0 /* called from fastpath */ #define LPFC_POLL_SLOWPATH 1 /* called from slowpath */ + + char os_host_name[MAXHOSTNAMELEN]; }; static inline struct Scsi_Host * diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index ee353c84a097..25d3dd39bc05 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -180,7 +180,7 @@ int lpfc_issue_gidft(struct lpfc_vport *vport); int lpfc_get_gidft_type(struct lpfc_vport *vport, struct lpfc_iocbq *iocbq); int lpfc_ns_cmd(struct lpfc_vport *, int, uint8_t, uint32_t); int lpfc_fdmi_cmd(struct lpfc_vport *, struct lpfc_nodelist *, int, uint32_t); -void lpfc_fdmi_num_disc_check(struct lpfc_vport *); +void lpfc_fdmi_change_check(struct lpfc_vport *vport); void lpfc_delayed_disc_tmo(struct timer_list *); void lpfc_delayed_disc_timeout_handler(struct lpfc_vport *); diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 1b4dbb28fb41..58b35a1442c1 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -1511,7 +1511,7 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, if (strlcat(symbol, tmp, size) >= size) goto buffer_done; - scnprintf(tmp, sizeof(tmp), " HN:%s", init_utsname()->nodename); + scnprintf(tmp, sizeof(tmp), " HN:%s", vport->phba->os_host_name); if (strlcat(symbol, tmp, size) >= size) goto buffer_done; @@ -2000,14 +2000,16 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, /** - * lpfc_fdmi_num_disc_check - Check how many mapped NPorts we are connected to + * lpfc_fdmi_change_check - Check for changed FDMI parameters * @vport: pointer to a host virtual N_Port data structure. * - * Called from hbeat timeout routine to check if the number of discovered - * ports has changed. If so, re-register thar port Attribute. + * Check how many mapped NPorts we are connected to + * Check if our hostname changed + * Called from hbeat timeout routine to check if any FDMI parameters + * changed. If so, re-register those Attributes. */ void -lpfc_fdmi_num_disc_check(struct lpfc_vport *vport) +lpfc_fdmi_change_check(struct lpfc_vport *vport) { struct lpfc_hba *phba = vport->phba; struct lpfc_nodelist *ndlp; @@ -2020,17 +2022,41 @@ lpfc_fdmi_num_disc_check(struct lpfc_vport *vport) if (!(vport->fc_flag & FC_FABRIC)) return; + ndlp = lpfc_findnode_did(vport, FDMI_DID); + if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) + return; + + /* Check if system hostname changed */ + if (strcmp(phba->os_host_name, init_utsname()->nodename)) { + memset(phba->os_host_name, 0, sizeof(phba->os_host_name)); + scnprintf(phba->os_host_name, sizeof(phba->os_host_name), "%s", + init_utsname()->nodename); + lpfc_ns_cmd(vport, SLI_CTNS_RSNN_NN, 0, 0); + + /* Since this effects multiple HBA and PORT attributes, we need + * de-register and go thru the whole FDMI registration cycle. + * DHBA -> DPRT -> RHBA -> RPA (physical port) + * DPRT -> RPRT (vports) + */ + if (vport->port_type == LPFC_PHYSICAL_PORT) + lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA, 0); + else + lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DPRT, 0); + + /* Since this code path registers all the port attributes + * we can just return without further checking. + */ + return; + } + if (!(vport->fdmi_port_mask & LPFC_FDMI_PORT_ATTR_num_disc)) return; + /* Check if the number of mapped NPorts changed */ cnt = lpfc_find_map_node(vport); if (cnt == vport->fdmi_num_disc) return; - ndlp = lpfc_findnode_did(vport, FDMI_DID); - if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) - return; - if (vport->port_type == LPFC_PHYSICAL_PORT) { lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_RPA, LPFC_FDMI_PORT_ATTR_num_disc); @@ -2618,8 +2644,8 @@ lpfc_fdmi_port_attr_host_name(struct lpfc_vport *vport, ae = (struct lpfc_fdmi_attr_entry *)&ad->AttrValue; memset(ae, 0, 256); - snprintf(ae->un.AttrString, sizeof(ae->un.AttrString), "%s", - init_utsname()->nodename); + scnprintf(ae->un.AttrString, sizeof(ae->un.AttrString), "%s", + vport->phba->os_host_name); len = strnlen(ae->un.AttrString, sizeof(ae->un.AttrString)); len += (len & 3) ? (4 - (len & 3)) : 4; diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 85ada3deb47d..dcc8999c6a68 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -3315,6 +3316,10 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) lpfc_sli4_clear_fcf_rr_bmask(phba); } + /* Prepare for LINK up registrations */ + memset(phba->os_host_name, 0, sizeof(phba->os_host_name)); + scnprintf(phba->os_host_name, sizeof(phba->os_host_name), "%s", + init_utsname()->nodename); return; out: lpfc_vport_set_state(vport, FC_VPORT_FAILED); diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 6298b1729098..633ca46b0e4b 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -1362,7 +1362,7 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba) if (vports != NULL) for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { lpfc_rcv_seq_check_edtov(vports[i]); - lpfc_fdmi_num_disc_check(vports[i]); + lpfc_fdmi_change_check(vports[i]); } lpfc_destroy_vport_work_array(phba, vports); From patchwork Wed Dec 18 23:58:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302461 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 47627138C for ; Wed, 18 Dec 2019 23:58:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2590321582 for ; Wed, 18 Dec 2019 23:58:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lWhH02+Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbfLRX62 (ORCPT ); Wed, 18 Dec 2019 18:58:28 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40205 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726634AbfLRX62 (ORCPT ); Wed, 18 Dec 2019 18:58:28 -0500 Received: by mail-wm1-f65.google.com with SMTP id t14so3779510wmi.5 for ; Wed, 18 Dec 2019 15:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Cn+hgHgXLDZqThg4qoDORZGKQZ/ccON73+7VFhks274=; b=lWhH02+Z2UFdKJ/rlLydfYpSpNVd576kHAiqnXjQyPr86s0B36vAovTVwXdxElwbYI TMM/rm2TkIeDSW9ZhydUZA4JhPyeq1kRWxhbtlJ8PNuz/59/JyQGn1sNa/azdgD0//zK h30jKGTv9tY8TyKB9mVozkHA3hSKJ7PmSXDiBgJ/zaEDtoAnNngAPhHU9Qemed8Qzg7E LwCKqlWe5hFis2ByrscmOU5m1+v3z7LU2rafREAXIj5CDegHm8wlTSuzB3JAVCTYp2aE 43SZ7W6XJWa08ofN/Pdbnc6IfY8DrUolapbE6FK21XFhTyy/gTuMc1B7XP1gK4qK4fDM OptQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Cn+hgHgXLDZqThg4qoDORZGKQZ/ccON73+7VFhks274=; b=ZHR4TBQUFGBmNt9vyOCwsriQrjKDCLQLjxThqTr2Li8XWAcMFPOsxNRdWqAleA6pSF 4ql+be/vQWil3+RX8pR1hSglIZJfbp9Jq4kKOnIhJi0v/3z++lUJgTPDBZF8jwJeTT4L UQw2bxkVUQDS7TxWTYuTmJOMuEJZE7h3S30Pc6DljgWnf0IpryheW/gPa721cZK+wPOD Hl8699PCJ+5iPaeu6WnVWwIi08DiBfVnM8TVhPVEZxj7EeaCaPR4TwH8boHTtaibIaWV 20/DrWXE8b/qMAUHJHLzNK4qYFyvZ//sLXwVPd8cahzCwIQwEyIJL7IUu8/+zrZAQMyL 3ZYQ== X-Gm-Message-State: APjAAAUWr3jiqGmTp1GwGLL2y0zYAh7Ks+TcRlqsDjvYQFZr9rE9qzno vvv24Sfz8bKxSYUdyRsGSVE1VcOO X-Google-Smtp-Source: APXvYqytEbiK4M57XdvcZviT9plOtSYD3CIp/mRG1wmet482458EGVxAj63dN04hZWpIMyVu9THPYA== X-Received: by 2002:a1c:bbc3:: with SMTP id l186mr6352026wmf.101.1576713506270; Wed, 18 Dec 2019 15:58:26 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:25 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 05/10] lpfc: Fix ras_log via debugfs Date: Wed, 18 Dec 2019 15:58:03 -0800 Message-Id: <20191218235808.31922-6-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org /sys/kernel/debug/lpfc/fn0/ras_log always shows the same ras_log even if there are link bounce events triggered via issue_lip Dynamic FW logging had logic that prematurely breaks from the buffer filling loop. Fix the check for buffer overrun by looking before copying and restricting copy length to the remaining buffer. When copying, ensure space for NULL character is left in the buffer. While in the routine - ensure the buffer is cleared before adding elements. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_debugfs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 2e6a68d9ea4f..d7504b2990a3 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -2085,6 +2085,8 @@ static int lpfc_debugfs_ras_log_data(struct lpfc_hba *phba, int copied = 0; struct lpfc_dmabuf *dmabuf, *next; + memset(buffer, 0, size); + spin_lock_irq(&phba->hbalock); if (phba->ras_fwlog.state != ACTIVE) { spin_unlock_irq(&phba->hbalock); @@ -2094,10 +2096,15 @@ static int lpfc_debugfs_ras_log_data(struct lpfc_hba *phba, list_for_each_entry_safe(dmabuf, next, &phba->ras_fwlog.fwlog_buff_list, list) { + /* Check if copying will go over size and a '\0' char */ + if ((copied + LPFC_RAS_MAX_ENTRY_SIZE) >= (size - 1)) { + memcpy(buffer + copied, dmabuf->virt, + size - copied - 1); + copied += size - copied - 1; + break; + } memcpy(buffer + copied, dmabuf->virt, LPFC_RAS_MAX_ENTRY_SIZE); copied += LPFC_RAS_MAX_ENTRY_SIZE; - if (size > copied) - break; } return copied; } From patchwork Wed Dec 18 23:58:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302463 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72096138C for ; Wed, 18 Dec 2019 23:58:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F4DC21582 for ; Wed, 18 Dec 2019 23:58:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DUtryaeE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbfLRX6a (ORCPT ); Wed, 18 Dec 2019 18:58:30 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44758 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfLRX63 (ORCPT ); Wed, 18 Dec 2019 18:58:29 -0500 Received: by mail-wr1-f68.google.com with SMTP id q10so4120201wrm.11 for ; Wed, 18 Dec 2019 15:58:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KGtupt5O4VqDIbyjx/1nXTaVSxz4aRc+ZHDkOvzEnQk=; b=DUtryaeEIqTwYl4L/Qn9uxq6nn+0QU/duf0mryCBL6n55OoIVBnX9F4Pu977ino2Qk K5JxQk/aDJPmCsJelUVpDT2MZahBi1hScb9iQmmyHF7oiKGJYa+reeEWKVBCO8mlBInY wFsELp260Fh9K4sSnHv0ocGC9fP07QDViggCtgfLc14TjmD8Z3W+lyE6NjR4xDiQSoPq GTFYoOYmQYRtxc7uCng5SjoKxbGyPqwa65VALHrKSontBlHj5XtaLoqsoqtblFzN59H+ RrwuJJ3Md1o7D+w1BNwhbWAxfiNyKWh4pDkyUF5a8QvG1OhPzWNlD+KjUQtKaW5Ch1we mOog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KGtupt5O4VqDIbyjx/1nXTaVSxz4aRc+ZHDkOvzEnQk=; b=SUyAOOC30Ktmudib9ka4dv8iE79oOSvo/tDXB+c7pXyXQRIllNz0RYxiCBKtFw+ol9 yL4M/a4Xfaq87U1LMl1Fs6JvizQfrsjC+zH8j+IPc2Uqc3jUWdMnUSXD5sG9JCiA78n3 r6RlD3ydMGexjL5dn5XDFlXf7zTqmgBfzPPooPFYYpIPTpNyQ2DGXsUYsajLU+AzTWs3 eW8RRG5Qz2tzu1OGNQ+MRLGAj2NZUSr2cu2SxQw2556ZzBt/WekdJG2QKEeZyVHJysCM XzQgvaNQz8Vt6HhzYx8Wsf2840ADYo2dLF8dUWbn7MrEOT4A4TFyVEwVAQaavHO0AZpy KaLA== X-Gm-Message-State: APjAAAVWi46QBgXrijm1NXvRsBnzqKed3vQT06Bkg90OSd+uLuoJPDKC Am0Fau/cs/VVnA6Z4WcCWz2llFGv X-Google-Smtp-Source: APXvYqwPuwJcM7i9wcG4ZMxFdYXKhOhEVsOuwD3CxotkNDHflSogvqzCOE8EogfvNXKuMl2YTSN8Wg== X-Received: by 2002:a5d:6901:: with SMTP id t1mr5454625wru.94.1576713507891; Wed, 18 Dec 2019 15:58:27 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:27 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 06/10] lpfc: Fix disablement of FC-AL on lpe35000 models Date: Wed, 18 Dec 2019 15:58:04 -0800 Message-Id: <20191218235808.31922-7-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The order of the flags/checks for adapters where FC-AL is supported erroneously excluded lpe35000 adapter models. Also noted that the G7 flags for Loop and Persistent topology are incorrect. They should follow the rules as G6. Rework the logic to enable LPe35000 FC-AL support. Collapse G7 support logic to the same rules as G6. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 9 ++++----- drivers/scsi/lpfc/lpfc_init.c | 8 -------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 4ff82b36a37a..46f56f30f77e 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -4123,14 +4123,13 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr, /* * The 'topology' is not a configurable parameter if : * - persistent topology enabled - * - G7 adapters - * - G6 with no private loop support + * - G7/G6 with no private loop support */ - if (((phba->hba_flag & HBA_PERSISTENT_TOPO) || + if ((phba->hba_flag & HBA_PERSISTENT_TOPO || (!phba->sli4_hba.pc_sli4_params.pls && - phba->pcidev->device == PCI_DEVICE_ID_LANCER_G6_FC) || - phba->pcidev->device == PCI_DEVICE_ID_LANCER_G7_FC) && + (phba->pcidev->device == PCI_DEVICE_ID_LANCER_G6_FC || + phba->pcidev->device == PCI_DEVICE_ID_LANCER_G7_FC))) && val == 4) { lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, "3114 Loop mode not supported\n"); diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 633ca46b0e4b..3defada2602f 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -8320,14 +8320,6 @@ lpfc_map_topology(struct lpfc_hba *phba, struct lpfc_mbx_read_config *rd_config) phba->hba_flag |= HBA_PERSISTENT_TOPO; switch (phba->pcidev->device) { case PCI_DEVICE_ID_LANCER_G7_FC: - if (tf || (pt == LINK_FLAGS_LOOP)) { - /* Invalid values from FW - use driver params */ - phba->hba_flag &= ~HBA_PERSISTENT_TOPO; - } else { - /* Prism only supports PT2PT topology */ - phba->cfg_topology = FLAGS_TOPOLOGY_MODE_PT_PT; - } - break; case PCI_DEVICE_ID_LANCER_G6_FC: if (!tf) { phba->cfg_topology = ((pt == LINK_FLAGS_LOOP) From patchwork Wed Dec 18 23:58:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DD5817EF for ; Wed, 18 Dec 2019 23:58:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BD86222C2 for ; Wed, 18 Dec 2019 23:58:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bMt+26XW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbfLRX6c (ORCPT ); Wed, 18 Dec 2019 18:58:32 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51745 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfLRX6b (ORCPT ); Wed, 18 Dec 2019 18:58:31 -0500 Received: by mail-wm1-f65.google.com with SMTP id d73so3652798wmd.1 for ; Wed, 18 Dec 2019 15:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5yOUiAdfGCzDfQkiqJsNYF8xa1i2MT8Bhv7OHRnaL/U=; b=bMt+26XWU6wvdwTJ+ma2gsJ7QofXNf/+L8PTGSXDE2cSlnbZNuKWeplCZdgqmEC9kh sq8CNqFOsHsPqxfwsDD/Tj+HZpiAFFj6177hAqcQZjFI1YMzXGlHAkPkUnz+rs38Wkn1 89RFo1pHzOGJBy9FUFOPCAfIaTNqR1chS0tM8t95j/KgQKkYciiIrpi1gSTmsS8WRcPQ Fy0UBtZS1/RGBczo5mvVFfEysgKNWA9UP0OLZef1+/4M6ZtT4I7b0/vqiTZsXGpqTAd6 zcBJL1MuxOCqEAzRU3hxSDIwg5Ocms8yBUgTNLjRFtDZML9rg/n5mq1ERCjadFb0Qzy/ G6nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5yOUiAdfGCzDfQkiqJsNYF8xa1i2MT8Bhv7OHRnaL/U=; b=A+4oQKlPpy6sNEmsyAJ+FCPQlwYhNk0Kw2pCDpHcobHixxPrrhzIlSUvjgTsS9UBn5 wC5w/cT7g/M5CVwE9YKSO7o+viBOiWevetqjfS38CNIFGS/+AOuoHkeE2lKGUAtlPMyP zpx4SXgyK+1ramIPK50Bl7wAf5USFKCteIsre0zpBp8iCctLUUMFlQltVrXRV9Pd0pO2 tHpS70W8FElT1PNnjo2nAinZHStZCTPGYb3ucMd2/7lz/lJ6JlaEI7SqZcTnNJvTlqia ml/d/e9SQTytL9io5ua88l9n0CtISrw0bp/VSnmaDhft1fqO4MsGG2pAVAPjUzXAKpZ7 jCYA== X-Gm-Message-State: APjAAAUQqardDylhYdQ1khg8HN9umTJmiWF+GHHioJXXu5RJesbFids2 5HESePk7eoW1j3oXU2YpDlgKsCfZ X-Google-Smtp-Source: APXvYqx8SlLQMS9ZPpxzRXThbNEEkBGMkAKmQO7bsqee0v8Wt87cd/4Ma9FZXSjY+EhpHhR+XeZjGA== X-Received: by 2002:a1c:dcd5:: with SMTP id t204mr6655403wmg.34.1576713509512; Wed, 18 Dec 2019 15:58:29 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:29 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 07/10] lpfc: Fix unmap of dpp bars affecting next driver load Date: Wed, 18 Dec 2019 15:58:05 -0800 Message-Id: <20191218235808.31922-8-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org When unattaching, the driver did not unmap the DPP bar. This caused the next load of the driver, which attempts to enable wc, to not work correctly and wc to be disabled due to an address mapping overlap. Fix by unmapping on unattach. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 3defada2602f..4685745aa6ed 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -10441,6 +10441,8 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba) case LPFC_SLI_INTF_IF_TYPE_6: iounmap(phba->sli4_hba.drbl_regs_memmap_p); iounmap(phba->sli4_hba.conf_regs_memmap_p); + if (phba->sli4_hba.dpp_regs_memmap_p) + iounmap(phba->sli4_hba.dpp_regs_memmap_p); break; case LPFC_SLI_INTF_IF_TYPE_1: default: From patchwork Wed Dec 18 23:58:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302467 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84A1C14F6 for ; Wed, 18 Dec 2019 23:58:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6123F21582 for ; Wed, 18 Dec 2019 23:58:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TIhSAy3K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726536AbfLRX6d (ORCPT ); Wed, 18 Dec 2019 18:58:33 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37237 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbfLRX6c (ORCPT ); Wed, 18 Dec 2019 18:58:32 -0500 Received: by mail-wm1-f65.google.com with SMTP id f129so3796904wmf.2 for ; Wed, 18 Dec 2019 15:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sJThSQrCzIMCci9msuxVVOlbZZ2FNJGh01WUc1dAmJM=; b=TIhSAy3KQhGzo513x/gBQMqnMKvm+BO7VKyWx3Wh3K/yTYx9AKynZRI7rVYBreGkwS uCTruuEiE3g8xUHfPqWLOqfZOTCPK+7WkpH514Y5vsEmjdqBA5Q6uo3g8ehhslXxAH5y l5Pxqjwo78Pb1wSTnvIKEhXw5S5/26+tCJl6nJq1dHMRhS7ibQp5uq+xRDiOD3gWg16p NuAbujTqOus7B+N4HvRGIfRE/3zpoysTzooXOGtIeiCpbEPuDyIUUINC/B0FjRfVysrr 186citorqF4b4+InjVZqeVoraqpkWwV7tal7jojsr4GjanukQhjsgSdrIkhmqCRmJP8W A2lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sJThSQrCzIMCci9msuxVVOlbZZ2FNJGh01WUc1dAmJM=; b=fj2/4E97raf0iQNivCuYIcP2jaFXHrUwhdHSZC5BJ1D6DuOHhv546qgVTjUs4ZP/p3 htNJhCK3myLhXYaAahN5vXFO6ewuurEWEDudNDU+iwKPzDYZzdd+GbWHTb6deVEjN4Hy vz/sMRUvHhLP18JJBnG4eMPHkTdmHG3SJuyhUyOxdBS4GmRwXQc2NGPOQwe4PhTscKxw 5kAq+BjHbYf3nO/xsqBtZLUralu4cEZMNsiz3jS/5wchAvb2ROWdyJwvYQBx1xDUf2sC qqG0jtlhoh9gHKFYXju4zmxKxmC2RV8OV5k4yM13vBdIanSSVm2yc+vluCj/OpJdYoSh oayg== X-Gm-Message-State: APjAAAXijCCLtw8holVqONBVv9aNnodj5n9vHYPCiHP5qpOHmoJaoW4K +5C6DFyIcLilq8uy58VBlZhtPmO3 X-Google-Smtp-Source: APXvYqxvyy/EFWfIt5aCqSyOlV9ep+vZ2wFiLBCAi0Hm1HRSCEslz3ZllNMC8dSUKi14p2oIExMtpQ== X-Received: by 2002:a05:600c:20c7:: with SMTP id y7mr6527924wmm.21.1576713511140; Wed, 18 Dec 2019 15:58:31 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:30 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 08/10] lpfc: Fix MDS Latency Diagnostics Err-drop rates Date: Wed, 18 Dec 2019 15:58:06 -0800 Message-Id: <20191218235808.31922-9-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org When running Cisco-MDS diagnostics which perform driver-level frame loop back, the switch is reporting errors. Diagnostic has a limit on latency that is not being met by the driver. The requirement of Latency frames is that they should be responded back by the host with a maximum delay of few hundreds of microseconds. If the switch doesn't get response frames within this time frame, it fails the test. Test is failing as the lpfc-wq workqueue was overwhelmed by the packet rate and in some cases, the work element yielded to other kernel elements. To resolve, reduce the outstanding load allowed by the adapter. This ensures the driver spends a reasonable amount of time doing loopback and can do so such that latency values can be met. Load is managed by reducing the number of receive buffers posted such that the link can be backpressured to reduce load. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 12319f63cb45..e660ee98ad8b 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -4918,8 +4918,17 @@ static int lpfc_sli4_rb_setup(struct lpfc_hba *phba) { phba->hbq_in_use = 1; - phba->hbqs[LPFC_ELS_HBQ].entry_count = - lpfc_hbq_defs[LPFC_ELS_HBQ]->entry_count; + /** + * Specific case when the MDS diagnostics is enabled and supported. + * The receive buffer count is truncated to manage the incoming + * traffic. + **/ + if (phba->cfg_enable_mds_diags && phba->mds_diags_support) + phba->hbqs[LPFC_ELS_HBQ].entry_count = + lpfc_hbq_defs[LPFC_ELS_HBQ]->entry_count >> 1; + else + phba->hbqs[LPFC_ELS_HBQ].entry_count = + lpfc_hbq_defs[LPFC_ELS_HBQ]->entry_count; phba->hbq_count = 1; lpfc_sli_hbqbuf_init_hbqs(phba, LPFC_ELS_HBQ); /* Initially populate or replenish the HBQs */ From patchwork Wed Dec 18 23:58:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302469 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53F1D138C for ; Wed, 18 Dec 2019 23:58:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31B9D21582 for ; Wed, 18 Dec 2019 23:58:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r6kg800K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726696AbfLRX6f (ORCPT ); Wed, 18 Dec 2019 18:58:35 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40216 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbfLRX6e (ORCPT ); Wed, 18 Dec 2019 18:58:34 -0500 Received: by mail-wm1-f66.google.com with SMTP id t14so3779668wmi.5 for ; Wed, 18 Dec 2019 15:58:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4Gm7kV156yShIXHTK6fFqsQOeVAGlnxtZJEsUpw2+ZA=; b=r6kg800KlKafvQ47SzK0KPr2hIHK22sSilBDVxVpP34G5sa851T0NwvNFV4ji4uukn Qz7cksNm+SQhzX0vPR3v/ySbYVQhEnmH0fnxkMxRruKufEeibsO1/cPiofvdCjYWtAs8 4zv994nq66rvnRR+pQ+yQaokbcqgQskRGnPJNqlKMFTk51rF785zUEPa0pP6n37Iao/b xxeTfywIc4BvijB5yOV4KU6Xjarfmhw9Efs24JW2ArVKqPy/oeDYbAWqtwTIOpH0RNeD heC45AdJPFFSnTAFBVGII1obakIeUIFIFbjzeoEh158QfG//1UUv01knYBK0XcROqq2K T0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4Gm7kV156yShIXHTK6fFqsQOeVAGlnxtZJEsUpw2+ZA=; b=akEL/fSNh3xYoWXyZ0iCDYZzPpeyzrLabWMrpUSnNiZtyRc1s+auq4JEaYUC840s0A 0j4ej403UPCUYguDTpLvefNoQjsbbcyvySI3tmwV2qWnYsDNvhbBNSRZZX+7l2hgXoQO +JZxrMv7OP6lwMJFHUEVmRBK5zlBgDqp7kNYnjvW4auglt33gdzMucHchaus6iGUxfug MA0g/SBwxUDXR/0ZufLKBOyM2oOME+kCYL63Z3yllrV1NOQYdOsA2dIgc7+goK/ofh/5 /RNpwA7QqppT0psi6Cw0nhLfK4hbgFhfHWyQg/8Zpd4wPb/9hcn2A/m769ZTjiPVujaW YkXg== X-Gm-Message-State: APjAAAVdvKAtS5N9BWmA3O7P+aAWBNj7O4knxf6keX14DWAPdo0PabEN VIcKMb/FXT8IfbKgjonDc4zLLeDq X-Google-Smtp-Source: APXvYqybzzM1gEwJuMBfcWI9Hs4ghx4K7lfgqG9zJ5Z8gRjCfNbZexuhPn4H7x6cGrLMzCMk5Uffwg== X-Received: by 2002:a7b:c183:: with SMTP id y3mr6450059wmi.0.1576713512824; Wed, 18 Dec 2019 15:58:32 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:32 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 09/10] lpfc: Fix improper flag check for IO type Date: Wed, 18 Dec 2019 15:58:07 -0800 Message-Id: <20191218235808.31922-10-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Current driver code looks at iocb types and uses a "==" comparison on the flags to determine type. If another flag were set, it would disrupt the comparison. Fix by converting to a bitwise & operation. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index b138d9fee675..2c7e0b22db2f 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -481,7 +481,7 @@ lpfc_sli4_vport_delete_fcp_xri_aborted(struct lpfc_vport *vport) spin_lock(&qp->abts_io_buf_list_lock); list_for_each_entry_safe(psb, next_psb, &qp->lpfc_abts_io_buf_list, list) { - if (psb->cur_iocbq.iocb_flag == LPFC_IO_NVME) + if (psb->cur_iocbq.iocb_flag & LPFC_IO_NVME) continue; if (psb->rdata && psb->rdata->pnode && @@ -528,7 +528,7 @@ lpfc_sli4_io_xri_aborted(struct lpfc_hba *phba, list_del_init(&psb->list); psb->flags &= ~LPFC_SBUF_XBUSY; psb->status = IOSTAT_SUCCESS; - if (psb->cur_iocbq.iocb_flag == LPFC_IO_NVME) { + if (psb->cur_iocbq.iocb_flag & LPFC_IO_NVME) { qp->abts_nvme_io_bufs--; spin_unlock(&qp->abts_io_buf_list_lock); spin_unlock_irqrestore(&phba->hbalock, iflag); From patchwork Wed Dec 18 23:58:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 11302471 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5655814F6 for ; Wed, 18 Dec 2019 23:58:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33D6B21582 for ; Wed, 18 Dec 2019 23:58:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZQsIO2YO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbfLRX6h (ORCPT ); Wed, 18 Dec 2019 18:58:37 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:55803 "EHLO mail-wm1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbfLRX6g (ORCPT ); Wed, 18 Dec 2019 18:58:36 -0500 Received: by mail-wm1-f48.google.com with SMTP id q9so3646778wmj.5 for ; Wed, 18 Dec 2019 15:58:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8HpBvRCSayXYv5pcttp/eHHIlispcTWSkzwSsvE7cns=; b=ZQsIO2YODodilz7Q1Tdcs/S7NCrYRzF6P8PTCMt0E7TKdrDfVaRHPaDz+cmDdrtCxh k1PlsQrR5HHVqlCY0B2eu5H/pxNEfuMfrJ9vAMbb7/z+8AyX1fRcOhkzoAZGH8D7+rgM VQKP9ZNAMqPCcMUJ0eDFhSpF3ZBRYe3e9c20krgZ2XojnQjYVm1tARji4p2MegT7zaZK 2V29JVIf4ze6pXkgswvvQyWBSwpW8nMAbrVCv2Pj2V2HqLVA4lMEf9S2Fskc/W9Pow/y QS+0dBdLDTwPqpYc9MN4mB0VwO5V3bv0Gqki8hU9ZHmgB8Xb9saLnXJLGQ1b6EzVxGwx 7KNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8HpBvRCSayXYv5pcttp/eHHIlispcTWSkzwSsvE7cns=; b=m9cn5VHVy/6r2wHyoA645yFQOgGXkSStbPe22hbj+O3sQhuHZchuj+MbzsyZC9vBnZ rkUyQ8FNOFKGkfIALCXefKp0eXf0Gj5OV7Egij0eZ+5AHQIDDADdCFJcGbW1+VhrzUzy FrtpiimsuBrm5SL131UuhxzoA6zbd/jE6eBXgzXXDhb0WTO2OaxAhNUMKkm+yXdxUB04 BbGMyCZB7jqe1LjVnP0ZmbKIOu+yPaLZ3Kg6VnJuekpx9j++t7eGNuhfcn1Q+47Z6pMX uuY/BKmNXd0YfvCeUM2V3jYjlnxKcI35SWFSh/nazVagtK0q9xELNSRahglwA4cAkv2p M7AQ== X-Gm-Message-State: APjAAAXqpaXa5ZafnYIRz2qYn3203+C/8mIbyAKXNd6sg8orMmgTaZWr SexiAPaX31eQfxRpeRKYU2p8ju0W X-Google-Smtp-Source: APXvYqx19X2mG02W7Xe6nCJLtPnn8qju5jf3ILsrRqzE6x+D6f32tZyTZRsO47BlJ36e2sOyaaXUzA== X-Received: by 2002:a1c:6809:: with SMTP id d9mr6441282wmc.70.1576713514440; Wed, 18 Dec 2019 15:58:34 -0800 (PST) Received: from os42.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x11sm4240731wmg.46.2019.12.18.15.58.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Dec 2019 15:58:34 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy Subject: [PATCH 10/10] lpfc: Update lpfc version to 12.6.0.3 Date: Wed, 18 Dec 2019 15:58:08 -0800 Message-Id: <20191218235808.31922-11-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191218235808.31922-1-jsmart2021@gmail.com> References: <20191218235808.31922-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Update lpfc version to 12.6.0.3 Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index 9e5ff58edaca..9563c49f36ab 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "12.6.0.2" +#define LPFC_DRIVER_VERSION "12.6.0.3" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */