From: Stephen Hemminger <stephen@networkplumber.org>
To: adrien.mazarguil@6wind.com
Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH] rte_flow: mark rte_flow_error_set as cold
Date: Mon, 20 May 2019 15:52:00 -0700 [thread overview]
Message-ID: <20190520225200.328-1-stephen@networkplumber.org> (raw)
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 <stephen@networkplumber.org>
---
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
next reply other threads:[~2019-05-20 22:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 22:52 Stephen Hemminger [this message]
2019-05-21 8:01 ` [dpdk-dev] [PATCH] rte_flow: mark rte_flow_error_set as cold Van Haaren, Harry
2019-05-21 14:31 ` Stephen Hemminger
2019-05-21 15:32 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190520225200.328-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.