@@ -126,6 +126,7 @@ struct collector_set_ids;
OVNACT(COMMIT_LB_AFF, ovnact_commit_lb_aff) \
OVNACT(CHK_LB_AFF, ovnact_result) \
OVNACT(SAMPLE, ovnact_sample) \
+ OVNACT(MAC_CACHE_USE, ovnact_null) \
/* enum ovnact_type, with a member OVNACT_<ENUM> for each action. */
enum OVS_PACKED_ENUM ovnact_type {
@@ -879,6 +880,8 @@ struct ovnact_encode_params {
sends packets to controller. */
uint32_t common_nat_ct_zone; /* When performing NAT in a common CT zone,
this determines which CT zone to use */
+ uint32_t mac_cache_use_table; /* OpenFlow table for 'mac_cache_use'
+ * to resubmit. */
};
void ovnacts_encode(const struct ovnact[], size_t ovnacts_len,
@@ -5224,6 +5224,20 @@ encode_CHK_LB_AFF(const struct ovnact_result *res,
MLF_USE_LB_AFF_SESSION_BIT, ofpacts);
}
+static void
+format_MAC_CACHE_USE(const struct ovnact_null *null OVS_UNUSED, struct ds *s)
+{
+ ds_put_cstr(s, "mac_cache_use;");
+}
+
+static void
+encode_MAC_CACHE_USE(const struct ovnact_null *null OVS_UNUSED,
+ const struct ovnact_encode_params *ep,
+ struct ofpbuf *ofpacts)
+{
+ emit_resubmit(ofpacts, ep->mac_cache_use_table);
+}
+
/* Parses an assignment or exchange or put_dhcp_opts action. */
static void
parse_set_action(struct action_context *ctx)
@@ -5429,9 +5443,12 @@ parse_action(struct action_context *ctx)
parse_commit_lb_aff(ctx, ovnact_put_COMMIT_LB_AFF(ctx->ovnacts));
} else if (lexer_match_id(ctx->lexer, "sample")) {
parse_sample(ctx);
+ } else if (lexer_match_id(ctx->lexer, "mac_cache_use")) {
+ ovnact_put_MAC_CACHE_USE(ctx->ovnacts);
} else {
lexer_syntax_error(ctx->lexer, "expecting action");
}
+
lexer_force_match(ctx->lexer, LEX_T_SEMICOLON);
return !ctx->lexer->error;
}
@@ -2790,6 +2790,14 @@ tcp.flags = RST;
</dd>
</dl>
</dd>
+
+ <dt><code>mac_cache_use;</code></dt>
+ <dd>
+ <p>
+ This action resubmits to corresponding table which updates the
+ use statistics of MAC cache.
+ </p>
+ </dd>
</dl>
</column>
@@ -2253,6 +2253,10 @@ sample(probability=0,collector_set=200,obs_domain=300,obs_point=foo);
sample(probability=10,foo=bar,obs_domain=0,obs_point=1000);
Syntax error at `foo' unknown argument.
+# mac_cache_use
+mac_cache_use;
+ encodes as resubmit(,79)
+
# Miscellaneous negative tests.
;
Syntax error at `;'.
@@ -1374,6 +1374,7 @@ test_parse_actions(struct ovs_cmdl_context *ctx OVS_UNUSED)
.common_nat_ct_zone = MFF_LOG_DNAT_ZONE,
.in_port_sec_ptable = OFTABLE_CHK_IN_PORT_SEC,
.out_port_sec_ptable = OFTABLE_CHK_OUT_PORT_SEC,
+ .mac_cache_use_table = OFTABLE_MAC_CACHE_USE,
.lflow_uuid.parts =
{ 0xaaaaaaaa, 0xbbbbbbbb, 0xcccccccc, 0xdddddddd},
.dp_key = 0xabcdef,
@@ -3353,6 +3353,8 @@ trace_actions(const struct ovnact *ovnacts, size_t ovnacts_len,
break;
case OVNACT_SAMPLE:
break;
+ case OVNACT_MAC_CACHE_USE:
+ break;
}
}
ofpbuf_uninit(&stack);
The mac_cache_use is just resubmit to MAC use cache table, which will be later on used by the timestamp refresh mechanism. This is a preparation for the MAC binding refresh mechanism. Signed-off-by: Ales Musil <amusil@redhat.com> --- include/ovn/actions.h | 3 +++ lib/actions.c | 17 +++++++++++++++++ ovn-sb.xml | 8 ++++++++ tests/ovn.at | 4 ++++ tests/test-ovn.c | 1 + utilities/ovn-trace.c | 2 ++ 6 files changed, 35 insertions(+)