@@ -122,6 +122,7 @@ struct ovn_extend_table;
OVNACT(CHK_ECMP_NH_MAC, ovnact_result) \
OVNACT(CHK_ECMP_NH, ovnact_result) \
OVNACT(COMMIT_LB_AFF, ovnact_commit_lb_aff) \
+ OVNACT(CHK_LB_AFF, ovnact_result) \
/* enum ovnact_type, with a member OVNACT_<ENUM> for each action. */
enum OVS_PACKED_ENUM ovnact_type {
@@ -4984,6 +4984,29 @@ ovnact_commit_lb_aff_free(struct ovnact_commit_lb_aff *ecmp_nh OVS_UNUSED)
{
}
+static void
+parse_chk_lb_aff(struct action_context *ctx, const struct expr_field *dst,
+ struct ovnact_result *res)
+{
+ parse_ovnact_result(ctx, "chk_lb_aff", NULL, dst, res);
+}
+
+static void
+format_CHK_LB_AFF(const struct ovnact_result *res, struct ds *s)
+{
+ expr_field_format(&res->dst, s);
+ ds_put_cstr(s, " = chk_lb_aff();");
+}
+
+static void
+encode_CHK_LB_AFF(const struct ovnact_result *res,
+ const struct ovnact_encode_params *ep OVS_UNUSED,
+ struct ofpbuf *ofpacts)
+{
+ encode_result_action__(res, OFTABLE_CHK_LB_AFFINITY,
+ MLF_USE_LB_AFF_SESSION_BIT, ofpacts);
+}
+
/* Parses an assignment or exchange or put_dhcp_opts action. */
static void
parse_set_action(struct action_context *ctx)
@@ -5068,6 +5091,10 @@ parse_set_action(struct action_context *ctx)
&& lexer_lookahead(ctx->lexer) == LEX_T_LPAREN) {
parse_chk_ecmp_nh(ctx, &lhs,
ovnact_put_CHK_ECMP_NH(ctx->ovnacts));
+ } else if (!strcmp(ctx->lexer->token.s, "chk_lb_aff") &&
+ lexer_lookahead(ctx->lexer) == LEX_T_LPAREN) {
+ parse_chk_lb_aff(ctx, &lhs,
+ ovnact_put_CHK_LB_AFF(ctx->ovnacts));
} else {
parse_assignment_action(ctx, false, &lhs);
}
@@ -2659,6 +2659,15 @@ tcp.flags = RST;
load-balacer with affinity timeout configured.
</p>
</dd>
+
+ <dt><code><var>R</var> = chk_lb_aff();</code></dt>
+ <dd>
+ <p>
+ This action checks if the packet under consideration matches any
+ flow in table 78. If it is so, then the 1-bit destination
+ register <var>R</var> is set to 1.
+ </p>
+ </dd>
</dl>
</column>
@@ -2135,6 +2135,10 @@ commit_lb_aff(vip = "172.16.0.123", backend = "10.0.0.3", timeout = 30);
commit_lb_aff(vip = "[::1]:8080", backend = "[::2]:8080", proto = tcp, timeout = 30);
encodes as learn(table=78,idle_timeout=30,delete_learned,OXM_OF_METADATA[],eth_type=0x86dd,NXM_NX_IPV6_SRC[],ipv6_dst=::1,nw_proto=6,tcp_dst=8080,load:0x1->NXM_NX_REG10[14],load:0x2->NXM_NX_XXREG0[],load:0x1f90->NXM_NX_REG8[0..15])
+# chk_lb_aff()
+reg9[6] = chk_lb_aff();
+ encodes as set_field:0/0x4000->reg10,resubmit(,78),move:NXM_NX_REG10[14]->OXM_OF_PKT_REG4[6]
+
# push/pop
push(xxreg0);push(xxreg1[10..20]);push(eth.src);pop(xxreg0[0..47]);pop(xxreg0[48..57]);pop(xxreg1);
formats as push(xxreg0); push(xxreg1[10..20]); push(eth.src); pop(xxreg0[0..47]); pop(xxreg0[48..57]); pop(xxreg1);
@@ -3292,6 +3292,8 @@ trace_actions(const struct ovnact *ovnacts, size_t ovnacts_len,
break;
case OVNACT_COMMIT_LB_AFF:
break;
+ case OVNACT_CHK_LB_AFF:
+ break;
}
}
ofpbuf_uninit(&stack);