From patchwork Fri Sep 18 08:02:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 1366620 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.a=rsa-sha256 header.s=n1 header.b=PHHltst6; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4Bt5tg3gYPz9sSt for ; Fri, 18 Sep 2020 18:03:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbgIRIDV (ORCPT ); Fri, 18 Sep 2020 04:03:21 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:4408 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbgIRIDU (ORCPT ); Fri, 18 Sep 2020 04:03:20 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 18 Sep 2020 01:02:36 -0700 Received: from sw-mtx-036.mtx.labs.mlnx (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 18 Sep 2020 08:03:19 +0000 From: Parav Pandit To: , , CC: Parav Pandit Subject: [PATCH net-next 1/3] devlink: Update kernel headers Date: Fri, 18 Sep 2020 11:02:58 +0300 Message-ID: <20200918080300.35132-2-parav@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200918080300.35132-1-parav@nvidia.com> References: <20200918080300.35132-1-parav@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600416156; bh=9x4XeV5I53rYvbhAY5dJ+R768l7h67r/AS3hL9BT4b4=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=PHHltst6/SOgmw0WPv+j1hvTCTuTLJy7s2Q158tr06ngH5q1JI0SFUw1kGACuiy7/ KHCuBnYTQvWX5HmuytWeHlzJc4fsen15dTNH4tEaQpSOGBTkCBg3QIsmPraroqYOFt ip4VSuWJ5lBRzROW0JO2ogba+RMJco48FVw3/MUWQ4tqCda+Q2+4UVjVw28WxRnh/i Q9IzcNXK76IDURumsGaB4SjV0k+mqTNMBgDTDVSwSRMGxULKKIo225OVgOUFDlbPoB AchHPjtuZMi4KX5U8QmG41ugIJQ7I8iITILCiZWgAC15yt3jMQA4VZ8htgpVpk8lS6 E79eL6rQmpkcg== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Update kernel headers to commit: e2ce94dc1d89 ("devlink: introduce the health reporter test command") Signed-off-by: Parav Pandit --- include/uapi/linux/devlink.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index b7f23faa..3d64b48e 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linux/devlink.h @@ -122,6 +122,8 @@ enum devlink_command { DEVLINK_CMD_TRAP_POLICER_NEW, DEVLINK_CMD_TRAP_POLICER_DEL, + DEVLINK_CMD_HEALTH_REPORTER_TEST, + /* add new commands above here */ __DEVLINK_CMD_MAX, DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 @@ -458,6 +460,8 @@ enum devlink_attr { DEVLINK_ATTR_PORT_LANES, /* u32 */ DEVLINK_ATTR_PORT_SPLITTABLE, /* u8 */ + DEVLINK_ATTR_PORT_EXTERNAL, /* u8 */ + DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, /* u32 */ /* add new attributes above here, update the policy in devlink.c */ __DEVLINK_ATTR_MAX, From patchwork Fri Sep 18 08:02:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 1366621 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.a=rsa-sha256 header.s=n1 header.b=k552+siL; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4Bt5tk2qWqz9sRf for ; Fri, 18 Sep 2020 18:03:26 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbgIRIDZ (ORCPT ); Fri, 18 Sep 2020 04:03:25 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:10955 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725874AbgIRIDV (ORCPT ); Fri, 18 Sep 2020 04:03:21 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 18 Sep 2020 01:03:08 -0700 Received: from sw-mtx-036.mtx.labs.mlnx (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 18 Sep 2020 08:03:19 +0000 From: Parav Pandit To: , , CC: Parav Pandit , Jiri Pirko Subject: [PATCH net-next 2/3] devlink: Show external port attribute Date: Fri, 18 Sep 2020 11:02:59 +0300 Message-ID: <20200918080300.35132-3-parav@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200918080300.35132-1-parav@nvidia.com> References: <20200918080300.35132-1-parav@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600416188; bh=20ZMItL7Pb8V8pDrbeTlVH92pzsGbajazG5oc+PmN+g=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=k552+siLTXqIaz+4ism1sKfnzRpH6rS7+w4eBdh0Qmd5rWNvVSZlpZM3PxXGwNLQk VQEPOGsxTIIHdjKpKODbR3YXFYPDdiCzX4P1Q3DvOqKDBTIHwPVRA+c3uCoP4TQz3E SpkeEKUJjKe/UQTAIWRS4wl8zmVtRof2bZTlc5ZtVIfptJXWuMzVfnQi5kXewZ1H4a 9tpb3FCkQNt9W6Qc96lI6H1uYWVpSXclJ6JjoC4zPGKncXIaCNao6so40p/5DgjGL7 ScC1aQPBxRMRMB74eY+wMzB15SU4yWzY4XAoOiGOjG/ITrxuyjEutvzIqgRmAPF6aK EqcCBzZwMY0zw== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If a port is for an external controller, port's external attribute is set. Show such external attribute. An example of an external controller port for PCI VF: $ devlink port show pci/0000:06:00.0/2 pci/0000:06:00.0/2: type eth netdev ens2f0c1pf0vf1 flavour pcivf pfnum 0 vfnum 1 external true splittable false function: hw_addr 00:00:00:00:00:00 $ devlink port show pci/0000:06:00.0/2 -jp { "port": { "pci/0000:06:00.0/2": { "type": "eth", "netdev": "ens2f0c1pf0vf1", "flavour": "pcivf", "pfnum": 0, "vfnum": 1, "external": true, "splittable": false, "function": { "hw_addr": "00:00:00:00:00:00" } } } } Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko --- devlink/devlink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devlink/devlink.c b/devlink/devlink.c index 007677a5..9f99c031 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -3351,6 +3351,12 @@ static void pr_out_port_pfvf_num(struct dl *dl, struct nlattr **tb) fn_num = mnl_attr_get_u16(tb[DEVLINK_ATTR_PORT_PCI_VF_NUMBER]); print_uint(PRINT_ANY, "vfnum", " vfnum %u", fn_num); } + if (tb[DEVLINK_ATTR_PORT_EXTERNAL]) { + uint8_t external; + + external = mnl_attr_get_u8(tb[DEVLINK_ATTR_PORT_EXTERNAL]); + print_bool(PRINT_ANY, "external", " external %s", external); + } } static void pr_out_port_function(struct dl *dl, struct nlattr **tb_port) From patchwork Fri Sep 18 08:03:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 1366622 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.a=rsa-sha256 header.s=n1 header.b=JJzGoczi; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4Bt5tl2Xmvz9sSt for ; Fri, 18 Sep 2020 18:03:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbgIRID0 (ORCPT ); Fri, 18 Sep 2020 04:03:26 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:2885 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbgIRIDW (ORCPT ); Fri, 18 Sep 2020 04:03:22 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 18 Sep 2020 01:01:51 -0700 Received: from sw-mtx-036.mtx.labs.mlnx (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 18 Sep 2020 08:03:20 +0000 From: Parav Pandit To: , , CC: Parav Pandit , Jiri Pirko Subject: [PATCH net-next 3/3] devlink: Show controller number of a devlink port Date: Fri, 18 Sep 2020 11:03:00 +0300 Message-ID: <20200918080300.35132-4-parav@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200918080300.35132-1-parav@nvidia.com> References: <20200918080300.35132-1-parav@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600416112; bh=uQ/QcLv1+9MA/ubZ4df6U77ijj75W6I7tjCeM/LhxoE=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=JJzGoczihmx3t8WrZz8e5ZWwLS3W1IU8xxYaQTJniLpROTtu4H5GuqzOA9CBeh5zq FF5k9s38ANA02fe2XMXwABdb2FKEeoBmqFpPAz5lmff99K310gR+hLyY0Z7vXZONXi tsfwP3ljugmLicFh8wdAJZJrBcIk3faRO8AZWZ7QxKUStJVtaNHW6440tlM16j3Grp 16nfoV+YICfEHjWae5pZ4g2wB+12lt6ehF4HaLA3rayYHxf74MB3XxKTLapnpI+qFo RiRJRtdlLBY9AUsq91Oa4jnZQZrb51Xl7hqdRoikhriA74AW4nWkLP6mLhIBTiI9xu AAUoQl0PAI/IQ== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Show the controller number of the devlink port whenever kernel reports it. Example of a PCI VF port for an external controller number 1: $ devlink port show pci/0000:06:00.0/2 pci/0000:06:00.0/2: type eth netdev ens2f0c1pf0vf1 flavour pcivf controller 1 pfnum 0 vfnum 1 external true splittable false function: hw_addr 00:00:00:00:00:00 $ devlink port show pci/0000:06:00.0/2 -jp { "port": { "pci/0000:06:00.0/2": { "type": "eth", "netdev": "ens2f0c1pf0vf1", "flavour": "pcivf", "controller": 1, "pfnum": 0, "vfnum": 1, "external": true, "splittable": false, "function": { "hw_addr": "00:00:00:00:00:00" } } } } Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko --- devlink/devlink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devlink/devlink.c b/devlink/devlink.c index 9f99c031..0374175e 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -3343,6 +3343,9 @@ static void pr_out_port_pfvf_num(struct dl *dl, struct nlattr **tb) { uint16_t fn_num; + if (tb[DEVLINK_ATTR_PORT_CONTROLLER_NUMBER]) + print_uint(PRINT_ANY, "controller", " controller %u", + mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_CONTROLLER_NUMBER])); if (tb[DEVLINK_ATTR_PORT_PCI_PF_NUMBER]) { fn_num = mnl_attr_get_u16(tb[DEVLINK_ATTR_PORT_PCI_PF_NUMBER]); print_uint(PRINT_ANY, "pfnum", " pfnum %u", fn_num);