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 4A759A05D3 for ; Tue, 21 May 2019 17:32:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 960BF4C96; Tue, 21 May 2019 17:32:08 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6A1F94C8B for ; Tue, 21 May 2019 17:32:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2019 08:32:05 -0700 X-ExtLoop1: 1 Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.36]) ([10.237.221.36]) by FMSMGA003.fm.intel.com with ESMTP; 21 May 2019 08:32:04 -0700 To: Stephen Hemminger , "Van Haaren, Harry" Cc: "adrien.mazarguil@6wind.com" , "dev@dpdk.org" References: <20190520225200.328-1-stephen@networkplumber.org> <20190521073117.4263f03d@hermes.lan> From: Ferruh Yigit Openpgp: preference=signencrypt Autocrypt: addr=ferruh.yigit@intel.com; prefer-encrypt=mutual; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMqOtQS/sB3FYLT0/d3+bvy qbL9YnlbPyRvZfnP3pXiKwkRoR1RJwEo2BOf6hxdzTmLRtGtwWzI9MwrUPj6n/ldiD58VAGQ +iR1I/z9UBUN/ZMksElA2D7Jgg7vZ78iKwNnd+vLBD6I61kVrZ45Vjo3r+pPOByUBXOUlxp9 GWEKKIrJ4eogqkVNSixN16VYK7xR+5OUkBYUO+sE6etSxCr7BahMPKxH+XPlZZjKrxciaWQb +dElz3Ab4Opl+ZT/bK2huX+W+NJBEBVzjTkhjSTjcyRdxvS1gwWRuXqA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2/a758vDpKLidCJctAPKTzI2RRTx8m 20MM3SjxxKwxSoWnQmbrJMvLqWcfJ00k44nxh48s/X8+ywuKbJoh8ZXyy7ZCWKCXePJ1DaMW QQy3E19BpgVswZjYsAji71VnY4Mwebilj6lJx1sCTgQavtvVRI6swDCQlfhmnw21tq+6YfiW GayFyOLzhEr6yTTb0U+LXK8A+gcHgkeD62JmVdrOToFuq7i+CYDZZlCmnu0S+EDku5TDACca jrfa/XxNrwOS5MQz9VjyYbj9exGpKnk7jFsoLnG5VzpXkXjEZZen0lwGKZRDHuG2P4jR9dH0 cXr9AOvnF/lQAJHcGdMX9wPZcgdTCMHboBU9I0gbZiicvkiuyaT+OAO9MYkIp2mfpAV92BcP TyLaLSDgrgj/Bjhwunrm4qm27RI6pNoBtIlGGDW8t0yMlQ8ykNK3AGpGD7wVm0iKPl9GzCqA qU+n3U/KO6lgw4Xa4/FHkEbZi5jQto5GwfKKsmrN/mhzV7JtihZGunscbB0ZiDbyGLB1YXu6 34s= Message-ID: <92bb31ee-216d-f7bf-5e01-78331469205c@intel.com> Date: Tue, 21 May 2019 16:32:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190521073117.4263f03d@hermes.lan> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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" On 5/21/2019 3:31 PM, Stephen Hemminger wrote: > On Tue, 21 May 2019 08:01:53 +0000 > "Van Haaren, Harry" wrote: > >>> -----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 >>> >>> 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. >> >> 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(-) >>> >>> 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 >>> + ; >> >> >> 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. +1 to define '__rte_cold' [1] in 'lib/librte_eal/common/include/rte_common.h' as defined other similar compiler attributes there. [1] or '__rte_attribute_cold' but all other attribute defines are missing 'attribute' keyword, so I think can be skipped here as well >> >> -Harry > > I just cloned what was already on rte_log. >