Skip to content

Commit

Permalink
netdev-offload-tc: Add support for ct_state flag rel.
Browse files Browse the repository at this point in the history
Signed-off-by: Ariel Levkovich <[email protected]>
Acked-by: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
Awik84 authored and igsilya committed Apr 19, 2021
1 parent 0c147fb commit ea71a9d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/netdev-offload-tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,13 @@ parse_tc_flower_to_match(struct tc_flower *flower,
ct_statem |= OVS_CS_F_INVALID;
}

if (mask->ct_state & TCA_FLOWER_KEY_CT_FLAGS_RELATED) {
if (key->ct_state & TCA_FLOWER_KEY_CT_FLAGS_RELATED) {
ct_statev |= OVS_CS_F_RELATED;
}
ct_statem |= OVS_CS_F_RELATED;
}

match_set_ct_state_masked(match, ct_statev, ct_statem);
}

Expand Down Expand Up @@ -1522,6 +1529,14 @@ parse_match_ct_state_to_flower(struct tc_flower *flower, struct match *match)
mask->ct_state &= ~OVS_CS_F_INVALID;
}

if (mask->ct_state & OVS_CS_F_RELATED) {
if (key->ct_state & OVS_CS_F_RELATED) {
flower->key.ct_state |= TCA_FLOWER_KEY_CT_FLAGS_RELATED;
}
flower->mask.ct_state |= TCA_FLOWER_KEY_CT_FLAGS_RELATED;
mask->ct_state &= ~OVS_CS_F_RELATED;
}

if (flower->key.ct_state & TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED) {
flower->key.ct_state &= ~(TCA_FLOWER_KEY_CT_FLAGS_NEW);
flower->mask.ct_state &= ~(TCA_FLOWER_KEY_CT_FLAGS_NEW);
Expand Down

0 comments on commit ea71a9d

Please sign in to comment.