Skip to content

Commit

Permalink
northd: Consolidate register usage in logical flows.
Browse files Browse the repository at this point in the history
We were running out of space in registers. After the consolidation
there are several registers are free to use once again.
The consolidation is mainly done by reusing single register for LB
affinity flows.

Signed-off-by: Ales Musil <[email protected]>
Acked-by: Mark Michelson <[email protected]>
Signed-off-by: Mark Michelson <[email protected]>
  • Loading branch information
almusil authored and putnopvut committed Jan 23, 2025
1 parent fd85ce1 commit 9198808
Show file tree
Hide file tree
Showing 6 changed files with 309 additions and 366 deletions.
7 changes: 3 additions & 4 deletions include/ovn/logical-fields.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ enum ovn_controller_event {
*
* Make sure these don't overlap with the logical fields! */
#define MFF_LOG_REG0 MFF_REG0
#define MFF_LOG_LB_ORIG_DIP_IPV4 MFF_REG1
#define MFF_LOG_LB_ORIG_DIP_IPV4 MFF_REG4
#define MFF_LOG_LB_ORIG_TP_DPORT MFF_REG2

#define MFF_LOG_XXREG0 MFF_XXREG0
Expand All @@ -56,9 +56,8 @@ enum ovn_controller_event {
#define MFF_N_LOG_REGS 10

#define MFF_LOG_LB_AFF_MATCH_IP4_ADDR MFF_REG4
#define MFF_LOG_LB_AFF_MATCH_LS_IP6_ADDR MFF_XXREG0
#define MFF_LOG_LB_AFF_MATCH_LR_IP6_ADDR MFF_XXREG1
#define MFF_LOG_LB_AFF_MATCH_PORT MFF_REG8
#define MFF_LOG_LB_AFF_MATCH_IP6_ADDR MFF_XXREG1
#define MFF_LOG_LB_AFF_MATCH_PORT MFF_REG2

#define MFF_LOG_CT_ORIG_NW_DST_ADDR MFF_REG1 /* REG_ORIG_DIP_IPV4 */
#define MFF_LOG_CT_ORIG_IP6_DST_ADDR MFF_XXREG1 /* REG_ORIG_DIP_IPV6 */
Expand Down
6 changes: 1 addition & 5 deletions lib/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -5371,11 +5371,7 @@ encode_COMMIT_LB_AFF(const struct ovnact_commit_lb_aff *lb_aff,
imm_backend_ip = (union mf_value) {
.ipv6 = lb_aff->backend,
};
if (ep->is_switch) {
ol_spec->dst.field = mf_from_id(MFF_LOG_LB_AFF_MATCH_LS_IP6_ADDR);
} else {
ol_spec->dst.field = mf_from_id(MFF_LOG_LB_AFF_MATCH_LR_IP6_ADDR);
}
ol_spec->dst.field = mf_from_id(MFF_LOG_LB_AFF_MATCH_IP6_ADDR);
} else {
ovs_be32 ip4 = in6_addr_get_mapped_ipv4(&lb_aff->backend);
imm_backend_ip = (union mf_value) {
Expand Down
Loading

0 comments on commit 9198808

Please sign in to comment.