Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp884497rdb; Fri, 1 Dec 2023 00:43:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeFMdw0iPZVp/y9gzt9g3Z7sYHYXMiVpP38ZDv/hPLvF7UjU3KLndYIAtupOhn608l7ZYY X-Received: by 2002:a05:6a20:841e:b0:18b:4f8b:5a05 with SMTP id c30-20020a056a20841e00b0018b4f8b5a05mr35002606pzd.30.1701420203495; Fri, 01 Dec 2023 00:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701420203; cv=none; d=google.com; s=arc-20160816; b=0m1lzqGO7LRhD/FPlzYtCXDBXyZumz2gxwCsO5CZuEd0SC14pRkybmt/J7iPkFGdiS zuOGQTcBlS3puTU6uw3xcL/sF3U4pdpFsFrtTF6B9roLa/ne9YVP2O8JRk6JX3s8HbaT 1omHJlCD3fM7J0XTI7smwq7gguHkbldHznUXGgmw7OsyeUrQXPm5hOA4uQyoaqCE+6Yv Vtj7qSNCklEyqCr93YgEdOCukRNHJOnyFnacsE2Z2KPBFS5rGpS8lyssSkDPTbjrQLN3 J/OfwipAd2zFSMTlz8hGCTDhhTvQzEhp9NkLKecEbUIVJYi9JnTTxwyfayjxLGepV7xb MVJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=+BektOburQXG+cnVes1gG9CvIvVklrxBOP0251luLyc=; fh=RkyYv4zt2eLcEOurIDNA6In57WQu7kooSPH0tUOh/Ec=; b=Q0UdXepJ54CzyaO1XAMYU3MG8QfbzQ5/T0yivSiM9Ob4vPUGjdpc2lalYadS16qXUh 4Hjlxpr60gZ4199XuSeCywzpNOXzqJTysWAeAh3Rstf0Yf04ULpQonkhmtl05hYeHdaR tHgcF0ceoci9tx8ojBkbdLcfPGZfGIZ/Fe5ahfVRuQkw2k/e4Vcrop0f67/p54/vJWz3 Cdiej/apoH1jKGsYXXZEM167h8B0OIaYEZ2M6iNS1FWjsq1h4xJiEHggnslpyplawvvv ayTM9k9xm/bqJWTFMEC54Y5crXR6gxfVLdCocDlkj6CmHhBGUmgp9mHa6R8n1GUP4xyw targ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=kHYsiKrj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u13-20020a63f64d000000b005c2791fedbasi2969563pgj.124.2023.12.01.00.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 00:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=kHYsiKrj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9D23F80215AA; Fri, 1 Dec 2023 00:43:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377832AbjLAInI (ORCPT + 99 others); Fri, 1 Dec 2023 03:43:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjLAInG (ORCPT ); Fri, 1 Dec 2023 03:43:06 -0500 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CEAB1712 for ; Fri, 1 Dec 2023 00:42:49 -0800 (PST) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5c637e83915so225410a12.1 for ; Fri, 01 Dec 2023 00:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1701420169; x=1702024969; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=+BektOburQXG+cnVes1gG9CvIvVklrxBOP0251luLyc=; b=kHYsiKrj19n2T9Kt0FmcQ0QcDbtiHorBeZoHw5NhUJoKIz09o3vkNMQ2QNq9U/323u QdyJ8WGL9kY+CTx4572elOksuM/z5ekEeqeAVdRFdmWbxAnlumlBmJXsdmpoPUGOdJhR Yxef/EEZy8gKa1WBikMrAC3cvQbbgOlTjs9M5XkyQr0TflQW0vvoxhEDIsQVvBSIZ94G 4gY/T7aW0bM1KnobZeNuckOYqc68QLS84MGmrEgPowJWd2kF3wyLolNyKh0123zp+Ov0 IjZfY3jl9oTPTnLVxWHiTupaNUJSq3nYsc4vGfZiFxvGNUSsZPbhLC7rvtE7OdHekS/8 4Wmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701420169; x=1702024969; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+BektOburQXG+cnVes1gG9CvIvVklrxBOP0251luLyc=; b=R5oFYfDlilq6DmVks/AV/JHlGzybRHnQcKd2Xr9ZDY7S96wHz31rzUAAn48xeYVOnc eMHSayUuVzVu5PN0+pH2N9P5FNQ0sdp7qR+9VJ6kjErZPZS1oVqp0owqAqNQPerW5Tlq I/JAQsQ+tuej7IDZwvNS/9eSkdmf7pRkcB+i09TP0bI7rmbD/taUl/Olnv2vaSvjNqwK GxXPH98wzRKa+BlqZjEqrlQbyJip8Zdzg9oROJuT6tmRHw3QnZqXYeE1jeY2czUAT2ok ZBQ//P8W0IlvvO4hohTobEL39Qy8inBypmqyYwRqpPo9hZOVHQA9kcm5IpWBCuFdzPRU Fg9g== X-Gm-Message-State: AOJu0YxkOkouR6kRQczRKFXTIQ436KYtmTgfHHt+UXWwRP/K5pc+pZwz Z7ZdGSTO1UISc1g7mon9NJjs8Q== X-Received: by 2002:a17:90b:3a90:b0:285:8cb6:6153 with SMTP id om16-20020a17090b3a9000b002858cb66153mr33062567pjb.17.1701420168679; Fri, 01 Dec 2023 00:42:48 -0800 (PST) Received: from [10.84.154.115] ([203.208.167.146]) by smtp.gmail.com with ESMTPSA id o10-20020a170902d4ca00b001cfba9dac6esm2770341plg.115.2023.12.01.00.42.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Dec 2023 00:42:48 -0800 (PST) Message-ID: <57587b74-f865-4b56-8d65-a5cbc6826079@bytedance.com> Date: Fri, 1 Dec 2023 16:42:42 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Re: [PATCH bpf-next] netkit: Add some ethtool ops to provide information to user To: Daniel Borkmann , Nikolay Aleksandrov , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yangzhenze@bytedance.com, wangdongdong.6@bytedance.com, tangchen.1@bytedance.com References: <20231130075844.52932-1-zhoufeng.zf@bytedance.com> <51dd35c9-ff5b-5b11-04d1-9a5ae9466780@blackwall.org> <16b4d42d-2d62-460e-912f-6e3b86f3004d@bytedance.com> <94e335d4-ec90-ba78-b2b4-8419b25bfa88@iogearbox.net> From: Feng Zhou In-Reply-To: <94e335d4-ec90-ba78-b2b4-8419b25bfa88@iogearbox.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 01 Dec 2023 00:43:20 -0800 (PST) 在 2023/11/30 18:56, Daniel Borkmann 写道: > On 11/30/23 10:24 AM, Feng Zhou wrote: >> 在 2023/11/30 17:06, Nikolay Aleksandrov 写道: >>> On 11/30/23 09:58, Feng zhou wrote: >>>> From: Feng Zhou >>>> >>>> Add get_strings, get_sset_count, get_ethtool_stats to get peer >>>> ifindex. >>>> ethtool -S nk1 >>>> NIC statistics: >>>>       peer_ifindex: 36 >>>> >>>> Add get_link, get_link_ksettings to get link stat. >>>> ethtool nk1 >>>> Settings for nk1: >>>>     ... >>>>     Link detected: yes >>>> >>>> Add get_ts_info. >>>> ethtool -T nk1 >>>> Time stamping parameters for nk1: >>>> ... >>>> >>>> Signed-off-by: Feng Zhou >>>> --- >>>>   drivers/net/netkit.c | 53 >>>> ++++++++++++++++++++++++++++++++++++++++++++ >>>>   1 file changed, 53 insertions(+) >>>> >>> >>> Hi, >>> I don't see any point in sending peer_ifindex through ethtool, even >>> worse through ethtool stats. That is definitely the wrong place for it. >>> You can already retrieve that through netlink. About the speed/duplex >>> this one makes more sense, but this is the wrong way to do it. >>> See how we did it for virtio_net (you are free to set speed/duplex >>> to anything to please bonding for example). Although I doubt anyone >>> will use netkit with bonding, so even that is questionable. :) >>> >>> Nacked-by: Nikolay Aleksandrov >> >> We use netkit to replace veth to improve performance, veth can be used >> ethtool -S veth to get peer_ifindex, so this part is added, as long as >> it is to keep the netkit part and veth unified, to ensure the same >> usage habits, and to replace it without perception. > > Could you elaborate some more on the use case why you need to retrieve it > via ethtool, what alternatives were tried and don't work? > > Please also elaborate on the case for netkit_get_link_ksettings() and which > concrete problem you are trying to address with this extension? > > The commit message only explains what is done but does not go into the > detail > of _why_ you need it. > > Thanks, > Daniel In general, this information can be obtained through ip commands or netlink, and netkit_get_link_ksettings really not necessary. The reason why ethtool supports this is that when we use veth, our business colleagues are used to using ethtool to obtain peer_ifindex, and then replace netkit, found that it could not be used, resulting in their script failure, so they asked us for a request.