From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=hhZxFXDxWtBU7y1mxiNo+qOYHwXPeI02oq8TZD2zcl4=; b=yb5JVQw4nYpeRYd75zamwWEX6TqOfx6M1mhYVvARD7OmcYbrOnc42fffMll+xON1/E KDWoYwVHbw9mH/VIoPl+33UVtIziGYfGAsGf6BgRY3oQrsyZMMDBlUAXFS4KOa57isuD ize97ZlWsaT2XMdvAi7z4a8CzC/ZsDOc9ZG1KcFXWQpck7DnbU3YawTEVtQAAI5R3N/9 IISLEmCaM3TOZVqrAjwCDAxFlypnSiSeIpNSxrtLXZBbYB5v4Wsyzt4T1ZePrN8bhHqj gIVg6yjJrfEB1HZ0qnkscmB0KVYwjux81ftvvJVY/DqAnL2dR4O2qvC2JptXrcqWZ+cw siWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=hhZxFXDxWtBU7y1mxiNo+qOYHwXPeI02oq8TZD2zcl4=; b=ZkoBaqTErx1e85eeT5R8G1qmx75T+jP/9cJfTjfvsO4nuGo8eUFpX6PF8JevGpyITZ MvukFXQE43gMr6GEgNc2WcNLzSgNBkPWpd6pBNuL9FQVgBi+XEBNhXibpWqOlGpAv5lI Yk6G5r+10coQm8vv4pT5JFaEi3/sVCTY4reAZ9qbix5xwUROqjTpDX49lpdRwS9IKE3i /P4uxXHCMx2gNN9ckVAQhrpMnb7ne57mJHlrcLrzajFGSa548BC1ucY5ZGE7dz4IJ0SQ t30YhuV3G0EUKHGZ3hl9afzcTnXbrRGtM13Pz+HzPLGios9wfVVAVqrgWMXBe5f3MYAL ojvQ== X-Gm-Message-State: AD7BkJLG1JOwYXmY+nLIxdQxugqaSCU5lOPxZSYoG77ZFEBQi3wxbaE0p1HPr2kfFiKdqIL1 X-Received: by 10.194.21.197 with SMTP id x5mr25273797wje.90.1457983278253; Mon, 14 Mar 2016 12:21:18 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id jf6sm23753241wjb.2.2016.03.14.12.21.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2016 12:21:17 -0700 (PDT) From: Thomas Monjalon To: Jan Medala Cc: dev@dpdk.org, matua@amazon.com, Evgeny Schemeilin , Jakub Palider Date: Mon, 14 Mar 2016 20:19:53 +0100 Message-ID: <1736374.3NoExuoUaJ@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1457982741-11047-4-git-send-email-jan@semihalf.com> References: <1457982741-11047-1-git-send-email-jan@semihalf.com> <1457982741-11047-4-git-send-email-jan@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v6 3/4] ena: Amazon ENA communication layer for DPDK platform X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 19:21:19 -0000 > +#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.