From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v6 3/4] ena: Amazon ENA communication layer for DPDK platform Date: Mon, 14 Mar 2016 20:19:53 +0100 Message-ID: <1736374.3NoExuoUaJ@xps13> References: <1457982741-11047-1-git-send-email-jan@semihalf.com> <1457982741-11047-4-git-send-email-jan@semihalf.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, matua@amazon.com, Evgeny Schemeilin , Jakub Palider To: Jan Medala Return-path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 6EBB947CE for ; Mon, 14 Mar 2016 20:21:19 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id p65so115584211wmp.1 for ; Mon, 14 Mar 2016 12:21:19 -0700 (PDT) In-Reply-To: <1457982741-11047-4-git-send-email-jan@semihalf.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > +#ifndef unlikely > +#define unlikely(c) __builtin_expect(!!(c), 0) > +#endif > +#ifndef likely > +#define likely(c) __builtin_expect(!!(c), 1) > +#endif Including lib/librte_eal/common/include/rte_branch_prediction.h should be enough. > +#define max_t(type, x, y) ({ \ > + type __max1 = (x); \ > + type __max2 = (y); \ > + __max1 > __max2 ? __max1 : __max2; }) > + > +#define min_t(type, x, y) ({ \ > + type __min1 = (x); \ > + type __min2 = (y); \ > + __min1 < __min2 ? __min1 : __min2; }) > + > +#define ENA_MAX32(x, y) max_t(u32, (x), (y)) > +#define ENA_MAX16(x, y) max_t(u16, (x), (y)) > +#define ENA_MAX8(x, y) max_t(u8, (x), (y)) > +#define ENA_MIN32(x, y) min_t(u32, (x), (y)) > +#define ENA_MIN16(x, y) min_t(u16, (x), (y)) > +#define ENA_MIN8(x, y) min_t(u8, (x), (y)) There are RTE_MIN and RTE_MAX in lib/librte_eal/common/include/rte_common.h.