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 EB5F34408C; Tue, 21 May 2024 19:05:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85B46402E2; Tue, 21 May 2024 19:05:05 +0200 (CEST) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mails.dpdk.org (Postfix) with ESMTP id 508474025C for ; Tue, 21 May 2024 19:05:04 +0200 (CEST) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5f415fd71f8so520912a12.3 for ; Tue, 21 May 2024 10:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1716311103; x=1716915903; 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=a6fMg5D28WVTtV73yC4uTjH18qoRM1gvDdNrwx1g1SI=; b=iI0wEsyoG3/vEv/74xsgcGZHDqHPM4em59lfXaEGfA1QKodtgN4l0S740YiEj/4zfK eWM7T20nAD1h5iksldA8iehs29CF7Nvpow0p6VUutelvStCMnWD7p62yIp5caUxs8Fby HdjoNq808PkfvEphy8Mc0B/+kFg5oAk9KnCkBClidX1lo5Mqyy1aINveK66siV31ykql XuA3oSOHM4OiAPPXT4HZxSrqym5Oo8mlr5NnMPWgc4tg1uv35q/EUHm/NaUhPI/BFkcJ XvwG9ShExAOAsWdHWZHpfNwtQyDEjkTlW+W3InFGB4SAnSkrg50XVN3tswmNhyV4eRHe zL+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716311103; x=1716915903; 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=a6fMg5D28WVTtV73yC4uTjH18qoRM1gvDdNrwx1g1SI=; b=p9qXF0B8jYUkOHmLrsq7KtYL2UO42baCKrQ4b9N6tQAm1i+JoczwY6wQ7NfTQA+nUH KqD2+6y2xlSXJf8BGOzuv95ORgzjD1UPEajEom0YYPAnC3ZXsObUhAF9hNyMA4TVIbly ztuxGMcDKvdNI0nGm3cz+0j/z7pE8FVxklWqGXVq66zxQ7MyNL+3Lr3ydq0xfsjiqDU8 MrQt6WKoj43yZqSk670F38w8UNbDCsPbKZAQbOJ7h8WlyOf2wPhUyEKKS5rOTAEx0BCt IGnhZCATJY04x1Fs8aE2mQ/a0dnMsy458ZyL9YpwFr8oeXwDkXiOXTix/cD/SNlSSsdI KUiQ== X-Gm-Message-State: AOJu0YyJCQK/rV6YHsCOGDFsvuAFpXIa1iHdYP16c+wZTx0VtYOdwnhR /gewTNgKieL3m7S2BjL+SOo4PqZrTgdVaf9r1PUuf1sMrf0qWNR3cmO9enPZ/VnHx9kvsEhnyVU X X-Google-Smtp-Source: AGHT+IEyl9Z/+VRyemio6wkI8teZA1K9nWs3dAmtQdCaybBp7jF2MpBiL+wf6EngcGGVhPzHIKqfUg== X-Received: by 2002:a17:90b:1a8c:b0:2bd:7135:21a8 with SMTP id 98e67ed59e1d1-2bd7135259cmr6764068a91.42.1716311103021; Tue, 21 May 2024 10:05:03 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2bd7a0867fcsm4297018a91.29.2024.05.21.10.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 10:05:02 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 0/8] Common statistics routines for SW based PMD's Date: Tue, 21 May 2024 10:00:47 -0700 Message-ID: <20240521170453.119036-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. v8 - use counter and offset (based on mailing list discussion) to avoid having to locked operation on x86 64. 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