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 8127244052; Fri, 17 May 2024 19:40:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F23F640278; Fri, 17 May 2024 19:40:48 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 6ABFE40268 for ; Fri, 17 May 2024 19:40:47 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1ecd9a81966so6265115ad.0 for ; Fri, 17 May 2024 10:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715967646; x=1716572446; 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=bBKRvXILD1FG55XcpcXxdBtRLjPN2RQ9Bv5jH0PeC7w=; b=CP/z4duDvEJtPJbQJuENSzMQ6o4JqhVsiOF4M02FqRUvDhexMDnCHEfP8OxUlvfso1 IelsmZVoJN1SYUZsr/27/1rXhR9K6pW/txvfdITAJW8omBkWpkI5yGkQqhqiKDSUm6vc m+BL+XGNU7Pmf3zbji78cEM54qUJejqGiDx9nvicQemDtfwZu91nCHxYX/T/tIZmjzoy tti8WbOEoOLvJDNx/C5rdF+ON1V3qodX1IY/tN1y6Pi45x+C8KKnHkdxrafkWT5dvLeB Zojpfe9dOQZ68G0C3MlV/jB4AGpqP0oEAE6LzQiwZUIloBsfPNYtOg3yRGykXBVsXanM 3Q4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715967646; x=1716572446; 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=bBKRvXILD1FG55XcpcXxdBtRLjPN2RQ9Bv5jH0PeC7w=; b=pMDDyzgE5ouq/Y+vA47v9DVUG/hL+CY8xAwEg/Ic+KoOMUuoek/pmIweYnd++jdpuJ dZnRiFI4xoMb1JsdXCt92zNAv1P3Yj7GWSoTgfG4Yh/ON/wWvnqJG4aWr/d3Ila2eRMF qtqBaFPrdxS/BWsMl9PT58brL+nM7nngYr8wGULuZydZp4zUNqC7ESytbt8EMFhnOlZ4 44Sz+nd4/QLd3rovVi+5nkoSjRh4Fc5MkEQptHjQyukkVgoYrZ95xaY+OBoiiSw0bUDJ 4AxlsiDumoXMQw2bjUcoeMXeZeqdW6ZZoSpvQFaRNIONG4t9ph/uvi6ybxz3OHqJXZbQ AZiA== X-Gm-Message-State: AOJu0YwbNBdX4QAflYdZnOWkOxgkoCe3BByP2+jfRt2GHdxh4T0Xg0BQ vAGWxubQ0/Zz9wLt9mLV+O7Dm2FaCkvo4nBghGH570DzEADAs8NnuKiGdDOOkVcuVIm9pf4YzhG 9Tkc= X-Google-Smtp-Source: AGHT+IEdf3SIUXgx4LZ6Nv8/2fSyXqVg5axP6kJ+ApVHpJu/qUimFPk3s8Y+lRdDpL86VD0cM2e6QQ== X-Received: by 2002:a17:902:da8f:b0:1e4:2859:e59b with SMTP id d9443c01a7336-1eefa58a243mr409385475ad.28.1715967646317; Fri, 17 May 2024 10:40:46 -0700 (PDT) Received: from hermes.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0bf31032sm158830485ad.131.2024.05.17.10.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 10:40:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v7 0/9] Use weak atomic operations for SW PMD counters Date: Fri, 17 May 2024 10:35:07 -0700 Message-ID: <20240517174044.90952-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 std atomic on all platforms. The memory order is chosen to be the best performance but still providing the guarantees expected of PMD counters. By using common code, it also fixes missing counts in several drivers. And fixes several bugs. v7 - use stdatomic even on 64 bit. Does cause extra locked operation for increment on x86 64 but will be safe. - rebase Stephen Hemminger (9): 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 test/pmd_ring: initialize mbufs net/ring: use generic SW stats net/tap: use generic SW stats net/null: use generic SW stats app/test/test_pmd_ring.c | 26 ++++- drivers/net/af_packet/rte_eth_af_packet.c | 82 +++----------- drivers/net/af_xdp/rte_eth_af_xdp.c | 97 +++++------------ drivers/net/null/rte_eth_null.c | 80 +++----------- drivers/net/pcap/pcap_ethdev.c | 125 +++++----------------- drivers/net/ring/rte_eth_ring.c | 71 +++++------- drivers/net/tap/rte_eth_tap.c | 88 +++------------ drivers/net/tap/rte_eth_tap.h | 15 +-- lib/eal/include/meson.build | 1 + lib/eal/include/rte_counter.h | 116 ++++++++++++++++++++ lib/ethdev/ethdev_swstats.c | 101 +++++++++++++++++ lib/ethdev/ethdev_swstats.h | 124 +++++++++++++++++++++ lib/ethdev/meson.build | 2 + lib/ethdev/version.map | 3 + 14 files changed, 495 insertions(+), 436 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