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 6B68D4408D; Tue, 21 May 2024 22:18:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5AF80402ED; Tue, 21 May 2024 22:18:23 +0200 (CEST) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mails.dpdk.org (Postfix) with ESMTP id 60B15400D7 for ; Tue, 21 May 2024 22:18:04 +0200 (CEST) Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-5e4f79007ffso1287022a12.2 for ; Tue, 21 May 2024 13:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1716322683; x=1716927483; 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=sv7SdIHERRjNtsDjgUDKk2R928ZocLgoHhGQoP8GMCs=; b=RXKW/IhFrzHfnFiPGewY36wLm0npai9xI8HG0GGHvx/aFxnOlMkHyImwosN0FFv7rH L+cKaTBDBWHBV7/XdPgXX8ctwWfGRERoeCbAU6P1D13vgefptUzTKEN1anKcSBH37XEb uOCNUkaiynNnE4JlB2AI7TQxWoq/GFUz/WjoX4H937GPSfgph+TUSRR9KGgAxdaGEs8j KjbJYouD8WKl8qsWlvqdvKQYf9Z8x81sSYGEO1doqWh3ZsodTOPN4MBKJUiG1vXAVPUc eKCXHvUETrK3tLmLYp6hhC4FM8zGvCQBGelkOrhPaoanFX6CXoBECv6/zp5rA/gvitbL wIfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716322683; x=1716927483; 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=sv7SdIHERRjNtsDjgUDKk2R928ZocLgoHhGQoP8GMCs=; b=ciU+OpRniM6urr2vAGS6oSBXjzHU3h6n2GlufU8aW6sUQMePo7pfSavI8o/CxqOlQe ri3EZv5lj4y5+JX4M5sn65rc1y93jE40Vk6WotshJvlsEpJ2rhhSxsDijCVAkCLweCa8 4P+GjLyDS0T4vsStI1aHX6nbvi3CWHFmuT+H4FjKR6YW7mDlpMf+hnURVUuueVo3R5yg L/yf9lDBn3Phh/EDEZonBhK5yEsMP0sfrjuNwIkwlGEdRPeFXJco/hePU5IYSEzNHctR VxvTNv7LJzNfHYcRwo70QZN9eP4YyNkaTm2jFh2anJp3kzSLDxHOcxE3waJWQo7zs6KK ZiUw== X-Gm-Message-State: AOJu0YxECrAl9XRdUtPhq8nndHwz+zjNe+ObZAgGpKm4oefJ6fb9N2GN ZVPEh1swjMg/P6hTTIWbDOrdt/6v0q+OU9XibtxkFLtTmUhEIJOUFsrl16Yu/uWVAk8pKZuRPfH c X-Google-Smtp-Source: AGHT+IG5lK2vVMOtx9EXMzoFBIn1jeYFMoBXO4J6NfAl4va/4VqYLog6ubkOFLv5OWGqGHEJvaoeAw== X-Received: by 2002:a17:902:efc6:b0:1e9:cf94:5bea with SMTP id d9443c01a7336-1f31c997f1bmr272115ad.35.1716322683526; Tue, 21 May 2024 13:18:03 -0700 (PDT) Received: from hermes.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f30fb5303csm16119075ad.166.2024.05.21.13.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 13:18:03 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v9 0/8] Common statistics for SW PMD's Date: Tue, 21 May 2024 13:16:33 -0700 Message-ID: <20240521201801.126886-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-Type: text/plain; charset=UTF-8 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 Adds common code for collecting basic statistics used by many SW based PMD's such as af_packet, af_xdp, null, tap and ring. This version uses two counters (current and offset) to implement SMP safe reset on 64 bit platforms; this avoids having to do locked operation in the fast path. On 32 bit platforms, the compiler will split access to 64 bit variables by default; therefore it has to use std atomic. By using common code, it also fixes missing counts in several drivers. And fixes several bugs. v9 - change includes in rte_counter.h to fix build on some versions Stephen Hemminger (8): eal: generic 64 bit counter ethdev: add common counters for statistics net/af_packet: use generic SW stats net/af_xdp: use generic SW stats net/pcap: use generic SW stats net/ring: use generic SW stats net/tap: use generic SW stats net/null: use generic SW stats drivers/net/af_packet/rte_eth_af_packet.c | 78 +++-------- drivers/net/af_xdp/rte_eth_af_xdp.c | 85 ++++-------- drivers/net/null/rte_eth_null.c | 83 +++--------- drivers/net/pcap/pcap_ethdev.c | 100 ++++----------- drivers/net/ring/rte_eth_ring.c | 63 +++------ drivers/net/tap/rte_eth_tap.c | 75 ++--------- drivers/net/tap/rte_eth_tap.h | 15 +-- lib/eal/include/meson.build | 1 + lib/eal/include/rte_counter.h | 150 ++++++++++++++++++++++ lib/ethdev/ethdev_swstats.c | 101 +++++++++++++++ lib/ethdev/ethdev_swstats.h | 111 ++++++++++++++++ lib/ethdev/meson.build | 2 + lib/ethdev/version.map | 3 + 13 files changed, 486 insertions(+), 381 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