From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A2BFA0530; Sun, 26 Jan 2020 02:09:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B6671199BC; Sun, 26 Jan 2020 02:09:26 +0100 (CET) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 232AE4C8B for ; Sun, 26 Jan 2020 02:09:23 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id p9so2379253plk.9 for ; Sat, 25 Jan 2020 17:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EHcb8pqwC+IJBPh6to8bv1paAjMJ12JgruJ3tbsoQdM=; b=bt3xG6wUS0R3vbqNAayCvcYHOkGNjeyficgqYDFvxaLBtHZtg47rWg/a5YrzqqZVnO T+NPCiNr3NDWVmj+sAHS3Eh0LP6Oiuk8OoKIuG9cJ2kTBakAUTYgLKGMMa+h4S2n7vlA xQe/n1uPDVuJ7+pftxNKRcZTjRyR5amb+yJbPjrfN9vNEtr24r6YPQ+G8fcD1gJnnud4 kd/cRv6rNUpDohl3lrh7nRsto8gDUzE8VeXNSAuJZlC4G2g8h5b8i3Uerm9Zn3Z2j4oV mWsI4jK1XNhzAOoOL8fY39dTSSejveRWZyAjrGlVi1T5tqYbGiZHJc3dtRBS/9vMdN50 ee4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EHcb8pqwC+IJBPh6to8bv1paAjMJ12JgruJ3tbsoQdM=; b=Isgu/7W8/+1aag3kabtHtuqQE2dANWSI5obeZaLgl47lS8KeImMVS7DS9GEzTTTwXO BX3y/sHiLks/RTekdox6TugUAyHBlDjNHCIOi6qHLQu9k35FccRXxb7CPGkQ+5VMA5zV j2eTTicagZ1PD5oLccXLQ2LQWFrKo9jD8pU1vSK5k7Xv0b27QngE7imPh+rGC5Gdd3hb 3ZAMpSNyEyOPHjB0FtHkEXZrX1uLuRdENnBsXMsXuqM9uK5rb8EjIWsfKIdWLUHszwmH JLJh39B09cHWk8Y59IMpfzaAG+q8ELeLZ4w+GVZ+QfNepInbaThiZE7/SMOOk/4KNRTe 9wnw== X-Gm-Message-State: APjAAAXqGf0RPBOSqFGHyG7/zp2lHXhexQByW/YJ39A7acIorzMScphf i0u3UJN6VoZHANfsjitQQSyF9ZuULxM= X-Google-Smtp-Source: APXvYqy0QZib6wQzhb/0VDR5Tmd2Ae8GSwlsQtoJFwbriXZFX9GyWwyV6EmoZivasZTSKhe+x+KNHg== X-Received: by 2002:a17:902:b40b:: with SMTP id x11mr11384145plr.268.1580000961804; Sat, 25 Jan 2020 17:09:21 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id t1sm11560267pgq.23.2020.01.25.17.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jan 2020 17:09:21 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Sat, 25 Jan 2020 17:09:08 -0800 Message-Id: <20200126010911.3733-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200126010911.3733-1-stephen@networkplumber.org> References: <20200126010911.3733-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/5] examples/l3fwd: use RTE_DIM X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use the standard RTE_DIM macro to compute array size. Signed-off-by: Stephen Hemminger --- examples/l3fwd/l3fwd_lpm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index 349de2703cd1..b6802d63ba1d 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -65,10 +65,8 @@ static struct ipv6_l3fwd_lpm_route ipv6_l3fwd_lpm_route_array[] = { {{32, 1, 2, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0}, 48, 7}, }; -#define IPV4_L3FWD_LPM_NUM_ROUTES \ - (sizeof(ipv4_l3fwd_lpm_route_array) / sizeof(ipv4_l3fwd_lpm_route_array[0])) -#define IPV6_L3FWD_LPM_NUM_ROUTES \ - (sizeof(ipv6_l3fwd_lpm_route_array) / sizeof(ipv6_l3fwd_lpm_route_array[0])) +#define IPV4_L3FWD_LPM_NUM_ROUTES RTE_DIM(ipv4_l3fwd_lpm_route_array) +#define IPV6_L3FWD_LPM_NUM_ROUTES RTE_DIM(ipv6_l3fwd_lpm_route_array) #define IPV4_L3FWD_LPM_MAX_RULES 1024 #define IPV4_L3FWD_LPM_NUMBER_TBL8S (1 << 8) -- 2.20.1