From patchwork Mon Aug 31 20:48:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 7101571 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 69FAB9F32B for ; Mon, 31 Aug 2015 20:48:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E57F206A3 for ; Mon, 31 Aug 2015 20:48:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D117206A5 for ; Mon, 31 Aug 2015 20:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752385AbbHaUsk (ORCPT ); Mon, 31 Aug 2015 16:48:40 -0400 Received: from mail-qk0-f172.google.com ([209.85.220.172]:33181 "EHLO mail-qk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753277AbbHaUsh (ORCPT ); Mon, 31 Aug 2015 16:48:37 -0400 Received: by qkdv1 with SMTP id v1so16763292qkd.0 for ; Mon, 31 Aug 2015 13:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=date:from:to:subject:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=VwgxVc6PLu37l252o0baBTBz6Er7jFQGO6fBuEN6ry4=; b=nGsdPbQTan9rDU13I7mnFtNnWBffNSKtWfgAtwk2WC7nmFujJEEHw8TXxrNQAykLmG lZzXA3BL66QaEPE9CdhAjDKcmUhT+GtJRCt077gBFYicNLbCgG1sKwdAI7aV5mkBMXll 8obiXvzLZOWKdDgC/7uPM23SXuQGyeldxFlfI= 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=VwgxVc6PLu37l252o0baBTBz6Er7jFQGO6fBuEN6ry4=; b=UcW7jWhWvL/GnWaAZY2OIi2/WCRfj7w5P7jtL+gWR+QoEJSdpzIHfrWV1iID+q6dgY Ny6JoDei4VbrfzAtMq6lzeqnnmNCrYInYSe0hu8dPoYkxiH4ERx4tmflsC8pOr/eCFia yVyzsrnOQjh2AHR2QZ8z1oSUKNdpzkbP4haliY67u8eGB1kMOiJwYGLKfD9CLT4qUllq 7jh6dYszmi+GEbubDaYXela95RiXcrw4aJAGchsssl9XvRfQHTL+WtkpxuKfftyZtTak PzysA9ChCcN2W1KqaOVUvdK+Bo9IP5IuZYfUb6II6vIZKkvzHGNN45l/JINo8l216lTc Wibg== X-Gm-Message-State: ALoCoQmhvz/fgA0ljH6Gm13v7lly7WxLIVz7n5XczQZmjrbccZN654JtFe3+Ccqi/nOjmEbPzWOe X-Received: by 10.55.214.70 with SMTP id t67mr12598457qki.61.1441054116509; Mon, 31 Aug 2015 13:48:36 -0700 (PDT) Received: from myfc17 (c-75-67-235-135.hsd1.nh.comcast.net. [75.67.235.135]) by smtp.gmail.com with ESMTPSA id 64sm9449716qhe.9.2015.08.31.13.48.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 31 Aug 2015 13:48:35 -0700 (PDT) Date: Mon, 31 Aug 2015 16:48:21 -0400 From: james.smart@avagotech.com (James Smart) To: linux-scsi@vger.kernel.org Subject: [PATCH 13/14] lpfc: Fix default RA_TOV and ED_TOV in the FC/FCoE driver for all topologies Message-ID: <55e4bd95.zMd4O6V0Gs9gSANh%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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,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 default RA_TOV and ED_TOV in the FC/FCoE driver for all topologies Initial link up defaults were not properly being tracked relative to initial FLOGI or pt2pt PLOGI. Add code to initialize them. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_hbadisc.c | 15 ++++++++++++++- drivers/scsi/lpfc/lpfc_hw.h | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 614d8e9..bfc2442 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -2974,7 +2974,8 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) MAILBOX_t *mb = &pmb->u.mb; struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) pmb->context1; struct lpfc_vport *vport = pmb->vport; - + struct serv_parm *sp = &vport->fc_sparam; + uint32_t ed_tov; /* Check for error */ if (mb->mbxStatus) { @@ -2989,6 +2990,18 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) memcpy((uint8_t *) &vport->fc_sparam, (uint8_t *) mp->virt, sizeof (struct serv_parm)); + + ed_tov = be32_to_cpu(sp->cmn.e_d_tov); + if (sp->cmn.edtovResolution) /* E_D_TOV ticks are in nanoseconds */ + ed_tov = (ed_tov + 999999) / 1000000; + + phba->fc_edtov = ed_tov; + phba->fc_ratov = (2 * ed_tov) / 1000; + if (phba->fc_ratov < FF_DEF_RATOV) { + /* RA_TOV should be atleast 10sec for initial flogi */ + phba->fc_ratov = FF_DEF_RATOV; + } + lpfc_update_vport_wwn(vport); if (vport->port_type == LPFC_PHYSICAL_PORT) { memcpy(&phba->wwnn, &vport->fc_nodename, sizeof(phba->wwnn)); diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index f73b6e1..2cce88e 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h @@ -33,7 +33,7 @@ #define FF_DEF_EDTOV 2000 /* Default E_D_TOV (2000ms) */ #define FF_DEF_ALTOV 15 /* Default AL_TIME (15ms) */ -#define FF_DEF_RATOV 2 /* Default RA_TOV (2s) */ +#define FF_DEF_RATOV 10 /* Default RA_TOV (10s) */ #define FF_DEF_ARBTOV 1900 /* Default ARB_TOV (1900ms) */ #define LPFC_BUF_RING0 64 /* Number of buffers to post to RING