From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED 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 8395BC43381 for ; Mon, 18 Mar 2019 12:35:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4EBA52085A for ; Mon, 18 Mar 2019 12:35:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="FDpMQIgI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbfCRMfG (ORCPT ); Mon, 18 Mar 2019 08:35:06 -0400 Received: from mail-eopbgr140044.outbound.protection.outlook.com ([40.107.14.44]:46337 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726504AbfCRMfG (ORCPT ); Mon, 18 Mar 2019 08:35:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/kUkE47tiFp/Do3ysxECtuMGYQ4q1K7+O9S/p60F5L4=; b=FDpMQIgIjfjMM77+f0oQcAQb+EYhmI1rw0zb6Hz67rIyNIP8xYj7xEJUgvsIq9eWDpvXSqeqp1XXBygIo4JQ4zkzfjcY5pRXRPnse5bqL1RiV1BVJJomWqa0czJog67scti1OZttV4c7bFVKj8I5NC1OHM6ZdeYrWsBgAAu2o/0= Received: from AM6PR05MB6133.eurprd05.prod.outlook.com (20.179.3.144) by AM6PR05MB5158.eurprd05.prod.outlook.com (20.177.196.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Mon, 18 Mar 2019 12:34:55 +0000 Received: from AM6PR05MB6133.eurprd05.prod.outlook.com ([fe80::8c6:b0f3:d983:2fea]) by AM6PR05MB6133.eurprd05.prod.outlook.com ([fe80::8c6:b0f3:d983:2fea%2]) with mapi id 15.20.1709.015; Mon, 18 Mar 2019 12:34:55 +0000 From: Petr Machata To: Jakub Kicinski CC: "netdev@vger.kernel.org" , Jiri Pirko , Ido Schimmel , "davem@davemloft.net" , Tariq Toukan , "andrew@lunn.ch" , "stephen@networkplumber.org" Subject: Re: [RFC PATCH net-next 1/3] net: rtnetlink: Add link-down reason to RTNL messages Thread-Topic: [RFC PATCH net-next 1/3] net: rtnetlink: Add link-down reason to RTNL messages Thread-Index: AQHU21hddEVxaeti1Ey0mD5+skDyyqYNiIyAgAPOtgA= Date: Mon, 18 Mar 2019 12:34:55 +0000 Message-ID: <871s34icnr.fsf@mellanox.com> References: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@mellanox.com> <20190315192611.3354f9b5@cakuba.netronome.com> In-Reply-To: <20190315192611.3354f9b5@cakuba.netronome.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR04CA0019.eurprd04.prod.outlook.com (2603:10a6:206:1::32) To AM6PR05MB6133.eurprd05.prod.outlook.com (2603:10a6:20b:af::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [78.45.160.211] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: be4e9bc8-9a57-4e07-803a-08d6ab9e203e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB5158; x-ms-traffictypediagnostic: AM6PR05MB5158: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-forefront-prvs: 098076C36C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(39860400002)(376002)(396003)(366004)(136003)(189003)(199004)(14454004)(478600001)(6436002)(26005)(966005)(52116002)(76176011)(256004)(68736007)(6916009)(2906002)(446003)(11346002)(5660300002)(476003)(2616005)(486006)(14444005)(54906003)(316002)(229853002)(386003)(6506007)(6116002)(3846002)(8676002)(102836004)(81166006)(81156014)(25786009)(186003)(6486002)(8936002)(106356001)(305945005)(66066001)(99286004)(7736002)(36756003)(97736004)(6246003)(53936002)(6306002)(4326008)(15650500001)(6512007)(86362001)(71190400001)(71200400001)(105586002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB5158;H:AM6PR05MB6133.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Sb1+NuCRoRSdv5qC5sx99F3JtRcxB19S8VYaAuWNEHZIGVKQhJfJ/fPFX5kZTn7Vpf2eG41kyCGe8stI3VvL86X7aULbduVvCfWmJtJuwWdt7+4l4ZozMYOPoEmGx3QDfK/Oh/Ni0NqWZwaPtI/edAtjAUmNYJfJl5WMTXVNpMOQtlejr7wJkLbONoG0Nd299ZvaaW0YpgBY+TmOizdHGZ2dHTU4Eot3ZrRnoKPHyKwppZtjJjGmLnx/zdIZk2gwSTk3CLxuC2Hcx96U9qYA5Rx2Tv+ttnpAwpr9iGIozb5yAtfhHnTFIJTndTCdE9NKSY6Mpj0T4MNAGVF+FuFa4YK2bGwqNuKfEzde/MS9sIs3IGiMuk64QQaBTR+0QU5MMP/ea2EAbVzTrtSPeHZWB2/cHRM7xabECXJNm09to4U= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: be4e9bc8-9a57-4e07-803a-08d6ab9e203e X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2019 12:34:55.6585 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5158 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Jakub Kicinski writes: > On Fri, 15 Mar 2019 17:56:07 +0000, Petr Machata wrote: >> diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h >> index e2091bb2b3a8..cfd9e86ff0ca 100644 >> --- a/include/net/rtnetlink.h >> +++ b/include/net/rtnetlink.h >> @@ -110,6 +110,9 @@ struct rtnl_link_ops { >> int (*fill_linkxstats)(struct sk_buff *skb, >> const struct net_device *dev, >> int *prividx, int attr); >> + size_t (*link_down_reason_get_size)(const struct net_device *dev); >> + int (*fill_link_down_reason)(struct sk_buff *skb, >> + const struct net_device *dev); > > IMHO the API is a little heavy for returning, what is effectively a u64 > value sliced in two.. If a year from now someone wants to add string reason, this API will just extend naturally to cover that case. > Perhaps the core can just assume the reason will be provided if the NDO > is present? And the "fill" NDO should probably fill in the reason > structure, rather than getting the skb passed and dealing with netlink > directly. This copies how other fill APIs are done, in that the responsibility for filling up the message is deferred to the driver. I think it makes the API easier to extend: if there ever is richer information available, the drivers that want to support it just opt in and provide those attributes. > Also perhaps this would be a ethtool-nl candidate (which would > hopefully land soon after the merge window)? Is this the repository with the patches? I'll take a look. https://github.com/mkubecek/ethnl Thanks, Petr