Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp518259lqs; Thu, 13 Jun 2024 18:27:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWdFLv4oWsGkEZNNPZK1AWOVLZ913zkpV+VsN9BRgJp++7tfZb74PAJChDjtSnf057+mg6Wd9Yv6UABiOjFl+rWrhR+ABCAj3gmgoGmQ== X-Google-Smtp-Source: AGHT+IHpemV5WcTP2ghC/63tlAQs8L3fvNThf1Z2an4Rj6EOHDwfYEJdIaohlGq11kqyH/lLz2Z7 X-Received: by 2002:a05:6808:181d:b0:3d1:d2e2:6116 with SMTP id 5614622812f47-3d24e9da67cmr1414596b6e.49.1718328469579; Thu, 13 Jun 2024 18:27:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718328469; cv=pass; d=google.com; s=arc-20160816; b=oYtgy2RaH7Ry2ea9pMhWT8Vm9RSRkwHSgPnGiT21YBb+8FSh3D9i94+jBGQ52SxbAC guXpK4On7frzdI0Yjrn/EgeVXzpbOSiXwTtf+GdIY5DwXqf1adX3CedrFRY0gIbrBmbO WYjwjQQSFvp0uSaJGL5k5bRtmtmxTIChi1MXKSoh+VN4ZhGFs7iimKEEoO54eDCEMVVN vtIzUGJ3ddZN5HBbHE/4OouxQXQIBvxPUPCpVlpzxw3htLQJmTp6a8CfDjJJ+TXH6LT0 XLdVcRyZCwAtz1W9rv+FtbuU4AWVUaV70qKidPz8Hfqd0UOyOupEZotVvqkPEGcbzRCa cZ6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=JkEkW+3sCSycHe6JuHQ8j6MCKpBEQNJITqNSFUIVlv8=; fh=6qDCUBeIV0fcb2uHEPZQSYe1u17wWht3pNX+p92lUNY=; b=aPsd1hK8hphdr2m+neSuqzPeDT2cdI/1sru3cW7Vf39p2a5+1yC8tnwNA7uTR/H/DC 1tq3j47mh3wncOWQlzvFg6askJekHJBeCNTHeJVqeyGkxBv5THsoMCZCcErSOAiqGAhp My/84z+8xbQ/x4caQCuiz4p0uyQB4zaxchJaws+eglyhOO5S+OBI302Nh5PknNrZBOJw 5hJgq4XxBhypOfHykYeVbQhW0eAcialqorq5bAnQXLTAKxz3uxE2ryUWpr7Fm11kCSzu 0dPF/Uafp91VFjp+Ty1HhHcQ81nLE1BnT0Ew61hpE9LiPLP7OzDGCocYT6fkezQ0d1AJ O/vQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s1Ta7p4A; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-214178-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214178-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-705cc95ef20si2528074b3a.93.2024.06.13.18.27.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 18:27:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214178-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s1Ta7p4A; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-214178-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214178-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 164D9284308 for ; Fri, 14 Jun 2024 01:18:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0460F1822DA; Fri, 14 Jun 2024 01:18:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="s1Ta7p4A" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A5FC181D00; Fri, 14 Jun 2024 01:18:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718327895; cv=none; b=fJ6rPUGAhb3WlTgDuGzSNDvaF/J0V2/HIuxDg7utznFwkzc8t2s9wFbFyQWPnWVGtQT72m1mr/ze9iYZxfdgF5+XcaJrydB4aOK/zpvlOzVfwJhiUa3vW1ADH4XdwCKu+UFrMPp9IfEtpUpUZ6uGh0myQzfSzsupx39HOx7C5ng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718327895; c=relaxed/simple; bh=mgyOAziEuF5dLoY3SVasa/F54zKNQeGUaNP4KbuGUY4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YH4zhsc7IVanyakwPm6/xN8ddwg0jTbmVVPkVWPyHO+O/ZI8YrR7lUPOFljQRNT359gwoT4fgcwZ+DvYowOUJ5MtrgQje9IiXlRWbIGokRGaRdzxISB9uZvehl8oYAO+tHmYTUD5KKHreSKMCsSn0YrFWilKvEjYZf+VRfooTxA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s1Ta7p4A; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CE72C2BBFC; Fri, 14 Jun 2024 01:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718327894; bh=mgyOAziEuF5dLoY3SVasa/F54zKNQeGUaNP4KbuGUY4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=s1Ta7p4A4luCkj5qnPlasVhv+/Gg3eidQjjiELWr1vIgCQ2GEElJxlBsKXYji0rd+ FMhle+qqBxCo39gDdg/MJFSfnJ9VQD8iKv+c3kY2RmnPkKQiWx3Ru53tK9wqybpFhi 9eu0cbPkTzJdmR/+WEideu4BWXkzz5gN0YPW2a6Zw3jsvHvZbtr87eQ+TeOeymWbQm G38vGvjT9CXKcocFRUxbPl1t4xIwxHbQ7zatTnYYw1lbbE8eTOdDNb+JUFA2tfvje2 yUsyedtNqFR214FM/UlEK+r5w6yVVFmxkxwNI2DtI/2TqfbxAJEwVlfaOuoilI+rIT JEmJsRXCyTgxw== Date: Thu, 13 Jun 2024 18:18:12 -0700 From: Jakub Kicinski To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , Simon Horman , mwojtas@chromium.org, Nathan Chancellor , Antoine Tenart Subject: Re: [PATCH net-next v13 07/13] net: ethtool: Introduce a command to list PHYs on an interface Message-ID: <20240613181812.27d02c88@kernel.org> In-Reply-To: <20240607071836.911403-8-maxime.chevallier@bootlin.com> References: <20240607071836.911403-1-maxime.chevallier@bootlin.com> <20240607071836.911403-8-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 7 Jun 2024 09:18:20 +0200 Maxime Chevallier wrote: > + it's parent PHY through = an SFP its > +static int ethnl_phy_parse_request(struct ethnl_req_info *req_base, > + struct nlattr **tb) > +{ > + struct phy_link_topology *topo =3D req_base->dev->link_topo; > + struct phy_req_info *req_info =3D PHY_REQINFO(req_base); > + struct phy_device_node *pdn; > + > + if (!req_base->phydev) > + return 0; > + > + if (!topo) > + return 0; > + > + pdn =3D xa_load(&topo->phys, req_base->phydev->phyindex); > + memcpy(&req_info->pdn, pdn, sizeof(*pdn)); > + xa_for_each_start(&dev->link_topo->phys, ctx->phy_index, pdn, ctx->phy_= index) { > + ehdr =3D ethnl_dump_put(skb, cb, ETHTOOL_MSG_PHY_GET_REPLY); > + if (!ehdr) { > + ret =3D -EMSGSIZE; > + break; > + } > + > + ret =3D ethnl_fill_reply_header(skb, dev, ETHTOOL_A_PHY_HEADER); > + if (ret < 0) { > + genlmsg_cancel(skb, ehdr); > + break; > + } > + > + memcpy(&pri->pdn, pdn, sizeof(*pdn)); Why do you copy the pdn each time =F0=9F=A4=94=EF=B8=8F > + return ret; > +} > + double new line at the end