Skip to content

Commit

Permalink
controller: Fix issue with ct_commit encode.
Browse files Browse the repository at this point in the history
Action length is getting set incorrectly during ct_commit encode
due to which ct action is getting skipped  during phsycial flows
creation. This issue is noticed only if ct_commit is prefixed
with other actions.

logical flow: reg8[17] = 1; ct_commit { ct_mark.blocked = 1; };
without fix: encodes as set_field:0x2000000000000/0x2000000000000->xreg4
with fix: encodes as set_field:0x2000000000000/0x2000000000000->xreg4,ct(commit,zone=NXM_NX_REG13[0..15],exec(set_field:0x1/0x1->ct_mark))

Signed-off-by: Naveen Yerramneni <naveen.yerramneni@nutanix.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
(cherry picked from commit 7b43959)
  • Loading branch information
naveen-yerramneni authored and dceara committed Jun 11, 2024
1 parent 7973b41 commit 1c4cdc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,9 @@ encode_CT_COMMIT_V2(const struct ovnact_nest *on,
const struct ovnact_encode_params *ep OVS_UNUSED,
struct ofpbuf *ofpacts)
{
size_t ct_offset = ofpacts->size;
ofpbuf_pull(ofpacts, ct_offset);

struct ofpact_conntrack *ct = ofpact_put_CT(ofpacts);
ct->flags = NX_CT_F_COMMIT;
ct->recirc_table = NX_CT_RECIRC_NONE;
Expand Down Expand Up @@ -906,6 +909,7 @@ encode_CT_COMMIT_V2(const struct ovnact_nest *on,
ofpacts->header = ofpbuf_push_uninit(ofpacts, set_field_offset);
ct = ofpacts->header;
ofpact_finish(ofpacts, &ct->ofpact);
ofpbuf_push_uninit(ofpacts, ct_offset);
}

static void
Expand Down
3 changes: 3 additions & 0 deletions tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,9 @@ ct_commit { ct_label=0x181716151413121110090807060504030201; };
141-bit constant is not compatible with 128-bit field ct_label.
ct_commit { ip4.dst = 192.168.0.1; };
Field ip4.dst is not modifiable.
reg8[17] = 1; ct_commit { ct_mark.blocked = 1; };
encodes as set_field:0x2000000000000/0x2000000000000->xreg4,ct(commit,zone=NXM_NX_REG13[0..15],exec(set_field:0x1/0x1->ct_mark))
has prereqs ip

# Legact ct_commit_v1 action.
ct_commit();
Expand Down

0 comments on commit 1c4cdc6

Please sign in to comment.