From c5f476af3ff89a61d6cb553e937ab87089705365 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: May 19 2021 17:44:05 +0000 Subject: Import openvswitch2.15-2.15.0-22 from Fast DataPath --- diff --git a/SOURCES/openvswitch-2.15.0.patch b/SOURCES/openvswitch-2.15.0.patch index 264f9bd..a3b4f27 100644 --- a/SOURCES/openvswitch-2.15.0.patch +++ b/SOURCES/openvswitch-2.15.0.patch @@ -18351,7 +18351,7 @@ index 64111768b3..668507fd37 100755 global xfrm policies = xfrm.get_policies() diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c -index 4381c618f1..251788b049 100644 +index 4381c618f1..650e67ab30 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -279,8 +279,9 @@ static bool dpcls_lookup(struct dpcls *cls, @@ -18424,7 +18424,7 @@ index 4381c618f1..251788b049 100644 + uint64_t max_bucket_size; + band = &meter->bands[m]; -+ max_bucket_size = (band->rate + band->burst_size) * 1000ULL; ++ max_bucket_size = band->burst_size * 1000ULL; /* Update band's bucket. */ - band->bucket += delta_t * band->up.rate; - if (band->bucket > band->up.burst_size) { @@ -18457,7 +18457,7 @@ index 4381c618f1..251788b049 100644 exceeded_band[i] = m; } } -@@ -6329,16 +6354,15 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, +@@ -6329,16 +6354,14 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, config->bands[i].burst_size = config->bands[i].rate; } @@ -18470,8 +18470,7 @@ index 4381c618f1..251788b049 100644 + meter->bands[i].rate = config->bands[i].rate; + meter->bands[i].burst_size = config->bands[i].burst_size; + /* Start with a full bucket. */ -+ meter->bands[i].bucket = -+ (meter->bands[i].burst_size + meter->bands[i].rate) * 1000ULL; ++ meter->bands[i].bucket = meter->bands[i].burst_size * 1000ULL; /* Figure out max delta_t that is enough to fill any bucket. */ band_max_delta_t @@ -19728,10 +19727,10 @@ index a7982de381..39d9aa391e 100644 ]) AT_CLEANUP diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at -index 2862a3c9b9..57cae383fe 100644 +index 2862a3c9b9..16402ebae2 100644 --- a/tests/dpif-netdev.at +++ b/tests/dpif-netdev.at -@@ -299,59 +299,61 @@ type=drop rate=1 burst_size=2 +@@ -299,60 +299,87 @@ type=drop rate=1 burst_size=2 ]) ovs-appctl time/warp 5000 @@ -19761,25 +19760,37 @@ index 2862a3c9b9..57cae383fe 100644 # Meter 1 is measuring packets, allowing one packet per second with -# bursts of one packet, so 4 out of 5 packets should hit the drop -+# bursts of one packet, so 3 out of 5 packets should hit the drop - # band. --# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). 4 packets +-# band. ++# bursts of one packet, so 4 out of 5 packets should hit the drop band. + # Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). 4 packets -# (240 bytes == 1920 bits) pass, but the last packet should hit the drop band. -+# Meter 2 is measuring kbps, with burst size 2 (== 3000 bits). 6 packets -+# (360 bytes == 2880 bits) pass, but the last packet should hit the drop band. ++# (240 bytes == 1920 bits) pass, but the last three packets should hit the ++# drop band. There should be 80 bits remaining for the next packets. AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl OFPST_METER reply (OF1.3) (xid=0x2): meter:1 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands: --0: packet_count:4 byte_count:240 -+0: packet_count:3 byte_count:180 + 0: packet_count:4 byte_count:240 -meter:2 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands: +-0: packet_count:1 byte_count:60 +meter:2 flow_count:1 packet_in_count:7 byte_in_count:420 duration:0.0s bands: - 0: packet_count:1 byte_count:60 ++0: packet_count:3 byte_count:180 ]) - # Advance time by 1/2 second - ovs-appctl time/warp 500 +-# Advance time by 1/2 second +-ovs-appctl time/warp 500 ++# Advance time by 870 ms ++ovs-appctl time/warp 870 ++ ++for i in `seq 1 5`; do ++ AT_CHECK( ++ [ovs-appctl netdev-dummy/receive p7 \ ++ 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) ++ ++ AT_CHECK( ++ [ovs-appctl netdev-dummy/receive p8 \ ++ 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) ++done -AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) @@ -19791,16 +19802,6 @@ index 2862a3c9b9..57cae383fe 100644 -AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -+for i in `seq 1 5`; do -+ AT_CHECK( -+ [ovs-appctl netdev-dummy/receive p7 \ -+ 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -+ -+ AT_CHECK( -+ [ovs-appctl netdev-dummy/receive p8 \ -+ 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -+done -+ sleep 1 # wait for forwarders process packets # Meter 1 is measuring packets, allowing one packet per second with @@ -19808,30 +19809,57 @@ index 2862a3c9b9..57cae383fe 100644 # band. -# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). After 500ms -# there should be space for 80 + 500 bits, so one new 60 byte (480 bit) packet -+# Meter 2 is measuring kbps, with burst size 2 (== 3000 bits). After 500ms -+# there should be space for 120 + 500 bits, so one new 60 byte (480 bit) packet - # should pass, remaining 4 should hit the drop band. +-# should pass, remaining 4 should hit the drop band. ++# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). After 870ms ++# there should be space for 80 + 870 = 950 bits, so one new 60 byte (480 bit) ++# packet should pass, remaining 4 should hit the drop band. There should be ++# 470 bits left. AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl OFPST_METER reply (OF1.3) (xid=0x2): meter:1 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: --0: packet_count:9 byte_count:540 -+0: packet_count:8 byte_count:480 + 0: packet_count:9 byte_count:540 -meter:2 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: +-0: packet_count:5 byte_count:300 +meter:2 flow_count:1 packet_in_count:12 byte_in_count:720 duration:0.0s bands: - 0: packet_count:5 byte_count:300 ++0: packet_count:7 byte_count:420 ++]) ++ ++# Advance time by 10 ms ++ovs-appctl time/warp 10 ++ ++for i in `seq 1 5`; do ++ AT_CHECK( ++ [ovs-appctl netdev-dummy/receive p7 \ ++ 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) ++done ++ ++sleep 1 # wait for forwarders process packets ++ ++# Meter 1 should remain the same as we didn't send anything that should hit it. ++# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). After 10ms ++# there should be space for 470 + 10 = 480 bits, so one new 60 byte (480 bit) ++# packet should pass, remaining 4 should hit the drop band. ++AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl ++OFPST_METER reply (OF1.3) (xid=0x2): ++meter:1 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: ++0: packet_count:9 byte_count:540 ++ ++meter:2 flow_count:1 packet_in_count:17 byte_in_count:1020 duration:0.0s bands: ++0: packet_count:11 byte_count:660 ]) -@@ -360,7 +362,7 @@ ovs-appctl time/warp 5000 + ovs-appctl time/warp 5000 +@@ -360,7 +387,7 @@ ovs-appctl time/warp 5000 AT_CHECK([ ovs-appctl coverage/read-counter datapath_drop_meter ], [0], [dnl -14 -+13 ++20 ]) AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout_keep_actions], [0], [dnl -@@ -370,6 +372,8 @@ recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), a +@@ -370,6 +397,8 @@ recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), a recirc_id(0),in_port(8),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:2 ]) @@ -19840,7 +19868,7 @@ index 2862a3c9b9..57cae383fe 100644 OVS_VSWITCHD_STOP AT_CLEANUP -@@ -589,3 +593,20 @@ arp,in_port=ANY,dl_vlan=11,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=00:06:07:08:09: +@@ -589,3 +618,20 @@ arp,in_port=ANY,dl_vlan=11,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=00:06:07:08:09: DPIF_NETDEV_FLOW_HW_OFFLOAD_OFFSETS_VID_ARP([dummy]) DPIF_NETDEV_FLOW_HW_OFFLOAD_OFFSETS_VID_ARP([dummy-pmd]) @@ -19873,19 +19901,6 @@ index e3173fb88f..2347c690ef 100644 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-6540965472632832 b/tests/fuzz-regression/ofp_print_fuzzer-6540965472632832 new file mode 100644 index 0000000000..e69de29bb2 -diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at -index 31064ed95e..24bbd884ca 100644 ---- a/tests/ofproto-dpif.at -+++ b/tests/ofproto-dpif.at -@@ -2123,7 +2123,7 @@ AT_CHECK([ovs-appctl revalidator/purge]) - AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) - - dnl Add a controller meter. --AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=controller pktps stats bands=type=drop rate=2']) -+AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=controller pktps burst stats bands=type=drop rate=1 burst_size=1']) - - dnl Advance time by 1 second. - AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore]) diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at index c8babe3612..1f1fc3c79a 100644 --- a/tests/ovs-vsctl.at diff --git a/SPECS/openvswitch2.15.spec b/SPECS/openvswitch2.15.spec index 888a450..beaa81f 100644 --- a/SPECS/openvswitch2.15.spec +++ b/SPECS/openvswitch2.15.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.15.0 -Release: 21%{?dist} +Release: 22%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -697,6 +697,12 @@ exit 0 %endif %changelog +* Wed May 19 2021 Open vSwitch CI - 2.15.0-22 +- Merging upstream branch-2.15 [RH gerrit: 8b6b82c2ed] + Commit list: + e87adce83c dpif-netdev: Remove meter rate from the bucket size calculation. + + * Sat May 15 2021 Open vSwitch CI - 2.15.0-21 - Merging upstream branch-2.15 [RH gerrit: c7b9daa243] Commit list: