From patchwork Thu Mar 15 09:02:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10284129 X-Patchwork-Delegate: jgg@ziepe.ca 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 3F1DE6061F for ; Thu, 15 Mar 2018 09:03:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 360BC28818 for ; Thu, 15 Mar 2018 09:03:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AE8828832; Thu, 15 Mar 2018 09:03:05 +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,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 B8E1228818 for ; Thu, 15 Mar 2018 09:03:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751095AbeCOJCX (ORCPT ); Thu, 15 Mar 2018 05:02:23 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38570 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751826AbeCOJCV (ORCPT ); Thu, 15 Mar 2018 05:02:21 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DCD74023156; Thu, 15 Mar 2018 09:02:21 +0000 (UTC) Received: from dhcp-13-42.nay.redhat.com (unknown [10.66.128.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0262202698A; Thu, 15 Mar 2018 09:02:18 +0000 (UTC) From: Honggang LI To: dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org Cc: noaos@mellanox.com, linux-kernel@vger.kernel.org, honli@redhat.com Subject: [PATCH 1/2] IB/core: Set speed string to SDR for invalid active rates Date: Thu, 15 Mar 2018 17:02:13 +0800 Message-Id: <20180315090214.21706-2-honli@redhat.com> In-Reply-To: <20180315090214.21706-1-honli@redhat.com> References: <20180315090214.21706-1-honli@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 15 Mar 2018 09:02:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 15 Mar 2018 09:02:21 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'honli@redhat.com' RCPT:'' Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Honggang Li commit f1b65df5a232 ("IB/mlx5: Add support for active_width and active_speed in RoCE"). Before this patch applied, the mlx5_ib driver set default active_width and active_speed to IB_WIDTH_4X and IB_SPEED_QDR. Now, the active_width and active_speed are zeros if the RoCE port is in DOWN state. The speed string should be set to " SDR" instead of a blank string when active_speed is zero. Signed-off-by: Honggang Li --- drivers/infiniband/core/sysfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index 8ae1308eecc7..cf36ff1f0068 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c @@ -273,6 +273,7 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused, break; case IB_SPEED_SDR: default: /* default to SDR for invalid rates */ + speed = " SDR"; rate = 25; break; }