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 9D0DD4401D; Mon, 13 May 2024 20:55:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1EE6402EF; Mon, 13 May 2024 20:55:00 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id 9B7E3402CD for ; Mon, 13 May 2024 20:54:59 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-5d42e7ab8a9so2666186a12.3 for ; Mon, 13 May 2024 11:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715626498; x=1716231298; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Yzaco9WZn0+5AHZTJ4uUrdh2nerd5ihBSNHlXchIYMI=; b=Kvnr0QaKYH8HO4lPIjJfima1+0YrbIvENCBm0GJHKha4ttkue84h8+Tr5h1NEMEie7 KlamcqCOMK5S+Zy12qqjrWQr16lXA3/wseluWpz2cnneLCTiMiO7YYcnrasJMjDJhJn6 W3H147stewdFfmaSQ88lxeMwBX/dEN03r/vd+JnzKjpMjLFeSSI0QgcuRqPSdz+nlejt MMulKnVrjFSqOkX9dPjtS/7vhIcmgKZp6ukicsT2u6HhRNJ3ewqd9ZuQus2AWkJTloRZ PI/oCh6gFEa0hLda2HB0AL9HvkNkN0R8mFw+X4UvxcewT8XEFy3/fWr07Wf0VjEhut7F BpoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715626498; x=1716231298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yzaco9WZn0+5AHZTJ4uUrdh2nerd5ihBSNHlXchIYMI=; b=o/JPtImrDXJaix5clFABg2A90oQC+AeDePC7t2pNbEZqqUYk8tmfi59tK+lQagOg+h GHl7c/+F1eQVuTL0qCs/mDOROes/872ICnr0VcnJmCdt95Fxf3l23beGOmBIrj75g8GX BX45wny6mg2gdhvOMIVta3oT1JJRBVFP3mq8O9nM4VeAMYN0xeKQWmycMQmhIJK0Bl2N koNEYZFMXO4JiNb/jhezDuFYyP7KTxP+OEg6qXLcqLiUKto7NL634EZ9qAmLyA4zJ0M9 1N2h7Kws2VRhsed8bo6BZoZlxDoPGLuU7uS8W3amXWIc/IUgigZhbBjdL01ThP6t+0qC O+5g== X-Gm-Message-State: AOJu0YxRI5ftMWyBeM04nV5UtyB7ZmUrHm42CBlHm2dJ4VxdCfw9FXO0 oAi1XvRP5XVceoC0wNwwPFb6WBgTrZaJPTadQ5d7XDvcOBt125CxFwXlZbU4pWTM/VZpz4gHBaA CXxDF3Q== X-Google-Smtp-Source: AGHT+IH5Wl1Svc0iJxbices1F2unE5/N/H8wxjncqPGwsJLjiTRBO2+SQh1ckzAp5S2edDoor17gFw== X-Received: by 2002:a05:6a20:8415:b0:1aa:48d1:2144 with SMTP id adf61e73a8af0-1afde1ddba4mr10838032637.52.1715626498483; Mon, 13 May 2024 11:54:58 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-634103f7237sm8154680a12.71.2024.05.13.11.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 11:54:57 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [RFC v2 0/7] generic SW counters Date: Mon, 13 May 2024 11:52:10 -0700 Message-ID: <20240513185448.120356-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240510050507.14381-1-stephen@networkplumber.org> References: <20240510050507.14381-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This is second attempt to demonstrate: - generic counters for SW drivers, the example does covers: af_packet, af_xdp, tap, ring but could be applied to virtio, etc. - counters are safe against 64 bit tearing on 32 bit platform v2 - renamed and reorganized - put counters in eal, stats in ethdev internal functions - use offset to find stats in queue struct Stephen Hemminger (3): ethdev: add internal helper of SW driver statistics net/af_packet: use SW stats helper net/tap: use generic SW stats Stephen Hemminger (7): eal: generic 64 bit counter ethdev: add internal helper of SW driver statistics net/af_packet: use SW stats helper net/tap: use generic SW stats net/pcap: use generic SW stats net/af_xdp: use generic SW stats net/ring: use generic SW stats drivers/net/af_packet/rte_eth_af_packet.c | 95 +++----- drivers/net/af_xdp/rte_eth_af_xdp.c | 115 ++++----- drivers/net/pcap/pcap_ethdev.c | 146 ++++-------- drivers/net/ring/rte_eth_ring.c | 85 +++---- drivers/net/tap/rte_eth_tap.c | 102 +++----- drivers/net/tap/rte_eth_tap.h | 15 +- lib/eal/include/meson.build | 1 + lib/eal/include/rte_counter.h | 91 ++++++++ lib/ethdev/ethdev_swstats.c | 270 ++++++++++++++++++++++ lib/ethdev/ethdev_swstats.h | 54 +++++ lib/ethdev/meson.build | 2 + lib/ethdev/version.map | 8 + 12 files changed, 624 insertions(+), 360 deletions(-) create mode 100644 lib/eal/include/rte_counter.h create mode 100644 lib/ethdev/ethdev_swstats.c create mode 100644 lib/ethdev/ethdev_swstats.h -- 2.43.0