From patchwork Tue May 23 13:19:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dupuis, Chad" X-Patchwork-Id: 9742581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5AE566032C for ; Tue, 23 May 2017 13:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49367287B7 for ; Tue, 23 May 2017 13:20:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E2D8287D7; Tue, 23 May 2017 13:20:31 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 B079A287B7 for ; Tue, 23 May 2017 13:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937119AbdEWNU3 (ORCPT ); Tue, 23 May 2017 09:20:29 -0400 Received: from mail-dm3nam03on0058.outbound.protection.outlook.com ([104.47.41.58]:54285 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S937120AbdEWNT6 (ORCPT ); Tue, 23 May 2017 09:19:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=37ugp2YvBr9OvF8gn7bR1F68SlqCFenXmZ8PmReI1C0=; b=CPAeMe+gNv0Q1xc/mHDwP87/Fu6wab6kPmL7T2yoZQ8ZdbQsu8CYC+qcp5Kb//evKNkmRuRaLKWGcW6IVIo4PODS3Gbb8zQQpvKkQA6e0XwE/s26IPc1Q9cWKgn9HBQ9ATLohn1Hxx5MR8aiKr7hKcaqxbF5P9trcw+DXfVSlTg= Received: from CO2PR07CA0048.namprd07.prod.outlook.com (10.174.192.16) by BN1PR07MB422.namprd07.prod.outlook.com (10.141.59.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Tue, 23 May 2017 13:19:45 +0000 Received: from BN1AFFO11FD028.protection.gbl (2a01:111:f400:7c10::174) by CO2PR07CA0048.outlook.office365.com (2603:10b6:100::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Tue, 23 May 2017 13:19:45 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; oracle.com; dkim=none (message not signed) header.d=none; oracle.com; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD028.mail.protection.outlook.com (10.58.52.88) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1075.5 via Frontend Transport; Tue, 23 May 2017 13:19:44 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 23 May 2017 06:19:32 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id v4NDJXf7001836; Tue, 23 May 2017 06:19:33 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v4NDJXDg001835; Tue, 23 May 2017 06:19:33 -0700 From: "Dupuis, Chad" To: CC: , , Subject: [PATCH 06/15] qedf: Add fka_period SCSI host attribute to show fip keep alive period. Date: Tue, 23 May 2017 06:19:22 -0700 Message-ID: <20170523131931.1777-7-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170523131931.1777-1-chad.dupuis@cavium.com> References: <20170523131931.1777-1-chad.dupuis@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39400400002)(39840400002)(39450400003)(39850400002)(39410400002)(2980300002)(428002)(189002)(199003)(9170700003)(47776003)(76176999)(8936002)(50226002)(356003)(50986999)(8676002)(81166006)(305945005)(33646002)(5003940100001)(48376002)(50466002)(72206003)(5660300001)(478600001)(189998001)(101416001)(2906002)(54906002)(36756003)(1076002)(2950100002)(6916009)(6666003)(4326008)(107886003)(38730400002)(2351001)(80596001)(105586002)(110136004)(106466001)(42186005)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR07MB422; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD028; 1:Y2v1gdJbeKataFJEABFilDJijzova6bvKU+p2+B57smwahTN807uN8+lfzhW/oPGW2LBolxYBVJKqbb4i6UwBQ11Jcfj196A0ZUOfNl8vN7I3D4dsIgRiRyZl1G3kut3Ue1gMIJRuvW0dtFNeBRzRLFZlIEIhmKRSL9NGwWgDDWXRTiOCmZI/2RnAut9T6ZC9lE+swmxmJMUyVueM4n+ooGCRd+S/l/9FS6jr/GCauquMOO+kAMr84Iu1r7lTcFW7Co0gIDd1AMvTAoGzdJLDY0aCrKjXhKoSv7iqLS4wxCab+V+f6KH7x10B4ernXBaFq1Vf5r0MZvICcknKHjz2tl9GANEyYO+OqbDKjDNt3oqEUvem8+kU017P1ns9MXvVJJjoJj3+P7Sfm/X00+dEPoKbB5K6Acv9MhCEZ6ZKILVjdCMP9D7S+gXxUzvKZRzLOy2MlMLqWELnSULanmNmqQ7WhPXuoJRN/+S5mRX36aJ8j69RdX40PRtq5tmrwbeQO2knqX/mFqieXsUJgWCZg== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PR07MB422: X-MS-Office365-Filtering-Correlation-Id: 27676588-513e-47a2-2fa4-08d4a1de610c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BN1PR07MB422; X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB422; 3:Y3PPn5gKPvGGdTOPeUjT6hK9K8BG3d1VlfvZ97YuriUgYGNz7oNj+NFtWRoGAqC52d1QuL0f4Y8kEC0ggF+cCnyQ4l+wDaXNKr/tHzaPl8acGv3MiFzg8dvk8v8u8AKVKBNo8mdHUK2FlmLis2V4n2mr4pbDRwtOtAJ4Gawgz4R1fDAQoKGEzsqLZFdNA+qQPQHBxCf1Lo+8sTxSJoHaX7/q9PnsYu0AQThUuGgibgvA5/aBfxEkXDYX6l/umL/9a7BqSVVYNV+ZYQDY82zKlhxIVo3MpUMZMd48L2qEtoccbBroiH7JEqMhVKzMKFBTWL3IHmzqHv4aq2OV54vuWcKTHwYXX0bdAvd7vPzefirUBfbboQXgTuLsmymJ8xvbdmAsoFF7iVjeN+9WSKk5hZuKZ11p5Rne991wdY4dnjGOr275sQa/V69CI2xiyTFobGsm7XR7ohijZJNhtOMvdBwtVmHWMKx3oJJBuPWW3PBSzBHA4nN5cmxePaoDbOH5 X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB422; 25:nwflGWx4Zea90iRwVDPqjM3Lt5feOlp7u/FbDFjYkx87jk2zCYaZxMomxRJ+/61pnh4jnDE2jnj3lEzaDgI0t9VHX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Ox3YGcRmBeRaZjLrayfgeeI/Sb+Hw5jpSqkQvutxN/fYeo/hueGYCFc6bqwFA/BnxG1SBjV8EZNk6xwFd7YX2RJ7Erdj0FNc9qm0mAgWTpwHNKJRCRzvd49VoCJl9cH2zvzD/UbhfKyYDHdjkpalgS3kKPFTRT/zKyrgM26tjUDf1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(13023025)(13024025)(13018025)(13017025)(5005006)(13015025)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148); SRVR:BN1PR07MB422; BCL:0; PCL:0; RULEID:; SRVR:BN1PR07MB422; X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB422; 4:iPvGZHHV+OktJ8DV/MyhsSpd4x+5/eC7dBS8cEg3+fOyC9WuXXb/0tT+PZeHmhPyJVwUZHNXxSAFeYFWrBKAC4bGPYbMbq5f3UM0kNZNBhZkQ8+h/adNKdrDgHOGhZrNgl5Wh6oJMhqG37d7EyEqVoZf2RNottaQ7Xte/5qShfC5uu2h7E3TOUnnL2UiZA9FIxw2mDnpka3fLku09GI8tZRrLP+n+VYLssFrB4h/nrnftoIz6rLk0zRyXPEZTErDQZvEKMmVixr1bhLgZmkQkl7CNKZZCugHhBU+XFssLINa7ohUDAGsyHP6H2a98CE7hP1J8yL1w/cPAJc/qXSvm6JtvJWjA8yv1hkb7n/gzsagxwHkutM2XFrHRlXDefVZYf0rhmEmCQdSWYXEKYdc8pWLNQgUsnjPFFDO1PLGvDBffWICDa8KBaD9HNyZvvs8FALPbyltrAym817ynrjHQHL1vUTvFx0C37+2ZbIh7f9KSCHjaF2W09gK9vXjU5ZInJeTgzIL2FlGDTxeFMqb+Xq4dhL4qwWj1Hfe1MNdM+//HQ60mWxGfINpdzhMDnBgsWitsTiztd5oR6wYA2kSAzooH4KfM60YNGm0rY8Mr9eALJsZ+gcQ+AI9eOWy8suH4LBsMw+F1oXqqDWR7N708KBHW9vH6QA8TXvqwmhasYd2KU/K2A7PPM6A8H++LbCtMxA4+zrobQgy3E9ooB85qR/f0dOhFYnw0jJJbLpqGQWbKiB8EVjsjH4iz323P63P91keB79KQAEsG88CGptCl6DnE7/gF3BuRbTHprrQj/P08PNCMMZtYV6J9IkV1X3i51Y3OKTqCMZdy/OaTN0cWKHbhA6+dTHFEi+Qp6NBm7B4v9vYFwphknig9cxWfehH X-Forefront-PRVS: 0316567485 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR07MB422; 23:VSZaf2P+ZIpMVZyGRZy1KYa1cwTa4RsneiLtS6B/07?= =?us-ascii?Q?7p/ie3lRqhtuMgewUfPPw4SnwiJ+kBeBJ5paYuB0Zj5QEFnFD/uu49QUJJ7s?= =?us-ascii?Q?yNhIeZHfDpKEJ5+rCO+UA9FWzD6xVemKJBL+WoAWD9sbSLIHuf6wXie80jXr?= =?us-ascii?Q?0BolVmBCP2o9TbOEEDdDHKSjhcAP/YjT5aEsT1FNqATi6wvMYxG5mbKRag/G?= =?us-ascii?Q?gFs+l9pgteQ7EgpE3qmLMeLGiOU5gZTcdCTFpDCvojwtYbJguVj/Qkwjn3B+?= =?us-ascii?Q?HPSNoCFY9tC0O75MNFNdo0ulxc81Zst2kC4w87VXDdKi7z4gaQEkoB9vdTro?= =?us-ascii?Q?53aY6Ml4ndry4ndjnoOtyuc3cR+QPwKdiO5O/Wm/+pNJrD7UP8wigqVQoRhx?= =?us-ascii?Q?cr1hdztep4IjEePXs2jAfrPBYD6d/+sezBX6bLUpdu5vNcEUwA5x7Xuwzt67?= =?us-ascii?Q?sIAYv+g8A88F7TYHMkv/hGl94DwrCtpmoslXPB95GKNSSF2+KNYVga9EICen?= =?us-ascii?Q?mwezOHXd7Wcg9p93LTS5cR8pqBcpDKIRVtVixKE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DIrhd5h6A2JyU9/D6tD58xeiLgdBpCsoyJ7o10p9xubeLxcni4noraGTZR6xR9QrXwdKWB1YwXVH6DdAI/1Kb9hBgJ2yLgPgUacDw92/CdHQUeDV+bLaO8RjNldJZB9IV2o+nMJ9jFt+m+6v+/kT8gLxbQi7oeeKTU3LXIDO8V0J/JXS4nnZjTUPb9qN1jEojTwUbuLZwMbIQmi7vPdveakY3H3/g==; 5:Ipk3YDRXNlRg5u29x0yPztGpCKsEmz31XYU5AF771ucgDp16xYFAJytb7owXnUayI/uk6ffEonHSK7n8mQzesVMvCYspH29Rtubf4fNy9ZIBd8NeqeXWk80s/eOR+U5ctJ1vxeflRkXJJNxXszOyIQ==; 24:E1rsR4tr7mukILbbPrsclq7d1WrbaCIEuZu87EUYmd5D0++mWMTtex57SW0iBFflMC85uuYcz+CRGQcas+y9Rlfly5bJbx11F10DAQ6WtzQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR07MB422; 7:Yc8Mu+LqExPrrJgT6OksWqE493ZTaKSTvODqZ2GhY2rGhwc3gUQHUvENTiv8a7fizV0Hx4B5MfX+3BRMHAaYUgfKh+sx9a8d7g+ZyxqsEV8aY7gvYIFfeUm3dwJ65ttsNIHC86TMdi84lMGMjglMjelBp8GdxMciMyJTDR4dZgfYimpX1FqsHe8Sov1r1aDkRTrd4M+eS2vjJpxuyCXQE/J70tLI1j81ycQxylF29TkArBqWgQlKUbqe4O0EEEjJIudwAphIRzjgpGZtUmdEcmXCcCv4TDOxxMLqFBr33o97BUnSvnnIkbId3jMI43tyM75q7b0TxudHMNpuRYJb2g== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 13:19:44.5650 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR07MB422 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 Expose this information for interested applications. Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_attr.c | 60 +++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/qedf/qedf_attr.c b/drivers/scsi/qedf/qedf_attr.c index 1349f8a..68e2b77 100644 --- a/drivers/scsi/qedf/qedf_attr.c +++ b/drivers/scsi/qedf/qedf_attr.c @@ -8,6 +8,25 @@ */ #include "qedf.h" +inline bool qedf_is_vport(struct qedf_ctx *qedf) +{ + return (!(qedf->lport->vport == NULL)); +} + +/* Get base qedf for physical port from vport */ +static struct qedf_ctx *qedf_get_base_qedf(struct qedf_ctx *qedf) +{ + struct fc_lport *lport; + struct fc_lport *base_lport; + + if (!(qedf_is_vport(qedf))) + return NULL; + + lport = qedf->lport; + base_lport = shost_priv(vport_to_shost(lport->vport)); + return (struct qedf_ctx *)(lport_priv(base_lport)); +} + static ssize_t qedf_fcoe_mac_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -26,34 +45,37 @@ return scnprintf(buf, PAGE_SIZE, "%pM\n", fcoe_mac); } +static ssize_t +qedf_fka_period_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct fc_lport *lport = shost_priv(class_to_shost(dev)); + struct qedf_ctx *qedf = lport_priv(lport); + int fka_period = -1; + + if (qedf_is_vport(qedf)) + qedf = qedf_get_base_qedf(qedf); + + if (!qedf->ctlr.sel_fcf) + goto out; + + fka_period = qedf->ctlr.sel_fcf->fka_period; + +out: + return scnprintf(buf, PAGE_SIZE, "%d\n", fka_period); +} + static DEVICE_ATTR(fcoe_mac, S_IRUGO, qedf_fcoe_mac_show, NULL); +static DEVICE_ATTR(fka_period, S_IRUGO, qedf_fka_period_show, NULL); struct device_attribute *qedf_host_attrs[] = { &dev_attr_fcoe_mac, + &dev_attr_fka_period, NULL, }; extern const struct qed_fcoe_ops *qed_ops; -inline bool qedf_is_vport(struct qedf_ctx *qedf) -{ - return (!(qedf->lport->vport == NULL)); -} - -/* Get base qedf for physical port from vport */ -static struct qedf_ctx *qedf_get_base_qedf(struct qedf_ctx *qedf) -{ - struct fc_lport *lport; - struct fc_lport *base_lport; - - if (!(qedf_is_vport(qedf))) - return NULL; - - lport = qedf->lport; - base_lport = shost_priv(vport_to_shost(lport->vport)); - return (struct qedf_ctx *)(lport_priv(base_lport)); -} - void qedf_capture_grc_dump(struct qedf_ctx *qedf) { struct qedf_ctx *base_qedf;