From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 679E341C50; Fri, 10 Feb 2023 18:25:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 457D7410EA; Fri, 10 Feb 2023 18:25:55 +0100 (CET) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mails.dpdk.org (Postfix) with ESMTP id 92C3A410D3 for ; Fri, 10 Feb 2023 18:25:53 +0100 (CET) Received: by mail-ej1-f48.google.com with SMTP id gr7so17754365ejb.5 for ; Fri, 10 Feb 2023 09:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4Kp0y0Vf1U30opp01V2+3Qhm3vA/sgLUjkZKYTxUgVo=; b=PDJhV12sKmYeU5K9YZjP9lQTHY/G7L6ZoCpspzgPXa8yU2SdLzcs83XdZixEwGgyuI DbeCCHj9pktVu7IIplEoatM/5oThHq/y2KXnQUdoxsfTwyH40n492XTpV+lMgCu2fSKu i7Ur5blJAzWPFJsRqg9xPYCewBdNd+N8JvLvxGKaooNrxy5s3wMGbZIELOZKanExWhRj gv7YtmfLLXaLeaNNhEsJsyIiPfSw+Ijd+0C2VMF1O0vy4CPRQZo1mkK3SiQDyYRxAd5s qZUYn7udDtnR0nbnPua72bgNICPmr1s8t9Gf6sD1DQbPdjOUj2UaNMW6RPM+pszOnrgi ND4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Kp0y0Vf1U30opp01V2+3Qhm3vA/sgLUjkZKYTxUgVo=; b=HiYgCVdGOy1rZB13jOZX+XfyyfswupyXXBIsvd1o/tobcN7IN4wdi5UmRW8CaKydWf Rj+whJs+tiwVEYtn+Yb3ZyjmuHlL9stS+7hLvh4D+wDLnYc65cFJuOQiMREpmE8SS6aL dJS+FT1u6zT/mRTDSbRTE7UmRfHl2G5OJcO/sMzu3C2JH7MPgoa5NpcP0P9W62d+xzwF Y4WHP6I36cLic4w0xw9PiRzTgk4nelUpz9YkSIZdvcQCkcM0kKsNWYlbQgfn3YOQIc6h qPXmc3+PukKYIpgp+lTtblqadeK/QNZwi+GHwEpXN8jAoewHELzo4tvK4wOHd1Qvqsus 9xtQ== X-Gm-Message-State: AO0yUKXoaIkqiLr6atv1x4UEk+SdrQOH0ST+vHiOdC0ouAwQXStd5xJ4 v9V7qm7cUNFmR7w0c244axqpD7EQGlw= X-Google-Smtp-Source: AK7set/OWIEUlZ+NnzXxGPLZuvuyRkuFEyTi32d75zEydYXhpDu4VuLfjWTBNRYAjuXIDJKrqCOLSQ== X-Received: by 2002:a17:907:b681:b0:8af:4327:cf38 with SMTP id vm1-20020a170907b68100b008af4327cf38mr5609898ejc.26.1676049953290; Fri, 10 Feb 2023 09:25:53 -0800 (PST) Received: from smtpclient.apple ([176.41.30.74]) by smtp.gmail.com with ESMTPSA id aa5-20020a170907354500b008aecadcc97esm2648624ejc.0.2023.02.10.09.25.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Feb 2023 09:25:52 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: [PATCH 2/2] net/gve: add standard and extended statistics From: Levend Sayar In-Reply-To: <20230210083457.0e20a310@hermes.local> Date: Fri, 10 Feb 2023 20:25:41 +0300 Cc: Junfeng Guo , dev@dpdk.org Content-Transfer-Encoding: quoted-printable Message-Id: <20DC6215-2930-43A4-8C9A-8B8B90D8F43F@gmail.com> References: <20230210130606.57036-1-levendsayar@gmail.com> <20230210083457.0e20a310@hermes.local> To: Stephen Hemminger X-Mailer: Apple Mail (2.3731.300.101.1.3) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Accessing a stack variable is faster. So copying to given stats pointer will be done at once. But of course, given stats pointer can also be used. > On 10 Feb 2023, at 19:34, Stephen Hemminger = wrote: >=20 > On Fri, 10 Feb 2023 16:06:06 +0300 > Levend Sayar wrote: >=20 >> +gve_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) >> +{ >> + uint16_t i; >> + struct rte_eth_stats tmp; >> + >> + memset(&tmp, 0, sizeof(tmp)) >=20 > Why do you need tmp? > The stats pointer passed in is already available and zeroed.