From 3d735f88d47e92fa385e3f144d601ab0979c060c Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Sep 09 2021 01:51:28 +0000 Subject: Import openvswitch2.13-2.13.0-124 from Fast DataPath --- diff --git a/SOURCES/openvswitch-2.13.0.patch b/SOURCES/openvswitch-2.13.0.patch index 33fdb34..9a3f7e0 100644 --- a/SOURCES/openvswitch-2.13.0.patch +++ b/SOURCES/openvswitch-2.13.0.patch @@ -80714,7 +80714,7 @@ index 7e48630f0e..4e2874c22e 100644 } else if (retval < 0) { VLOG_FATAL("waitpid failed (%s)", ovs_strerror(errno)); diff --git a/lib/dp-packet.h b/lib/dp-packet.h -index 9f8991faad..dc8b773fe1 100644 +index 9f8991faad..4c14951d6a 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -81,7 +81,7 @@ struct dp_packet { @@ -80737,7 +80737,34 @@ index 9f8991faad..dc8b773fe1 100644 static inline void *dp_packet_l2_5(const struct dp_packet *); static inline void dp_packet_set_l2_5(struct dp_packet *, void *); static inline void *dp_packet_l3(const struct dp_packet *); -@@ -327,14 +327,14 @@ dp_packet_reset_offsets(struct dp_packet *b) +@@ -155,6 +155,7 @@ struct dp_packet *dp_packet_clone_data_with_headroom(const void *, size_t, + void dp_packet_resize(struct dp_packet *b, size_t new_headroom, + size_t new_tailroom); + static inline void dp_packet_delete(struct dp_packet *); ++static inline void dp_packet_swap(struct dp_packet *, struct dp_packet *); + + static inline void *dp_packet_at(const struct dp_packet *, size_t offset, + size_t size); +@@ -212,6 +213,18 @@ dp_packet_delete(struct dp_packet *b) + } + } + ++/* Swaps content of two packets. */ ++static inline void ++dp_packet_swap(struct dp_packet *a, struct dp_packet *b) ++{ ++ ovs_assert(a->source == DPBUF_MALLOC || a->source == DPBUF_STUB); ++ ovs_assert(b->source == DPBUF_MALLOC || b->source == DPBUF_STUB); ++ struct dp_packet c = *a; ++ ++ *a = *b; ++ *b = c; ++} ++ + /* If 'b' contains at least 'offset + size' bytes of data, returns a pointer to + * byte 'offset'. Otherwise, returns a null pointer. */ + static inline void * +@@ -327,14 +340,14 @@ dp_packet_reset_offsets(struct dp_packet *b) b->l4_ofs = UINT16_MAX; } @@ -80754,7 +80781,7 @@ index 9f8991faad..dc8b773fe1 100644 { ovs_assert(pad_size <= dp_packet_size(b)); b->l2_pad_size = pad_size; -@@ -950,7 +950,6 @@ enum { NETDEV_MAX_BURST = 32 }; /* Maximum number packets in a batch. */ +@@ -950,7 +963,6 @@ enum { NETDEV_MAX_BURST = 32 }; /* Maximum number packets in a batch. */ struct dp_packet_batch { size_t count; bool trunc; /* true if the batch needs truncate. */ @@ -80762,7 +80789,7 @@ index 9f8991faad..dc8b773fe1 100644 struct dp_packet *packets[NETDEV_MAX_BURST]; }; -@@ -959,7 +958,6 @@ dp_packet_batch_init(struct dp_packet_batch *batch) +@@ -959,7 +971,6 @@ dp_packet_batch_init(struct dp_packet_batch *batch) { batch->count = 0; batch->trunc = false; @@ -80817,7 +80844,7 @@ index 68c33a0f96..9b251f81fa 100644 * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c -index d393aab5e3..d953da223f 100644 +index d393aab5e3..2fb0d418b1 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -83,9 +83,9 @@ @@ -81113,15 +81140,35 @@ index d393aab5e3..d953da223f 100644 if (put->ufid) { ufid = *put->ufid; } else { -@@ -3831,7 +3932,6 @@ dpif_netdev_execute(struct dpif *dpif, struct dpif_execute *execute) +@@ -3830,8 +3931,10 @@ dpif_netdev_execute(struct dpif *dpif, struct dpif_execute *execute) + flow_hash_5tuple(execute->flow, 0)); } - dp_packet_batch_init_packet(&pp, execute->packet); +- dp_packet_batch_init_packet(&pp, execute->packet); - pp.do_not_steal = true; ++ /* Making a copy because the packet might be stolen during the execution ++ * and caller might still need it. */ ++ struct dp_packet *packet_clone = dp_packet_clone(execute->packet); ++ dp_packet_batch_init_packet(&pp, packet_clone); dp_netdev_execute_actions(pmd, &pp, false, execute->flow, execute->actions, execute->actions_len); dp_netdev_pmd_flush_output_packets(pmd, true); -@@ -3875,11 +3975,12 @@ dpif_netdev_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops, +@@ -3841,6 +3944,14 @@ dpif_netdev_execute(struct dpif *dpif, struct dpif_execute *execute) + dp_netdev_pmd_unref(pmd); + } + ++ if (dp_packet_batch_size(&pp)) { ++ /* Packet wasn't dropped during the execution. Swapping content with ++ * the original packet, because the caller might expect actions to ++ * modify it. */ ++ dp_packet_swap(execute->packet, packet_clone); ++ dp_packet_delete_batch(&pp, true); ++ } ++ + return 0; + } + +@@ -3875,11 +3986,12 @@ dpif_netdev_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops, /* Enable or Disable PMD auto load balancing. */ static void @@ -81135,7 +81182,7 @@ index d393aab5e3..d953da223f 100644 bool enable_alb = false; bool multi_rxq = false; -@@ -3906,18 +4007,24 @@ set_pmd_auto_lb(struct dp_netdev *dp) +@@ -3906,18 +4018,24 @@ set_pmd_auto_lb(struct dp_netdev *dp) enable_alb = enable_alb && pmd_rxq_assign_cyc && pmd_alb->auto_lb_requested; @@ -81164,7 +81211,7 @@ index d393aab5e3..d953da223f 100644 } /* Applies datapath configuration from the database. Some of the changes are -@@ -3935,6 +4042,9 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) +@@ -3935,6 +4053,9 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) uint32_t insert_min, cur_min; uint32_t tx_flush_interval, cur_tx_flush_interval; uint64_t rebalance_intvl; @@ -81174,7 +81221,7 @@ index d393aab5e3..d953da223f 100644 tx_flush_interval = smap_get_int(other_config, "tx-flush-interval", DEFAULT_TX_FLUSH_INTERVAL); -@@ -4012,7 +4122,7 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) +@@ -4012,7 +4133,7 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) false); rebalance_intvl = smap_get_int(other_config, "pmd-auto-lb-rebal-interval", @@ -81183,7 +81230,7 @@ index d393aab5e3..d953da223f 100644 /* Input is in min, convert it to msec. */ rebalance_intvl = -@@ -4020,9 +4130,38 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) +@@ -4020,9 +4141,38 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) if (pmd_alb->rebalance_intvl != rebalance_intvl) { pmd_alb->rebalance_intvl = rebalance_intvl; @@ -81225,7 +81272,7 @@ index d393aab5e3..d953da223f 100644 return 0; } -@@ -4493,6 +4632,12 @@ struct rr_numa { +@@ -4493,6 +4643,12 @@ struct rr_numa { bool idx_inc; }; @@ -81238,7 +81285,7 @@ index d393aab5e3..d953da223f 100644 static struct rr_numa * rr_numa_list_lookup(struct rr_numa_list *rr, int numa_id) { -@@ -4940,9 +5085,17 @@ reconfigure_datapath(struct dp_netdev *dp) +@@ -4940,9 +5096,17 @@ reconfigure_datapath(struct dp_netdev *dp) /* Check for all the ports that need reconfiguration. We cache this in * 'port->need_reconfigure', because netdev_is_reconf_required() can @@ -81258,7 +81305,7 @@ index d393aab5e3..d953da223f 100644 port->need_reconfigure = true; } } -@@ -5076,7 +5229,7 @@ reconfigure_datapath(struct dp_netdev *dp) +@@ -5076,7 +5240,7 @@ reconfigure_datapath(struct dp_netdev *dp) reload_affected_pmds(dp); /* Check if PMD Auto LB is to be enabled */ @@ -81267,7 +81314,7 @@ index d393aab5e3..d953da223f 100644 } /* Returns true if one of the netdevs in 'dp' requires a reconfiguration */ -@@ -5189,10 +5342,17 @@ get_dry_run_variance(struct dp_netdev *dp, uint32_t *core_list, +@@ -5189,10 +5353,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); @@ -81288,7 +81335,7 @@ index d393aab5e3..d953da223f 100644 goto cleanup; } -@@ -5320,7 +5480,7 @@ pmd_rebalance_dry_run(struct dp_netdev *dp) +@@ -5320,7 +5491,7 @@ pmd_rebalance_dry_run(struct dp_netdev *dp) improvement = ((curr_variance - new_variance) * 100) / curr_variance; } @@ -81297,7 +81344,7 @@ index d393aab5e3..d953da223f 100644 ret = false; } } -@@ -5787,12 +5947,14 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, +@@ -5787,12 +5958,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) { @@ -81316,7 +81363,7 @@ index d393aab5e3..d953da223f 100644 } /* Drain the bucket for all the packets, if possible. */ -@@ -5810,8 +5972,8 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, +@@ -5810,8 +5983,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++) { @@ -81327,7 +81374,7 @@ index d393aab5e3..d953da223f 100644 exceeded_band[i] = m; } } -@@ -5830,8 +5992,8 @@ dp_netdev_run_meter(struct dp_netdev *dp, struct dp_packet_batch *packets_, +@@ -5830,8 +6003,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.) */ @@ -81338,7 +81385,7 @@ index d393aab5e3..d953da223f 100644 exceeded_band[i] = m; } } -@@ -5913,16 +6075,14 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, +@@ -5913,16 +6086,14 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, config->bands[i].burst_size = config->bands[i].rate; } @@ -81360,7 +81407,7 @@ index d393aab5e3..d953da223f 100644 if (band_max_delta_t > meter->max_delta_t) { meter->max_delta_t = band_max_delta_t; } -@@ -7800,6 +7960,7 @@ const struct dpif_class dpif_netdev_class = { +@@ -7800,6 +7971,7 @@ const struct dpif_class dpif_netdev_class = { NULL, /* ct_timeout_policy_dump_next */ NULL, /* ct_timeout_policy_dump_done */ NULL, /* ct_get_timeout_policy_name */ @@ -81368,7 +81415,7 @@ index d393aab5e3..d953da223f 100644 dpif_netdev_ipf_set_enabled, dpif_netdev_ipf_set_min_frag, dpif_netdev_ipf_set_max_nfrags, -@@ -8040,6 +8201,7 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd, +@@ -8040,6 +8212,7 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd, if (pmd->ctx.now > pmd->rxq_next_cycle_store) { uint64_t curr_tsc; @@ -81376,7 +81423,7 @@ index d393aab5e3..d953da223f 100644 struct pmd_auto_lb *pmd_alb = &pmd->dp->pmd_alb; if (pmd_alb->is_enabled && !pmd->isolated && (pmd->perf_stats.counters.n[PMD_CYCLES_ITER_IDLE] >= -@@ -8056,7 +8218,9 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd, +@@ -8056,7 +8229,9 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd, pmd_load = ((tot_proc * 100) / (tot_idle + tot_proc)); } @@ -87498,7 +87545,7 @@ index 4893280a99..a0487341c9 100644 bad_action 'fin_timeout(foo=bar)' "invalid key 'foo' in 'fin_timeout' argument" diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at -index ff1cc93707..6415a8a04d 100644 +index ff1cc93707..7b5b2183bf 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -5171,6 +5171,36 @@ AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2 @@ -87568,7 +87615,34 @@ index ff1cc93707..6415a8a04d 100644 m4_define([OFPROTO_DPIF_MEGAFLOW_DISABLED], [AT_SETUP([ofproto-dpif megaflow - disabled$1]) OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])]) -@@ -10540,6 +10593,62 @@ udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10. +@@ -9215,6 +9268,26 @@ OFPST_TABLE reply (OF1.3) (xid=0x2): + OVS_VSWITCHD_STOP + AT_CLEANUP + ++AT_SETUP([ofproto-dpif packet-out table meter drop]) ++OVS_VSWITCHD_START ++add_of_ports br0 1 2 ++ ++AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=1 pktps bands=type=drop rate=1']) ++AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 'in_port=1 action=meter:1,output:2']) ++ ++ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000400080000 actions=resubmit(,0)" ++ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000400080000 actions=resubmit(,0)" ++ ++# Check that vswitchd hasn't crashed by dumping the meter added above ++AT_CHECK([ovs-ofctl -O OpenFlow13 dump-meters br0 | ofctl_strip], [0], [dnl ++OFPST_METER_CONFIG reply (OF1.3): ++meter=1 pktps bands= ++type=drop rate=1 ++]) ++ ++OVS_VSWITCHD_STOP ++AT_CLEANUP ++ + AT_SETUP([ofproto-dpif - ICMPv6]) + OVS_VSWITCHD_START + add_of_ports br0 1 +@@ -10540,6 +10613,62 @@ udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10. OVS_VSWITCHD_STOP AT_CLEANUP @@ -90833,6 +90907,73 @@ index 4af44200e8..68ce2c5442 100644 + stream_close(stream); return (error || !stream) ? 1 : 0; } +diff --git a/tests/tunnel-push-pop.at b/tests/tunnel-push-pop.at +index b92c23fde8..9feb1c5fec 100644 +--- a/tests/tunnel-push-pop.at ++++ b/tests/tunnel-push-pop.at +@@ -573,6 +573,62 @@ OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep 50540000000a5054000000091235 | wc + OVS_VSWITCHD_STOP + AT_CLEANUP + ++AT_SETUP([tunnel_push_pop - packet_out debug_slow]) ++ ++OVS_VSWITCHD_START( ++ [add-port br0 p0 dnl ++ -- set Interface p0 type=dummy ofport_request=1 dnl ++ other-config:hwaddr=aa:55:aa:55:00:00]) ++AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg]) ++AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy]) ++AT_CHECK([ovs-vsctl add-port int-br t2 dnl ++ -- set Interface t2 type=geneve options:remote_ip=1.1.2.92 dnl ++ options:key=123 ofport_request=2]) ++ ++dnl First setup dummy interface IP address, then add the route ++dnl so that tnl-port table can get valid IP address for the device. ++AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK ++]) ++AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK ++]) ++AT_CHECK([ovs-ofctl add-flow br0 action=normal]) ++ ++dnl This ARP reply from p0 has two effects: ++dnl 1. The ARP cache will learn that 1.1.2.92 is at f8:bc:12:44:34:b6. ++dnl 2. The br0 mac learning will learn that f8:bc:12:44:34:b6 is on p0. ++AT_CHECK([ ++ ovs-appctl netdev-dummy/receive p0 dnl ++ 'recirc_id(0),in_port(2),dnl ++ eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),dnl ++ arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)' ++]) ++ ++AT_CHECK([ovs-vsctl -- set Interface p0 options:tx_pcap=p0.pcap]) ++ ++packet=50540000000a505400000009123 ++encap=f8bc124434b6aa55aa5500000800450000320000400040113406010102580101025c83a917c1001e00000000655800007b00 ++ ++dnl Output to tunnel from a int-br internal port. ++dnl Checking that the packet arrived and it was correctly encapsulated. ++AT_CHECK([ovs-ofctl add-flow int-br "in_port=LOCAL,actions=debug_slow,output:2"]) ++AT_CHECK([ovs-appctl netdev-dummy/receive int-br "${packet}4"]) ++OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep "${encap}${packet}4" | wc -l` -ge 1]) ++dnl Sending again to exercise the non-miss upcall path. ++AT_CHECK([ovs-appctl netdev-dummy/receive int-br "${packet}4"]) ++OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep "${encap}${packet}4" | wc -l` -ge 2]) ++ ++dnl Output to tunnel from the controller. ++AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out int-br CONTROLLER "debug_slow,output:2" "${packet}5"]) ++OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep "${encap}${packet}5" | wc -l` -ge 1]) ++ ++dnl Datapath actions should not have tunnel push action. ++AT_CHECK([ovs-appctl dpctl/dump-flows | grep -q tnl_push], [1]) ++dnl There should be slow_path action instead. ++AT_CHECK([ovs-appctl dpctl/dump-flows | grep -q 'slow_path(action)'], [0]) ++ ++OVS_VSWITCHD_STOP ++AT_CLEANUP ++ + AT_SETUP([tunnel_push_pop - underlay bridge match]) + + OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00]) diff --git a/tests/tunnel.at b/tests/tunnel.at index ce000a25e6..7a6b7f42c6 100644 --- a/tests/tunnel.at diff --git a/SPECS/openvswitch2.13.spec b/SPECS/openvswitch2.13.spec index fbdb45f..0d38998 100644 --- a/SPECS/openvswitch2.13.spec +++ b/SPECS/openvswitch2.13.spec @@ -59,7 +59,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.13.0 -Release: 122%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} +Release: 124%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -710,6 +710,17 @@ exit 0 %endif %changelog +* Wed Sep 08 2021 Open vSwitch CI - 2.13.0-124 +- Merging upstream branch-2.13 [RH git: b3c7c50935] + Commit list: + 38efd803dd dpif-netdev: Fix crash when PACKET_OUT is metered. + + +* Tue Aug 17 2021 Michael Santana - 2.13.0-123 +- Migrate openvswitch to gitlab [RH git: 081bad43fc] + Signed-off-by: Michael Santana + + * Mon Aug 16 2021 Open vSwitch CI - 2.13.0-122 - Merging upstream branch-2.13 [RH git: 775922244f] Commit list: