From patchwork Thu Aug 25 22:33:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 115435 X-Patchwork-Delegate: david.marchand@redhat.com 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 49369A0551; Fri, 26 Aug 2022 00:34:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1906C410DC; Fri, 26 Aug 2022 00:34:15 +0200 (CEST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mails.dpdk.org (Postfix) with ESMTP id 1D162400D6; Fri, 26 Aug 2022 00:34:13 +0200 (CEST) Received: by mail-lf1-f41.google.com with SMTP id s1so27259847lfp.6; Thu, 25 Aug 2022 15:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=rrVZ06h3jgskvhAcTOJ6jj4i76cV4APE/U05B9yT+vc=; b=R50N3dCwDTpiYjdRKuKWW83Wu24ylPOKMp13aC2Y4gXItkRFZ7QsCStA66XJxhsVSp RYg80ufqI/KTnN60GmQh2tNjxC5BX8NnXHodChmLnR+eTJcAmRdjbabiE+tq9zu65geS nVD3pXhVkxZTCvyIKMHQjvZOHB1A1ctLESkUdNNCOb0lraU3eO5mtEN8WfjJNaqDj+iO UBW18KXFNsOJvPdi9IOfGBcfRhjmPxuhBTbse31XUlyt8nDmq5pHFG4VddXW3dHDap8H o6QHJDUWJDiCSA8/mtO+TlQtgkI/Bryl5d7lVOLuliGWsOSb/Yk03xlxicQyH7BahCJt 51jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=rrVZ06h3jgskvhAcTOJ6jj4i76cV4APE/U05B9yT+vc=; b=O7swwtT74NivQx9oA6Hy4vxV3odASNPISh9A17WLjxvJcJVNpfFMIq7sKYgmCLTwAF 5hDk+7oia6geJX4tSAd1oaaMIRgr3+Zpv9zKLxC8wwMf+Ru25vi3RC00EFwRL4psZgHU v88/NBXmWFIMYaowaGSzWQM0lE4tF5TV9t36omVZP0tev+hdOsG0uEWGRt4TRaaV9ujD yiMS3fAL35xDrKK0YqBvwcQmw3BJnEUHjc900J4huNgIKm2ClMCcJwMndhb+HCTgn2pV ySfX8laG9WYDNF902p3bU283bss9rMbEz0pR5ZafQAsk2v+LarwFuMlej0u2k1G1z2YB HNlw== X-Gm-Message-State: ACgBeo1lwx3Vvtj0Jk0zOckxOHK58kFYvp/FwZpSeHEiQNXh0AjfM691 0DT++eqFyDftFrF2KpM8tGZ/VEFt6IE= X-Google-Smtp-Source: AA6agR4mx9O2mynWTYLOadIUUn7zgT8Ube5MGJ0u7qdT6eFDkd9p8GABJCsenhxs/TaKLfpX/nZ4dA== X-Received: by 2002:a05:6512:12c9:b0:48b:3e0f:7a79 with SMTP id p9-20020a05651212c900b0048b3e0f7a79mr1772520lfg.52.1661466852374; Thu, 25 Aug 2022 15:34:12 -0700 (PDT) Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b0048b0975ac7asm68249lfm.151.2022.08.25.15.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 15:34:11 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , stable@dpdk.org, =?utf-8?q?Mo?= =?utf-8?q?rten_Br=C3=B8rup?= , Bruce Richardson , Chengwen Feng Subject: [PATCH v3 1/4] eal: fix pointer arithmetic with an expression argument Date: Fri, 26 Aug 2022 01:33:52 +0300 Message-Id: <20220825223355.410540-2-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220825223355.410540-1-dmitry.kozliuk@gmail.com> References: <20220825153709.33181-1-dmitry.kozliuk@gmail.com> <20220825223355.410540-1-dmitry.kozliuk@gmail.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 RTE_PTR_SUB(ptr, x) and RTE_PTR_ALIGN_FLOOR() worked incorrectly if "ptr" was an expression: uint32_t arr[3]; RTE_PTR_SUB(arr + 1, sizeof(arr[0])); // expected: (uint32_t *)((uintptr_t)(arr + 1) - 4) == arr // actual: (uint32_t *)((uintptr_t) arr + 1 - 4) != arr RTE_PTR_ALIGN_FLOOR(arr + 2, sizeof(arr[0])); // expected: RTE_ALIGN_FLOOR((uintptr_t)(arr + 2), 4) == &arr[2] // actual: RTE_ALIGN_FLOOR((uintptr_t) arr + 2, 4) == &arr[0] Fix the macros and extend the relevant unit test. Convert uses of a custom test failure macro to RTE_TEST_ASSERT*(). Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk Reviewed-by: Morten Brørup Acked-by: Bruce Richardson Acked-by: Chengwen Feng --- app/test/test_common.c | 58 +++++++++++++++++++++++++----------- lib/eal/include/rte_common.h | 4 +-- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/app/test/test_common.c b/app/test/test_common.c index ef177cecb1..f89e1eb7ee 100644 --- a/app/test/test_common.c +++ b/app/test/test_common.c @@ -25,31 +25,53 @@ test_macros(int __rte_unused unused_parm) #define SMALLER 0x1000U #define BIGGER 0x2000U #define PTR_DIFF BIGGER - SMALLER -#define FAIL_MACRO(x)\ - {printf(#x "() test failed!\n");\ - return -1;} uintptr_t unused = 0; unsigned int smaller = SMALLER, bigger = BIGGER; + uint32_t arr[3]; RTE_SET_USED(unused); RTE_SWAP(smaller, bigger); - if (smaller != BIGGER && bigger != SMALLER) - FAIL_MACRO(RTE_SWAP); - if ((uintptr_t)RTE_PTR_ADD(SMALLER, PTR_DIFF) != BIGGER) - FAIL_MACRO(RTE_PTR_ADD); - if ((uintptr_t)RTE_PTR_SUB(BIGGER, PTR_DIFF) != SMALLER) - FAIL_MACRO(RTE_PTR_SUB); - if (RTE_PTR_DIFF(BIGGER, SMALLER) != PTR_DIFF) - FAIL_MACRO(RTE_PTR_DIFF); - if (RTE_MAX(SMALLER, BIGGER) != BIGGER) - FAIL_MACRO(RTE_MAX); - if (RTE_MIN(SMALLER, BIGGER) != SMALLER) - FAIL_MACRO(RTE_MIN); - - if (strncmp(RTE_STR(test), "test", sizeof("test"))) - FAIL_MACRO(RTE_STR); + RTE_TEST_ASSERT(smaller == BIGGER && bigger == SMALLER, + "RTE_SWAP"); + RTE_TEST_ASSERT_EQUAL((uintptr_t)RTE_PTR_ADD(SMALLER, PTR_DIFF), BIGGER, + "RTE_PTR_ADD"); + RTE_TEST_ASSERT_EQUAL((uintptr_t)RTE_PTR_SUB(BIGGER, PTR_DIFF), SMALLER, + "RTE_PTR_SUB"); + RTE_TEST_ASSERT_EQUAL(RTE_PTR_DIFF(BIGGER, SMALLER), PTR_DIFF, + "RTE_PTR_DIFF"); + RTE_TEST_ASSERT_EQUAL(RTE_MAX(SMALLER, BIGGER), BIGGER, + "RTE_MAX"); + RTE_TEST_ASSERT_EQUAL(RTE_MIN(SMALLER, BIGGER), SMALLER, + "RTE_MIN"); + + RTE_TEST_ASSERT_EQUAL(RTE_PTR_ADD(arr + 1, sizeof(arr[0])), &arr[2], + "RTE_PTR_ADD(expr, x)"); + RTE_TEST_ASSERT_EQUAL(RTE_PTR_SUB(arr + 1, sizeof(arr[0])), &arr[0], + "RTE_PTR_SUB(expr, x)"); + RTE_TEST_ASSERT_EQUAL(RTE_PTR_ALIGN_FLOOR(arr + 2, 4), &arr[2], + "RTE_PTR_ALIGN_FLOOR(expr, x)"); + RTE_TEST_ASSERT_EQUAL(RTE_PTR_ALIGN_CEIL(arr + 2, 4), &arr[2], + "RTE_PTR_ALIGN_CEIL(expr, x)"); + RTE_TEST_ASSERT_EQUAL(RTE_PTR_ALIGN(arr + 2, 4), &arr[2], + "RTE_PTR_ALIGN(expr, x)"); + + RTE_TEST_ASSERT_EQUAL( + RTE_PTR_ALIGN_FLOOR(RTE_PTR_ADD(&arr[1], 1), 4), &arr[1], + "RTE_PTR_ALIGN_FLOOR(x < y/2, y)"); + RTE_TEST_ASSERT_EQUAL( + RTE_PTR_ALIGN_FLOOR(RTE_PTR_ADD(&arr[1], 3), 4), &arr[1], + "RTE_PTR_ALIGN_FLOOR(x > y/2, y)"); + RTE_TEST_ASSERT_EQUAL( + RTE_PTR_ALIGN_CEIL(RTE_PTR_ADD(&arr[1], 3), 4), &arr[2], + "RTE_PTR_ALIGN_CEIL(x < y/2, y)"); + RTE_TEST_ASSERT_EQUAL( + RTE_PTR_ALIGN_CEIL(RTE_PTR_ADD(&arr[1], 1), 4), &arr[2], + "RTE_PTR_ALIGN_CEIL(x > y/2, y)"); + + RTE_TEST_ASSERT(strncmp(RTE_STR(test), "test", sizeof("test")) == 0, + "RTE_STR"); return 0; } diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index a96cc2a138..d517e9f75f 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -295,7 +295,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) /** * subtract a byte-value offset from a pointer */ -#define RTE_PTR_SUB(ptr, x) ((void*)((uintptr_t)ptr - (x))) +#define RTE_PTR_SUB(ptr, x) ((void *)((uintptr_t)(ptr) - (x))) /** * get the difference between two pointer values, i.e. how far apart @@ -320,7 +320,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) * must be a power-of-two value. */ #define RTE_PTR_ALIGN_FLOOR(ptr, align) \ - ((typeof(ptr))RTE_ALIGN_FLOOR((uintptr_t)ptr, align)) + ((typeof(ptr))RTE_ALIGN_FLOOR((uintptr_t)(ptr), align)) /** * Macro to align a value to a given power-of-two. The resultant value From patchwork Thu Aug 25 22:33:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 115436 X-Patchwork-Delegate: david.marchand@redhat.com 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 2E672A0551; Fri, 26 Aug 2022 00:34:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FE6A40693; Fri, 26 Aug 2022 00:34:18 +0200 (CEST) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by mails.dpdk.org (Postfix) with ESMTP id D107E400D6 for ; Fri, 26 Aug 2022 00:34:13 +0200 (CEST) Received: by mail-lj1-f175.google.com with SMTP id bx38so20790357ljb.10 for ; Thu, 25 Aug 2022 15:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=yzV4FIO6TvddPTDy+I5WhZfH0aNYsn53IMxwL6MkaVY=; b=K7eNQ+1OtmsArxLVAmSqTexLkFo4STAMN3+nzHtMZcwRPcKuXPmGpwy2ewAhfftC/X xCymYsMZgrfKaXhCQ1e87Iz1GVfUMpcrhROpLKj1XZ+1sJmk53zLttgYfVlayJv+iy1Q igekFgzZbKaXgag1lg50k1DBWSKczANoRee8+9R+v1ErCYi0t/TryJ5Ig5AzS+p/g7Wt ZIlwM3IE043rWIMG70ogLstlcgHLEMGRsXMZkJByuY8OuH/xjwkU/wVBrfhXhPCiG0Gd kyr/HYqdYVN9WtKIvVqWu1KX3p+L/suuTKrZ2iTeezkVSc1p7X8Q2Ch8R4n3vfA2iy// xnTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=yzV4FIO6TvddPTDy+I5WhZfH0aNYsn53IMxwL6MkaVY=; b=4iSPP4UcWm/ogI4YtgssN9v6ZIp5QvtkbF/l2sUkzXYBJSf2c/FeIHVX/5jEnPiF+3 vYaaStil0UTArDjl5RcllVxNTBx9EdB+L0pvd11SuS7RWD5YmMLz+GhK3cWPTBvUeg3m LPcrXOo6+gAn5jZ83vv1r4Q5+pRU5Mk4E8dxYuJasztTvlRRs7hJZrgUqj+Y4M7G6UMS Ca4FpCyhsW65d1/8a3yhXqLRYuAliwIRvoWRpJLO7s6k2SGFDgm1TeJEa+7axtUu9jpH TTk3+JxdpZ4z5tmrFUrgBSkDVzF+zAg0vYPvvfmAwbgneKlS+SyMJMHQTqGUtQWQzBnV 7y7Q== X-Gm-Message-State: ACgBeo12Cc8l+4FkE3/aqPF6FiPvHCNly7VaX9NLWC78DnyLHYe5poCC nlmhAmatpqrXb6YGkKLta/pNruUoVZ4= X-Google-Smtp-Source: AA6agR6jbDDZ0++z7QBt/sKe35/yE82F77II8J5PTShlr4690Kf+InovgJOW2v5ZwLDqMxz3dCow0Q== X-Received: by 2002:a2e:be9b:0:b0:25f:e027:4999 with SMTP id a27-20020a2ebe9b000000b0025fe0274999mr1629165ljr.395.1661466853170; Thu, 25 Aug 2022 15:34:13 -0700 (PDT) Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b0048b0975ac7asm68249lfm.151.2022.08.25.15.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 15:34:12 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , =?utf-8?q?Morten_Br=C3=B8rup?= , Bruce Richardson , Chengwen Feng Subject: [PATCH v3 2/4] eal: deduplicate roundup code Date: Fri, 26 Aug 2022 01:33:53 +0300 Message-Id: <20220825223355.410540-3-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220825223355.410540-1-dmitry.kozliuk@gmail.com> References: <20220825153709.33181-1-dmitry.kozliuk@gmail.com> <20220825223355.410540-1-dmitry.kozliuk@gmail.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 RTE_CACHE_LINE_ROUNDUP() implementation repeated RTE_ALIGN_MUL_CEIL(). In other places RTE_CACHE_LINE_SIZE is assumed to be a power-of-2, so define RTE_CACHE_LINE_ROUNDUP() using RTE_ALIGN_CEIL(). Signed-off-by: Dmitry Kozlyuk Reviewed-by: Morten Brørup Acked-by: Bruce Richardson Acked-by: Chengwen Feng --- lib/eal/include/rte_common.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index d517e9f75f..b65555bac6 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -425,9 +425,7 @@ rte_is_aligned(void *ptr, unsigned align) #define RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1) /** Return the first cache-aligned value greater or equal to size. */ -#define RTE_CACHE_LINE_ROUNDUP(size) \ - (RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / \ - RTE_CACHE_LINE_SIZE)) +#define RTE_CACHE_LINE_ROUNDUP(size) RTE_ALIGN_CEIL(size, RTE_CACHE_LINE_SIZE) /** Cache line size in terms of log2 */ #if RTE_CACHE_LINE_SIZE == 64 From patchwork Thu Aug 25 22:33:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 115437 X-Patchwork-Delegate: david.marchand@redhat.com 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 6C26AA0551; Fri, 26 Aug 2022 00:34:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FBBF42829; Fri, 26 Aug 2022 00:34:19 +0200 (CEST) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mails.dpdk.org (Postfix) with ESMTP id C561A40693 for ; Fri, 26 Aug 2022 00:34:14 +0200 (CEST) Received: by mail-lj1-f176.google.com with SMTP id x10so20821088ljq.4 for ; Thu, 25 Aug 2022 15:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=zenFBCYP3ig2zKLvJ8GGjWTGkwpnUUqkE2EdFf4PgSo=; b=RdDmMTH6bWAp/9Es4xlRHyhcLEsnXgJJzYwaCJApYdZi8w9HYyyekx0YUIW9gunoaq syPzcLGIbE3RZGzQakS1be/9RkAE4OHTvjjO0yvq4fz9Z+kBJcQs8NAk4eGtWZyJFS+7 aTcIBDYQZ8D71FKivg9MHDO88lJ39ZrO1FP9JXXHtch4nHX/L0EJwRVAWIGrsCP6ie+R e+y/R11E7Fc/D+9w59dbhZcGrtbq1L2clDrcyYh7vXRosnCJYdQjxhS5YFUaHCc5tAlJ Q2kt68MmeEUtNWJ6I+ky7aBzlTfqutFqwr0Wv0WB5HPkE6/CtXQTbW5CWu0Fc8ussOJt rhWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=zenFBCYP3ig2zKLvJ8GGjWTGkwpnUUqkE2EdFf4PgSo=; b=MLa8LZQgRnKjLIJs+LWi1p7+ka4LCZb1NBSvYqbxZ2kCbx/T4Mqw8JwOLdaSS+yum0 iFv3kEqNkeWBQQao8ZSzHrucq7mg5BInfx8MFO4mK/D91f/kunt3lzCYZVHkFD4IjhiF yiC7C1BmJK1PPLfDVYKRGFUhku9kSv/HhPkEOKDaHuOVrAcw6UMFdFqIA/Gs0dbPdF24 iWR8b16XEKQr58Csp9qrex+xqPcZexibsfHj+1x9OP+gw+fsKmT3pOzXo/Tlnr0hG/MC 3CxMtb8xyEAaERZ4OxbN3t7H5Ksurvt3Wslwus3DIhNNpCiMYzSa8gdLSEj8fFXpeM9l /Y7Q== X-Gm-Message-State: ACgBeo06fUkkAbOjXpqamybT7c+sPrvwgElXasX4yl62Dn9aIK8BMsxG ZxmSrlnh2wN68dB5BAAXgt36Fy7pU+g= X-Google-Smtp-Source: AA6agR4/DaMxsbjW6c47g5bXLZCLDzl18Iozx624xpsgLvqTuRNiDVXpcn8i8SHmjNcDpzsSGC5G1g== X-Received: by 2002:a05:651c:198e:b0:261:d4a5:db55 with SMTP id bx14-20020a05651c198e00b00261d4a5db55mr1822241ljb.231.1661466854063; Thu, 25 Aug 2022 15:34:14 -0700 (PDT) Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b0048b0975ac7asm68249lfm.151.2022.08.25.15.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 15:34:13 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , Ray Kinsella , =?utf-8?q?Morten_Br=C3=B8rup?= , Bruce Richardson , Chengwen Feng Subject: [PATCH v3 3/4] eal: uninline rte_str_to_size Date: Fri, 26 Aug 2022 01:33:54 +0300 Message-Id: <20220825223355.410540-4-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220825223355.410540-1-dmitry.kozliuk@gmail.com> References: <20220825153709.33181-1-dmitry.kozliuk@gmail.com> <20220825223355.410540-1-dmitry.kozliuk@gmail.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 There is no reason for rte_str_to_size() to be inline. Move the implementation out of . Export it as a stable ABI because it always has been public. Signed-off-by: Dmitry Kozlyuk Acked-by: Morten Brørup Acked-by: Bruce Richardson Acked-by: Chengwen Feng --- lib/eal/common/eal_common_string_fns.c | 32 ++++++++++++++++++++++++++ lib/eal/include/rte_common.h | 30 ++---------------------- lib/eal/version.map | 1 + 3 files changed, 35 insertions(+), 28 deletions(-) diff --git a/lib/eal/common/eal_common_string_fns.c b/lib/eal/common/eal_common_string_fns.c index 0236ae4023..5fc4ee71dc 100644 --- a/lib/eal/common/eal_common_string_fns.c +++ b/lib/eal/common/eal_common_string_fns.c @@ -64,3 +64,35 @@ rte_strscpy(char *dst, const char *src, size_t dsize) rte_errno = E2BIG; return -rte_errno; } + +uint64_t +rte_str_to_size(const char *str) +{ + char *endptr; + unsigned long long size; + + while (isspace((int)*str)) + str++; + if (*str == '-') + return 0; + + errno = 0; + size = strtoull(str, &endptr, 0); + if (errno) + return 0; + + if (*endptr == ' ') + endptr++; /* allow 1 space gap */ + + switch (*endptr) { + case 'G': case 'g': + size *= 1024; /* fall-through */ + case 'M': case 'm': + size *= 1024; /* fall-through */ + case 'K': case 'k': + size *= 1024; /* fall-through */ + default: + break; + } + return size; +} diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index b65555bac6..86c50c55e0 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -873,34 +873,8 @@ rte_log2_u64(uint64_t v) * @return * Number. */ -static inline uint64_t -rte_str_to_size(const char *str) -{ - char *endptr; - unsigned long long size; - - while (isspace((int)*str)) - str++; - if (*str == '-') - return 0; - - errno = 0; - size = strtoull(str, &endptr, 0); - if (errno) - return 0; - - if (*endptr == ' ') - endptr++; /* allow 1 space gap */ - - switch (*endptr){ - case 'G': case 'g': size *= 1024; /* fall-through */ - case 'M': case 'm': size *= 1024; /* fall-through */ - case 'K': case 'k': size *= 1024; /* fall-through */ - default: - break; - } - return size; -} +uint64_t +rte_str_to_size(const char *str); /** * Function to terminate the application immediately, printing an error diff --git a/lib/eal/version.map b/lib/eal/version.map index 1f293e768b..773b0902c0 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -261,6 +261,7 @@ DPDK_23 { rte_socket_id; rte_socket_id_by_idx; rte_srand; + rte_str_to_size; rte_strerror; rte_strscpy; rte_strsplit; From patchwork Thu Aug 25 22:33:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 115438 X-Patchwork-Delegate: david.marchand@redhat.com 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 46123A0551; Fri, 26 Aug 2022 00:34:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D63554282F; Fri, 26 Aug 2022 00:34:19 +0200 (CEST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mails.dpdk.org (Postfix) with ESMTP id C0770427F5 for ; Fri, 26 Aug 2022 00:34:15 +0200 (CEST) Received: by mail-lj1-f181.google.com with SMTP id u24so6242lji.0 for ; Thu, 25 Aug 2022 15:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=wUMlgmMt3a1eFYOyzwb3yzTACAwwHUpfK7XcvPrhmnI=; b=bCJqzaZWqltjdB1xgulAn8Fak/2kq+FecTdU5xOQKkz7JVV2Lsn6os/rrcDKaKiJ42 WRxsESs2r/rd+Fd50/834MuOD3OVSmWkiwBMFA20MiR+bwOJzrVdLYDhiUmBxcRWAbDm pYbxYE+HrlAq4DUFPG+1q7oY8hddVTI/uzS8OKVgCpb728zLNG7X5XcDxCM0gMVBzzMe HR33WDIda5g9s40zAq9RMjsq6BC7YdsTT+HawvFB8rU0CfPu8ysJ9EIh8MZas7EVkI9t l/JQufiJAD/Nj7t3b4aJn4Hk17MapF4E6tT5xm8+RPFbwc/dtsV7YjxHUGmSoZ9nI+qB 6dKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=wUMlgmMt3a1eFYOyzwb3yzTACAwwHUpfK7XcvPrhmnI=; b=pdEByXkA3ziXx4zp5RWKaxF0pctZBT71Xa9mmyd9+1xad+s+WSvGFXbNdqMfvpW3bs HGPx9UBQC8jo/ugGUd4gScAtadTBWKmL2V0dr1w+zoZtivFPUTiv8/v/VrOgUXbMlDZg 6HyIlXGRId6TQsm+BBT6Lq4AgkIOFdqyG+/6xn6V9NuSzncyejGVMtnxG765ulGXvh01 8VJehl1AIeCrQwGIh596bEMF8ENBa0Z94TXRJQKXKhpXTZE5mA419RM3efPrrrX5289q wDV6hmVkBaOJz1SaMac889zZu0qLxk1jqLWnixJ2ZbYSpB0RBFpvf/ArJ71eVoQAEAf+ kgUA== X-Gm-Message-State: ACgBeo3Orr4Mb46ghLyumrkvrj3ityTxwqRIrJX89VlKZbzERmTFfw5y 2nYXok+OrI1V0Q6tJ+tjQdNawoVxkUM= X-Google-Smtp-Source: AA6agR7RrCq3fcPBaBy1XIT+OzG5f0JyMC+9Al4Lqe6vnDZ0eyrJg9XhWWP17+1Y5mjoSz/hkqFexw== X-Received: by 2002:a2e:a794:0:b0:261:de2a:e9d7 with SMTP id c20-20020a2ea794000000b00261de2ae9d7mr1733534ljf.159.1661466854989; Thu, 25 Aug 2022 15:34:14 -0700 (PDT) Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b0048b0975ac7asm68249lfm.151.2022.08.25.15.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 15:34:14 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk Subject: [PATCH v3 4/4] eal: remove unneeded includes from a public header Date: Fri, 26 Aug 2022 01:33:55 +0300 Message-Id: <20220825223355.410540-5-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220825223355.410540-1-dmitry.kozliuk@gmail.com> References: <20220825153709.33181-1-dmitry.kozliuk@gmail.com> <20220825223355.410540-1-dmitry.kozliuk@gmail.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 Do not include , , and from , because they are not used by this file directly. Include the needed headers directly from the files that need them. Signed-off-by: Dmitry Kozlyuk --- app/test-bbdev/test_bbdev_vector.c | 1 + app/test-crypto-perf/cperf_test_vector_parsing.c | 1 + app/test-eventdev/parser.h | 1 + app/test-pmd/bpf_cmd.c | 2 ++ app/test-pmd/cmdline.c | 1 + app/test-pmd/cmdline_tm.c | 2 ++ app/test-pmd/config.c | 1 + app/test/test.h | 2 ++ drivers/bus/vdev/vdev_params.c | 1 + drivers/common/cnxk/cnxk_telemetry_nix.c | 1 + drivers/common/cnxk/cnxk_telemetry_npa.c | 1 + drivers/crypto/scheduler/scheduler_pmd.c | 2 ++ drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 2 ++ drivers/net/i40e/i40e_ethdev.c | 1 + drivers/net/iavf/iavf_ethdev.c | 1 + drivers/net/ice/ice_ethdev.c | 1 + drivers/net/softnic/parser.h | 1 + examples/eventdev_pipeline/main.c | 1 + examples/fips_validation/fips_validation.c | 1 + examples/ip_pipeline/parser.h | 1 + examples/ipsec-secgw/parser.h | 1 + examples/l3fwd-power/perf_core.c | 1 + examples/pipeline/cli.c | 1 + examples/vhost/main.c | 1 + lib/dmadev/rte_dmadev.c | 1 + lib/eal/common/eal_common_debug.c | 2 ++ lib/eal/common/eal_common_string_fns.c | 4 +++- lib/eal/freebsd/eal.c | 1 + lib/eal/include/generic/rte_rwlock.h | 2 ++ lib/eal/include/rte_common.h | 3 --- lib/eal/linux/eal.c | 1 + lib/eal/linux/eal_vfio_mp_sync.c | 1 + lib/eal/unix/eal_unix_timer.c | 1 + lib/eal/windows/rte_thread.c | 2 ++ lib/ethdev/sff_telemetry.c | 1 + lib/eventdev/rte_event_eth_rx_adapter.c | 1 + lib/eventdev/rte_event_timer_adapter.c | 1 + lib/meter/rte_meter.c | 1 + lib/pci/rte_pci.c | 1 + lib/pipeline/rte_swx_ctl.c | 1 + lib/sched/rte_pie.c | 1 + lib/security/rte_security.c | 2 ++ lib/telemetry/telemetry.c | 1 + lib/telemetry/telemetry_data.c | 3 +++ lib/telemetry/telemetry_legacy.c | 2 ++ 45 files changed, 58 insertions(+), 4 deletions(-) diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c index f020836f88..5018397c46 100644 --- a/app/test-bbdev/test_bbdev_vector.c +++ b/app/test-bbdev/test_bbdev_vector.c @@ -5,6 +5,7 @@ #ifdef RTE_EXEC_ENV_FREEBSD #define _WITH_GETLINE #endif +#include #include #include #include diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c index 87f3a90055..2c9087b5f9 100644 --- a/app/test-crypto-perf/cperf_test_vector_parsing.c +++ b/app/test-crypto-perf/cperf_test_vector_parsing.c @@ -4,6 +4,7 @@ #ifdef RTE_EXEC_ENV_FREEBSD #define _WITH_GETLINE #endif +#include #include #include diff --git a/app/test-eventdev/parser.h b/app/test-eventdev/parser.h index 696b40a3e2..954371b5b8 100644 --- a/app/test-eventdev/parser.h +++ b/app/test-eventdev/parser.h @@ -5,6 +5,7 @@ #ifndef __INCLUDE_PARSER_H__ #define __INCLUDE_PARSER_H__ +#include #include #define PARSE_DELIMITER " \f\n\r\t\v" diff --git a/app/test-pmd/bpf_cmd.c b/app/test-pmd/bpf_cmd.c index 648e0e9294..46f6b7d6d2 100644 --- a/app/test-pmd/bpf_cmd.c +++ b/app/test-pmd/bpf_cmd.c @@ -2,7 +2,9 @@ * Copyright(c) 2018 Intel Corporation */ +#include #include + #include #include #include diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index b4fe9dfb17..07566c7a77 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -3,6 +3,7 @@ * Copyright(c) 2014 6WIND S.A. */ +#include #include #include #include diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index fb56a234c5..1bc6c00998 100644 --- a/app/test-pmd/cmdline_tm.c +++ b/app/test-pmd/cmdline_tm.c @@ -2,6 +2,8 @@ * Copyright(c) 2017 Intel Corporation */ +#include + #include #include #include diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index a2939867c4..86054455d2 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3,6 +3,7 @@ * Copyright 2013-2014 6WIND S.A. */ +#include #include #include #include diff --git a/app/test/test.h b/app/test/test.h index 7115edf469..85f57efbc6 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -5,7 +5,9 @@ #ifndef _TEST_H_ #define _TEST_H_ +#include #include +#include #include #include diff --git a/drivers/bus/vdev/vdev_params.c b/drivers/bus/vdev/vdev_params.c index 3969faf16d..3d6f63344a 100644 --- a/drivers/bus/vdev/vdev_params.c +++ b/drivers/bus/vdev/vdev_params.c @@ -2,6 +2,7 @@ * Copyright 2018 Gaëtan Rivet */ +#include #include #include diff --git a/drivers/common/cnxk/cnxk_telemetry_nix.c b/drivers/common/cnxk/cnxk_telemetry_nix.c index 4119e9ee4f..b7285cf137 100644 --- a/drivers/common/cnxk/cnxk_telemetry_nix.c +++ b/drivers/common/cnxk/cnxk_telemetry_nix.c @@ -2,6 +2,7 @@ * Copyright(C) 2021 Marvell. */ +#include #include "cnxk_telemetry.h" #include "roc_api.h" #include "roc_priv.h" diff --git a/drivers/common/cnxk/cnxk_telemetry_npa.c b/drivers/common/cnxk/cnxk_telemetry_npa.c index ae515df84f..b6ae108b10 100644 --- a/drivers/common/cnxk/cnxk_telemetry_npa.c +++ b/drivers/common/cnxk/cnxk_telemetry_npa.c @@ -2,6 +2,7 @@ * Copyright(C) 2021 Marvell. */ +#include #include "cnxk_telemetry.h" #include "roc_api.h" #include "roc_priv.h" diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c index dd198080bf..2750fe8bd3 100644 --- a/drivers/crypto/scheduler/scheduler_pmd.c +++ b/drivers/crypto/scheduler/scheduler_pmd.c @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include + #include #include #include diff --git a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c index bfdbd1ee5d..c38af63bdc 100644 --- a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c +++ b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c @@ -2,6 +2,8 @@ * Copyright(C) 2022 Marvell. */ +#include + #include #include diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 67d79de08d..36ca42aa87 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2017 Intel Corporation */ +#include #include #include #include diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 506fcff6e3..652f0d00a5 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -2,6 +2,7 @@ * Copyright(c) 2017 Intel Corporation */ +#include #include #include #include diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index b2300790ae..e8304a1f2b 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/drivers/net/softnic/parser.h b/drivers/net/softnic/parser.h index 6f408b2485..c17a5d8ef0 100644 --- a/drivers/net/softnic/parser.h +++ b/drivers/net/softnic/parser.h @@ -5,6 +5,7 @@ #ifndef __INCLUDE_SOFTNIC_PARSER_H__ #define __INCLUDE_SOFTNIC_PARSER_H__ +#include #include #include diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index 3dbef6ed45..b9448c7c4b 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -2,6 +2,7 @@ * Copyright(c) 2016-2017 Intel Corporation */ +#include #include #include #include diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c index 12b9b03f56..7719b56123 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c @@ -2,6 +2,7 @@ * Copyright(c) 2018 Intel Corporation */ +#include #include #include diff --git a/examples/ip_pipeline/parser.h b/examples/ip_pipeline/parser.h index 4538f675d4..5224b18a89 100644 --- a/examples/ip_pipeline/parser.h +++ b/examples/ip_pipeline/parser.h @@ -5,6 +5,7 @@ #ifndef __INCLUDE_PARSER_H__ #define __INCLUDE_PARSER_H__ +#include #include #include diff --git a/examples/ipsec-secgw/parser.h b/examples/ipsec-secgw/parser.h index a0ff7e1b3f..b5c5d0210f 100644 --- a/examples/ipsec-secgw/parser.h +++ b/examples/ipsec-secgw/parser.h @@ -5,6 +5,7 @@ #ifndef __PARSER_H #define __PARSER_H +#include #include #include #include diff --git a/examples/l3fwd-power/perf_core.c b/examples/l3fwd-power/perf_core.c index 4705967ea2..3051c45674 100644 --- a/examples/l3fwd-power/perf_core.c +++ b/examples/l3fwd-power/perf_core.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2018 Intel Corporation */ +#include #include #include diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c index ad553f19ab..41eefbaae8 100644 --- a/examples/pipeline/cli.c +++ b/examples/pipeline/cli.c @@ -2,6 +2,7 @@ * Copyright(c) 2020 Intel Corporation */ +#include #include #include #include diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 7e1666f42a..71d053bf0c 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2017 Intel Corporation */ +#include #include #include #include diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 174d4c40ae..e64c923a00 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -3,6 +3,7 @@ * Copyright(c) 2021 Intel Corporation */ +#include #include #include diff --git a/lib/eal/common/eal_common_debug.c b/lib/eal/common/eal_common_debug.c index 15418e957f..dcb554af1e 100644 --- a/lib/eal/common/eal_common_debug.c +++ b/lib/eal/common/eal_common_debug.c @@ -3,6 +3,8 @@ */ #include +#include + #include #include #include diff --git a/lib/eal/common/eal_common_string_fns.c b/lib/eal/common/eal_common_string_fns.c index 5fc4ee71dc..9ca2045b18 100644 --- a/lib/eal/common/eal_common_string_fns.c +++ b/lib/eal/common/eal_common_string_fns.c @@ -2,8 +2,10 @@ * Copyright(c) 2010-2014 Intel Corporation */ -#include +#include #include +#include +#include #include #include diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 26fbc91b26..ee5c929da8 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -3,6 +3,7 @@ * Copyright(c) 2014 6WIND S.A. */ +#include #include #include #include diff --git a/lib/eal/include/generic/rte_rwlock.h b/lib/eal/include/generic/rte_rwlock.h index da9bc3e9c0..6f600db2af 100644 --- a/lib/eal/include/generic/rte_rwlock.h +++ b/lib/eal/include/generic/rte_rwlock.h @@ -21,6 +21,8 @@ extern "C" { #endif +#include + #include #include #include diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index 86c50c55e0..2e22c1b955 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -17,9 +17,6 @@ extern "C" { #endif #include -#include -#include -#include #include #include diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index 37d29643a5..46bf52cef0 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -3,6 +3,7 @@ * Copyright(c) 2012-2014 6WIND S.A. */ +#include #include #include #include diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c index 4e26781948..157f20e583 100644 --- a/lib/eal/linux/eal_vfio_mp_sync.c +++ b/lib/eal/linux/eal_vfio_mp_sync.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2018 Intel Corporation */ +#include #include #include diff --git a/lib/eal/unix/eal_unix_timer.c b/lib/eal/unix/eal_unix_timer.c index cc50159104..e71602b3a1 100644 --- a/lib/eal/unix/eal_unix_timer.c +++ b/lib/eal/unix/eal_unix_timer.c @@ -2,6 +2,7 @@ * Copyright 2020 Mellanox Technologies, Ltd */ +#include #include #include diff --git a/lib/eal/windows/rte_thread.c b/lib/eal/windows/rte_thread.c index 077152568f..63442ece9d 100644 --- a/lib/eal/windows/rte_thread.c +++ b/lib/eal/windows/rte_thread.c @@ -3,6 +3,8 @@ * Copyright (C) 2022 Microsoft Corporation */ +#include + #include #include #include diff --git a/lib/ethdev/sff_telemetry.c b/lib/ethdev/sff_telemetry.c index 887f07c47e..81dec4a39c 100644 --- a/lib/ethdev/sff_telemetry.c +++ b/lib/ethdev/sff_telemetry.c @@ -2,6 +2,7 @@ * Copyright(c) 2022 Intel Corporation */ +#include #include #include "rte_ethdev.h" diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index bf8741d2ea..2ce7dc652c 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -2,6 +2,7 @@ * Copyright(c) 2017 Intel Corporation. * All rights reserved. */ +#include #if defined(LINUX) #include #endif diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c index e0d978d641..27bf4c85b3 100644 --- a/lib/eventdev/rte_event_timer_adapter.c +++ b/lib/eventdev/rte_event_timer_adapter.c @@ -3,6 +3,7 @@ * All rights reserved. */ +#include #include #include #include diff --git a/lib/meter/rte_meter.c b/lib/meter/rte_meter.c index 4549b97d36..6545803d36 100644 --- a/lib/meter/rte_meter.c +++ b/lib/meter/rte_meter.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#include #include #include diff --git a/lib/pci/rte_pci.c b/lib/pci/rte_pci.c index 355772ff56..1c5ef951d3 100644 --- a/lib/pci/rte_pci.c +++ b/lib/pci/rte_pci.c @@ -3,6 +3,7 @@ * Copyright 2013-2014 6WIND S.A. */ +#include #include #include #include diff --git a/lib/pipeline/rte_swx_ctl.c b/lib/pipeline/rte_swx_ctl.c index 710e89a46a..fecc215398 100644 --- a/lib/pipeline/rte_swx_ctl.c +++ b/lib/pipeline/rte_swx_ctl.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Intel Corporation */ +#include #include #include #include diff --git a/lib/sched/rte_pie.c b/lib/sched/rte_pie.c index c84f75a18c..947e2a059f 100644 --- a/lib/sched/rte_pie.c +++ b/lib/sched/rte_pie.c @@ -2,6 +2,7 @@ * Copyright(c) 2020 Intel Corporation */ +#include #include #include diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c index 4f5e4b4d49..9bf49a3bd0 100644 --- a/lib/security/rte_security.c +++ b/lib/security/rte_security.c @@ -4,6 +4,8 @@ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include + #include #include #include diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c index c6fd03a5ab..8345120413 100644 --- a/lib/telemetry/telemetry.c +++ b/lib/telemetry/telemetry.c @@ -2,6 +2,7 @@ * Copyright(c) 2020 Intel Corporation */ +#include #ifndef RTE_EXEC_ENV_WINDOWS #include #include diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c index e14ae3c4d4..2581c27413 100644 --- a/lib/telemetry/telemetry_data.c +++ b/lib/telemetry/telemetry_data.c @@ -2,6 +2,9 @@ * Copyright(c) 2020 Intel Corporation */ +#include +#include + #undef RTE_USE_LIBBSD #include diff --git a/lib/telemetry/telemetry_legacy.c b/lib/telemetry/telemetry_legacy.c index 8aba44d689..a1d074d884 100644 --- a/lib/telemetry/telemetry_legacy.c +++ b/lib/telemetry/telemetry_legacy.c @@ -1,7 +1,9 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Intel Corporation */ +#include +#include #ifndef RTE_EXEC_ENV_WINDOWS #include #include