Skip to content

Commit

Permalink
northd: Add ipv6_{src, dst} to selection_fields column in the NB db.
Browse files Browse the repository at this point in the history
Introduce ipv6_src and ipv6_dst to selection_fields column in
Load_Balancer Logical_Router_Static_Route tables in order to properly
load-balance IPv6 traffic if these fields are selected in group hash
algorithm.

Reported-at: https://issues.redhat.com/browse/FDP-1032
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: 0-day Robot <[email protected]>
  • Loading branch information
LorenzoBianconi authored and ovsrobot committed Dec 11, 2024
1 parent a099f58 commit 48a5696
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
9 changes: 5 additions & 4 deletions ovn-nb.ovsschema
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "OVN_Northbound",
"version": "7.7.0",
"cksum": "116357561 38626",
"version": "7.8.0",
"cksum": "1354114919 38707",
"tables": {
"NB_Global": {
"columns": {
Expand Down Expand Up @@ -247,7 +247,7 @@
"type": {"key": {"type": "string",
"enum": ["set",
["eth_src", "eth_dst", "ip_src", "ip_dst",
"tp_src", "tp_dst"]]},
"ipv6_src", "ipv6_dst", "tp_src", "tp_dst"]]},
"min": 0, "max": "unlimited"}},
"options": {
"type": {"key": "string",
Expand Down Expand Up @@ -510,7 +510,8 @@
"type": {"key": {"type": "string",
"enum": ["set",
["eth_src", "eth_dst", "ip_proto", "ip_src",
"ip_dst", "tp_src", "tp_dst"]]},
"ip_dst", "ipv6_src", "ipv6_dst", "tp_src",
"tp_dst"]]},
"min": 0, "max": "unlimited"}},
"options": {
"type": {"key": "string", "value": "string",
Expand Down
1 change: 1 addition & 0 deletions ovn-nb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3870,6 +3870,7 @@ or
</p>
<p>
Example: <code>{ip_proto,ip_src,ip_dst}</code> for a 3-tuple match.
Example: <code>{ip_proto,ipv6_src,ipv6_dst}</code> for a IPv6 match.
Example: <code>{ip_proto,ip_src,ip_dst,tp_src,tp_dst}</code>
for a 5-tuple match.
</p>
Expand Down
6 changes: 3 additions & 3 deletions tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -25649,7 +25649,7 @@ check ovn-nbctl lsp-set-options sw1-lr0 router-port=lr0-sw1

check ovn-nbctl lb-add lb1 [[2001::a]]:80 [[2001::3]]:80,[[2002::3]]:80
OVN_LB_ID=$(ovn-nbctl --bare --column _uuid find load_balancer name=lb1)
check ovn-nbctl set load_balancer ${OVN_LB_ID} selection_fields="ip_dst,ip_src,tp_dst,tp_src"
check ovn-nbctl set load_balancer ${OVN_LB_ID} selection_fields="ipv6_dst,ipv6_src,tp_dst,tp_src"
#
check ovn-nbctl --wait=sb set load_balancer . ip_port_mappings:\"[[2001::3]]\"=\"sw0-p1:[[2001::2]]\"
check ovn-nbctl --wait=sb set load_balancer . ip_port_mappings:\"[[2002::3]]\"=\"sw1-p1:[[2002::2]]\"
Expand Down Expand Up @@ -25692,14 +25692,14 @@ OVS_WAIT_FOR_OUTPUT(
ovn-sbctl dump-flows sw0 | grep ct_lb_mark | grep priority=120 | sed 's/table=..//'], 0,
[dnl
(ls_in_pre_stateful ), priority=120 , match=(reg0[[2]] == 1 && ip6.dst == 2001::a && tcp.dst == 80), action=(xxreg1 = 2001::a; reg2[[0..15]] = 80; ct_lb_mark;)
(ls_in_lb ), priority=120 , match=(ct.new && ip6.dst == 2001::a && tcp.dst == 80), action=(xxreg1 = 2001::a; reg2[[0..15]] = 80; ct_lb_mark(backends=[[2001::3]]:80,[[2002::3]]:80; hash_fields="ip_dst,ip_src,tcp_dst,tcp_src");)
(ls_in_lb ), priority=120 , match=(ct.new && ip6.dst == 2001::a && tcp.dst == 80), action=(xxreg1 = 2001::a; reg2[[0..15]] = 80; ct_lb_mark(backends=[[2001::3]]:80,[[2002::3]]:80; hash_fields="ipv6_dst,ipv6_src,tcp_dst,tcp_src");)
])

AT_CAPTURE_FILE([sbflows2])
OVS_WAIT_FOR_OUTPUT(
[ovn-sbctl dump-flows > sbflows2
ovn-sbctl dump-flows lr0 | grep ct_lb_mark | grep priority=120 | sed 's/table=..//'], 0,
[ (lr_in_dnat ), priority=120 , match=(ct.new && !ct.rel && ip6 && ip6.dst == 2001::a && tcp && tcp.dst == 80 && is_chassis_resident("cr-lr0-public")), action=(ct_lb_mark(backends=[[2001::3]]:80,[[2002::3]]:80; hash_fields="ip_dst,ip_src,tcp_dst,tcp_src");)
[ (lr_in_dnat ), priority=120 , match=(ct.new && !ct.rel && ip6 && ip6.dst == 2001::a && tcp && tcp.dst == 80 && is_chassis_resident("cr-lr0-public")), action=(ct_lb_mark(backends=[[2001::3]]:80,[[2002::3]]:80; hash_fields="ipv6_dst,ipv6_src,tcp_dst,tcp_src");)
])

# get the svc monitor mac.
Expand Down
8 changes: 4 additions & 4 deletions tests/system-ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -1755,10 +1755,10 @@ tcp,orig=(src=fd01::2,dst=fd03::2,sport=<cleared>,dport=<cleared>),reply=(src=fd
])

# Configure selection_fields.
check ovn-nbctl set load_balancer $lb2_uuid selection_fields="ip_src,ip_dst,tp_src,tp_dst"
check ovn-nbctl set load_balancer $lb2_uuid selection_fields="ipv6_src,ipv6_dst,tp_src,tp_dst"
OVS_WAIT_UNTIL([
test $(ovs-ofctl dump-groups br-int | \
grep "selection_method=hash,fields(ip_src,ip_dst,tcp_src,tcp_dst)" -c) -eq 2
grep "selection_method=hash,fields(ipv6_src,ipv6_dst,tcp_src,tcp_dst)" -c) -eq 2
])

AT_CHECK([ovs-appctl dpctl/flush-conntrack])
Expand Down Expand Up @@ -1789,10 +1789,10 @@ done
# there should be only one conntrack entry.
AT_CHECK([test $(ovs-appctl dpctl/dump-conntrack | grep fd03::2 -c) -eq 1])

check ovn-nbctl set load_balancer $lb2_uuid selection_fields="eth_src,ip_src"
check ovn-nbctl set load_balancer $lb2_uuid selection_fields="eth_src,ipv6_src"
OVS_WAIT_UNTIL([
test $(ovs-ofctl dump-groups br-int | \
grep "selection_method=hash,fields(eth_src,ip_src)" -c) -eq 2
grep "selection_method=hash,fields(eth_src,ipv6_src)" -c) -eq 2
])

AT_CHECK([ovs-appctl dpctl/flush-conntrack])
Expand Down

0 comments on commit 48a5696

Please sign in to comment.