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 CB0FB45717; Fri, 2 Aug 2024 04:43:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1EE74029A; Fri, 2 Aug 2024 04:43:01 +0200 (CEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id E2CBF400D6 for ; Fri, 2 Aug 2024 04:42:59 +0200 (CEST) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2cb4c4de4cbso5185354a91.1 for ; Thu, 01 Aug 2024 19:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1722566579; x=1723171379; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=p655xmbUSLknalHgFF2h8A7EW6Dannpo0goH0O7kv88=; b=GzwQmuP6CqCu9ZktdRGl8+XHLY7asC6Cu3Qqj+OrmNrfoSm3tGjqpPnVUWGJidnmeS EMS5LzXCtHDrFord/WywvDCwy264COrIb3YVNeXXVqt/USZDwZXhkuZeXCDMJndx7V7f iZW9uVb1roGlZGurW68XiKeJrgDhH+gikR1ygLVIcgNFRfCXIkTiyGm/HeAeunTpt1q1 7Cjs44nwVVHJ8tnmI5uxN6YjMWPzo5exURSQfDJRW/GHfcltqihczEQ4LPJQwyO24no3 G/n06DACvQ1OsrGbf0QR4P/qPlracSXJ0vwqyd45HRN7U+6vZJYRKIkWRPovx4FZH9Sb VdMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722566579; x=1723171379; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p655xmbUSLknalHgFF2h8A7EW6Dannpo0goH0O7kv88=; b=Hp5ui5X5Q5aCyjFuWjaD4+YgUJn03K/iiQULshbJlQM78SOtjyXktPl114YFCtZhDa 1xNx9avzBGRVB6aG4rtGt+i4SsFUlCsrDjV/CMhPt44DmE017cYvyT1WbVUXs0I/hL6N hhCLrKoXmbkTCMsPTfHkF+bJ9ebQAT0S0tPgY3vXTEAX3SkJdXNf7wDUNW1600ezwRV7 ygRLBazLZKqmgW/DlQBlb1MilaoRrXITGh94DMExdmdtCvpY+Sxh9C/NbRhTm7HFQ63K mGYDg18R9J9pUUB2ywR9wPyoQMYCPFrAQHyLVBe/M5LRKyVkZ2oN7afS1oiPHmLdHdP9 0bhg== X-Forwarded-Encrypted: i=1; AJvYcCU+b7q+ApBH0+S4o3xKTmPBNPQsZ2rTc1YCxyuruoYWhhV4iXufo36jWJDiBnAB3p93dRYA2JeIRBLB7c0= X-Gm-Message-State: AOJu0Yzw7zSB2rllgL0ILImFtIxcM4Wy29mIviu1l4halGdHnSXnhwYH 4mjXxM8SMKrFUY4st10mLWyguOqd0TOcV0ZPT5Zp+Vh5Cnq2RJRbSM5D9XnaR5I= X-Google-Smtp-Source: AGHT+IHq5tTBlneTyr5FqYsRzca5SLMIV75hTWXaXI3m4O+f+SNZrGp1aEure4Rn/e2/EX9l5fBemA== X-Received: by 2002:a17:90b:2301:b0:2c9:a3ca:cc8b with SMTP id 98e67ed59e1d1-2cff91440dcmr2727829a91.0.1722566578624; Thu, 01 Aug 2024 19:42:58 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2cffaf69c23sm656349a91.11.2024.08.01.19.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 19:42:58 -0700 (PDT) Date: Thu, 1 Aug 2024 19:42:56 -0700 From: Stephen Hemminger To: "lihuisong (C)" Cc: Morten =?UTF-8?B?QnLDuHJ1cA==?= , , , Subject: Re: [PATCH v5] virtio: optimize stats counters performance Message-ID: <20240801194256.0cd2c400@hermes.local> In-Reply-To: <677a47da-c6ba-57a9-92c7-a98df739d216@huawei.com> References: <20240731131744.36448-1-mb@smartsharesystems.com> <20240801160312.205281-1-mb@smartsharesystems.com> <677a47da-c6ba-57a9-92c7-a98df739d216@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Fri, 2 Aug 2024 10:23:12 +0800 "lihuisong (C)" wrote: > > void > > -virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbu= f *mbuf) > > +virtio_update_packet_stats(struct virtnet_stats *const stats, > > + const struct rte_mbuf *const mbuf) =20 > The two const is also for performace?=C2=A0 Is there gain? If you look at resulting code (ie godbolt.org) the resulting code never changes when const is added. The compiler already knows what is modified. Const is only a programmer and correctness thing.