From patchwork Tue Jun 8 14:07:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 455775 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3771775jae; Tue, 8 Jun 2021 06:58:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy233Wxd3ZH+v8NEV+sT2TEAm/SW1E4KFQmpzcjazPOgBhQY8YeGWOa40nzpownjX7lFZrI X-Received: by 2002:a05:6402:54f:: with SMTP id i15mr25380202edx.339.1623160715898; Tue, 08 Jun 2021 06:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623160715; cv=none; d=google.com; s=arc-20160816; b=nB3n96kdmjkil5HHsszvpgFCzrPfvP6+zCHv1uGdUp6y9KdboYiDAuZ183rqlCRp0J IBi37cDjt/BYcJthNiFqHn/xkAHgwt2trq4zn7IDebzgF/hUW4gS7NbBMgy+M7gqrcbS Qf/VTiLvumAjj3Dulzt+XMD5P6buDPM4V0dfACd1WfMhFqRaj9EPTOqJrulUno9q93za gUXrCbN+Ec0V2uHxkOtBVS9EDGdkOd4wIEPWdxVcNvPwwWHqNu0ldY0rQr5dOGFIlvXT ig/qG+OKnbj8xFsEnV4+ECvWF5Fcd0FDgMLX7EyJ6B14RYYj+Zwyysof+Ru1QO+t2WMF zbyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=WxNx57mPX5CoyU1yFaPVyt2pdIp6epOYJaS+sjEZn20=; b=nU+35e1Xra2oDgjhdM0DtU+J8gyFjz847QxDzmbiSYjQDyO64G1rp5oPV8rrWPnMdL xaVzo7/s8BQ5NBGPMCm2+LE1ea3XxbdP2ZL92d7fMRIjOZY031SSuX2+MDuKzoODW4ep /Ri230H8olTAMtD+fu2pxN2SOnI2U3zDxCFyKZ6Z1l8hJChLhQ63N3mfVqIgzYRU70sS wZopVTGQWv64+Rz4Jf2vB1Cm2kjB6Ttwy0aXnwunEKpdEwtqSWPvZ9yviTlf0ZFR18EG BQQtICrRC3/MfzDZJlt/BfUsw/CiDOcoGVY9J+warKMOcknpjWeDhT+hocNWBGn2jQD3 ZAlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mr/g80xt"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si13492948ejc.261.2021.06.08.06.58.35; Tue, 08 Jun 2021 06:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mr/g80xt"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233127AbhFHOA1 (ORCPT + 8 others); Tue, 8 Jun 2021 10:00:27 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:34568 "EHLO mail-wr1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233118AbhFHOAU (ORCPT ); Tue, 8 Jun 2021 10:00:20 -0400 Received: by mail-wr1-f45.google.com with SMTP id q5so21720034wrm.1 for ; Tue, 08 Jun 2021 06:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WxNx57mPX5CoyU1yFaPVyt2pdIp6epOYJaS+sjEZn20=; b=mr/g80xtX7GL1/5VN9aSPuw0Y4MpWN+kOd02LksE+PxtSqd87doKeNg++AP+q78bH4 grS+epvq34fHMxJzS8x0lpcTcfqJ/OzTK0CtTZ9rIYMiKqwZRLjy/bKDxfTRa8CIpvTk fgyln0OqSEdczz4OuCer3ztXi8DRJ57H2Iqe2d/sF7YIcEuEifDQhbxDOj3oPZS03HdF Qj5HP6boKJexJxNi5Oz7THvtwXigrU5doSs8fJgGT3rNjwnsYgDmJWIVR7liJJrh2Nw6 EJThJ5bepNzyGWZ20fXSHzfo58A68bFG5RbylL7dE5RJ43ijIHSKGVZHP8N0j3NH/XqH ehpA== 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; bh=WxNx57mPX5CoyU1yFaPVyt2pdIp6epOYJaS+sjEZn20=; b=msmotVQiOljiEqfcaAmn2XEEi/2SQFhJvn7ec6xwHFZkEfET1YMpJouv3Q3oX0Xhry VwWdkgU8QPkGfEf3XSYwjQbMwA8W1X+52JCYg4UTheNCktlMbBMB88QLDMlUlllF2Ol1 Ej6eK7uApubK0QyxM74bxtXNmaLt04UhE7AIRSvyPPphNg4aBuXb6oBOaU5yospDZ6mS kH9o7j/f2q/OBjPEnadNwYnLIoQcWWajGmeaV5OedtgcAYa0geP0lSFIseqa77w3rNi6 DEwlSYra1Cw51DjvYS9lV2cnUlMyDfic25cLRiXiD5RARzqE54k+YJh1+Ov3yGgZ1rDF JeOg== X-Gm-Message-State: AOAM531mIKlZnMpe4KXZqGWVdGckC0WovrwLcQ5t47AlM+Rd6Ex8i43m NVpZ2BF4buN2dgSt3A+sSADNHmrATTN/NgmF X-Received: by 2002:adf:cd82:: with SMTP id q2mr16298980wrj.258.1623160646983; Tue, 08 Jun 2021 06:57:26 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:85ed:406e:1bc4:a268]) by smtp.gmail.com with ESMTPSA id f14sm1956108wmq.10.2021.06.08.06.57.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jun 2021 06:57:26 -0700 (PDT) From: Loic Poulain To: kuba@kernel.org, davem@davemloft.net Cc: netdev@vger.kernel.org, johannes.berg@intel.com, leon@kernel.org, m.chetan.kumar@intel.com, Sergey Ryazanov Subject: [PATCH net-next 3/4] rtnetlink: fill IFLA_PARENT_DEV_NAME on link dump Date: Tue, 8 Jun 2021 16:07:06 +0200 Message-Id: <1623161227-29930-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1623161227-29930-1-git-send-email-loic.poulain@linaro.org> References: <1623161227-29930-1-git-send-email-loic.poulain@linaro.org> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sergey Ryazanov Return a parent device using the FLA_PARENT_DEV_NAME attribute during links dump. This should help a user figure out which links belong to a particular HW device. E.g. what data channels exists on a specific WWAN modem. Signed-off-by: Sergey Ryazanov --- net/core/rtnetlink.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 56ac16a..120887c 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1819,6 +1819,11 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, if (rtnl_fill_prop_list(skb, dev)) goto nla_put_failure; + if (dev->dev.parent && + nla_put_string(skb, IFLA_PARENT_DEV_NAME, + dev_name(dev->dev.parent))) + goto nla_put_failure; + nlmsg_end(skb, nlh); return 0;