DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH 2/5] examples/l3fwd: use RTE_DIM
Date: Sat, 25 Jan 2020 17:09:08 -0800
Message-ID: <20200126010911.3733-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20200126010911.3733-1-stephen@networkplumber.org>

Use the standard RTE_DIM macro to compute array size.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 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


  parent reply	other threads:[~2020-01-26  1:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-26  1:09 [dpdk-dev] [PATCH 0/5] l3fwd and lpm cleanups Stephen Hemminger
2020-01-26  1:09 ` [dpdk-dev] [PATCH 1/5] lpm: make ipv6 address immutable Stephen Hemminger
2020-01-26  1:09 ` Stephen Hemminger [this message]
2020-01-26  1:09 ` [dpdk-dev] [PATCH 3/5] examples/l3fwd: make lookup struct static Stephen Hemminger
2020-01-26  1:09 ` [dpdk-dev] [PATCH 4/5] examples/l3fwd: make route array constant Stephen Hemminger
2020-01-26  1:09 ` [dpdk-dev] [PATCH 5/5] examples/l3fwd: improve readability for destination lookup Stephen Hemminger
2020-02-16 19:39 ` [dpdk-dev] [PATCH 0/5] l3fwd and lpm cleanups Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200126010911.3733-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git