Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2997807rwd; Fri, 9 Jun 2023 22:55:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Ia76VGK5HVaV7wT08996hzpcwZqw6wv3Rs6JhfOcxv08sizjQSfr/68NgQrPBZzFgx4nk X-Received: by 2002:a17:907:2682:b0:973:9492:bcd6 with SMTP id bn2-20020a170907268200b009739492bcd6mr3352522ejc.38.1686376539576; Fri, 09 Jun 2023 22:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686376539; cv=none; d=google.com; s=arc-20160816; b=fOb6c0Oy5I497yMPjvB0vyK9Pty7tObIk7CZHJ4fHN1I0CCtg6BgJZ62XXwxxk+6bb sXz/WuCqQR+e6yTmQ5iRNJQOmqDSE+YikqoxXNzD1QewvJ35Ltf3xAJaukejbOiDXYZJ pLxA9CYumzClm20bz8tzgYLlSoetilkBdNRxFjF3MNj3M/WQAHPc3xIzPpoTz8PCtFem fYf0HvpzjC8sT/qIQej5i9Nkra0IFJdSN6048MBu3Pfz8QEnGBtDTCQB4nS/folR5ZOt QUhZo/HTWRF8BI63ULmlBQbDC3WXmOo3wPaNV6DiaMTCSUV7laCTD23rWpaV6ohrsbXJ uK7Q== 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:references :cc:to:from:subject:user-agent:mime-version:date:message-id; bh=EDK9L3qlDUehAmaAIQlIYdsTrgX+iJ1rsFdHOetS7rs=; b=cXsUnX0dhr/HdnFFb4AiThnAZfUx5nktdAWpST857YY8A9eGo3hGcUpuanFnpcXqvH s/ScAmarFVySNavRKVTHQgoOzZZNPgmj39bRKQ/btHUHj3Vvihc3HneZv3wJA9/gvZyo cb/hXq6whW4nKD47EpZ//F20u/SypkE4rMMz/Of0K1XV5CkG/AigHzArf/jiYGaX0neD 2jKqRKc30CHr2mjes8wJ6Bd+N3/Ner1Aqu0wdzOm67mql5lkdeJY7vPMRoCeBN2E7KS6 KBLFGbNVJ5ZAagJpuOiai0DPMwECYqzfEm+kHKgKtFGxFWUbRFTzPH5sYwBhXbHl8DqB c62g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sangfor.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170906a38f00b009788b0e1ea5si2261067ejz.563.2023.06.09.22.55.15; Fri, 09 Jun 2023 22:55:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sangfor.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231538AbjFJEBF (ORCPT + 99 others); Sat, 10 Jun 2023 00:01:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjFJEBD (ORCPT ); Sat, 10 Jun 2023 00:01:03 -0400 Received: from mail-m11875.qiye.163.com (mail-m11875.qiye.163.com [115.236.118.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E566319BB; Fri, 9 Jun 2023 21:00:58 -0700 (PDT) Received: from [IPV6:240e:3b7:3279:1440:9db:41ed:be98:62d0] (unknown [IPV6:240e:3b7:3279:1440:9db:41ed:be98:62d0]) by mail-m11875.qiye.163.com (Hmail) with ESMTPA id 8BC2C280E48; Sat, 10 Jun 2023 12:00:53 +0800 (CST) Message-ID: <6a1a873a-e2d9-dce0-8fcb-9415b6124550@sangfor.com.cn> Date: Sat, 10 Jun 2023 12:01:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH net-next] net: ethtool: Fix out-of-bounds copy to user From: Ding Hui To: Alexander Duyck , Jakub Kicinski Cc: Andrew Lunn , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, pengdonglin@sangfor.com.cn, huangcun@sangfor.com.cn, jacob.e.keller@intel.com References: <20230601112839.13799-1-dinghui@sangfor.com.cn> <6e28cea9-d615-449d-9c68-aa155efc8444@lunn.ch> <44905acd-3ac4-cfe5-5e91-d182c1959407@sangfor.com.cn> <20230602225519.66c2c987@kernel.org> <5f0f2bab-ae36-8b13-2c6d-c69c6ff4a43f@sangfor.com.cn> <20230604104718.4bf45faf@kernel.org> <20230605113915.4258af7f@kernel.org> <034f5393-e519-1e8d-af76-ae29677a1bf5@sangfor.com.cn> <9c1fecc1-7d17-c039-6bfa-c63be6fcf013@sangfor.com.cn> <20230609101301.39fcb12b@kernel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkZHh0eVkkZQhhPGh5DTklOQ1UTARMWGhIXJBQOD1 lXWRgSC1lBWUlPSx5BSBlMQUhJTEJBSk9PS0FCHxlBT0oeH0EZHkJDQU1JH0tZV1kWGg8SFR0UWU FZT0tIVUpKS0hKTFVKS0tVS1kG X-HM-Tid: 0a88a376d49d2eb1kusn8bc2c280e48 X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Pi46CDo4Vj1WLiMdGhwLAzIU ETQwCSNVSlVKTUNNSE1CTU5PSUJPVTMWGhIXVR8SFRwTDhI7CBoVHB0UCVUYFBZVGBVFWVdZEgtZ QVlJT0seQUgZTEFISUxCQUpPT0tBQh8ZQU9KHh9BGR5CQ0FNSR9LWVdZCAFZQU9OQkk3Bg++ X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/6/10 11:47, Ding Hui wrote: > On 2023/6/10 1:59, Alexander Duyck wrote: >> On Fri, Jun 9, 2023 at 10:13 AM Jakub Kicinski wrote: >>> >>> On Fri, 9 Jun 2023 23:25:34 +0800 Ding Hui wrote: >>>> drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c: .get_sset_count         = nfp_net_get_sset_count, >>>> drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c: .get_sset_count         = nfp_port_get_sset_count, >>> >>> Not sure if your research is accurate, NFP does not change the number >>> of stats. The number depends on the device and the FW loaded, but those >>> are constant during a lifetime of a netdevice. > > Sorry, my research is rough indeed. > >> >> Yeah, the value doesn't need to be a constant, it just need to be constant. >> >> So for example in the ixgbe driver I believe we were using the upper >> limits on the Tx and Rx queues which last I recall are stored in the >> netdev itself. >> > Thanks to point that, the examples NFP and ixgbe do help me. The commit f8ba7db85035 ("ice: Report stats for allocated queues via ethtool stats") also helps a lot. -- Thanks, -dinghui