From patchwork Fri Sep 18 10:16:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 260652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E97A4C43464 for ; Fri, 18 Sep 2020 10:17:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2FAE2075E for ; Fri, 18 Sep 2020 10:17:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="pbNxAFTO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbgIRKRH (ORCPT ); Fri, 18 Sep 2020 06:17:07 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:8789 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbgIRKRE (ORCPT ); Fri, 18 Sep 2020 06:17:04 -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 03:16:51 -0700 Received: from sw-mtx-036.mtx.labs.mlnx (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 18 Sep 2020 10:17:03 +0000 From: Parav Pandit To: , , CC: Parav Pandit Subject: [PATCH iproute2-next RESEND 1/3] devlink: Update kernel headers Date: Fri, 18 Sep 2020 13:16:47 +0300 Message-ID: <20200918101649.60086-2-parav@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200918101649.60086-1-parav@nvidia.com> References: <20200918080300.35132-1-parav@nvidia.com> <20200918101649.60086-1-parav@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600424211; 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=pbNxAFTOlEnYzK+z1zmjZiAFM7gXXCehHY3yD+SCFme/0KoVnjxLN0NRVQobB7lEG esbs3wRf/tnIx9W1aP+eN4I7zJbuOw07n7QOLQghKGUCBq9o2tL++C9N8IMPa9ZGhT j2p/U2tOihymeASfk/E4wuWeMpqg0JhQBm72pOnX1CO1nLqQeEW1ykLlcvxDMkXS89 3l0TYj0ik78YrYvYHAl3KMfir8jIAt5XZqv+gpMez3GYtGrq3r6iD4fDRCtcqmXcnw tHr7ZkXU1zSBevdw1Pf3be+YYgyM5CQO1t9papOnUgAFNpJ76ObgYrF+UbLZxqebgt C/dSweKoSt8Cw== 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 10:16:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 260651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8677AC43463 for ; Fri, 18 Sep 2020 10:17:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41075208C3 for ; Fri, 18 Sep 2020 10:17:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="TbjrbnwC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbgIRKRL (ORCPT ); Fri, 18 Sep 2020 06:17:11 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:18713 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgIRKRG (ORCPT ); Fri, 18 Sep 2020 06:17:06 -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 03:15:36 -0700 Received: from sw-mtx-036.mtx.labs.mlnx (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 18 Sep 2020 10:17:04 +0000 From: Parav Pandit To: , , CC: Parav Pandit , Jiri Pirko Subject: [PATCH iproute2-next RESEND 3/3] devlink: Show controller number of a devlink port Date: Fri, 18 Sep 2020 13:16:49 +0300 Message-ID: <20200918101649.60086-4-parav@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200918101649.60086-1-parav@nvidia.com> References: <20200918080300.35132-1-parav@nvidia.com> <20200918101649.60086-1-parav@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600424136; 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=TbjrbnwCP2Mca3GMMMh2aJ5lSOXI1GcCwIAzySRY2/OMqIklnloI3ORYdN3nlXzji QOhOQkELaoSZS5mavv9SWWp/ou2sMcNGc06YOpDBNbtCukOrfro+72TJtProia8LJh XdZXmxn8sRM8fkzdnTDQJsmSfE7KAcyhOesNp5rGSspSgTK3s6n2x08sHUe8NvEKsL wEg9UMF2y//kzopVkS42CTdnOehQDZqseIbU1OQRbHkQUKotJD2mvKKR3/dV8zc8Z9 vXlnJkISP7eDlnP+BoW+1sBf4fIKjoh6VILuGZ5k2vfbOfkNnEdR0jEjx4zJqhOvGn JnSWn4u52MpRw== 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);