From a40c623bf5295b0dba3757ea75c693dda86817d8 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Nov 25 2022 00:09:35 +0000 Subject: Import openvswitch2.17-2.17.0-65 from Fast DataPath --- diff --git a/SOURCES/openvswitch-2.17.0.patch b/SOURCES/openvswitch-2.17.0.patch index 67ad874..3181760 100644 --- a/SOURCES/openvswitch-2.17.0.patch +++ b/SOURCES/openvswitch-2.17.0.patch @@ -486,10 +486,80 @@ index 4e9bcce272..733068bfd2 100644 AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c -index 70ac0a0e56..218e7db814 100644 +index 70ac0a0e56..e3eb05d659 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c -@@ -1712,6 +1712,15 @@ OvsUpdateIPv4Header(OvsForwardingContext *ovsFwdCtx, +@@ -1502,6 +1502,8 @@ OvsUpdateAddressAndPort(OvsForwardingContext *ovsFwdCtx, + UINT16 *checkField = NULL; + BOOLEAN l4Offload = FALSE; + NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO csumInfo; ++ UINT16 preNatPseudoChecksum = 0; ++ BOOLEAN preservePseudoChecksum = FALSE; + + ASSERT(layers->value != 0); + +@@ -1537,6 +1539,11 @@ OvsUpdateAddressAndPort(OvsForwardingContext *ovsFwdCtx, + * case, we only update the TTL. + */ + /*Only tx direction the checksum value will be reset to be PseudoChecksum*/ ++ if (!isTx) { ++ preNatPseudoChecksum = IPPseudoChecksum(&ipHdr->saddr, &ipHdr->daddr, ++ tcpHdr ? IPPROTO_TCP : IPPROTO_UDP, ++ ntohs(ipHdr->tot_len) - ipHdr->ihl * 4); ++ } + + if (isSource) { + addrField = &ipHdr->saddr; +@@ -1553,7 +1560,12 @@ OvsUpdateAddressAndPort(OvsForwardingContext *ovsFwdCtx, + ((BOOLEAN)csumInfo.Receive.UdpChecksumSucceeded || + (BOOLEAN)csumInfo.Receive.UdpChecksumFailed); + } +- if (isTx && l4Offload) { ++ if (!isTx && l4Offload) { ++ if (*checkField == preNatPseudoChecksum) { ++ preservePseudoChecksum = TRUE; ++ } ++ } ++ if (isTx && l4Offload || preservePseudoChecksum) { + *checkField = IPPseudoChecksum(&newAddr, &ipHdr->daddr, + tcpHdr ? IPPROTO_TCP : IPPROTO_UDP, + ntohs(ipHdr->tot_len) - ipHdr->ihl * 4); +@@ -1573,8 +1585,13 @@ OvsUpdateAddressAndPort(OvsForwardingContext *ovsFwdCtx, + ((BOOLEAN)csumInfo.Receive.UdpChecksumSucceeded || + (BOOLEAN)csumInfo.Receive.UdpChecksumFailed); + } ++ if (!isTx && l4Offload) { ++ if (*checkField == preNatPseudoChecksum) { ++ preservePseudoChecksum = TRUE; ++ } ++ } + +- if (isTx && l4Offload) { ++ if (isTx && l4Offload || preservePseudoChecksum) { + *checkField = IPPseudoChecksum(&ipHdr->saddr, &newAddr, + tcpHdr ? IPPROTO_TCP : IPPROTO_UDP, + ntohs(ipHdr->tot_len) - ipHdr->ihl * 4); +@@ -1583,7 +1600,8 @@ OvsUpdateAddressAndPort(OvsForwardingContext *ovsFwdCtx, + + if (*addrField != newAddr) { + UINT32 oldAddr = *addrField; +- if ((checkField && *checkField != 0) && (!l4Offload || !isTx)) { ++ if ((checkField && *checkField != 0) && ++ (!l4Offload || (!isTx && !preservePseudoChecksum))) { + /* Recompute total checksum. */ + *checkField = ChecksumUpdate32(*checkField, oldAddr, + newAddr); +@@ -1597,7 +1615,8 @@ OvsUpdateAddressAndPort(OvsForwardingContext *ovsFwdCtx, + } + + if (portField && *portField != newPort) { +- if ((checkField) && (!l4Offload || !isTx)) { ++ if ((checkField) && ++ (!l4Offload || (!isTx && !preservePseudoChecksum))) { + /* Recompute total checksum. */ + *checkField = ChecksumUpdate16(*checkField, *portField, + newPort); +@@ -1712,6 +1731,15 @@ OvsUpdateIPv4Header(OvsForwardingContext *ovsFwdCtx, ipHdr->ttl = ipAttr->ipv4_ttl; key->ipKey.nwTtl = ipAttr->ipv4_ttl; } @@ -52500,6 +52570,80 @@ index 89d711225f..3252f17ebf 100644 member_destroy(member); } +diff --git a/lib/learn.c b/lib/learn.c +index a40209ec0b..a62add2fda 100644 +--- a/lib/learn.c ++++ b/lib/learn.c +@@ -241,7 +241,7 @@ static char * OVS_WARN_UNUSED_RESULT + learn_parse_spec(const char *orig, char *name, char *value, + const struct ofputil_port_map *port_map, + struct ofpact_learn_spec *spec, +- struct ofpbuf *ofpacts, struct match *match) ++ struct ofpbuf *ofpacts) + { + /* Parse destination and check prerequisites. */ + struct mf_subfield dst; +@@ -275,14 +275,14 @@ learn_parse_spec(const char *orig, char *name, char *value, + } else { + char *tail; + /* Partial field value. */ +- if (parse_int_string(value, (uint8_t *)&imm, ++ if (parse_int_string(value, imm.b, + dst.field->n_bytes, &tail) + || *tail != 0) { + imm_error = xasprintf("%s: cannot parse integer value", orig); + } + + if (!imm_error && +- !bitwise_is_all_zeros(&imm, dst.field->n_bytes, ++ !bitwise_is_all_zeros(imm.b, dst.field->n_bytes, + dst.n_bits, + dst.field->n_bytes * 8 - dst.n_bits)) { + struct ds ds; +@@ -304,15 +304,13 @@ learn_parse_spec(const char *orig, char *name, char *value, + + spec->src_type = NX_LEARN_SRC_IMMEDIATE; + +- /* Update 'match' to allow for satisfying destination +- * prerequisites. */ +- mf_write_subfield_value(&dst, &imm, match); +- + /* Push value last, as this may reallocate 'spec'! */ + unsigned int imm_bytes = DIV_ROUND_UP(dst.n_bits, 8); + uint8_t *src_imm = ofpbuf_put_zeros(ofpacts, + OFPACT_ALIGN(imm_bytes)); +- memcpy(src_imm, &imm, imm_bytes); ++ ++ memcpy(src_imm, &imm.b[dst.field->n_bytes - imm_bytes], ++ imm_bytes); + + free(error); + return NULL; +@@ -391,7 +389,6 @@ learn_parse__(char *orig, char *arg, const struct ofputil_port_map *port_map, + struct ofpbuf *ofpacts) + { + struct ofpact_learn *learn; +- struct match match; + char *name, *value; + + learn = ofpact_put_LEARN(ofpacts); +@@ -400,7 +397,6 @@ learn_parse__(char *orig, char *arg, const struct ofputil_port_map *port_map, + learn->priority = OFP_DEFAULT_PRIORITY; + learn->table_id = 1; + +- match_init_catchall(&match); + while (ofputil_parse_key_value(&arg, &name, &value)) { + if (!strcmp(name, "table")) { + if (!ofputil_table_from_string(value, table_map, +@@ -448,7 +444,7 @@ learn_parse__(char *orig, char *arg, const struct ofputil_port_map *port_map, + + spec = ofpbuf_put_zeros(ofpacts, sizeof *spec); + error = learn_parse_spec(orig, name, value, port_map, +- spec, ofpacts, &match); ++ spec, ofpacts); + if (error) { + return error; + } diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in index 2a3f2ca7bc..44fbb1f9fd 100644 --- a/lib/libopenvswitch.pc.in @@ -55179,7 +55323,7 @@ index 4e751ff2c7..70fabeb8a3 100644 #ifdef _WIN32 if (node->wevent && node->pollfd.fd) { diff --git a/lib/rculist.h b/lib/rculist.h -index 1072b87af2..c0d77acf94 100644 +index 1072b87af2..9bb8cbf3eb 100644 --- a/lib/rculist.h +++ b/lib/rculist.h @@ -365,35 +365,57 @@ rculist_is_singleton_protected(const struct rculist *list) @@ -55231,18 +55375,18 @@ index 1072b87af2..c0d77acf94 100644 +#define RCULIST_FOR_EACH_REVERSE_PROTECTED(ITER, MEMBER, RCULIST) \ + for (INIT_MULTIVAR(ITER, MEMBER, (RCULIST)->prev, struct rculist); \ + CONDITION_MULTIVAR(ITER, MEMBER, ITER_VAR(ITER) != (RCULIST)); \ -+ UPDATE_MULTIVAR(ITER, ITER_VAR(VAR).prev)) ++ UPDATE_MULTIVAR(ITER, ITER_VAR(ITER)->prev)) + +#define RCULIST_FOR_EACH_REVERSE_PROTECTED_CONTINUE(ITER, MEMBER, RCULIST) \ + for (INIT_MULTIVAR(ITER, MEMBER, (ITER)->MEMBER.prev, struct rculist); \ + CONDITION_MULTIVAR(ITER, MEMBER, ITER_VAR(ITER) != (RCULIST)); \ -+ UPDATE_MULTIVAR(ITER, ITER_VAR(VAR).prev)) ++ UPDATE_MULTIVAR(ITER, ITER_VAR(ITER)->prev)) + +#define RCULIST_FOR_EACH_PROTECTED(ITER, MEMBER, RCULIST) \ + for (INIT_MULTIVAR(ITER, MEMBER, rculist_next_protected(RCULIST), \ + struct rculist); \ + CONDITION_MULTIVAR(ITER, MEMBER, ITER_VAR(ITER) != (RCULIST)); \ -+ UPDATE_MULTIVAR(ITER, rculist_next_protected(ITER_VAR(ITER))) \ ++ UPDATE_MULTIVAR(ITER, rculist_next_protected(ITER_VAR(ITER)))) \ + +#define RCULIST_FOR_EACH_SAFE_SHORT_PROTECTED(ITER, MEMBER, RCULIST) \ + for (INIT_MULTIVAR_SAFE_SHORT(ITER, MEMBER, \ @@ -55250,18 +55394,18 @@ index 1072b87af2..c0d77acf94 100644 + struct rculist); \ + CONDITION_MULTIVAR_SAFE_SHORT(ITER, MEMBER, \ + ITER_VAR(ITER) != (RCULIST), \ -+ ITER_NEXT_VAR(ITER) = rculist_next_protected(ITER_VAR(VAR))); \ -+ UPDATE_MULTIVAR_SHORT(ITER)) ++ ITER_NEXT_VAR(ITER) = rculist_next_protected(ITER_VAR(ITER))); \ ++ UPDATE_MULTIVAR_SAFE_SHORT(ITER)) + +#define RCULIST_FOR_EACH_SAFE_LONG_PROTECTED(ITER, NEXT, MEMBER, RCULIST) \ + for (INIT_MULTIVAR_SAFE_LONG(ITER, NEXT, MEMBER, \ -+ rculist_next_protected(RCULIST) \ ++ rculist_next_protected(RCULIST), \ + struct rculist); \ -+ CONDITION_MULTIVAR_SAFE_LONG(VAR, NEXT, MEMBER \ ++ CONDITION_MULTIVAR_SAFE_LONG(ITER, NEXT, MEMBER, \ + ITER_VAR(ITER) != (RCULIST), \ -+ ITER_VAR(NEXT) = rculist_next_protected(ITER_VAR(VAR)), \ ++ ITER_VAR(NEXT) = rculist_next_protected(ITER_VAR(ITER)), \ + ITER_VAR(NEXT) != (RCULIST)); \ -+ UPDATE_MULTIVAR_LONG(ITER)) ++ UPDATE_MULTIVAR_SAFE_LONG(ITER, NEXT)) + +#define RCULIST_FOR_EACH_SAFE_PROTECTED(...) \ + OVERLOAD_SAFE_MACRO(RCULIST_FOR_EACH_SAFE_LONG_PROTECTED, \ @@ -61111,6 +61255,28 @@ index f3e19cd83b..1d3af98dab 100644 AT_CHECK([ ovs-appctl netdev-dummy/receive p1 'in_port(1),packet_type(ns=0,id=0),eth(src=3a:6d:d2:09:9c:ab,dst=1e:2c:e9:2a:66:9e),ipv4(src=192.168.10.10,dst=192.168.10.30,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' ], [0], [ignore]) +diff --git a/tests/learn.at b/tests/learn.at +index 5f1d6df9de..d127fed348 100644 +--- a/tests/learn.at ++++ b/tests/learn.at +@@ -6,7 +6,7 @@ actions=learn() + actions=learn(send_flow_rem) + actions=learn(delete_learned) + actions=learn(send_flow_rem,delete_learned) +-actions=learn(NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], output:NXM_OF_IN_PORT[], load:10->NXM_NX_REG0[5..10]) ++actions=learn(NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], NXM_NX_REG3[3..19]=0x10011, output:NXM_OF_IN_PORT[], load:10->NXM_NX_REG0[5..10]) + actions=learn(table=1,idle_timeout=10, hard_timeout=20, fin_idle_timeout=5, fin_hard_timeout=10, priority=10, cookie=0xfedcba9876543210, in_port=99,eth_dst=eth_src,load:in_port->reg1[16..31]) + actions=learn(limit=4096) + actions=learn(limit=4096,result_dst=reg0[0]) +@@ -18,7 +18,7 @@ OFPT_FLOW_MOD (xid=0x1): ADD actions=learn(table=1) + OFPT_FLOW_MOD (xid=0x2): ADD actions=learn(table=1,send_flow_rem) + OFPT_FLOW_MOD (xid=0x3): ADD actions=learn(table=1,delete_learned) + OFPT_FLOW_MOD (xid=0x4): ADD actions=learn(table=1,send_flow_rem,delete_learned) +-OFPT_FLOW_MOD (xid=0x5): ADD actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[],load:0xa->NXM_NX_REG0[5..10]) ++OFPT_FLOW_MOD (xid=0x5): ADD actions=learn(table=1,NXM_OF_VLAN_TCI[0..11],NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],NXM_NX_REG3[3..19]=0x10011,output:NXM_OF_IN_PORT[],load:0xa->NXM_NX_REG0[5..10]) + OFPT_FLOW_MOD (xid=0x6): ADD actions=learn(table=1,idle_timeout=10,hard_timeout=20,fin_idle_timeout=5,fin_hard_timeout=10,priority=10,cookie=0xfedcba9876543210,in_port=99,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],load:NXM_OF_IN_PORT[]->NXM_NX_REG1[16..31]) + OFPT_FLOW_MOD (xid=0x7): ADD actions=learn(table=1,limit=4096) + OFPT_FLOW_MOD (xid=0x8): ADD actions=learn(table=1,limit=4096,result_dst=NXM_NX_REG0[0]) diff --git a/tests/library.at b/tests/library.at index db4997d8f0..6489be2c15 100644 --- a/tests/library.at @@ -66517,7 +66683,7 @@ index 37cc72d401..1032089fc2 100644 if (fscset->bridge == br->br_cfg) { ovsrec_flow_sample_collector_set_delete(fscset); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c -index 5223aa8970..e328d8ead1 100644 +index 5223aa8970..793bad1243 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -543,13 +543,13 @@ bridge_exit(bool delete_datapath) @@ -66644,7 +66810,15 @@ index 5223aa8970..e328d8ead1 100644 br->cfg = shash_find_data(&new_br, br->name); if (!br->cfg || strcmp(br->type, ofproto_normalize_type( br->cfg->datapath_type))) { -@@ -3266,13 +3266,13 @@ bridge_run(void) +@@ -2660,6 +2660,7 @@ iface_refresh_stats(struct iface *iface) + IFACE_STAT(tx_512_to_1023_packets, "tx_512_to_1023_packets") \ + IFACE_STAT(tx_1024_to_1522_packets, "tx_1024_to_1522_packets") \ + IFACE_STAT(tx_1523_to_max_packets, "tx_1523_to_max_packets") \ ++ IFACE_STAT(multicast, "rx_multicast_packets") \ + IFACE_STAT(tx_multicast_packets, "tx_multicast_packets") \ + IFACE_STAT(rx_broadcast_packets, "rx_broadcast_packets") \ + IFACE_STAT(tx_broadcast_packets, "tx_broadcast_packets") \ +@@ -3266,13 +3267,13 @@ bridge_run(void) if (ovsdb_idl_is_lock_contended(idl)) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); @@ -66660,7 +66834,7 @@ index 5223aa8970..e328d8ead1 100644 bridge_destroy(br, false); } /* Since we will not be running system_stats_run() in this process -@@ -3594,13 +3594,13 @@ static void +@@ -3594,13 +3595,13 @@ static void bridge_destroy(struct bridge *br, bool del) { if (br) { @@ -66678,7 +66852,7 @@ index 5223aa8970..e328d8ead1 100644 mirror_destroy(mirror); } -@@ -3746,11 +3746,11 @@ static void +@@ -3746,11 +3747,11 @@ static void bridge_del_ports(struct bridge *br, const struct shash *wanted_ports) { struct shash_node *port_node; @@ -66692,7 +66866,7 @@ index 5223aa8970..e328d8ead1 100644 port->cfg = shash_find_data(wanted_ports, port->name); if (!port->cfg) { port_destroy(port); -@@ -4211,7 +4211,7 @@ bridge_configure_aa(struct bridge *br) +@@ -4211,7 +4212,7 @@ bridge_configure_aa(struct bridge *br) const struct ovsdb_datum *mc; struct ovsrec_autoattach *auto_attach = br->cfg->auto_attach; struct aa_settings aa_s; @@ -66701,7 +66875,7 @@ index 5223aa8970..e328d8ead1 100644 size_t i; if (!auto_attach) { -@@ -4227,7 +4227,7 @@ bridge_configure_aa(struct bridge *br) +@@ -4227,7 +4228,7 @@ bridge_configure_aa(struct bridge *br) mc = ovsrec_autoattach_get_mappings(auto_attach, OVSDB_TYPE_INTEGER, OVSDB_TYPE_INTEGER); @@ -66710,7 +66884,7 @@ index 5223aa8970..e328d8ead1 100644 union ovsdb_atom atom; atom.integer = m->isid; -@@ -4341,12 +4341,12 @@ static void +@@ -4341,12 +4342,12 @@ static void bridge_aa_refresh_queued(struct bridge *br) { struct ovs_list *list = xmalloc(sizeof *list); @@ -66725,7 +66899,7 @@ index 5223aa8970..e328d8ead1 100644 struct port *port; VLOG_INFO("ifname=%s, vlan=%u, oper=%u", node->port_name, node->vlan, -@@ -4387,7 +4387,7 @@ port_create(struct bridge *br, const struct ovsrec_port *cfg) +@@ -4387,7 +4388,7 @@ port_create(struct bridge *br, const struct ovsrec_port *cfg) static void port_del_ifaces(struct port *port) { @@ -66734,7 +66908,7 @@ index 5223aa8970..e328d8ead1 100644 struct sset new_ifaces; size_t i; -@@ -4398,7 +4398,7 @@ port_del_ifaces(struct port *port) +@@ -4398,7 +4399,7 @@ port_del_ifaces(struct port *port) } /* Get rid of deleted interfaces. */ @@ -66743,7 +66917,7 @@ index 5223aa8970..e328d8ead1 100644 if (!sset_contains(&new_ifaces, iface->name)) { iface_destroy(iface); } -@@ -4412,13 +4412,13 @@ port_destroy(struct port *port) +@@ -4412,13 +4413,13 @@ port_destroy(struct port *port) { if (port) { struct bridge *br = port->bridge; @@ -66759,7 +66933,7 @@ index 5223aa8970..e328d8ead1 100644 iface_destroy__(iface); } -@@ -5013,12 +5013,12 @@ bridge_configure_mirrors(struct bridge *br) +@@ -5013,12 +5014,12 @@ bridge_configure_mirrors(struct bridge *br) { const struct ovsdb_datum *mc; unsigned long *flood_vlans; diff --git a/SPECS/openvswitch2.17.spec b/SPECS/openvswitch2.17.spec index 72e0e28..03996d2 100644 --- a/SPECS/openvswitch2.17.spec +++ b/SPECS/openvswitch2.17.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.17.0 -Release: 64%{?dist} +Release: 65%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -743,6 +743,15 @@ exit 0 %endif %changelog +* Thu Nov 24 2022 Open vSwitch CI - 2.17.0-65 +- Merging upstream branch-2.17 [RH git: 63d511698e] + Commit list: + 118e4349db rculist: Fix iteration macros. + c9f10ae334 vswitchd: Publish per iface received multicast packets. + 4e3f9951fb learn: Fix parsing immediate value for a field match. + 282ba24d99 datapath-windows: Check the condition to reset pseudo header checksum on Rx side + + * Mon Nov 14 2022 Open vSwitch CI - 2.17.0-64 - Merging upstream branch-2.17 [RH git: 6214c5363d] Commit list: