DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX
       [not found] ` <EDD8E64855FBDA45ACDFE02112E795B70DC85350FD@HQ1-EXCH03.corp.brocade.com>
@ 2014-12-10 16:45   ` r k
  0 siblings, 0 replies; only message in thread
From: r k @ 2014-12-10 16:45 UTC (permalink / raw)
  To: dev

Subject: [PATCH] Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX

Number 0 is not a power_of_2, fix it in rte_is_power_of_2 function.
Avoid code which generates branching when calculating min and max.

Ravi Kerur (1):
  Fix rte_is_power_of_2() function since it returns true for zero and
     zero is not a power of 2.     Avoid branching in RTE_MIN and
    RTE_MAX when calculating     minimum and maximum of two numbers.

 lib/librte_eal/common/include/rte_common.h | 6 +++---
 lib/librte_pmd_e1000/igb_pf.c              | 4 ++--
 lib/librte_pmd_ixgbe/ixgbe_pf.c            | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-10 16:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1418229688-4667-1-git-send-email-rkerur@gmail.com>
     [not found] ` <EDD8E64855FBDA45ACDFE02112E795B70DC85350FD@HQ1-EXCH03.corp.brocade.com>
2014-12-10 16:45   ` [dpdk-dev] [PATCH] Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX r k

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 \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

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