projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto-dpif: Keep subfacet "used" times more up-to-date.
[openvswitch]
/
lib
/
odp-util.c
diff --git
a/lib/odp-util.c
b/lib/odp-util.c
index ffb486ecf8b171f6440d5926d73ccbdab2d08206..8fa3359493b11523fb43a729e06bf45c2e727210 100644
(file)
--- a/
lib/odp-util.c
+++ b/
lib/odp-util.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2009, 2010, 2011 Nicira Networks.
+ * Copyright (c) 2009, 2010, 2011
, 2012
Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-278,10
+278,16
@@
format_odp_actions(struct ds *ds, const struct nlattr *actions,
format_odp_action(ds, a);
}
if (left) {
format_odp_action(ds, a);
}
if (left) {
+ int i;
+
if (left == actions_len) {
ds_put_cstr(ds, "<empty>");
}
if (left == actions_len) {
ds_put_cstr(ds, "<empty>");
}
- ds_put_format(ds, ",***%u leftover bytes***", left);
+ ds_put_format(ds, ",***%u leftover bytes*** (", left);
+ for (i = 0; i < left; i++) {
+ ds_put_format(ds, "%02x", ((const uint8_t *) a)[i]);
+ }
+ ds_put_char(ds, ')');
}
} else {
ds_put_cstr(ds, "drop");
}
} else {
ds_put_cstr(ds, "drop");
@@
-727,10
+733,16
@@
odp_flow_key_format(const struct nlattr *key, size_t key_len, struct ds *ds)
format_odp_key_attr(a, ds);
}
if (left) {
format_odp_key_attr(a, ds);
}
if (left) {
+ int i;
+
if (left == key_len) {
ds_put_cstr(ds, "<empty>");
}
if (left == key_len) {
ds_put_cstr(ds, "<empty>");
}
- ds_put_format(ds, ",***%u leftover bytes***", left);
+ ds_put_format(ds, ",***%u leftover bytes*** (", left);
+ for (i = 0; i < left; i++) {
+ ds_put_format(ds, "%02x", ((const uint8_t *) a)[i]);
+ }
+ ds_put_char(ds, ')');
}
} else {
ds_put_cstr(ds, "<empty>");
}
} else {
ds_put_cstr(ds, "<empty>");
@@
-1687,6
+1699,24
@@
odp_flow_key_to_flow(const struct nlattr *key, size_t key_len,
expected_attrs, flow, key, key_len);
}
expected_attrs, flow, key, key_len);
}
+/* Returns 'fitness' as a string, for use in debug messages. */
+const char *
+odp_key_fitness_to_string(enum odp_key_fitness fitness)
+{
+ switch (fitness) {
+ case ODP_FIT_PERFECT:
+ return "OK";
+ case ODP_FIT_TOO_MUCH:
+ return "too_much";
+ case ODP_FIT_TOO_LITTLE:
+ return "too_little";
+ case ODP_FIT_ERROR:
+ return "error";
+ default:
+ return "<unknown>";
+ }
+}
+
/* Appends an OVS_ACTION_ATTR_USERSPACE action to 'odp_actions' that specifies
* Netlink PID 'pid'. If 'cookie' is nonnull, adds a userdata attribute whose
* contents contains 'cookie' and returns the offset within 'odp_actions' of
/* Appends an OVS_ACTION_ATTR_USERSPACE action to 'odp_actions' that specifies
* Netlink PID 'pid'. If 'cookie' is nonnull, adds a userdata attribute whose
* contents contains 'cookie' and returns the offset within 'odp_actions' of