From 0aa0183654f0e481f95f586806ac5b0722a511b3 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Mar 31 2021 06:16:13 +0000 Subject: Import openvswitch2.15-2.15.0-6 from Fast DataPath --- diff --git a/SOURCES/openvswitch-2.15.0.patch b/SOURCES/openvswitch-2.15.0.patch index 1c8c7a5..e2cbefb 100644 --- a/SOURCES/openvswitch-2.15.0.patch +++ b/SOURCES/openvswitch-2.15.0.patch @@ -105,10 +105,22 @@ index 1f2b7a3668..8b5d075840 100644 * New upstream version diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c -index 4381c618f1..94cc9b80c5 100644 +index 4381c618f1..251788b049 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c -@@ -3834,6 +3834,15 @@ dpif_netdev_flow_put(struct dpif *dpif, const struct dpif_flow_put *put) +@@ -279,8 +279,9 @@ static bool dpcls_lookup(struct dpcls *cls, + ( 1 << OFPMBT13_DROP ) + + struct dp_meter_band { +- struct ofputil_meter_band up; /* type, prec_level, pad, rate, burst_size */ +- uint32_t bucket; /* In 1/1000 packets (for PKTPS), or in bits (for KBPS) */ ++ uint32_t rate; ++ uint32_t burst_size; ++ uint64_t bucket; /* In 1/1000 packets (for PKTPS), or in bits (for KBPS) */ + uint64_t packet_count; + uint64_t byte_count; + }; +@@ -3834,6 +3835,15 @@ dpif_netdev_flow_put(struct dpif *dpif, const struct dpif_flow_put *put) return error; } @@ -124,7 +136,7 @@ index 4381c618f1..94cc9b80c5 100644 if (put->ufid) { ufid = *put->ufid; } else { -@@ -4878,6 +4887,12 @@ struct rr_numa { +@@ -4878,6 +4888,12 @@ struct rr_numa { bool idx_inc; }; @@ -137,7 +149,7 @@ index 4381c618f1..94cc9b80c5 100644 static struct rr_numa * rr_numa_list_lookup(struct rr_numa_list *rr, int numa_id) { -@@ -5590,10 +5605,17 @@ get_dry_run_variance(struct dp_netdev *dp, uint32_t *core_list, +@@ -5590,10 +5606,17 @@ get_dry_run_variance(struct dp_netdev *dp, uint32_t *core_list, for (int i = 0; i < n_rxqs; i++) { int numa_id = netdev_get_numa_id(rxqs[i]->port->netdev); numa = rr_numa_list_lookup(&rr, numa_id); @@ -158,6 +170,70 @@ index 4381c618f1..94cc9b80c5 100644 goto cleanup; } +@@ -6203,12 +6226,14 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, + /* Update all bands and find the one hit with the highest rate for each + * packet (if any). */ + for (int m = 0; m < meter->n_bands; ++m) { +- band = &meter->bands[m]; ++ uint64_t max_bucket_size; + ++ band = &meter->bands[m]; ++ max_bucket_size = (band->rate + band->burst_size) * 1000ULL; + /* Update band's bucket. */ +- band->bucket += delta_t * band->up.rate; +- if (band->bucket > band->up.burst_size) { +- band->bucket = band->up.burst_size; ++ band->bucket += (uint64_t) delta_t * band->rate; ++ if (band->bucket > max_bucket_size) { ++ band->bucket = max_bucket_size; + } + + /* Drain the bucket for all the packets, if possible. */ +@@ -6226,8 +6251,8 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, + * (Only one band will be fired by a packet, and that + * can be different for each packet.) */ + for (int i = band_exceeded_pkt; i < cnt; i++) { +- if (band->up.rate > exceeded_rate[i]) { +- exceeded_rate[i] = band->up.rate; ++ if (band->rate > exceeded_rate[i]) { ++ exceeded_rate[i] = band->rate; + exceeded_band[i] = m; + } + } +@@ -6246,8 +6271,8 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, + /* Update the exceeding band for the exceeding packet. + * (Only one band will be fired by a packet, and that + * can be different for each packet.) */ +- if (band->up.rate > exceeded_rate[i]) { +- exceeded_rate[i] = band->up.rate; ++ if (band->rate > exceeded_rate[i]) { ++ exceeded_rate[i] = band->rate; + exceeded_band[i] = m; + } + } +@@ -6329,16 +6354,15 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, + config->bands[i].burst_size = config->bands[i].rate; + } + +- meter->bands[i].up = config->bands[i]; +- /* Convert burst size to the bucket units: */ +- /* pkts => 1/1000 packets, kilobits => bits. */ +- meter->bands[i].up.burst_size *= 1000; +- /* Initialize bucket to empty. */ +- meter->bands[i].bucket = 0; ++ 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; + + /* Figure out max delta_t that is enough to fill any bucket. */ + band_max_delta_t +- = meter->bands[i].up.burst_size / meter->bands[i].up.rate; ++ = meter->bands[i].bucket / meter->bands[i].rate; + if (band_max_delta_t > meter->max_delta_t) { + meter->max_delta_t = band_max_delta_t; + } diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 6be23dbeed..15b25084b3 100644 --- a/lib/netdev-linux.c @@ -529,10 +605,110 @@ index a7982de381..39d9aa391e 100644 ]) AT_CLEANUP diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at -index 2862a3c9b9..3e62225571 100644 +index 2862a3c9b9..d5765a6632 100644 --- a/tests/dpif-netdev.at +++ b/tests/dpif-netdev.at -@@ -589,3 +589,20 @@ arp,in_port=ANY,dl_vlan=11,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=00:06:07:08:09: +@@ -299,59 +299,61 @@ type=drop rate=1 burst_size=2 + ]) + + ovs-appctl time/warp 5000 +-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]) +-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]) +-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]) +-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]) +-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 7`; 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 ++ ++for i in `seq 1 5`; do ++ 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 +-# 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 +-# (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. + 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 + +-meter:2 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands: ++meter:2 flow_count:1 packet_in_count:7 byte_in_count:420 duration:0.0s bands: + 0: packet_count:1 byte_count:60 + ]) + + # Advance time by 1/2 second + ovs-appctl time/warp 500 + +-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]) +-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]) +-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]) +-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]) +-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 + # bursts of one packet, so all 5 of the new packets should hit the drop + # 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. + 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 + +-meter:2 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: ++meter:2 flow_count:1 packet_in_count:12 byte_in_count:720 duration:0.0s bands: + 0: packet_count:5 byte_count:300 + ]) + +@@ -360,7 +362,7 @@ ovs-appctl time/warp 5000 + AT_CHECK([ + ovs-appctl coverage/read-counter datapath_drop_meter + ], [0], [dnl +-14 ++13 + ]) + + AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout_keep_actions], [0], [dnl +@@ -589,3 +591,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]) @@ -565,6 +741,19 @@ 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/ovsdb-client.at b/tests/ovsdb-client.at index 8d777a0275..5e3b26aea8 100644 --- a/tests/ovsdb-client.at diff --git a/SPECS/openvswitch2.15.spec b/SPECS/openvswitch2.15.spec index 54b94af..b78453f 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: 5%{?dist} +Release: 6%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -697,6 +697,10 @@ exit 0 %endif %changelog +* Wed Mar 31 2021 Open vSwitch CI - 2.15.0-6 +- Merging upstream branch-2.15 + [221cf613d702776d42a960a0ab99da970d50b555] + * Mon Mar 22 2021 Kevin Traynor - 2.15.0-5 - dpif-netdev: Allow PMD auto load balance with cross-numa. (#1941673) [47e2824210c7a4368aa6cb8044fecffcb4674dd2]