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=-4.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_PASS 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 AD6CCC43381 for ; Sat, 16 Mar 2019 02:26:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4612D218A1 for ; Sat, 16 Mar 2019 02:26:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="y8Uocw/z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726649AbfCPC0R (ORCPT ); Fri, 15 Mar 2019 22:26:17 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:42922 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbfCPC0R (ORCPT ); Fri, 15 Mar 2019 22:26:17 -0400 Received: by mail-qt1-f195.google.com with SMTP id u7so12263386qtg.9 for ; Fri, 15 Mar 2019 19:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=A7c/SWzdprX2uow3xd/2TfbYkpAMymNVb9VoquSHfKY=; b=y8Uocw/zhX4E+RJnG0QvLk9quXxEgCBjEafzdKzxX8dSheyjhDPC/+BH9YLWvsv533 clq/R2rGLnJWOpJWJgF95cJ/e5TOMwMi38EwT0OHsTlPPtgllbh9iVgImi0UrSQ0Z7UQ zUyJr9F25DqdeM04yWslZa5HnBwEHEtk/1imljlOH+utARkG9jhjQHMGm4rqTBMJO0x+ tKRH5gNzcKKWTOR7lQlN+4KFeBK6U/IbG+cCgfJA44eTVc06T5iYsni/TRgc/+C8qKC/ 67vcBpcUK4oWWVTd+Z3Azlhzi+zpg4hjfXu3OQ6x5GNwRt2w2itKUnBRuwtLfkHiaB1Q 0tAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=A7c/SWzdprX2uow3xd/2TfbYkpAMymNVb9VoquSHfKY=; b=P06zt7G7gStU4bvAoVFiucaCJtRED4ZV3my7a/fTsiTUXUXJR7a0nq6m/6tqkl+aVL VUXgPTHW1GxkDGcKREBRpKRVVVSq3xL3+8oVZFkKBq8UwIcwcrgRz8sJDglPvS3brpWp kHkY4d1MALq/oNmj6R023W5K6xW6/Q9qNf89a+xBchwVAdPoWKb92ym5IXO44HCHrFRa lXINhuANYdfvBjwYNs4RtwxVaTRqOqHcg8SBp2LA9ur8INDSFNwg8rcI5cDcLSDUjRkP /J7it6z9jnFjFFjBmFFa8q1MvfH809qpoImucoG69ea5dUKQ5wwQypZ53I6fAcCWt393 chtQ== X-Gm-Message-State: APjAAAW2s7p4JVM06wK3W3eHwfeW6wm8pGuQTOeRUu4Lu4mEx05rQmBA XvAe9kPFrCIZeT2vK8f/ZG0jpg== X-Google-Smtp-Source: APXvYqzNeTWmY0lqb1+cnSpwWd0PpIuCGOMDXRq9DYBo5yascJwm9IaFldThFSVMffs1AuNk1fZTiw== X-Received: by 2002:a0c:b620:: with SMTP id f32mr4966261qve.12.1552703176035; Fri, 15 Mar 2019 19:26:16 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id i65sm5314409qki.32.2019.03.15.19.26.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2019 19:26:15 -0700 (PDT) Date: Fri, 15 Mar 2019 19:26:11 -0700 From: Jakub Kicinski To: Petr Machata 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 Message-ID: <20190315192611.3354f9b5@cakuba.netronome.com> In-Reply-To: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@mellanox.com> References: <3a247e91ebe81cdae4bae27ec1631c5015fb943f.1552672441.git.petrm@mellanox.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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.. 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. Also perhaps this would be a ethtool-nl candidate (which would hopefully land soon after the merge window)? > }; > > int __rtnl_link_register(struct rtnl_link_ops *ops); > diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h > index 5b225ff63b48..a47f42e79741 100644 > --- a/include/uapi/linux/if_link.h > +++ b/include/uapi/linux/if_link.h > @@ -167,6 +167,8 @@ enum { > IFLA_NEW_IFINDEX, > IFLA_MIN_MTU, > IFLA_MAX_MTU, > + IFLA_LINK_DOWN_REASON_MAJOR, /* enum rtnl_link_down_reason_major */ > + IFLA_LINK_DOWN_REASON_MINOR, > __IFLA_MAX > };