diff options
author | Jarno Rajahalme <jrajahalme@nicira.com> | 2014-09-05 15:44:20 -0700 |
---|---|---|
committer | Jarno Rajahalme <jrajahalme@nicira.com> | 2014-09-08 15:02:30 -0700 |
commit | ea2735d3cc23d062bd60ab442e48d6021ac4d15d (patch) | |
tree | d58b3efc839e6454e99bf1a37e7f2bd6688fd930 /lib/odp-util.h | |
parent | 260974dcdfd707a8ee82ec97713211b76b08c82b (diff) | |
download | openvswitch-ea2735d3cc23d062bd60ab442e48d6021ac4d15d.tar.gz |
lib: Unify flags parsing and formatting.
Use the "+-" syntax more uniformly when printing masked flags, and use
the syntax of delimited 1-flags also for formatting fully masked TCP
flags.
The "+-" syntax only deals with masked flags, but if there are many of
those, the printout becomes long and confusing. Typically there are
many flags only when flags are fully masked, but even then most of
them are zeros, so it makes sense to print the flags that are set
(ones) and omit the zero flags.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/odp-util.h')
-rw-r--r-- | lib/odp-util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/odp-util.h b/lib/odp-util.h index d4c5fbffa..458b813b2 100644 --- a/lib/odp-util.h +++ b/lib/odp-util.h @@ -62,6 +62,14 @@ enum slow_path_reason { #undef SPR }; +/* Mask of all slow_path_reasons. */ +enum { + SLOW_PATH_REASON_MASK = 0 +#define SPR(ENUM, STRING, EXPLANATION) | 1 << ENUM##_INDEX + SLOW_PATH_REASONS +#undef SPR +}; + const char *slow_path_reason_to_explanation(enum slow_path_reason); #define ODPP_LOCAL ODP_PORT_C(OVSP_LOCAL) |