Message ID | 1481863290-29624-1-git-send-email-daniely@vmware.com |
---|---|
State | Changes Requested |
Headers | show |
On Thu, Dec 15, 2016 at 08:41:29PM -0800, Benli Ye wrote: > When sampling field is 0, no need to generate sample or > the inner action. Thanks for the patch. The change to compose_sample_action() makes sense to me. I don't think that we should change the database schema because the benefit of the change is minimal but it carries the risk of breaking a few users' configurations. Can you repost with a Signed-off-by? Thanks, Ben.
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index d0f9a33..840062b 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -2479,6 +2479,11 @@ compose_sample_action(struct xlate_ctx *ctx, const odp_port_t tunnel_out_port, bool include_actions) { + if (probability == 0) { + /* No need to generate sampling or the inner action. */ + return 0; + } + size_t sample_offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_SAMPLE); diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema index b04d360..87e00fc 100644 --- a/vswitchd/vswitch.ovsschema +++ b/vswitchd/vswitch.ovsschema @@ -1,6 +1,6 @@ {"name": "Open_vSwitch", "version": "7.14.0", - "cksum": "3374030633 22987", + "cksum": "4010240282 23110", "tables": { "Open_vSwitch": { "columns": { @@ -453,7 +453,10 @@ "targets": { "type": {"key": "string", "min": 1, "max": "unlimited"}}, "sampling": { - "type": {"key": "integer", "min": 0, "max": 1}}, + "type": {"key": {"type": "integer", + "minInteger": 1, + "maxInteger": 4294967295}, + "min": 0, "max": 1}}, "polling": { "type": {"key": "integer", "min": 0, "max": 1}}, "header": {