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 AA278A00C2; Sun, 21 Aug 2022 22:50:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1143F4282F; Sun, 21 Aug 2022 22:50:35 +0200 (CEST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mails.dpdk.org (Postfix) with ESMTP id 8F3A24280E for ; Sun, 21 Aug 2022 22:50:32 +0200 (CEST) Received: by mail-lf1-f51.google.com with SMTP id d23so8399255lfl.13 for ; Sun, 21 Aug 2022 13:50:32 -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=s2Hzop8zhB0NxiM0a7sDp+Tr2O/LmjiZDM+PeF2jAJ4=; b=ZkzRIQa82ZuFaBaS22FxQY3pcJ1e5JQT5BquSpY5lDDYdz9lG4AXFr55jtZEJFZOtF Y03HVXJKGQADBHV0ltzFaH00ZTYGllOtDye1GOcCALulCK66lUl5aOOCu8+Un/FpYWCh AYKnuMw8o7yQ+M7bEGBhDIXDbSmlNZYdh2g5wtQVKXWhSg3Hfd/bT5itOcacccEIQYWB HlREbzdS0TYXFogQYeE29Tny76T/cIUZeOC8VFMiPVdOXDADQhX45ZSJdEUJpd+9AQOF Jh2gSKuyV4lhGbJp8idKTQl9nvBu34/FyP+b9aMeGz5bedViphJrja0sMpmJIa5ci0jz 9S/w== 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=s2Hzop8zhB0NxiM0a7sDp+Tr2O/LmjiZDM+PeF2jAJ4=; b=2wE0CFqypQ9bQ6ua2XgBxAI4h0PO8t0ZfvYHHlaYedpy/i+/wvwlUYoimSSUuiYCv2 dQLCkMdBMoNqxTfyo14GACxVI7n7dl98CuLBgh+nrtTkKVSkS23gol15tDEDMrTOjLQN lT6FTB1MeJrDxnYgMZNWnwm34BCjUSZgPE5UbahINXa93U0Qmb0Fb9VmAOj59DXDLqY/ pDAjQpylYb4oV7Tj/D1mUfYKLze96tKRUsp14hhTrGOXDzWC3HWgdAJuRpMPTjJeDZeg jyDr3gsTvB1RZkD6jbw7HiCA+jPZDF7Qldf26nONj0bN490Mhf0K1YpbaQek0ePjMCEh 991g== X-Gm-Message-State: ACgBeo3OtgqtrKN9aEl3SLbejBvHeIydMnltEJoxKzK1db85iqKSti/2 nP3rP01yT5tm++eq/T27OIm2Q42d8U8= X-Google-Smtp-Source: AA6agR7RRSHXqhOKvb3SiuNOduR1miLyDz6wuBMw+6ZOf2GV1/2jobdbE2LCJ5S+Q5B6BbvK73SuCQ== X-Received: by 2002:a05:6512:4026:b0:48b:e4d:6657 with SMTP id br38-20020a056512402600b0048b0e4d6657mr5657896lfb.449.1661115031757; Sun, 21 Aug 2022 13:50:31 -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 b17-20020a056512071100b00492c77c55ddsm1337897lfs.67.2022.08.21.13.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Aug 2022 13:50:30 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk Subject: [PATCH 3/3] eal: deduplicate roundup code Date: Sun, 21 Aug 2022 23:50:09 +0300 Message-Id: <20220821205009.1317044-4-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220821205009.1317044-1-dmitry.kozliuk@gmail.com> References: <20220821205009.1317044-1-dmitry.kozliuk@gmail.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 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 --- 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 772e40f8c2..86c50c55e0 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 -- 2.33.1