From patchwork Thu Aug 25 15:37:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 115421 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 727F9A0547; Thu, 25 Aug 2022 17:37:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2794F410F2; Thu, 25 Aug 2022 17:37:27 +0200 (CEST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mails.dpdk.org (Postfix) with ESMTP id 5C2A640A7B; Thu, 25 Aug 2022 17:37:26 +0200 (CEST) Received: by mail-lf1-f46.google.com with SMTP id m5so18082253lfj.4; Thu, 25 Aug 2022 08:37:26 -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=P1kN45BDQiKhAb30KFHmbQ4pp3HIFWRKDuPLKCDEJX0DPRpw5KiGPp5iYJnHkHGPHa ieXjFY/UGBTCOajov+S4zfQA0MbVgcKTIa88yXR/PMG1YxZW3iF50PPzXKYHYtIjkP8P tTA2GfV48hbYcfPjZuczW1yULhe+62jiAreHLDu5rAo+sukrCAKb8pS7cpOa+YHzGYA4 0CzxhshW6h3vgqs9CfQ134wMYn7EeuV711h+8DHLEQ4+pbklAJCY/Ey0lyx9cGL/5yP1 OGo6+oLltz8AfeXIMEX7Y05S9shBIbDbnc0JeLEWSSUpxBKjt3UvSm1NJaSdl6hC0Drw xm2g== 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=j9K92FoRlnDaFR0KBDkktRstY6iRj3gzG0OGxWVRG6iwipd5ynWnMPCFaW9Ppy0Kl4 K0xJhFRdYylAghgAIMC8hbiQOJlTokdLDnULsNtY+8FhtRF8FF50/0SmGfzF6Ka/KH4z LaC7go9plhCPB+ge4E6Xz/CuuXa/AM2dOD81MXpM0CCvT1Bf9fdbzt+bhbVlEF/DR/VY UYcxy3VuPFpuwWXREgZL2KS2CQv+37UIYp7mDaHVsSwhSz81v3qYK+pE2NgSFlzjd752 +WeU03z47FF/6iKWWG4vG47F4560ZxD+2co0dWTd4Jr8JbLKel0IKT5awNdmGAxJBrCu E3oA== X-Gm-Message-State: ACgBeo2Vqxc7EfrrSYJN++TIIc+4mJinTXN1u5P7z9lrJrheC2dWE8cL PwqChQOKOk6XGpEOHi62vQwuTMN7lMc= X-Google-Smtp-Source: AA6agR6dz+pzbHZUHQE5pwLNEOYcZhaIv/vGO150QpucNhwAl0hNEAEgp/ZO0cxsktlZe7DqNyzrTA== X-Received: by 2002:a05:6512:304c:b0:492:cd69:6cb8 with SMTP id b12-20020a056512304c00b00492cd696cb8mr1466321lfb.551.1661441845561; Thu, 25 Aug 2022 08:37:25 -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 r2-20020ac25c02000000b0048a9e899693sm562909lfp.16.2022.08.25.08.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 08:37:25 -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 v2 1/4] eal: fix pointer arithmetic with an expression argument Date: Thu, 25 Aug 2022 18:37:06 +0300 Message-Id: <20220825153709.33181-2-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220825153709.33181-1-dmitry.kozliuk@gmail.com> References: <20220821205009.1317044-1-dmitry.kozliuk@gmail.com> <20220825153709.33181-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 15:37:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 115422 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 32BFDA0547; Thu, 25 Aug 2022 17:37:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36F32410E7; Thu, 25 Aug 2022 17:37:30 +0200 (CEST) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by mails.dpdk.org (Postfix) with ESMTP id 07ED2410E5 for ; Thu, 25 Aug 2022 17:37:27 +0200 (CEST) Received: by mail-lj1-f180.google.com with SMTP id x24so1751157lji.9 for ; Thu, 25 Aug 2022 08:37:26 -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=Zltm0lLB1w4IVt8kos4vbM9Seb5/FqUqhE9zDQ7Fe3s5A427cTp3tv48UWT2q4o0Ka 3+62VagTLllq9CISG+St/hFR2O7Y+GXWBSuUBWyySctjw89ZRSZhn8RETnVs1uKi+Jg4 vTtwpv+6HIxAKzQyDZGtVdgK1saObqkOdMCCXMssZ5q6cMmfXsUZ1YrU2xlDL+XAxozl Sg10dkDsxV6mlpci1fOxx6w6tyUE4rTqBGGeuL7y323bWSSr5zyUITPMX/cUTLcoG+8V OYRFf6xLXPsDNPH7TgkeDO2UPwfGIwZamM+fSbjlrJ0TWflwjXhv+6yEszSlswO4BzOC 8zXQ== 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=PWNMlHEzzCFrAhcQWJIXZdgX9xtnNDwV9o+MTlSmTEGgC+VGUvoTmvymdX5P1ODfrY /VnRIWwSOXE2cLV82GhDdIBNd9Ptm2T1vtAFaAUkXT0A5qL5XTxpyBnwx8+oPpkytWB1 wtibrUALcenAM8DZaGroG3RMq3OzcX7Xre4iGE/pN8DllkBUdfM8zXDkp4LWdD5oVBop nTLWMMZbQOLMHEss83TUoOoTJNVg70u/IO57RV9qD3G4KHOCVLhRH4XOkojcUxPBX75n KgZUxTuo6xTolkWD8QOUaBwGFWRclxPgwU4p89+++R+WojLDe+6LTuSkqO279xBtNAFy APLg== X-Gm-Message-State: ACgBeo3pURxGEFgDZTRyqSnnBDS4zW7jVQkvEr38KoELud0VQGzXS3ma 0sEZN/Oz7hw9zvrOodaPH+1PcqlIRVA= X-Google-Smtp-Source: AA6agR6usyiuQxUBFxT/4uZz5B17ZEs/40K67orYBanQlcTMBC51VHndpsSOr/q9rZbFhf6Kdr8s+A== X-Received: by 2002:a2e:a4d4:0:b0:261:cc95:e088 with SMTP id p20-20020a2ea4d4000000b00261cc95e088mr1266184ljm.502.1661441846367; Thu, 25 Aug 2022 08:37:26 -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 r2-20020ac25c02000000b0048a9e899693sm562909lfp.16.2022.08.25.08.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 08:37:25 -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 v2 2/4] eal: deduplicate roundup code Date: Thu, 25 Aug 2022 18:37:07 +0300 Message-Id: <20220825153709.33181-3-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220825153709.33181-1-dmitry.kozliuk@gmail.com> References: <20220821205009.1317044-1-dmitry.kozliuk@gmail.com> <20220825153709.33181-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 15:37:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 115423 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 BC2C4A0547; Thu, 25 Aug 2022 17:37:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1689C4281C; Thu, 25 Aug 2022 17:37:31 +0200 (CEST) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mails.dpdk.org (Postfix) with ESMTP id D5D05415D7 for ; Thu, 25 Aug 2022 17:37:27 +0200 (CEST) Received: by mail-lf1-f42.google.com with SMTP id s1so25932444lfp.6 for ; Thu, 25 Aug 2022 08:37:27 -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=PuiVzYchAX4837C9Bv4TNyIktcjKspOX8T5ULy5qSiRQNEf0Zut4u0wAd66uTi4Tbv J8BSmBjdW7O5hbOt32OowVPtdCPOx8dub6ndJyBVppl5Rv+b2GSMQAsg+Px0L7ExAEdO sZDo2hcXva/NMTgRW32QVtgGmXA+V9HMQFv6JpW7A5UFPExON3wToGf/vE8cJaaIkms4 1gQZdPDDwlntwEZKWJuhdCCsvKYwSNa0znCNNzcHXguO1eq9fMhxdvz1eGonCf4BYq61 dF7ulRMqoGaxIjGdAxGGUD1sSux64UYwz7Rqz/pHK1QaksgR0ZyU7OTCuG7nbHOp/d6F DmJg== 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=rBWDZf9sn9lBchIAzi4o9HsWIc9BlF4l+6FbfAkPiDdlPCIgPhwZs5gT69g3Kz5jIO 5b0+4UL25qczX8eyHv9XAokKePX8egQSqaFUFE7/oRDIpTspWlJH2QXtOUKJR3xp/y9x a73nfmCEyyi3LVZZBrPAkmoP6KYSbvRkh9rmQFiWsicK//wyLq2ZHPFSjDv0XUSsMiig NW8iWsW7XGLT1G5GlKPu+8tGUSqJWnP1GLLv8pHBZf5iUAn7ggRBouHlhzOO5Bvp6dWN UtYmIWMbFj1yrth4OGoB/hT54TeSZRVWphpQ2Tes+zvurcm5Z9yoNn32g8dK0qfHX30M NsoA== X-Gm-Message-State: ACgBeo0jEdlSqt5wFuqFZEo6xBWeun/LJbC7fGka/5AikK3p4Tz2fG+o Ew4/tm2Z6aScrb8GNAmGiKk1zMW619g= X-Google-Smtp-Source: AA6agR5bLmHGRO02Bq5MgC1rZtkmliCyxSpGhloH3ES7OaLUQv/9hgE2/mRiufrlz4y4d3mrMFNxSw== X-Received: by 2002:ac2:4d45:0:b0:492:d8a2:de61 with SMTP id 5-20020ac24d45000000b00492d8a2de61mr1428185lfp.313.1661441847233; Thu, 25 Aug 2022 08:37:27 -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 r2-20020ac25c02000000b0048a9e899693sm562909lfp.16.2022.08.25.08.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 08:37:26 -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 v2 3/4] eal: uninline rte_str_to_size Date: Thu, 25 Aug 2022 18:37:08 +0300 Message-Id: <20220825153709.33181-4-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220825153709.33181-1-dmitry.kozliuk@gmail.com> References: <20220821205009.1317044-1-dmitry.kozliuk@gmail.com> <20220825153709.33181-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 15:37:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 115424 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 4A142A0547; Thu, 25 Aug 2022 17:37:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61C9F42B6C; Thu, 25 Aug 2022 17:37:32 +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 C0C244280B for ; Thu, 25 Aug 2022 17:37:28 +0200 (CEST) Received: by mail-lj1-f176.google.com with SMTP id s8so2358201ljj.5 for ; Thu, 25 Aug 2022 08:37:28 -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=flSZ51o96WQTICQNKPA/3pAXVbZ+zl7tcADll00WpMQ=; b=bCqtzy3DK7/Vp2i9I2pXf8GUPzCZTu8FPT/3pI+veT5R+wkYA+w4vcx6CZO1SPOeaA Su542zu6+FpMn39LjPwAbMMHhkKj4qoQ8WXC4qJNVAM4CgF86tdmlDyVck2wbSEc3+35 a+oLm6E/HMKiV94oNdeydeZCs0hZpt3SOiO/SswlEy0P+ykeJt/SNU0IZgyHijvvL591 MPHDoPxLiNj5mRTSKt8UQEaIOCd1zFSFiX+L8IYrCvb7c6jbyEj+vkhpsfsIV2r5ySqV ffvJ3Qe45FOhz14l/Azq3DAKEHW8/CV0Hgs6OsXRhNm4QSmtWMSmF06TZELd9P+YnEoR gzMA== 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=flSZ51o96WQTICQNKPA/3pAXVbZ+zl7tcADll00WpMQ=; b=yviWITdho+xG6387HCwmvPkSn7wmZ5BIqG9Weo2qk+iHcPEPEVRFX6MK97rx3TOitt +x3nNSVkab1qb0+OAtaJysLplOKOobmIYk6OoytzziI3Sl5A3SqRy5WIuRN0DAAT6kxn nPHoA+/h/gJ+WqVJ0Y0hmXPG1zQ2xhvqv14kwQoijKYGogBnTYR4PPkDwZdaKUmiWJ09 X1qypafm7ZbOKqwAfLBME23hidrmrTrU7s5dsLaXJMNp1Koicf+fgNuvOP2edPHi+wbA qAqoRzqyS4D34Q2M9mBMMDJfMVcYMNCouVo8YxHd0RVgI2ck3AUvpjij7DyIrZjPbLEq q0Nw== X-Gm-Message-State: ACgBeo29beA3MkjftJOVMdTRnsorKoDZya/kWR7MaMzFrOnXL/6rJoXk JMu1Pt2IL006fL47Jbn3jmjXz9lfYIA= X-Google-Smtp-Source: AA6agR7zE9vcjH+G5T2HA+BzYbrg5WOT++s+nhuUCQFRa2DSp8zRd6+OQ2M5sNNtpS3qo0UArY084Q== X-Received: by 2002:a2e:544e:0:b0:261:cc28:d4cd with SMTP id y14-20020a2e544e000000b00261cc28d4cdmr1179523ljd.105.1661441847957; Thu, 25 Aug 2022 08:37:27 -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 r2-20020ac25c02000000b0048a9e899693sm562909lfp.16.2022.08.25.08.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 08:37:27 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk Subject: [PATCH v2 4/4] eal: remove unneeded includes from a public header Date: Thu, 25 Aug 2022 18:37:09 +0300 Message-Id: <20220825153709.33181-5-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220825153709.33181-1-dmitry.kozliuk@gmail.com> References: <20220821205009.1317044-1-dmitry.kozliuk@gmail.com> <20220825153709.33181-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 --- Done as a separate commit to keep EAL change clean. 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 + 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/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_data.c | 3 +++ lib/telemetry/telemetry_legacy.c | 1 + 36 files changed, 48 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/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/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_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..17d77fff59 100644 --- a/lib/telemetry/telemetry_legacy.c +++ b/lib/telemetry/telemetry_legacy.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Intel Corporation */ +#include #ifndef RTE_EXEC_ENV_WINDOWS #include