From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] lib/rib: Add Routing Information Base library Date: Tue, 11 Jul 2017 13:28:07 -0700 Message-ID: <20170711132807.4cbceb72@xeon-e3> References: <1499801585-10031-1-git-send-email-medvedkinv@gmail.com> <1499801585-10031-2-git-send-email-medvedkinv@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Medvedkin Vladimir Return-path: Received: from mail-pg0-f46.google.com (mail-pg0-f46.google.com [74.125.83.46]) by dpdk.org (Postfix) with ESMTP id A6045374C for ; Tue, 11 Jul 2017 22:28:14 +0200 (CEST) Received: by mail-pg0-f46.google.com with SMTP id t186so1574299pgb.1 for ; Tue, 11 Jul 2017 13:28:14 -0700 (PDT) In-Reply-To: <1499801585-10031-2-git-send-email-medvedkinv@gmail.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 11 Jul 2017 19:33:05 +0000 Medvedkin Vladimir wrote: > + > +#define ROUNDUP(x, y) ((((x - 1) >> (32 - y)) + 1) << (32 - y)) There is already RTE_ALIGN_FLOOR/RTE_ALIGN_CEIL > +#define RTE_DIR24_8_GET_TBL24_P(fib, ip) \ > + ((void *)&((uint8_t *)fib->tbl24)[(ip & \ > + RTE_DIR24_8_TBL24_MASK) >> (8 - fib->nh_sz)]) \ > + Why is this a macro and not an inline function. The expresion could also be split up to be simpler, and compiler would generate same result.