From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by dpdk.org (Postfix) with ESMTP id 781FD7EE3 for ; Fri, 27 Apr 2018 00:18:15 +0200 (CEST) Received: by mail-pf0-f195.google.com with SMTP id g14so19443991pfh.3 for ; Thu, 26 Apr 2018 15:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mfPEh8jqytqUir1WC4EcXBZM+pDSTwgjSIPE4u/UwLE=; b=kxvFuk8lHZtlqy4EH8AR8MNj1IpV9tpzdZD7+esZnIs4SPk/thOiaWHNwtupoZ8dhC p0vReAVjpnyAvfqTYVlerYMISvmjVf4ivg3uvVuwSmVkoGc+lhYz8z386vTdRyD630oU 8kvgQGat3aYK4DrFT3ztL7vLyYbEB78qrFyFZM6A5iu3u4iIbWDb99Ui7eCRLJKydUHx fOoOCjGhX7oYVxrurhntFkxRwl8mviiODxeyhcWuSj1QLRSV1RFSfrZv+qg9lMzei0MZ WxRTAvmqbMzvF92kZYVuF55AfT8stO8cpWp+YEyZscF4lW5xnBVYZIDTZ+bTcMibqKZl 8ODg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mfPEh8jqytqUir1WC4EcXBZM+pDSTwgjSIPE4u/UwLE=; b=qGV42ZhNj77Gzel0B0fZVAjEnF1V6v1jUTi+32WlW6iI+dBv79JP7utdbtPE323Sfl IiXbS28vn14u3ByAoOXjFbxtvfpni0b1h9+42ALxTOG/IJKTrWOIOg6jdu9SPOvuHz5O SVF+xaMgaSBV97DwpMucv5M5CUa54lZRDoF5r2170qnmSNrJLtrFg64GketZb4T+52Rx s63tS09Xg44KJ5IXF4nOtDX3PHCMz/0ua2SZgihAV+CVKQzrUsXkDDBXALw5JOelc3DU DCuhKe7ozMx7VqhZJPNb/zDmyqDVXAYcRfKjVp0omrOay8JBGIQjq2k5lWX+SdSQ9e47 lFBQ== X-Gm-Message-State: ALQs6tCbx5nH8xysqTEFphQkcP87/M95VWna2KhrJvvlyGcIkFfDNuTj uSik2FoSxi0vjQZfuNjp4Ak+7w== X-Google-Smtp-Source: AIpwx4/MR6fppzYDyiqXrhvoLwY6M3ERkAWwmMJYv8jENt91X4yWGkNrBDdw7PmiHZxt0AzoIg5UMg== X-Received: by 10.101.102.3 with SMTP id w3mr29045067pgv.151.1524781094698; Thu, 26 Apr 2018 15:18:14 -0700 (PDT) Received: from xeon-e3 (204-195-71-95.wavecable.com. [204.195.71.95]) by smtp.gmail.com with ESMTPSA id m7sm43520766pga.46.2018.04.26.15.18.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Apr 2018 15:18:14 -0700 (PDT) Date: Thu, 26 Apr 2018 15:18:12 -0700 From: Stephen Hemminger To: Medvedkin Vladimir Cc: dev@dpdk.org, bruce.richardson@intel.com, thomas@monjalon.net, cristian.dumitrescu@intel.com Message-ID: <20180426151812.52015da7@xeon-e3> In-Reply-To: <1524780214-23196-2-git-send-email-medvedkinv@gmail.com> References: <1524780214-23196-1-git-send-email-medvedkinv@gmail.com> <1524780214-23196-2-git-send-email-medvedkinv@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 1/4] Add RIB library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 22:18:15 -0000 On Fri, 27 Apr 2018 01:03:31 +0300 Medvedkin Vladimir wrote: > +/** > + * Check if prefix1 {key1/depth1} > + * is covered by prefix2 {key2/depth2} > + */ > +static inline int __attribute__((pure)) > +rte_rib_is_covered(uint32_t key1, uint8_t depth1, uint32_t key2, uint8_t depth2) > +{ > + return ((((key1 ^ key2) & rte_rib_depth_to_mask(depth2)) == 0) > + && (depth1 > depth2)); > +} Use standard boolean type (bool) for these kind of functions. Plus you really don't need the pure attribute for static (or inline) functions since compiler determines that itself.