From patchwork Thu Jan 12 10:58:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 121894 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A025423B5; Thu, 12 Jan 2023 11:59:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2B8B40E25; Thu, 12 Jan 2023 11:59:21 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id D770540156 for ; Thu, 12 Jan 2023 11:59:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673521160; x=1705057160; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xBeKH+NufXd7Kx+j5dJHXPSfGDq24h/kUewfw7Aga/o=; b=TwFW6R4MNQbbjjaYT63XoBTfojuMfpn/Zbw83vdruICUUIhJk/1mDiCg 0EXI9MISTOkvSODEXY0MzijuPwQkkOhUSe1K9jszFD8nKsHgcDkoA6XmG SxZt2lBuSmBJKCxUCd96teXXp7fKxH79gEEK/ukdpKSQorlboOOhardZp cSVTm2ExP5oPb/no8Lm/nXMFxqnRPI8szUA9GhaSwoBoBGqxtpWjBmOKZ OpmLXPKyF8OGv8B2MP7WygCDnjqu8S71Xsu+ApBFMJb/7dcibSL7BHN/i IhTkF9HEXfKYXZyvgVebkrSgQSWUHtv2SqGuh7yhXnCiqSuDOGgxshM5c Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="321365645" X-IronPort-AV: E=Sophos;i="5.96,319,1665471600"; d="scan'208";a="321365645" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 02:59:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="781746854" X-IronPort-AV: E=Sophos;i="5.96,319,1665471600"; d="scan'208";a="781746854" Received: from silpixa00401385.ir.intel.com ([10.237.214.166]) by orsmga004.jf.intel.com with ESMTP; 12 Jan 2023 02:59:17 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v2 0/9] Standardize telemetry int types Date: Thu, 12 Jan 2023 10:58:54 +0000 Message-Id: <20230112105903.46341-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221213182730.97065-1-bruce.richardson@intel.com> References: <20221213182730.97065-1-bruce.richardson@intel.com> MIME-Version: 1.0 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 Rather than having 64-bit unsigned types and 32-bit signed types supported by the telemetry lib, we should support 64-bit values for both types. On the naming side, since both are 64-bit, we should no longer call the unsigned value u64 - "uint" is better. This patchset implements these changes as far as is possible while still keeping API and ABI compatibility. * Internal structures and functions are updated to use 64-bit ints * Internal functions are renamed from u64 to uint * Public enum values are renamed from u64 to uint, and a macro is added to ensure that older code still compiles * The public add_*_int functions are changed to take a 64-bit value rather than a 32-bit one. Since this would be an ABI break, we use function versioning to ensure older code still calls into a wrapper function which takes a 32-bit value. The patchset also contains a couple of other small cleanups to the telemetry code that were seen in passing when making these changes - removing RTE_ prefix on internal enums, and simplifying the init of the the array of data types. NOTE: the renaming of the u64 functions to uint is split across 3 patches in this set - patches 4,5 and 6. This is to make it easier to review and to avoid warnings about new functions not being marked initially as experimental. Some/all of these 3 can be combined on merge if so desired. V2: - added additional patches to replace the old function calls within DPDK code, something missed in RFC version - added new patch to make the renamed/new functions immediately public allowing us to mark the original named versions as deprecated - re-ordered patches within the sit, so the extra cleanup changes come first Bruce Richardson (9): telemetry: remove RTE prefix from internal enum values telemetry: make array initialization more robust telemetry: rename unsigned 64-bit enum value to uint telemetry: add uint type as alias for u64 global: rename telemetry functions to newer versions telemetry: mark old names of renamed fns as deprecated telemetry: update json functions to use int/uint in names telemetry: make internal int representation 64-bits telemetry: change public API to use 64-bit signed values app/test/test_telemetry_data.c | 22 ++--- app/test/test_telemetry_json.c | 9 +- doc/guides/rel_notes/deprecation.rst | 5 ++ drivers/common/cnxk/roc_platform.h | 2 +- drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 24 ++--- drivers/net/cnxk/cnxk_ethdev_telemetry.c | 6 +- examples/ipsec-secgw/ipsec-secgw.c | 72 +++++++-------- examples/l3fwd-power/main.c | 4 +- lib/cryptodev/rte_cryptodev.c | 6 +- lib/dmadev/rte_dmadev.c | 2 +- lib/eal/common/eal_common_memory.c | 19 ++-- lib/ethdev/rte_ethdev.c | 12 +-- lib/ethdev/sff_telemetry.c | 2 +- lib/eventdev/rte_event_eth_rx_adapter.c | 22 ++--- lib/eventdev/rte_event_timer_adapter.c | 38 ++++---- lib/eventdev/rte_eventdev.c | 5 +- lib/ipsec/ipsec_telemetry.c | 32 +++---- lib/rawdev/rte_rawdev.c | 4 +- lib/security/rte_security.c | 8 +- lib/telemetry/meson.build | 1 + lib/telemetry/rte_telemetry.h | 51 +++++++++-- lib/telemetry/telemetry.c | 56 ++++++------ lib/telemetry/telemetry_data.c | 95 ++++++++++++++------ lib/telemetry/telemetry_data.h | 24 +++-- lib/telemetry/telemetry_json.h | 16 ++-- lib/telemetry/version.map | 9 ++ 26 files changed, 323 insertions(+), 223 deletions(-) --- 2.37.2