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 12185A05D3 for ; Tue, 21 May 2019 10:02:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1BB3510BD; Tue, 21 May 2019 10:01:59 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3838EA69 for ; Tue, 21 May 2019 10:01:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2019 01:01:55 -0700 X-ExtLoop1: 1 Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga008.jf.intel.com with ESMTP; 21 May 2019 01:01:54 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 21 May 2019 09:01:53 +0100 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.108]) by irsmsx155.ger.corp.intel.com ([169.254.14.127]) with mapi id 14.03.0415.000; Tue, 21 May 2019 09:01:53 +0100 From: "Van Haaren, Harry" To: Stephen Hemminger , "adrien.mazarguil@6wind.com" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] rte_flow: mark rte_flow_error_set as cold Thread-Index: AQHVD169vcWEqn2wrkCXpcYgGY2/L6Z1N0WQ Date: Tue, 21 May 2019 08:01:53 +0000 Message-ID: References: <20190520225200.328-1-stephen@networkplumber.org> In-Reply-To: <20190520225200.328-1-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWQ5NWM5ZDQtMjE5NC00NTkyLThjZGYtYmY1ZGI3YTA2OGYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYWFsY21IZ0p6djhQRXhEdXFiTDF5OE5uRWZIKzZGcGltemNTRmUwWkNmaVJXYUczYjl5TGJuSW0ya1haOUV4cyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger > Sent: Monday, May 20, 2019 11:52 PM > To: adrien.mazarguil@6wind.com > Cc: dev@dpdk.org; Stephen Hemminger > Subject: [dpdk-dev] [PATCH] rte_flow: mark rte_flow_error_set as cold >=20 > A minor optimization that save a few cycles during flow setup. >=20 > 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. Interesting - wasn't aware this is what the "cold" attribute does. > lib/librte_ethdev/rte_flow.h | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > 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__ =3D=3D 4 && __GNUC_MINOR__ > 2)) > + __attribute__((cold)) > +#endif > +#endif > + ; Would it be worth making an __rte_attribute_cold or similar? Less in-place #ifdefs and there are probably other locations in DPDK that would also benefit from such an annotation. -Harry