Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp173898rdb; Thu, 30 Nov 2023 01:24:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLVnTbSmGACHLERk9vUv0xH26K5k/tHQ8Lx4JWa5UDc0AhlJ5nhVR9JkCx/P/jxyS6wGnc X-Received: by 2002:a17:902:8309:b0:1d0:68a:4a45 with SMTP id bd9-20020a170902830900b001d0068a4a45mr6330476plb.35.1701336288683; Thu, 30 Nov 2023 01:24:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701336288; cv=none; d=google.com; s=arc-20160816; b=Hp4AXHY84Wigm0bx4bcqWlM5jg1LvVHJRIXYQXkQCYs8/DOfmG21BT/IGMs2e8iEE8 gwaG1ZuZkMzWx/TF35/OrajRRJ+gt8+er7PSQNTGHqRALY5Zid+h+g5Xf13nnjtzmztP 4SUs2/wsdoFRVL4ZxhIAztM4tSeQRYlXsDDAIxDxK48QxClLOqlr6Crcm16RMcebQfkL 1BPuc2xoFM6tsPpv99ps0f72K06hAEXpINEFRpBfzHn/EUkeNkYXUN62mk9l/KmbdBSh wLpH5fzx4XGQ011HlVziQtWfxddkHDIUnwIta8fneTAJh4hThSFA1KBgHjiqGGniqpb/ I5sA== 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=ODGxd7/u71d/rY/1QUl5tXlqtMzlubsqrETh3ZFBIzc=; fh=f/tt49/UkYYh8W+qh0Fpblh9V/WvJAJzGOfxdqpuhhc=; b=VhjVZV/BqyRDIF/A64VSjJPtCyNGmHVPYRx92HfjRmPQbbrmRkKqQpCk3MtjB8lu9W e0yfWOUx3ft5jj+ELTGKc5RJKYH4xY11Xonojk3GJyef/TTG+tN2MiMQOjDACJpLircp 4QoanNW33DHOuGWsR881us+zxZvfovEG0JjRgVu1UlJtZ3ROzhMLpC6XSN/JI8NDyC2k PV5s6eMGGqaO0lBciv6Dgg+ZKw0LJSH+2rwfik8P5VavLe7TTbDNMsW8hkUHjYlruio1 rozdzZ/mqCk1M1IDJZedKAZd9n04Qg2op9noDXvkHz9WXd9cHsLDOwyUOCKyrX84rfX+ ilCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=UUks07+c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id 2-20020a170902ee4200b001b86ddfd49bsi811735plo.6.2023.11.30.01.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 01:24:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=UUks07+c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id F3A6080BEAAB; Thu, 30 Nov 2023 01:24:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231755AbjK3JY3 (ORCPT + 99 others); Thu, 30 Nov 2023 04:24:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjK3JY2 (ORCPT ); Thu, 30 Nov 2023 04:24:28 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 341A0BD for ; Thu, 30 Nov 2023 01:24:12 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5c21e185df5so585761a12.1 for ; Thu, 30 Nov 2023 01:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1701336251; x=1701941051; 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=ODGxd7/u71d/rY/1QUl5tXlqtMzlubsqrETh3ZFBIzc=; b=UUks07+cN6WPU+Lhz+jl8Ma+nNwYywdE99+qa7HjaTsNJimsVx0/8GBu1sm0fshzUY hPF9tRyE3bvdvhBG3AtCnFf8w99n/hGyDLYNZ+usmZcDZzOx4N1gEdkzOAe+z/bq5cyo LHAdlRQWuGva8NqWHaHPGUAU/YjM3ylTY3z/yMioGqGk5zFahPwLwi5T2f27XxsuOMPd l9VtUIGlZhX8FgnhHH78RUBFKYvAkbKYGTJ+C+sY09IohPcvOBDUQxCpfjQPFAvsxJyk pBD0BpQRibAkzihXWD5Pgh9meVfyhasD6Zq50mToidNbTgm3Fbo/Xnp1rhCzcfkmApUZ 2h7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701336251; x=1701941051; 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=ODGxd7/u71d/rY/1QUl5tXlqtMzlubsqrETh3ZFBIzc=; b=fcHQRv8Jv9n+6mEihH/6dimeI7R9gW7JhFBdgre8CykAqLyREBfdFW/kTSEPN+sZ0e NPywLXImh7cqh7ti6WI0Xx35UYsOUaV/a8oaHwptgkdVw3A5KFqjy78c7QJ45IkhZePb maTcWBMIO662f8JstJLTHoKK7Iex74RQR0VmakLpqruEmXR7tyoyXJtCb00Uv1+WatSV eVXlpiOZeQgfodHPeaMfRfC+PZDFHWQxjR+3VUHI1h4LF2xYRAP+DvmbQA8+fhg5iA7n nAge7p8pB/KZMEasRO0xvgqoiR5NxgXUjgUBo0cmTLGwSOY5c0WuOKug4xe1JFbmb3Pm PpfQ== X-Gm-Message-State: AOJu0Yz64ZMgsLd+zGqxHjHAUpN1z1wjbHhqDAbaPmbUakxcU/J8UOzs IixYW6E3efcV8XnKvEPn8ryEnw== X-Received: by 2002:a05:6a21:a58d:b0:18b:d99a:99bd with SMTP id gd13-20020a056a21a58d00b0018bd99a99bdmr25455213pzc.32.1701336251730; Thu, 30 Nov 2023 01:24:11 -0800 (PST) Received: from [10.84.152.108] ([203.208.167.146]) by smtp.gmail.com with ESMTPSA id u8-20020a17090282c800b001cfc1b93179sm18516plz.232.2023.11.30.01.24.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Nov 2023 01:24:11 -0800 (PST) Message-ID: <16b4d42d-2d62-460e-912f-6e3b86f3004d@bytedance.com> Date: Thu, 30 Nov 2023 17:24:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [External] Re: [PATCH bpf-next] netkit: Add some ethtool ops to provide information to user To: Nikolay Aleksandrov , daniel@iogearbox.net, 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> From: Feng Zhou In-Reply-To: <51dd35c9-ff5b-5b11-04d1-9a5ae9466780@blackwall.org> 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 fry.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 (fry.vger.email [0.0.0.0]); Thu, 30 Nov 2023 01:24:46 -0800 (PST) 在 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 > > Cheers, >  Nik > 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.