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 C81B3A05D3 for ; Tue, 21 May 2019 16:31:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D51434F91; Tue, 21 May 2019 16:31:27 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 06B8E4CAB for ; Tue, 21 May 2019 16:31:26 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id n27so6096306pgm.4 for ; Tue, 21 May 2019 07:31:25 -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=qSN+siA6FKVo2H782NwlcDmSzEJS1mQCJAqa3Lpo7Dw=; b=thdLqaKnhVn8l5FdPRQ/0nOwqTMs0TLz3oYJxMnTkLiRsZ3xYz0mA9Q3j+ZeSAOHiO Ocq273sxV0yMImdlDLkmbNkdSQA0z/vffy9nu7OBrYgGbhyYHza2E6mZ3E/mQlPF2Wv2 6aXqJ5cKmcbmHWd+cvaV85Cov3Z/3y9WG6N+c2B/WvBCgdvIkunmkCmUreJKmtwrKrrQ tfWf4hFA2U3+2Oo4qADMWnUb/rdrWacxmVFeQGPtPARexNoUsdeFtVl2kOUtEOTdvWwJ QQ2lmqz7t8BQ+QDfsBPMI12tX56iwvc1irWTkcyTbQAPkO3c79QfE3w8Rc0Z5j4QerrO FvJg== 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=qSN+siA6FKVo2H782NwlcDmSzEJS1mQCJAqa3Lpo7Dw=; b=dbhXQII98zpndr4vuhyS7AbneyipImzHNEBo2oe5Iz03tVZ8xyeGZrEvs6yXbKJXw6 xV25wbrzvdBdcS9B8ACD5/47eJ0RqM2LL6iYVEACEI9teD2MvdKmHrhNUTtSYjSxacL5 i2S3wOaeY6KbBZ+5TQTnmq2n38dvX7idM2k8H2i4ZfRFZ3aDEpbfuT4gdEiFdsGfkCO7 8ZyiyD1T/9l+Tn0VHcl4DTE0XSz9Q0iuNOoyGn4Ddg1EImz+tJdnYnHjuT2/pu4MGh9E fiFuebDyFqc1dGZB3lpJRvlnBVk9K2u+i5o4S4gIy3PUMSwICdsPW2S/9DF/Tu+n05cj wPFA== X-Gm-Message-State: APjAAAUy4ZTWckkoE4ZmK2HbuRkPfKwjWAQMIcC7vH6HUh3bX+vhQ5X+ dTjRk5pr/RBCMSF0jFwW6c34mA== X-Google-Smtp-Source: APXvYqwIjOkMA8+EG9onkJdT+i2LJxVTWNokikBatUgrYHZsp/peYcdSXH+fgESXvjua2u1zWvK75g== X-Received: by 2002:a62:e90b:: with SMTP id j11mr35976077pfh.88.1558449085146; Tue, 21 May 2019 07:31:25 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id o6sm17787906pfo.164.2019.05.21.07.31.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 07:31:25 -0700 (PDT) Date: Tue, 21 May 2019 07:31:17 -0700 From: Stephen Hemminger To: "Van Haaren, Harry" Cc: "adrien.mazarguil@6wind.com" , "dev@dpdk.org" Message-ID: <20190521073117.4263f03d@hermes.lan> In-Reply-To: References: <20190520225200.328-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 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. > > -Harry I just cloned what was already on rte_log.