From patchwork Mon Jul 22 07:05:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11051689 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 BD5C3138D for ; Mon, 22 Jul 2019 07:06:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A785F27E71 for ; Mon, 22 Jul 2019 07:06:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9929E28495; Mon, 22 Jul 2019 07:06:22 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 4688527E71 for ; Mon, 22 Jul 2019 07:06:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727507AbfGVHGV (ORCPT ); Mon, 22 Jul 2019 03:06:21 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:33446 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727462AbfGVHGV (ORCPT ); Mon, 22 Jul 2019 03:06:21 -0400 Received: by mail-wm1-f65.google.com with SMTP id h19so28058002wme.0 for ; Mon, 22 Jul 2019 00:06:20 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=rNVQ+8E+RF952aYbTi91B8fuGaq22pT7KlcSHGXxod0=; b=rZYdMWFxztubokF8BzMoYfgLk6pHPZIKKrRrAi36t+8KeZlum9pDomGiUotlQupDex 3p8Ov0RhJj3XvdYKrJvO2WekNA02gSirSfaEhs47e3PHJ4jBnoPqaEwPOAn7t6nRdgdt p4Lqha0OsFLse2ojdmO+KLwyJDyxvP3JpS7qBexu3XhdzIUvRXYgwsG4KNUf8ZkHKFbl gW2RV+wsZLL1QOC5YzktK/gRVXgOxbwGyQmMVswvW0eHHYSo9m+VX0qIDJNG4kRoh3+r +aOlj1HK+zyOdD2ozF1m2gGNT6YhJhQKhWuvevhsb4MdycN1wGpSkZg5gN5Q1JjJxYqq fswQ== 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:mime-version:content-transfer-encoding; bh=rNVQ+8E+RF952aYbTi91B8fuGaq22pT7KlcSHGXxod0=; b=o0zlzM6aw2+g3JB/ic3G0GFqUxKaEAbauYvgGGH6VbgmH09eGVsDNLvSOS4FibicHu IccaPUh7iw7ua/DrQ0W+ZAZeUUDiikPtHrGRX1fSj0Vgp76cWLsLXq3yuZeGJwR5Xfq0 ExsB25Gz31DiQOMrcl7Z4jyVrTGg3zB4capoQFHbP61RvNocs62tU0G59erEdaJfUYL8 XJxSNeSdBCikir5hYAXe5kU3io2WQN//gF5Q7e02cB8IviQckUvKlAZxW/rJcxvVhhi5 eb8J2tI72UF1WGbeGcWWCuIHM9hWCU7TRF+9sWkulLmuVyxKSME3vmGClzprB21AJELQ xJ4Q== X-Gm-Message-State: APjAAAURs9Iog/Tk8td0P+WXxJ24oHFQ+utZ3n5CiO7rzlnsH13JY+Qw wBJ7bcyHIb0RIf+5TswWri7QBMP4 X-Google-Smtp-Source: APXvYqyVG3+Z1ngPEboLyXnkPiMTuPNh975OLC8YD52FJrHLNPFOnhOu59aeWjYUoTGMDQPfPeHCwA== X-Received: by 2002:a1c:be05:: with SMTP id o5mr62967570wmf.52.1563779179285; Mon, 22 Jul 2019 00:06:19 -0700 (PDT) Received: from kheib-workstation.redhat.com (bzq-79-178-23-200.red.bezeqint.net. [79.178.23.200]) by smtp.gmail.com with ESMTPSA id y18sm37360991wmi.23.2019.07.22.00.06.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 00:06:18 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Potnuri Bharat Teja , Faisal Latif , Shiraz Saleem , Kamal Heib Subject: [PATCH for-next 1/3] RDMA/cxgb3: Report phys_state in query_port Date: Mon, 22 Jul 2019 10:05:48 +0300 Message-Id: <20190722070550.25395-2-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722070550.25395-1-kamalheib1@gmail.com> References: <20190722070550.25395-1-kamalheib1@gmail.com> MIME-Version: 1.0 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 Add support for reporting physical state when calling query_port() via the sysfs interface. Signed-off-by: Kamal Heib --- drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index e775c1a1a450..7b0b7bfc570a 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c @@ -1004,18 +1004,24 @@ static int iwch_query_port(struct ib_device *ibdev, props->max_mtu = IB_MTU_4096; props->active_mtu = ib_mtu_int_to_enum(netdev->mtu); - if (!netif_carrier_ok(netdev)) + if (!netif_carrier_ok(netdev)) { props->state = IB_PORT_DOWN; - else { + props->phys_state = 3; + } else { inetdev = in_dev_get(netdev); if (inetdev) { - if (inetdev->ifa_list) + if (inetdev->ifa_list) { props->state = IB_PORT_ACTIVE; - else + props->phys_state = 5; + } else { props->state = IB_PORT_INIT; + props->phys_state = 4; + } in_dev_put(inetdev); - } else + } else { props->state = IB_PORT_INIT; + props->phys_state = 4; + } } props->port_cap_flags = From patchwork Mon Jul 22 07:05:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11051691 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 7A8206C5 for ; Mon, 22 Jul 2019 07:06:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6592A27E71 for ; Mon, 22 Jul 2019 07:06:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5866F28495; Mon, 22 Jul 2019 07:06: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 0A30327E71 for ; Mon, 22 Jul 2019 07:06:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727581AbfGVHGX (ORCPT ); Mon, 22 Jul 2019 03:06:23 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53012 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbfGVHGX (ORCPT ); Mon, 22 Jul 2019 03:06:23 -0400 Received: by mail-wm1-f67.google.com with SMTP id s3so33981085wms.2 for ; Mon, 22 Jul 2019 00:06:21 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=8eDi4pElNgxuidboKBe2fs6EPmhwWqTYdPnDkUOsWIE=; b=qP4dWzkHb8O9raRXALFTeD2f1667cT5Mluf7J8ldTfLrubRkYrWu5uLplqgc4DAKtS sB8su4HE+FwptIc1KSuT/1KXabR7kEyv+OUzBNoVjKO7WcXwo+f7/ZFAkw52qCYNmZPE lsjB6EPjuwWCU9VFf0Dw6FMI5+1rIy/jjzpeyKDp/z798dO2cqwWZMoQgkowDpcQqHYM RbnqNSzY7ZOll+uHXySoEs2Wj4tFJze6q/DLISHOVNaRwQt1W6e6caPimlrbokNOITuW hu5A1LGq+mUV6iLyUO7aWPAWBBTZ7GHCWswL8UENNp0HSqtxoGBVMxqFDuNbvEFN9vc+ JYjQ== 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:mime-version:content-transfer-encoding; bh=8eDi4pElNgxuidboKBe2fs6EPmhwWqTYdPnDkUOsWIE=; b=e+0LqNl2afn+hdZG9duledmIgoWXozn3GjOFjQ8jWzAtQtbDT+9odXgdG9cRGW7Djw CM2YJ1HxuavF6JwjHDhJl7JChBodh2gs+aFXScAFwm9m7qhBYVm9WxGjt7UT17UkEDgN UWJkUhEHn9c3DNc/Awr39qbr5TcQU6ONuHKF0jBDdDc7jA9dD2+OgIX0JZYDkX7t5aT5 6VKi+YBPkQ0ggr3m9gChHrh2HlJW0nkNDjdL5osrUQFnxqZ5bZdJUr/RtzrAf5oDoMhx mvMq+fPl2+OPNIX8wUz9SLK0c8Iy+e8m1mlnvbz/c5/jKx7JVztVCGTbGj89P0oFpTgW JnJw== X-Gm-Message-State: APjAAAX29DTCDxOgf+MVV0a70YqJF1nsQUFJT6cwJp9omXfJl7y8PGg1 UrrDg91ZKENSd0M8pO+z9CwDqzJD X-Google-Smtp-Source: APXvYqxITTEbfTiDfS49plpotwrYUUJha0PJwhXnrveDOvSXRBCQ2pueU+nYknWktqGWsJ5m20VP+A== X-Received: by 2002:a1c:a942:: with SMTP id s63mr61256446wme.76.1563779180760; Mon, 22 Jul 2019 00:06:20 -0700 (PDT) Received: from kheib-workstation.redhat.com (bzq-79-178-23-200.red.bezeqint.net. [79.178.23.200]) by smtp.gmail.com with ESMTPSA id y18sm37360991wmi.23.2019.07.22.00.06.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 00:06:20 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Potnuri Bharat Teja , Faisal Latif , Shiraz Saleem , Kamal Heib Subject: [PATCH for-next 2/3] RDMA/cxgb4: Report phys_state in query_port Date: Mon, 22 Jul 2019 10:05:49 +0300 Message-Id: <20190722070550.25395-3-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722070550.25395-1-kamalheib1@gmail.com> References: <20190722070550.25395-1-kamalheib1@gmail.com> MIME-Version: 1.0 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 Add support for reporting physical state when calling query_port() via the sysfs interface. Signed-off-by: Kamal Heib --- drivers/infiniband/hw/cxgb4/provider.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index 5e59c5708729..d38c242a1693 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -317,18 +317,24 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port, props->max_mtu = IB_MTU_4096; props->active_mtu = ib_mtu_int_to_enum(netdev->mtu); - if (!netif_carrier_ok(netdev)) + if (!netif_carrier_ok(netdev)) { props->state = IB_PORT_DOWN; - else { + props->phys_state = 3; + } else { inetdev = in_dev_get(netdev); if (inetdev) { - if (inetdev->ifa_list) + if (inetdev->ifa_list) { props->state = IB_PORT_ACTIVE; - else + props->phys_state = 5; + } else { props->state = IB_PORT_INIT; + props->phys_state = 4; + } in_dev_put(inetdev); - } else + } else { props->state = IB_PORT_INIT; + props->phys_state = 4; + } } props->port_cap_flags = From patchwork Mon Jul 22 07:05:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 11051693 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 532436C5 for ; Mon, 22 Jul 2019 07:06:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FC0A27E71 for ; Mon, 22 Jul 2019 07:06:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33FF128495; Mon, 22 Jul 2019 07:06:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 DE5B327E71 for ; Mon, 22 Jul 2019 07:06:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726534AbfGVHGY (ORCPT ); Mon, 22 Jul 2019 03:06:24 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51152 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727462AbfGVHGY (ORCPT ); Mon, 22 Jul 2019 03:06:24 -0400 Received: by mail-wm1-f68.google.com with SMTP id v15so34008785wml.0 for ; Mon, 22 Jul 2019 00:06:23 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=g2rNmp3b6nRPP1Tf/VlEY1KtJQoFPWoHmhuhzTL9Gbk=; b=lh1Qee0waWxiAw9Ix8Kp0p7TKDxu3/hAwekDanj4o6DMdt9CY9eAeVnFsmUvOEnKa8 u1cK4umG72N9os1Uft03DQmW78JSRwiMvi8o7y48TlYZPePwGvsag85y3Km6i278iymd PdqgNmufg/1EyyO4sRNZV4i3Csm1naMKIqwxDY6vFRNJYvZ4mJ1C3liju2lzSS6JghUH KYsPxDvEsl3SY8YlvyuijsxkG6P9WJ0HAixu7uzJAaLUEwteapYSEKFhUhtEubHXrIar E6Ws6+XN6X83X7BNrZMD8YD0CvotEp4pYLwXXCEkQhsziBO7AdtICVWTKlmTOteUPZA3 GrjQ== 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:mime-version:content-transfer-encoding; bh=g2rNmp3b6nRPP1Tf/VlEY1KtJQoFPWoHmhuhzTL9Gbk=; b=Xm6Xs5cumqTIaHXS1kHQ8g4oiX0IzlAYds7tPaSMCANzuruD0z0QuLl54c/haeD/tC zdr7XhEQleiSG4yg7OJHCRRunKAtKw1xqyCcSpmE6hZFy2+uQj4wZmvAffmToYxVLRsx Y2+/34jPV5ky6TqQk+u8otIOxLUEg2vZAz1ksEiqTLGTHNZJtfsjO4XKsCxZoKWhFExT YMmwI1e6vTlaeLQiJ26FcCOgDwlqfJOMaRk89l9P97ZvKf85FUC9V/ESuWEoiGO1OASL cbDg+elrUD7oAw1Pz/Pkbc7LZxo8OFZhgslZzMDbfHfEFifLv6UfZqeOjxJ21CZB9gd/ omuQ== X-Gm-Message-State: APjAAAUUGGG20xQYiIRxJeJcqkMwy9v++Xg1yo8yxUB09YDm97JyYv71 V+bP4eh+oO4xuiEmyt2fZ+CJVOuj X-Google-Smtp-Source: APXvYqw+pawjsLG7KkSNDPo4wnRaxghMa+hW+1Eq67MVR1T+rysM2vOHEVyWXty6FH5PKPiDplWr7g== X-Received: by 2002:a1c:7fc3:: with SMTP id a186mr10761071wmd.151.1563779182136; Mon, 22 Jul 2019 00:06:22 -0700 (PDT) Received: from kheib-workstation.redhat.com (bzq-79-178-23-200.red.bezeqint.net. [79.178.23.200]) by smtp.gmail.com with ESMTPSA id y18sm37360991wmi.23.2019.07.22.00.06.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 00:06:21 -0700 (PDT) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Potnuri Bharat Teja , Faisal Latif , Shiraz Saleem , Kamal Heib Subject: [PATCH for-next 3/3] RDMA/i40iw: Report phys_state in query_port Date: Mon, 22 Jul 2019 10:05:50 +0300 Message-Id: <20190722070550.25395-4-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722070550.25395-1-kamalheib1@gmail.com> References: <20190722070550.25395-1-kamalheib1@gmail.com> MIME-Version: 1.0 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 Add support for reporting physical state when calling query_port() via the sysfs interface. Signed-off-by: Kamal Heib --- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c index d169a8031375..c678b05bb829 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c @@ -105,10 +105,13 @@ static int i40iw_query_port(struct ib_device *ibdev, props->active_mtu = ib_mtu_int_to_enum(netdev->mtu); props->lid = 1; - if (netif_carrier_ok(iwdev->netdev)) + if (netif_carrier_ok(iwdev->netdev)) { props->state = IB_PORT_ACTIVE; - else + props->phys_state = 5; + } else { props->state = IB_PORT_DOWN; + props->phys_state = 3; + } props->port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP | IB_PORT_VENDOR_CLASS_SUP | IB_PORT_BOOT_MGMT_SUP; props->gid_tbl_len = 1;