DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Jan Medala <jan@semihalf.com>
Cc: dev@dpdk.org, matua@amazon.com,
	Evgeny Schemeilin <evgenys@amazon.com>,
	Jakub Palider <jpa@semihalf.com>
Subject: Re: [dpdk-dev] [PATCH v6 3/4] ena: Amazon ENA communication layer for DPDK platform
Date: Mon, 14 Mar 2016 20:19:53 +0100	[thread overview]
Message-ID: <1736374.3NoExuoUaJ@xps13> (raw)
In-Reply-To: <1457982741-11047-4-git-send-email-jan@semihalf.com>

> +#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.

  reply	other threads:[~2016-03-14 19:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14 19:12 [dpdk-dev] [PATCH v6 0/4] DPDK polling-mode driver for Amazon Elastic Network Adapters (ENA) Jan Medala
2016-03-14 19:12 ` [dpdk-dev] [PATCH v6 1/4] ena: Amazon ENA documentation Jan Medala
2016-03-14 19:12 ` [dpdk-dev] [PATCH v6 2/4] ena: Amazon ENA communication layer Jan Medala
2016-03-14 19:12 ` [dpdk-dev] [PATCH v6 3/4] ena: Amazon ENA communication layer for DPDK platform Jan Medala
2016-03-14 19:19   ` Thomas Monjalon [this message]
2016-03-14 19:12 ` [dpdk-dev] [PATCH v6 4/4] ena: DPDK polling-mode driver for Amazon Elastic Network Adapters (ENA) Jan Medala

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=1736374.3NoExuoUaJ@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=jan@semihalf.com \
    --cc=jpa@semihalf.com \
    --cc=matua@amazon.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).