From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EE8A3A05D3 for ; Tue, 21 May 2019 00:52:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E813911C5; Tue, 21 May 2019 00:52:05 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id B1EDA10BD for ; Tue, 21 May 2019 00:52:04 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id x15so7391940pln.9 for ; Mon, 20 May 2019 15:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4BTjcdxboAjXFwX46S9oX88kqwGcR2Tj/VaiTuBfIoQ=; b=Hf6fBHpgqIeodVAt4ceHfuoQ3vHB/qkbVyTtBVXJGt2fqWJspzN6ZrqB2g+AzRLZ3G uLT23LECIsktll/CyvwNq2qaBVDfIdYXEKZ7FCkOg6Ir2/B4OGqI29E5w2y0EyUHnVIf tva8FNSqNeX0eyxkNsZDKNduBwPJiUrWZ0MGQqAWLa7/ocS1nC3tR9OROL09sglY6XyN XD1aJq0zixmXsgFU1BR5szA4UECtrfvMsg2xQ6K5/dcyux3CC5Afk4WnNFZNsyuO+3kc lFDo7NVpyQGQxfF4sfvVPmAdjzqvRoGP2nbe66iSNR123juAW0CpLt1KLPqpTmyimPIz OVLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4BTjcdxboAjXFwX46S9oX88kqwGcR2Tj/VaiTuBfIoQ=; b=IP75ITj7F9AZhUyvkqJgUySoLhvLzWbvBOAH5o4ml5+JUBAMdOT+vQpWFTw+ptoCFb vmEaOUWvd8IsIW1hXGHDnIWS8sg3okz+pmlrqSBJrDXgcqq6BENpiHFPOpEvrxhgG1Fa IRhNG5sw1VYz2IO/ASDWliTKwAQLG7LGiCkhMXyapXAOdFh9gHxKRgPJgULJ0TOCvwBe udohPDLWxC0RRS9yzZ7iAgQiL6qAnaPyubBJ7rREHXipOsGpwlCisjUQoCEDVz0vqZiG jZneEd6ubR3A7ZW274ubNRIDCZoqcWko8p98oFVyPRCcvybZ86YNGnRGpl1pfig49VuD cawQ== X-Gm-Message-State: APjAAAXrpoQbuLxHTIekMTqkh9XIn5HNIWu3nbeGSqbicB3ngxK0NRfd Y1BZzjyCRgq5bEJdVHSiwVUAJ6HMvIc= X-Google-Smtp-Source: APXvYqwHxlorlIJ4lvFVFqnkXx/SX/CljSMDM5Aw5QmBhSMygMPJpAJhSWOXkDG3zWz6iryaBGXHGA== X-Received: by 2002:a17:902:63:: with SMTP id 90mr24549853pla.342.1558392723723; Mon, 20 May 2019 15:52:03 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id p81sm23814315pfa.26.2019.05.20.15.52.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 15:52:03 -0700 (PDT) From: Stephen Hemminger To: adrien.mazarguil@6wind.com Cc: dev@dpdk.org, Stephen Hemminger Date: Mon, 20 May 2019 15:52:00 -0700 Message-Id: <20190520225200.328-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] rte_flow: mark rte_flow_error_set as cold 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" A minor optimization that save a few cycles during flow setup. Use the GCC cold attribute for the rte_flow_error_set function. This attribute implicitly marks all code paths that arrive at this function as unlikely. Signed-off-by: Stephen Hemminger --- lib/librte_ethdev/rte_flow.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index 63f84fca65c4..dc821be43f19 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -2591,7 +2591,13 @@ rte_flow_error_set(struct rte_flow_error *error, int code, enum rte_flow_error_type type, const void *cause, - const char *message); + const char *message) +#ifdef __GNUC__ +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) + __attribute__((cold)) +#endif +#endif + ; /** * @deprecated -- 2.20.1