diff --git a/SOURCES/openvswitch-2.13.0.patch b/SOURCES/openvswitch-2.13.0.patch index c446119..91cb9fb 100644 --- a/SOURCES/openvswitch-2.13.0.patch +++ b/SOURCES/openvswitch-2.13.0.patch @@ -86637,9 +86637,18 @@ index 409286ab15..cb197e9010 100644 ofproto_dpif_send_async_msg(upcall->ofproto, am); diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c -index 4407f9c97a..3cfb6bf8d6 100644 +index 4407f9c97a..97fcbb6584 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c +@@ -460,7 +460,7 @@ static void xlate_commit_actions(struct xlate_ctx *ctx); + + static void + patch_port_output(struct xlate_ctx *ctx, const struct xport *in_dev, +- struct xport *out_dev); ++ struct xport *out_dev, bool is_last_action); + + static void + ctx_trigger_freeze(struct xlate_ctx *ctx) @@ -1516,15 +1516,32 @@ xlate_lookup_ofproto_(const struct dpif_backer *backer, return NULL; } @@ -86703,7 +86712,54 @@ index 4407f9c97a..3cfb6bf8d6 100644 if (is_sample) { nl_msg_end_nested(ctx->odp_actions, actions_offset); nl_msg_end_nested(ctx->odp_actions, sample_offset); -@@ -4071,7 +4088,21 @@ terminate_native_tunnel(struct xlate_ctx *ctx, struct flow *flow, +@@ -3572,7 +3589,7 @@ propagate_tunnel_data_to_flow(struct xlate_ctx *ctx, struct eth_addr dmac, + static int + native_tunnel_output(struct xlate_ctx *ctx, const struct xport *xport, + const struct flow *flow, odp_port_t tunnel_odp_port, +- bool truncate) ++ bool truncate, bool is_last_action) + { + struct netdev_tnl_build_header_params tnl_params; + struct ovs_action_push_tnl tnl_push_data; +@@ -3702,7 +3719,7 @@ native_tunnel_output(struct xlate_ctx *ctx, const struct xport *xport, + entry->tunnel_hdr.hdr_size = tnl_push_data.header_len; + entry->tunnel_hdr.operation = ADD; + +- patch_port_output(ctx, xport, out_dev); ++ patch_port_output(ctx, xport, out_dev, is_last_action); + + /* Similar to the stats update in revalidation, the x_cache entries + * are populated by the previous translation are used to update the +@@ -3796,7 +3813,7 @@ xlate_flow_is_protected(const struct xlate_ctx *ctx, const struct flow *flow, co + */ + static void + patch_port_output(struct xlate_ctx *ctx, const struct xport *in_dev, +- struct xport *out_dev) ++ struct xport *out_dev, bool is_last_action) + { + struct flow *flow = &ctx->xin->flow; + struct flow old_flow = ctx->xin->flow; +@@ -3838,8 +3855,9 @@ patch_port_output(struct xlate_ctx *ctx, const struct xport *in_dev, + if (!process_special(ctx, out_dev) && may_receive(out_dev, ctx)) { + if (xport_stp_forward_state(out_dev) && + xport_rstp_forward_state(out_dev)) { ++ + xlate_table_action(ctx, flow->in_port.ofp_port, 0, true, true, +- false, true, clone_xlate_actions); ++ false, is_last_action, clone_xlate_actions); + if (!ctx->freezing) { + xlate_action_set(ctx); + } +@@ -3854,7 +3872,7 @@ patch_port_output(struct xlate_ctx *ctx, const struct xport *in_dev, + mirror_mask_t old_mirrors2 = ctx->mirrors; + + xlate_table_action(ctx, flow->in_port.ofp_port, 0, true, true, +- false, true, clone_xlate_actions); ++ false, is_last_action, clone_xlate_actions); + ctx->mirrors = old_mirrors2; + ctx->base_flow = old_base_flow; + ctx->odp_actions->size = old_size; +@@ -4071,7 +4089,21 @@ terminate_native_tunnel(struct xlate_ctx *ctx, struct flow *flow, (flow->dl_type == htons(ETH_TYPE_ARP) || flow->nw_proto == IPPROTO_ICMPV6) && is_neighbor_reply_correct(ctx, flow)) { @@ -86726,7 +86782,35 @@ index 4407f9c97a..3cfb6bf8d6 100644 } } -@@ -4796,7 +4827,7 @@ put_controller_user_action(struct xlate_ctx *ctx, +@@ -4081,7 +4113,7 @@ terminate_native_tunnel(struct xlate_ctx *ctx, struct flow *flow, + static void + compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port, + const struct xlate_bond_recirc *xr, bool check_stp, +- bool is_last_action OVS_UNUSED, bool truncate) ++ bool is_last_action, bool truncate) + { + const struct xport *xport = get_ofp_port(ctx->xbridge, ofp_port); + struct flow_wildcards *wc = ctx->wc; +@@ -4118,7 +4150,7 @@ compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port, + if (truncate) { + xlate_report_error(ctx, "Cannot truncate output to patch port"); + } +- patch_port_output(ctx, xport, xport->peer); ++ patch_port_output(ctx, xport, xport->peer, is_last_action); + return; + } + +@@ -4203,7 +4235,8 @@ compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port, + xr->recirc_id); + } else if (is_native_tunnel) { + /* Output to native tunnel port. */ +- native_tunnel_output(ctx, xport, flow, odp_port, truncate); ++ native_tunnel_output(ctx, xport, flow, odp_port, truncate, ++ is_last_action); + flow->tunnel = flow_tnl; /* Restore tunnel metadata */ + + } else if (terminate_native_tunnel(ctx, flow, wc, +@@ -4796,7 +4829,7 @@ put_controller_user_action(struct xlate_ctx *ctx, ctx->xin->flow.in_port.ofp_port); uint32_t pid = dpif_port_get_pid(ctx->xbridge->dpif, odp_port); odp_put_userspace_action(pid, &cookie, sizeof cookie, ODPP_NONE, @@ -86735,7 +86819,7 @@ index 4407f9c97a..3cfb6bf8d6 100644 } static void -@@ -6123,11 +6154,32 @@ static void +@@ -6123,11 +6156,32 @@ static void compose_conntrack_action(struct xlate_ctx *ctx, struct ofpact_conntrack *ofc, bool is_last_action) { @@ -86746,7 +86830,7 @@ index 4407f9c97a..3cfb6bf8d6 100644 + if (ofc->zone_src.field) { + union mf_subvalue value; + memset(&value, 0xff, sizeof(value)); - ++ + zone = mf_get_subfield(&ofc->zone_src, &ctx->xin->flow); + if (ctx->xin->frozen_state) { + /* If the upcall is a resume of a recirculation, we only need to @@ -86764,14 +86848,14 @@ index 4407f9c97a..3cfb6bf8d6 100644 + } else { + zone = ofc->zone_imm; + } -+ + + size_t ct_offset; + ovs_u128 old_ct_label_mask = ctx->wc->masks.ct_label; + uint32_t old_ct_mark_mask = ctx->wc->masks.ct_mark; /* Ensure that any prior actions are applied before composing the new * conntrack action. */ xlate_commit_actions(ctx); -@@ -6139,11 +6191,6 @@ compose_conntrack_action(struct xlate_ctx *ctx, struct ofpact_conntrack *ofc, +@@ -6139,11 +6193,6 @@ compose_conntrack_action(struct xlate_ctx *ctx, struct ofpact_conntrack *ofc, do_xlate_actions(ofc->actions, ofpact_ct_get_action_len(ofc), ctx, is_last_action, false); @@ -86783,7 +86867,7 @@ index 4407f9c97a..3cfb6bf8d6 100644 ct_offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_CT); if (ofc->flags & NX_CT_F_COMMIT) { -@@ -6278,6 +6325,7 @@ xlate_check_pkt_larger(struct xlate_ctx *ctx, +@@ -6278,6 +6327,7 @@ xlate_check_pkt_larger(struct xlate_ctx *ctx, * then ctx->exit would be true. Reset to false so that we can * do flow translation for 'IF_LESS_EQUAL' case. finish_freezing() * would have taken care of Undoing the changes done for freeze. */ @@ -86791,7 +86875,7 @@ index 4407f9c97a..3cfb6bf8d6 100644 ctx->exit = false; offset_attr = nl_msg_start_nested( -@@ -6302,7 +6350,7 @@ xlate_check_pkt_larger(struct xlate_ctx *ctx, +@@ -6302,7 +6352,7 @@ xlate_check_pkt_larger(struct xlate_ctx *ctx, ctx->was_mpls = old_was_mpls; ctx->conntracked = old_conntracked; ctx->xin->flow = old_flow; @@ -86800,7 +86884,7 @@ index 4407f9c97a..3cfb6bf8d6 100644 } static void -@@ -6680,6 +6728,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, +@@ -6680,13 +6730,14 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, return; } @@ -86808,7 +86892,15 @@ index 4407f9c97a..3cfb6bf8d6 100644 OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) { struct ofpact_controller *controller; const struct ofpact_metadata *metadata; -@@ -6694,7 +6743,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, + const struct ofpact_set_field *set_field; + const struct mf_field *mf; + bool last = is_last_action && ofpact_last(a, ofpacts, ofpacts_len) +- && ctx->action_set.size; ++ && !ctx->action_set.size; + + if (ctx->error) { + break; +@@ -6694,7 +6745,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, recirc_for_mpls(a, ctx); @@ -86817,7 +86909,18 @@ index 4407f9c97a..3cfb6bf8d6 100644 /* Check if need to store the remaining actions for later * execution. */ if (ctx->freezing) { -@@ -7096,6 +7145,12 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, +@@ -7085,17 +7136,18 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, + break; + + case OFPACT_CHECK_PKT_LARGER: { +- if (last) { +- /* If this is last action, then there is no need to +- * translate the action. */ +- break; +- } + const struct ofpact *remaining_acts = ofpact_next(a); + size_t remaining_acts_len = ofpact_remaining_len(remaining_acts, + ofpacts, ofpacts_len); xlate_check_pkt_larger(ctx, ofpact_get_CHECK_PKT_LARGER(a), remaining_acts, remaining_acts_len); @@ -86830,7 +86933,7 @@ index 4407f9c97a..3cfb6bf8d6 100644 break; } } -@@ -7519,7 +7574,8 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) +@@ -7519,7 +7571,8 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) /* Restore pipeline metadata. May change flow's in_port and other * metadata to the values that existed when freezing was triggered. */ @@ -86840,7 +86943,7 @@ index 4407f9c97a..3cfb6bf8d6 100644 /* Restore stack, if any. */ if (state->stack) { -@@ -7571,14 +7627,10 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) +@@ -7571,14 +7624,10 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) ctx.error = XLATE_INVALID_TUNNEL_METADATA; goto exit; } @@ -89479,7 +89582,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..3e7a626319 100644 +index ff1cc93707..694146b428 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -4534,6 +4534,54 @@ recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,fr @@ -89574,7 +89677,42 @@ index ff1cc93707..3e7a626319 100644 AT_SETUP([ofproto-dpif - debug_slow action]) OVS_VSWITCHD_START -@@ -8632,6 +8710,29 @@ recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(dst=50:54:00:00:00:0c),eth_ty +@@ -8134,6 +8212,34 @@ AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], + OVS_VSWITCHD_STOP + AT_CLEANUP + ++ ++AT_SETUP([ofproto-dpif - patch ports - meter (clone)]) ++ ++OVS_VSWITCHD_START( ++ [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 -- \ ++ add-port br0 p1 -- set Interface p1 type=patch \ ++ options:peer=p2 ofport_request=2 -- \ ++ add-br br1 -- \ ++ set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ ++ set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ ++ fail-mode=secure -- \ ++ add-port br1 p2 -- set Interface p2 type=patch \ ++ options:peer=p1 -- \ ++ add-port br1 p3 -- set Interface p3 type=dummy ofport_request=3]) ++ ++AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br1 'meter=1 pktps stats bands=type=drop rate=2']) ++AT_CHECK([ovs-ofctl del-flows br0]) ++AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 in_port=local,ip,actions=2,1]) ++AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br1 in_port=1,ip,actions=meter:1,3]) ++ ++AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=f8:bc:12:44:34:b6,dst=f8:bc:12:46:58:e0),eth_type(0x0800),ipv4(src=10.1.1.22,dst=10.0.0.3,proto=6,tos=0,ttl=64,frag=no),tcp(src=53295,dst=8080)'], [0], [stdout]) ++AT_CHECK([tail -1 stdout], [0], ++ [Datapath actions: clone(meter(0),3),1 ++]) ++ ++OVS_VSWITCHD_STOP ++AT_CLEANUP ++ + dnl ---------------------------------------------------------------------- + AT_BANNER([ofproto-dpif -- megaflows]) + +@@ -8632,6 +8738,29 @@ recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(dst=50:54:00:00:00:0c),eth_ty OVS_VSWITCHD_STOP AT_CLEANUP @@ -89604,7 +89742,7 @@ index ff1cc93707..3e7a626319 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"])]) -@@ -9215,6 +9316,26 @@ OFPST_TABLE reply (OF1.3) (xid=0x2): +@@ -9215,6 +9344,26 @@ OFPST_TABLE reply (OF1.3) (xid=0x2): OVS_VSWITCHD_STOP AT_CLEANUP @@ -89631,7 +89769,7 @@ index ff1cc93707..3e7a626319 100644 AT_SETUP([ofproto-dpif - ICMPv6]) OVS_VSWITCHD_START add_of_ports br0 1 -@@ -10540,6 +10661,62 @@ udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10. +@@ -10540,6 +10689,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 @@ -89694,7 +89832,7 @@ index ff1cc93707..3e7a626319 100644 AT_SETUP([ofproto-dpif - conntrack - ofproto/trace]) OVS_VSWITCHD_START -@@ -10807,6 +10984,23 @@ Megaflow: recirc_id=0x3,eth,ip,in_port=1,nw_frag=no +@@ -10807,6 +11012,23 @@ Megaflow: recirc_id=0x3,eth,ip,in_port=1,nw_frag=no Datapath actions: 4 ]) diff --git a/SPECS/openvswitch2.13.spec b/SPECS/openvswitch2.13.spec index 4063cba..c77ddab 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: 152%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} +Release: 153%{?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 @@ -715,6 +715,12 @@ exit 0 %endif %changelog +* Wed Jan 26 2022 Open vSwitch CI - 2.13.0-153 +- Merging upstream branch-2.13 [RH git: 607e493104] + Commit list: + 348cdae4b4 ofproto-dpif: Fix issue with non-reversible actions on a patch ports. + + * Tue Jan 25 2022 Eelco Chaudron - 2.13.0-152 - downstream: Enable usdt probes in build [RH git: 30f6bfcfca] Fixes: BZ1840877