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 7F6FE43FEC; Fri, 10 May 2024 07:05:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19A38402F0; Fri, 10 May 2024 07:05:13 +0200 (CEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 84F1C402D1 for ; Fri, 10 May 2024 07:05:11 +0200 (CEST) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1ec41d82b8bso14766745ad.2 for ; Thu, 09 May 2024 22:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715317511; x=1715922311; 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=ldQ91PYLpuYXR1LIs3TfeIoMn+s/VENTxg6pMN0NASE=; b=oWWh9HvnGcg8X9PHLEh1gqH7uPyksLZ5EZ5gNXZGPMi1+2Oe+SEidnx6kJ9FQhsndu JPrFtUXf21uolVjO5cHsLXNcmnwh0iYXo4KLXcyMDprUMTabM6n097gjP40SqeQ/1AEz dUsvN7890crtjObK8VNw1byh2n2H/ZSUBUWAgUNrCfeSYBxPt4icOD93mOuidmZbI5Wt MEEVvFdvsWkoJHtmhI+1SJYC+R4j4CYRdEsado9lSBDLTJ+AcTQsmwu1pN+6PpkkFFdo slc2oxhlgyKTKJRn16ciwLYb5sw1Z/RS9+K4vSJl02y8Wi96aHtx3HDO57fo7G08NTHW z5FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715317511; x=1715922311; 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=ldQ91PYLpuYXR1LIs3TfeIoMn+s/VENTxg6pMN0NASE=; b=VoidX5iLg09mWiJ77WkrvxBWPUi6/0TmjxE78oigQjI5IvoEKfE4gRj/SxPsrte2+d jJ9rmwpmrtAjIdFhJzkORF0RtV9f9qGE/OEyUxAGka74iqji4hEEhMp086fYPmMjJcr4 ji7S9afBbzv3X6dHz03i93Sf3c373hw6R7e+k9nb3FPaHdh10c8qWwCfO8AS/YW72Um5 tOh9FhjD9ufhMZlLlyiribv+nZeVwuMGtbtXr9E+ZsW+r4xqm9jxwrY6iJAIkCxQlXFS z4zIzg4GCTI527tZkGvJlHm/5lfCbED/XFtZ3N6I6p8+bl1nHn8gxgTDzw6KB9iyAXZy p7Fg== X-Gm-Message-State: AOJu0Yz3mPaaejZdVkNgDhaRL3E+eCee1N0I3VLbhDMOhbFDktmpVG4s AW7OlgdyXeQXdd6FgoaoRbIAvJV/dwWAlaWp1HLoY2MAGq7bCem6T47gOpyE0SSBCh3mL9mZO7S qEiA= X-Google-Smtp-Source: AGHT+IGwFR4OvELBLuNnfw74dl//76riOriG21aZp4DB9zhYeOW553/s+L0657Hb4PO3ft3dECBPtw== X-Received: by 2002:a17:902:ce85:b0:1e5:11ac:a283 with SMTP id d9443c01a7336-1ef43d0ada2mr20902185ad.9.1715317510687; Thu, 09 May 2024 22:05:10 -0700 (PDT) Received: from hermes.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c25566asm23007385ad.283.2024.05.09.22.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 22:05:09 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [RFC 0/3] generic sw counters Date: Thu, 9 May 2024 22:01:20 -0700 Message-ID: <20240510050507.14381-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240425174617.2126159-1-ferruh.yigit@amd.com> References: <20240425174617.2126159-1-ferruh.yigit@amd.com> 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 my attempt to demonstrate: - generic counters for SW drivers, the example does af_packet and tap but same should be applied to af_xdp, virtio, etc. - counters are safe against 64 bit tearing on 32 bit platform The naming and organization could be improved: - should this be in rte_ethdev? - better name for struct and vairables? - audit and handle errors better. Stephen Hemminger (3): ethdev: add internal helper of SW driver statistics net/af_packet: use SW stats helper net/tap: use generic SW stats drivers/net/af_packet/rte_eth_af_packet.c | 97 ++----- drivers/net/tap/rte_eth_tap.c | 100 ++------ drivers/net/tap/rte_eth_tap.h | 17 +- lib/ethdev/ethdev_swstats.c | 294 ++++++++++++++++++++++ lib/ethdev/ethdev_swstats.h | 60 +++++ lib/ethdev/meson.build | 2 + lib/ethdev/version.map | 7 + 7 files changed, 400 insertions(+), 177 deletions(-) create mode 100644 lib/ethdev/ethdev_swstats.c create mode 100644 lib/ethdev/ethdev_swstats.h -- 2.43.0