From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 179D145BC0; Thu, 24 Oct 2024 14:06:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCF7843463; Thu, 24 Oct 2024 14:06:16 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 117F443458 for ; Thu, 24 Oct 2024 14:06:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729771574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5lMvsdLAdGH4n2sqZOWrzReVaeKqfeLyDMGRoyrQko4=; b=dBzdtrXxDlu9BGHzlFrJ52CLV6xYvXyXQ8pBIE8rBnsl1USmWbWcB22Tpc93W/dEyuPeRE A/2/YR2GGnSTA3PkjEzSJZOfnvsjfmC/04lBqcyWaXJu6Z1MdhUIIkvCTRTu4BP8JoOSwd uENSxr9CBzchgLCm6sDjQVPURT3Y3ME= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-151-E6AJ6TsaNV2A0BCNuljorw-1; Thu, 24 Oct 2024 08:06:11 -0400 X-MC-Unique: E6AJ6TsaNV2A0BCNuljorw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D55901955EA7; Thu, 24 Oct 2024 12:06:09 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.57]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A6E691956056; Thu, 24 Oct 2024 12:06:06 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@amd.com, stephen@networkplumber.org, mattias.ronnblom@ericsson.com, Hemant Agrawal , Sachin Saxena , Devendra Singh Rawat , Alok Prasad , Jochen Behrens Subject: [PATCH 5/6] drivers: use branch prediction macros Date: Thu, 24 Oct 2024 14:05:34 +0200 Message-ID: <20241024120535.2722316-6-david.marchand@redhat.com> In-Reply-To: <20241024120535.2722316-1-david.marchand@redhat.com> References: <20241024120535.2722316-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Prefer EAL macros over __builtin_ helpers. Signed-off-by: David Marchand --- drivers/bus/fslmc/qbman/include/compat.h | 6 ++---- drivers/net/qede/base/bcm_osal.h | 4 +++- drivers/net/vmxnet3/base/vmxnet3_osdep.h | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index ece5da5906..4ac3254bc7 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -16,7 +16,9 @@ #include #include #include + #include +#include /* The following definitions are primarily to allow the single-source driver * interfaces to be included by arbitrary program code. Ie. for interfaces that @@ -24,10 +26,6 @@ * with certain attributes and types used in those interfaces. */ -/* Required compiler attributes */ -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) - /* Required types */ typedef uint64_t dma_addr_t; diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h index 7869103c63..357981f63d 100644 --- a/drivers/net/qede/base/bcm_osal.h +++ b/drivers/net/qede/base/bcm_osal.h @@ -10,7 +10,9 @@ #include #include #include + #include +#include #include #include #include @@ -442,7 +444,7 @@ u32 qede_osal_log2(u32); #define OSAL_CACHE_LINE_SIZE RTE_CACHE_LINE_SIZE #define OSAL_IOMEM volatile #define OSAL_UNUSED __rte_unused -#define OSAL_UNLIKELY(x) __builtin_expect(!!(x), 0) +#define OSAL_UNLIKELY(x) unlikely(x) #define OSAL_MIN_T(type, __min1, __min2) RTE_MIN_T(__min1, __min2, type) #define OSAL_MAX_T(type, __max1, __max2) RTE_MAX_T(__max1, __max2, type) diff --git a/drivers/net/vmxnet3/base/vmxnet3_osdep.h b/drivers/net/vmxnet3/base/vmxnet3_osdep.h index 381a68db69..b1cd9ed056 100644 --- a/drivers/net/vmxnet3/base/vmxnet3_osdep.h +++ b/drivers/net/vmxnet3/base/vmxnet3_osdep.h @@ -7,13 +7,15 @@ #include +#include + typedef uint64_t uint64; typedef uint32_t uint32; typedef uint16_t uint16; typedef uint8_t uint8; #ifndef UNLIKELY -#define UNLIKELY(x) __builtin_expect((x),0) +#define UNLIKELY(x) unlikely(x) #endif /* unlikely */ #endif /* _VMXNET3_OSDEP_H */ -- 2.46.2