diff --git a/SOURCES/openvswitch-3.2.0.patch b/SOURCES/openvswitch-3.2.0.patch index 483fc8c..64d0ee5 100644 --- a/SOURCES/openvswitch-3.2.0.patch +++ b/SOURCES/openvswitch-3.2.0.patch @@ -148,8 +148,612 @@ index a3a5c2e4a..eb7a9b1ba 100644 v3.2.0 - 17 Aug 2023 -------------------- - OVSDB: +diff --git a/build-aux/automake.mk b/build-aux/automake.mk +index b9a77a51c..d65b6da6c 100644 +--- a/build-aux/automake.mk ++++ b/build-aux/automake.mk +@@ -1,11 +1,19 @@ + EXTRA_DIST += \ + build-aux/calculate-schema-cksum \ + build-aux/cccl \ ++ build-aux/check-structs \ + build-aux/cksum-schema-check \ + build-aux/dist-docs \ + build-aux/dpdkstrip.py \ +- build-aux/generate-dhparams-c \ ++ build-aux/extract-odp-netlink-h \ ++ build-aux/extract-odp-netlink-macros-h \ ++ build-aux/extract-odp-netlink-windows-dp-h \ ++ build-aux/extract-ofp-actions \ ++ build-aux/extract-ofp-errors \ ++ build-aux/extract-ofp-fields \ ++ build-aux/extract-ofp-msgs \ + build-aux/gen_ofp_field_decoders \ ++ build-aux/generate-dhparams-c \ + build-aux/initial-tab-allowed-files \ + build-aux/sodepends.py \ + build-aux/soexpand.py \ +@@ -13,8 +21,12 @@ EXTRA_DIST += \ + build-aux/xml2nroff + + FLAKE8_PYFILES += \ +- build-aux/dpdkstrip.py \ +- build-aux/gen_ofp_field_decoders \ +- build-aux/sodepends.py \ +- build-aux/soexpand.py \ +- build-aux/xml2nroff ++ build-aux/dpdkstrip.py \ ++ build-aux/extract-ofp-actions \ ++ build-aux/extract-ofp-errors \ ++ build-aux/extract-ofp-fields \ ++ build-aux/extract-ofp-msgs \ ++ build-aux/gen_ofp_field_decoders \ ++ build-aux/sodepends.py \ ++ build-aux/soexpand.py \ ++ build-aux/xml2nroff +diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions +index 0aa6c65f3..cc5c1dbb0 100755 +--- a/build-aux/extract-ofp-actions ++++ b/build-aux/extract-ofp-actions +@@ -17,27 +17,30 @@ version_map = {"1.0": 0x01, + version_reverse_map = dict((v, k) for (k, v) in version_map.items()) + + # Map from vendor name to the length of the action header. +-vendor_map = {"OF": (0x00000000, 4), ++vendor_map = {"OF": (0x00000000, 4), + "ONF": (0x4f4e4600, 10), + "NX": (0x00002320, 10)} + + # Basic types used in action arguments. +-types = {} +-types['uint8_t'] = {"size": 1, "align": 1, "ntoh": None, "hton": None} +-types['ovs_be16'] = {"size": 2, "align": 2, "ntoh": "ntohs", "hton": "htons"} +-types['ovs_be32'] = {"size": 4, "align": 4, "ntoh": "ntohl", "hton": "htonl"} +-types['ovs_be64'] = {"size": 8, "align": 8, "ntoh": "ntohll", "hton": "htonll"} +-types['uint16_t'] = {"size": 2, "align": 2, "ntoh": None, "hton": None} +-types['uint32_t'] = {"size": 4, "align": 4, "ntoh": None, "hton": None} +-types['uint64_t'] = {"size": 8, "align": 8, "ntoh": None, "hton": None} ++types = { ++ "uint8_t" : {"size": 1, "align": 1, "ntoh": None, "hton": None}, ++ "ovs_be16": {"size": 2, "align": 2, "ntoh": "ntohs", "hton": "htons"}, ++ "ovs_be32": {"size": 4, "align": 4, "ntoh": "ntohl", "hton": "htonl"}, ++ "ovs_be64": {"size": 8, "align": 8, "ntoh": "ntohll", "hton": "htonll"}, ++ "uint16_t": {"size": 2, "align": 2, "ntoh": None, "hton": None}, ++ "uint32_t": {"size": 4, "align": 4, "ntoh": None, "hton": None}, ++ "uint64_t": {"size": 8, "align": 8, "ntoh": None, "hton": None}, ++} + + line = "" +- ++n_errors = 0 + arg_structs = set() + ++ + def round_up(x, y): + return int((x + (y - 1)) / y) * y + ++ + def open_file(fn): + global file_name + global input_file +@@ -46,6 +49,7 @@ def open_file(fn): + input_file = open(file_name) + line_number = 0 + ++ + def get_line(): + global input_file + global line +@@ -56,16 +60,18 @@ def get_line(): + fatal("unexpected end of input") + return line + +-n_errors = 0 ++ + def error(msg): + global n_errors + sys.stderr.write("%s:%d: %s\n" % (file_name, line_number, msg)) + n_errors += 1 + ++ + def fatal(msg): + error(msg) + sys.exit(1) + ++ + def usage(): + argv0 = os.path.basename(sys.argv[0]) + print('''\ +@@ -84,10 +90,8 @@ Commands: + ''' % {"argv0": argv0}) + sys.exit(0) + +-def extract_ofp_actions(fn, definitions): +- error_types = {} + +- comments = [] ++def extract_ofp_actions(fn, definitions): + names = [] + domain = {} + for code, size in vendor_map.values(): +@@ -100,14 +104,14 @@ def extract_ofp_actions(fn, definitions): + + while True: + get_line() +- if re.match('enum ofp_raw_action_type {', line): ++ if re.match(r'enum ofp_raw_action_type {', line): + break + + while True: + get_line() + if line.startswith('/*') or not line or line.isspace(): + continue +- elif re.match('}', line): ++ elif re.match(r'}', line): + break + + if not line.lstrip().startswith('/*'): +@@ -119,10 +123,10 @@ def extract_ofp_actions(fn, definitions): + if line.startswith('/*') or not line or line.isspace(): + fatal("unexpected syntax within action") + comment += ' %s' % line.lstrip('* \t').rstrip(' \t\r\n') +- comment = re.sub('\[[^]]*\]', '', comment) ++ comment = re.sub(r'\[[^]]*\]', '', comment) + comment = comment[:-2].rstrip() + +- m = re.match('([^:]+):\s+(.*)$', comment) ++ m = re.match(r'([^:]+):\s+(.*)$', comment) + if not m: + fatal("unexpected syntax between actions") + +@@ -147,7 +151,9 @@ def extract_ofp_actions(fn, definitions): + names.append(enum) + + for dst in dsts.split(', '): +- m = re.match(r'([A-Z]+)([0-9.]+)(\+|-[0-9.]+)?(?:\((\d+)\))(?: is deprecated \(([^)]+)\))?$', dst) ++ m = re.match( ++ r'([A-Z]+)([0-9.]+)(\+|-[0-9.]+)?(?:\((\d+)\))(?:' ++ r' is deprecated \(([^)]+)\))?$', dst) + if not m: + fatal("%r: syntax error in destination" % dst) + vendor_name = m.group(1) +@@ -220,18 +226,18 @@ def extract_ofp_actions(fn, definitions): + else: + max_length = min_length + +- info = {"enum": enum, # 0 +- "deprecation": deprecation, # 1 +- "file_name": file_name, # 2 +- "line_number": line_number, # 3 +- "min_length": min_length, # 4 +- "max_length": max_length, # 5 +- "arg_ofs": arg_ofs, # 6 +- "arg_len": arg_len, # 7 +- "base_argtype": base_argtype, # 8 +- "arg_vl_mff_map": arg_vl_mff_map, # 9 +- "version": version, # 10 +- "type": type_} # 11 ++ info = {"enum": enum, # 0 ++ "deprecation": deprecation, # 1 ++ "file_name": file_name, # 2 ++ "line_number": line_number, # 3 ++ "min_length": min_length, # 4 ++ "max_length": max_length, # 5 ++ "arg_ofs": arg_ofs, # 6 ++ "arg_len": arg_len, # 7 ++ "base_argtype": base_argtype, # 8 ++ "arg_vl_mff_map": arg_vl_mff_map, # 9 ++ "version": version, # 10 ++ "type": type_} # 11 + domain[vendor][type_][version] = info + + enums.setdefault(enum, []) +@@ -247,9 +253,13 @@ def extract_ofp_actions(fn, definitions): + """) + + if definitions: +- print("/* Verify that structs used as actions are reasonable sizes. */") ++ print( ++ "/* Verify that structs used as actions are reasonable sizes. */" ++ ) + for s in sorted(arg_structs): +- print("BUILD_ASSERT_DECL(sizeof(%s) %% OFP_ACTION_ALIGN == 0);" % s) ++ print( ++ "BUILD_ASSERT_DECL(sizeof(%s) %% OFP_ACTION_ALIGN == 0);" % s ++ ) + + print("\nstatic struct ofpact_raw_instance all_raw_instances[] = {") + for vendor in domain: +@@ -265,9 +275,11 @@ def extract_ofp_actions(fn, definitions): + print(" %s," % d["max_length"]) + print(" %s," % d["arg_ofs"]) + print(" %s," % d["arg_len"]) +- print(" \"%s\"," % re.sub('_RAW[0-9]*', '', d["enum"], 1)) ++ print(" \"%s\"," ++ % re.sub(r'_RAW[0-9]*', '', d["enum"], 1)) + if d["deprecation"]: +- print(" \"%s\"," % re.sub(r'(["\\])', r'\\\1', d["deprecation"])) ++ print(" \"%s\"," ++ % re.sub(r'(["\\])', r'\\\1', d["deprecation"])) + else: + print(" NULL,") + print(" },") +@@ -286,10 +298,11 @@ def extract_ofp_actions(fn, definitions): + + decl = "static inline " + if base_argtype.startswith('struct'): +- decl += "%s *" %base_argtype ++ decl += "%s *" % base_argtype + else: + decl += "void" +- decl += "\nput_%s(struct ofpbuf *openflow" % versions[0]["enum"].replace('_RAW', '', 1) ++ decl += "\nput_%s(struct ofpbuf *openflow" \ ++ % versions[0]["enum"].replace('_RAW', '', 1) + if need_ofp_version: + decl += ", enum ofp_version version" + if base_argtype != 'void' and not base_argtype.startswith('struct'): +@@ -348,9 +361,13 @@ ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, + else: + arg = "arg" + if arg_vl_mff_map: +- print(" return decode_%s(%s, version, vl_mff_map, tlv_bitmap, out);" % (enum, arg)) ++ print( ++ " return decode_%s(%s," % (enum, arg), ++ "version, vl_mff_map, tlv_bitmap, out);" ++ ) + else: +- print(" return decode_%s(%s, version, out);" % (enum, arg)) ++ print(" return decode_%s(%s, version, out);" ++ % (enum, arg)) + print("") + print("""\ + default: +@@ -366,7 +383,8 @@ ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, + arg_vl_mff_map = versions[0]["arg_vl_mff_map"] + if base_argtype != 'void': + if base_argtype.startswith('struct'): +- prototype += "const %s *, enum ofp_version, " % base_argtype ++ prototype += "const %s *, " % base_argtype ++ prototype += "enum ofp_version, " + else: + prototype += "%s, enum ofp_version, " % base_argtype + if arg_vl_mff_map: +@@ -378,13 +396,15 @@ ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, + static enum ofperr ofpact_decode(const struct ofp_action_header *, + enum ofp_raw_action_type raw, + enum ofp_version version, +- uint64_t arg, const struct vl_mff_map *vl_mff_map, ++ uint64_t arg, ++ const struct vl_mff_map *vl_mff_map, + uint64_t *tlv_bitmap, struct ofpbuf *out); + """) ++ + +-## ------------ ## +-## Main Program ## +-## ------------ ## ++# ------------ # ++# Main Program # ++# ------------ # + + if __name__ == '__main__': + argv0 = sys.argv[0] +diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors +index 2c3fbfc88..eeefccbee 100755 +--- a/build-aux/extract-ofp-errors ++++ b/build-aux/extract-ofp-errors +@@ -22,6 +22,9 @@ tokenRe = "#?" + idRe + "|[0-9]+|." + inComment = False + inDirective = False + ++n_errors = 0 ++ ++ + def open_file(fn): + global fileName + global inputFile +@@ -30,6 +33,7 @@ def open_file(fn): + inputFile = open(fileName) + lineNumber = 0 + ++ + def tryGetLine(): + global inputFile + global line +@@ -38,10 +42,12 @@ def tryGetLine(): + lineNumber += 1 + return line != "" + ++ + def getLine(): + if not tryGetLine(): + fatal("unexpected end of input") + ++ + def getToken(): + global token + global line +@@ -82,37 +88,43 @@ def getToken(): + line = line[:-2] + inputFile.readline() + lineNumber += 1 + if line == "": +- if token == None: ++ if token is None: + fatal("unexpected end of input") + token = None + return False + +-n_errors = 0 ++ + def error(msg): + global n_errors + sys.stderr.write("%s:%d: %s\n" % (fileName, lineNumber, msg)) + n_errors += 1 + ++ + def fatal(msg): + error(msg) + sys.exit(1) + ++ + def skipDirective(): + getToken() + while token != '$': + getToken() + ++ + def isId(s): +- return re.match(idRe + "$", s) != None ++ return re.match(idRe + "$", s) is not None ++ + + def forceId(): + if not isId(token): + fatal("identifier expected") + ++ + def forceInteger(): +- if not re.match('[0-9]+$', token): ++ if not re.match(r'[0-9]+$', token): + fatal("integer expected") + ++ + def match(t): + if token == t: + getToken() +@@ -120,10 +132,12 @@ def match(t): + else: + return False + ++ + def forceMatch(t): + if not match(t): + fatal("%s expected" % t) + ++ + def parseTaggedName(): + assert token in ('struct', 'union') + name = token +@@ -133,26 +147,26 @@ def parseTaggedName(): + getToken() + return name + ++ + def print_enum(tag, constants, storage_class): +- print (""" ++ print(""" + %(storage_class)sconst char * + %(tag)s_to_string(uint16_t value) + { + switch (value) {\ + """ % {"tag": tag, +- "bufferlen": len(tag) + 32, + "storage_class": storage_class}) + for constant in constants: +- print (" case %s: return \"%s\";" % (constant, constant)) +- print ("""\ ++ print(" case %s: return \"%s\";" % (constant, constant)) ++ print("""\ + } + return NULL; +-}\ +-""" % {"tag": tag}) ++}""") ++ + + def usage(): + argv0 = os.path.basename(sys.argv[0]) +- print ('''\ ++ print('''\ + %(argv0)s, for extracting OpenFlow error codes from header files + usage: %(argv0)s ERROR_HEADER VENDOR_HEADER + +@@ -167,6 +181,7 @@ The output is suitable for use as lib/ofp-errors.inc.\ + ''' % {"argv0": argv0}) + sys.exit(0) + ++ + def extract_vendor_ids(fn): + global vendor_map + vendor_map = {} +@@ -174,7 +189,10 @@ def extract_vendor_ids(fn): + + open_file(fn) + while tryGetLine(): +- m = re.match(r'#define\s+([A-Z0-9_]+)_VENDOR_ID\s+(0x[0-9a-fA-F]+|[0-9]+)', line) ++ m = re.match( ++ r'#define\s+([A-Z0-9_]+)_VENDOR_ID\s+(0x[0-9a-fA-F]+|[0-9]+)', ++ line ++ ) + if not m: + continue + +@@ -202,9 +220,8 @@ def extract_vendor_ids(fn): + % (id_, vendor_reverse_map[id_], name)) + vendor_reverse_map[id_] = name + +-def extract_ofp_errors(fn): +- error_types = {} + ++def extract_ofp_errors(fn): + comments = [] + names = [] + domain = {} +@@ -220,14 +237,14 @@ def extract_ofp_errors(fn): + + while True: + getLine() +- if re.match('enum ofperr', line): ++ if re.match(r'enum ofperr', line): + break + + while True: + getLine() + if line.startswith('/*') or not line or line.isspace(): + continue +- elif re.match('}', line): ++ elif re.match(r'}', line): + break + + if not line.lstrip().startswith('/*'): +@@ -241,19 +258,19 @@ def extract_ofp_errors(fn): + comment += ' %s' % line.lstrip('* \t').rstrip(' \t\r\n') + comment = comment[:-2].rstrip() + +- m = re.match('Expected: (.*)\.$', comment) ++ m = re.match(r'Expected: (.*)\.$', comment) + if m: + expected_errors[m.group(1)] = (fileName, lineNumber) + continue + +- m = re.match('((?:.(?!\. ))+.)\.\s+(.*)$', comment) ++ m = re.match(r'((?:.(?!\. ))+.)\.\s+(.*)$', comment) + if not m: + fatal("unexpected syntax between errors") + + dsts, comment = m.groups() + + getLine() +- m = re.match('\s+(?:OFPERR_([A-Z0-9_]+))(\s*=\s*OFPERR_OFS)?,', ++ m = re.match(r'\s+(?:OFPERR_([A-Z0-9_]+))(\s*=\s*OFPERR_OFS)?,', + line) + if not m: + fatal("syntax error expecting OFPERR_ enum value") +@@ -262,11 +279,14 @@ def extract_ofp_errors(fn): + if enum in names: + fatal("%s specified twice" % enum) + +- comments.append(re.sub('\[[^]]*\]', '', comment)) ++ comments.append(re.sub(r'\[[^]]*\]', '', comment)) + names.append(enum) + + for dst in dsts.split(', '): +- m = re.match(r'([A-Z]+)([0-9.]+)(\+|-[0-9.]+)?\((\d+)(?:,(\d+))?\)$', dst) ++ m = re.match( ++ r'([A-Z]+)([0-9.]+)(\+|-[0-9.]+)?\((\d+)(?:,(\d+))?\)$', ++ dst ++ ) + if not m: + fatal("%r: syntax error in destination" % dst) + vendor_name = m.group(1) +@@ -313,8 +333,7 @@ def extract_ofp_errors(fn): + # mechanism that includes a type but not a code. + if v1 < version_map['1.2'] or v2 < version_map['1.2']: + if code is None: +- fatal("%s: NX1.0 and NX1.1 domains require code" +- % (dst, vendor_name)) ++ fatal("%s: NX1.0 and NX1.1 domains require code" % dst) + if v1 >= version_map['1.2'] or v2 >= version_map['1.2']: + if code is not None: + fatal("%s: NX1.2+ domains do not have codes" % dst) +@@ -340,11 +359,13 @@ def extract_ofp_errors(fn): + del expected_errors[msg] + else: + error("%s: %s." % (dst, msg)) +- sys.stderr.write("%s:%d: %s: Here is the location " +- "of the previous definition.\n" +- % (domain[version][vendor][type_][code][1], +- domain[version][vendor][type_][code][2], +- dst)) ++ sys.stderr.write( ++ "%s:%d: %s: Here is the location " ++ "of the previous definition.\n" ++ % (domain[version][vendor][type_][code][1], ++ domain[version][vendor][type_][code][2], ++ dst) ++ ) + else: + domain[version][vendor][type_][code] = (enum, fileName, + lineNumber) +@@ -361,7 +382,7 @@ def extract_ofp_errors(fn): + if n_errors: + sys.exit(1) + +- print ("""\ ++ print("""\ + /* Generated automatically; do not modify! -*- buffer-read-only: t -*- */ + + #define OFPERR_N_ERRORS %d +@@ -386,7 +407,7 @@ static const char *error_comments[OFPERR_N_ERRORS] = { + for comment in comments))) + + def output_domain(map, name, description, version): +- print (""" ++ print(""" + static enum ofperr + %s_decode(uint32_t vendor, uint16_t type, uint16_t code) + { +@@ -405,16 +426,16 @@ static enum ofperr + vendor_s = "(%#xULL << 32) | " % vendor + else: + vendor_s = "" +- print (" case %s ((uint32_t) %d << 16) | %d:" % (vendor_s, ++ print(" case %s ((uint32_t) %d << 16) | %d:" % (vendor_s, + type_, code)) +- print (" return OFPERR_%s;" % enum) +- print ("""\ ++ print(" return OFPERR_%s;" % enum) ++ print("""\ + } + + return 0; + }""") + +- print (""" ++ print(""" + static const struct ofperr_domain %s = { + "%s", + %d, +@@ -423,20 +444,22 @@ static const struct ofperr_domain %s = { + for enum in names: + if enum in map: + vendor, type_, code = map[enum] +- if code == None: ++ if code is None: + code = -1 +- print (" { %#8x, %2d, %3d }, /* %s */" % (vendor, type_, code, enum)) ++ print(" { %#8x, %2d, %3d }, /* %s */" % (vendor, type_, ++ code, enum)) + else: +- print (" { -1, -1, -1 }, /* %s */" % enum) +- print ("""\ ++ print(" { -1, -1, -1 }, /* %s */" % enum) ++ print("""\ + }, + };""") + + for version_name, id_ in version_map.items(): +- var = 'ofperr_of' + re.sub('[^A-Za-z0-9_]', '', version_name) ++ var = 'ofperr_of' + re.sub(r'[^A-Za-z0-9_]', '', version_name) + description = "OpenFlow %s" % version_name + output_domain(reverse[id_], var, description, id_) + ++ + if __name__ == '__main__': + if '--help' in sys.argv: + usage() diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields -index efec59c25..05d3e1df3 100755 +index efec59c25..89d80c208 100755 --- a/build-aux/extract-ofp-fields +++ b/build-aux/extract-ofp-fields @@ -4,9 +4,9 @@ import getopt @@ -164,15 +768,55 @@ index efec59c25..05d3e1df3 100755 extract_ofp_fields, PREREQS, OXM_CLASSES, -@@ -216,7 +216,7 @@ def field_to_xml(field_node, f, body, summary): - """.PP - \\fB%s Field\\fR +@@ -167,9 +167,9 @@ def make_nx_match(meta_flow_h): + print(oline) + + +-## ------------------------ ## +-## Documentation Generation ## +-## ------------------------ ## ++# ------------------------ # ++# Documentation Generation # ++# ------------------------ # + + + def field_to_xml(field_node, f, body, summary): +@@ -189,9 +189,9 @@ def field_to_xml(field_node, f, body, summary): + ovs_version = [int(x) for x in ovs_version_s.split(".")] + if min_ovs_version is None or ovs_version < min_ovs_version: + min_ovs_version = ovs_version +- summary += ["\\fB%s\\fR" % f["name"]] ++ summary += [r"\fB%s\fR" % f["name"]] + if f["extra_name"]: +- summary += [" aka \\fB%s\\fR" % f["extra_name"]] ++ summary += [r" aka \fB%s\fR" % f["extra_name"]] + summary += [";%d" % f["n_bytes"]] + if f["n_bits"] != 8 * f["n_bytes"]: + summary += [" (low %d bits)" % f["n_bits"]] +@@ -213,18 +213,18 @@ def field_to_xml(field_node, f, body, summary): + title = field_node.attributes["title"].nodeValue + + body += [ +- """.PP +-\\fB%s Field\\fR ++ r""".PP ++\fB%s Field\fR .TS -tab(;); +tab(;),nowarn; l lx. """ % title + ] + +- body += ["Name:;\\fB%s\\fR" % f["name"]] ++ body += [r"Name:;\fB%s\fR" % f["name"]] + if f["extra_name"]: +- body += [" (aka \\fB%s\\fR)" % f["extra_name"]] ++ body += [r" (aka \fB%s\fR)" % f["extra_name"]] + body += ["\n"] + + body += ["Width:;"] @@ -297,7 +297,7 @@ l lx. body += [".TE\n"] @@ -182,7 +826,7 @@ index efec59c25..05d3e1df3 100755 def group_xml_to_nroff(group_node, fields): -@@ -310,14 +310,14 @@ def group_xml_to_nroff(group_node, fields): +@@ -310,17 +310,18 @@ def group_xml_to_nroff(group_node, fields): id_ = node.attributes["id"].nodeValue field_to_xml(node, fields[id_], body, summary) else: @@ -199,16 +843,74 @@ index efec59c25..05d3e1df3 100755 + "tab(;),nowarn;\n", "l l l l l l l.\n", "Name;Bytes;Mask;RW?;Prereqs;NXM/OXM Support\n", - "\_;\_;\_;\_;\_;\_\n", -@@ -329,7 +329,7 @@ def group_xml_to_nroff(group_node, fields): +- "\_;\_;\_;\_;\_;\_\n", ++ r"\_;\_;\_;\_;\_;\_", ++ "\n", + ] + content += summary + content += [".TE\n"] +@@ -329,7 +330,7 @@ def group_xml_to_nroff(group_node, fields): def make_oxm_classes_xml(document): - s = """tab(;); -+ s = """tab(;),nowarn; ++ s = r"""tab(;),nowarn; l l l. Prefix;Vendor;Class \_;\_;\_ +@@ -367,42 +368,41 @@ def make_ovs_fields(meta_flow_h, meta_flow_xml): + doc = document.documentElement + + global version +- if version == None: ++ if version is None: + version = "UNKNOWN" + + print( +- """\ +-'\\" tp +-.\\" -*- mode: troff; coding: utf-8 -*- ++ r"""'\" tp ++.\" -*- mode: troff; coding: utf-8 -*- + .TH "ovs\-fields" 7 "%s" "Open vSwitch" "Open vSwitch Manual" +-.fp 5 L CR \\" Make fixed-width font available as \\fL. ++.fp 5 L CR \" Make fixed-width font available as \fL. + .de ST + . PP + . RS -0.15in +-. I "\\\\$1" ++. I "\\$1" + . RE + .. + + .de SU + . PP +-. I "\\\\$1" ++. I "\\$1" + .. + + .de IQ + . br + . ns +-. IP "\\\\$1" ++. IP "\\$1" + .. + + .de TQ + . br + . ns +-. TP "\\\\$1" ++. TP "\\$1" + .. + .de URL +-\\\\$2 \\(laURL: \\\\$1 \\(ra\\\\$3 ++\\$2 \(laURL: \\$1 \(ra\\$3 + .. +-.if \\n[.g] .mso www.tmac ++.if \n[.g] .mso www.tmac + .SH NAME + ovs\-fields \- protocol header fields in OpenFlow and Open vSwitch + . @@ -422,7 +422,7 @@ ovs\-fields \- protocol header fields in OpenFlow and Open vSwitch elif node.nodeType == node.COMMENT_NODE: pass @@ -218,6 +920,125 @@ index efec59c25..05d3e1df3 100755 for f in fields: if "used" not in f: +@@ -460,9 +460,9 @@ ovs\-fields \- protocol header fields in OpenFlow and Open vSwitch + print(output[i]) + + +-## ------------ ## +-## Main Program ## +-## ------------ ## ++# ------------ # ++# Main Program # ++# ------------ # + + if __name__ == "__main__": + argv0 = sys.argv[0] +diff --git a/build-aux/extract-ofp-msgs b/build-aux/extract-ofp-msgs +index 6b3295cf6..c26ea1d35 100755 +--- a/build-aux/extract-ofp-msgs ++++ b/build-aux/extract-ofp-msgs +@@ -24,6 +24,9 @@ OFPT11_STATS_REQUEST = 18 + OFPT11_STATS_REPLY = 19 + OFPST_VENDOR = 0xffff + ++n_errors = 0 ++ ++ + def decode_version_range(range): + if range in VERSION: + return (VERSION[range], VERSION[range]) +@@ -35,6 +38,7 @@ def decode_version_range(range): + a, b = re.match(r'^([^-]+)-([^-]+)$', range).groups() + return (VERSION[a], VERSION[b]) + ++ + def get_line(): + global line + global line_number +@@ -43,16 +47,18 @@ def get_line(): + if line == "": + fatal("unexpected end of input") + +-n_errors = 0 ++ + def error(msg): + global n_errors + sys.stderr.write("%s:%d: %s\n" % (file_name, line_number, msg)) + n_errors += 1 + ++ + def fatal(msg): + error(msg) + sys.exit(1) + ++ + def usage(): + argv0 = os.path.basename(sys.argv[0]) + print('''\ +@@ -65,6 +71,7 @@ only controls #line directives in the output.\ + ''' % {"argv0": argv0}) + sys.exit(0) + ++ + def make_sizeof(s): + m = re.match(r'(.*) up to (.*)', s) + if m: +@@ -73,9 +80,8 @@ def make_sizeof(s): + else: + return "sizeof(%s)" % s + +-def extract_ofp_msgs(output_file_name): +- raw_types = [] + ++def extract_ofp_msgs(output_file_name): + all_hdrs = {} + all_raws = {} + all_raws_order = [] +@@ -108,15 +114,16 @@ def extract_ofp_msgs(output_file_name): + comment += ' %s' % line.lstrip('* \t').rstrip(' \t\r\n') + comment = comment[:-2].rstrip() + +- m = re.match(r'([A-Z]+) ([-.+\d]+|) \((\d+)\): ([^.]+)\.$', comment) ++ m = re.match( ++ r'([A-Z]+) ([-.+\d]+|) \((\d+)\): ([^.]+)\.$', comment ++ ) + if not m: + fatal("unexpected syntax between messages") + type_, versions, number, contents = m.groups() + number = int(number) + + get_line() +- m = re.match('\s+(?:OFPRAW_%s)(\d*)_([A-Z0-9_]+),?$' % type_, +- line) ++ m = re.match(r'\s+(?:OFPRAW_%s)(\d*)_([A-Z0-9_]+),?$' % type_, line) + if not m: + fatal("syntax error expecting OFPRAW_ enum") + vinfix, name = m.groups() +@@ -300,7 +307,7 @@ def extract_ofp_msgs(output_file_name): + for hdrs in r['hdrs']: + output.append(" { {0, NULL}, {%d, %d, %d, 0x%x, %d}, %s, 0 }," + % (hdrs + (raw,))) +- ++ + output.append("};") + + output.append("") +@@ -349,8 +356,8 @@ def extract_ofp_msgs(output_file_name): + % r["human_name"]) + output.append("};") + +- output.append(""); +- output.append("static const char *type_names[] = {"); ++ output.append("") ++ output.append("static const char *type_names[] = {") + for t in all_types: + output.append(" \"%s\"," % t) + output.append("};") +@@ -378,4 +385,3 @@ if __name__ == '__main__': + + for line in extract_ofp_msgs(sys.argv[2]): + print(line) +- diff --git a/build-aux/gen_ofp_field_decoders b/build-aux/gen_ofp_field_decoders index 0b797ee8c..0cb6108c2 100755 --- a/build-aux/gen_ofp_field_decoders @@ -334,6 +1155,17 @@ index 320509c5f..764479514 100644 AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_CPP +diff --git a/datapath-windows/include/automake.mk b/datapath-windows/include/automake.mk +index a354f007f..185a06b03 100644 +--- a/datapath-windows/include/automake.mk ++++ b/datapath-windows/include/automake.mk +@@ -7,6 +7,4 @@ $(srcdir)/datapath-windows/include/OvsDpInterface.h: \ + build-aux/extract-odp-netlink-windows-dp-h + $(AM_V_GEN)sed -f $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h < $< > $@ + +-EXTRA_DIST += $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h +- + CLEANFILES += $(srcdir)/datapath-windows/include/OvsDpInterface.h diff --git a/debian/changelog b/debian/changelog index 8757e5cb2..780d1e2d8 100644 --- a/debian/changelog @@ -354,6 +1186,29 @@ index 8757e5cb2..780d1e2d8 100644 openvswitch (3.2.0-1) unstable; urgency=low * New upstream version +diff --git a/include/automake.mk b/include/automake.mk +index 1e3390ae0..a276c680b 100644 +--- a/include/automake.mk ++++ b/include/automake.mk +@@ -8,7 +8,6 @@ include/odp-netlink-macros.h: include/odp-netlink.h \ + build-aux/extract-odp-netlink-macros-h + $(AM_V_GEN)sh -f $(srcdir)/build-aux/extract-odp-netlink-macros-h $< > $@ + +-EXTRA_DIST += build-aux/extract-odp-netlink-h build-aux/extract-odp-netlink-macros-h + CLEANFILES += include/odp-netlink.h include/odp-netlink-macros.h + + include include/openflow/automake.mk +diff --git a/include/openflow/automake.mk b/include/openflow/automake.mk +index a1d75756c..820c09f84 100644 +--- a/include/openflow/automake.mk ++++ b/include/openflow/automake.mk +@@ -22,6 +22,3 @@ HSTAMP_FILES = $(openflowinclude_HEADERS:.h=.hstamp) + CLEANFILES += $(HSTAMP_FILES) + ALL_LOCAL += $(HSTAMP_FILES) + $(HSTAMP_FILES): build-aux/check-structs $(openflowinclude_HEADERS) +- +-EXTRA_DIST += build-aux/check-structs +- diff --git a/include/openvswitch/compiler.h b/include/openvswitch/compiler.h index cf009f826..52614a5ac 100644 --- a/include/openvswitch/compiler.h @@ -376,7 +1231,7 @@ index cf009f826..52614a5ac 100644 #define OVS_UNUSED __attribute__((__unused__)) #define OVS_PRINTF_FORMAT(FMT, ARG1) __attribute__((__format__(printf, FMT, ARG1))) diff --git a/lib/automake.mk b/lib/automake.mk -index e64ee76ce..24b0ffefe 100644 +index e64ee76ce..1be13a420 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -451,7 +451,7 @@ lib_libsflow_la_SOURCES = \ @@ -388,6 +1243,37 @@ index e64ee76ce..24b0ffefe 100644 if HAVE_WNO_UNUSED lib_libsflow_la_CFLAGS += -Wno-unused endif +@@ -642,7 +642,6 @@ lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields include/openvswitch/met + $(AM_V_at)mv $@.tmp $@ + lib/nx-match.lo: lib/nx-match.inc + CLEANFILES += lib/meta-flow.inc lib/nx-match.inc +-EXTRA_DIST += build-aux/extract-ofp-fields + + lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c + $(AM_V_GEN)$(run_python) $< prototypes $(srcdir)/lib/ofp-actions.c > $@.tmp && mv $@.tmp $@ +@@ -650,7 +649,6 @@ lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c + $(AM_V_GEN)$(run_python) $< definitions $(srcdir)/lib/ofp-actions.c > $@.tmp && mv $@.tmp $@ + lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2 + CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2 +-EXTRA_DIST += build-aux/extract-ofp-actions + + lib/ofp-errors.inc: include/openvswitch/ofp-errors.h include/openflow/openflow-common.h \ + $(srcdir)/build-aux/extract-ofp-errors +@@ -660,14 +658,12 @@ lib/ofp-errors.inc: include/openvswitch/ofp-errors.h include/openflow/openflow-c + mv $@.tmp $@ + lib/ofp-errors.lo: lib/ofp-errors.inc + CLEANFILES += lib/ofp-errors.inc +-EXTRA_DIST += build-aux/extract-ofp-errors + + lib/ofp-msgs.inc: include/openvswitch/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs + $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \ + $(srcdir)/include/openvswitch/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@ + lib/ofp-msgs.lo: lib/ofp-msgs.inc + CLEANFILES += lib/ofp-msgs.inc +-EXTRA_DIST += build-aux/extract-ofp-msgs + + # _server IDL + OVSIDL_BUILT += lib/ovsdb-server-idl.c lib/ovsdb-server-idl.h lib/ovsdb-server-idl.ovsidl diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c index 5d2635946..3a8068b12 100644 --- a/lib/db-ctl-base.c @@ -1094,6 +1980,19 @@ index 9fc2159b0..16ece0334 100644 elif self.state == self.IDL_S_DATA_MONITOR_COND_REQUESTED: self.__clear() self.__parse_update(msg.result, OVSDB_UPDATE2) +diff --git a/python/ovs/jsonrpc.py b/python/ovs/jsonrpc.py +index d5127268a..d9fe27aec 100644 +--- a/python/ovs/jsonrpc.py ++++ b/python/ovs/jsonrpc.py +@@ -377,7 +377,7 @@ class Session(object): + self.stream = None + self.pstream = None + self.seqno = 0 +- if type(remotes) != list: ++ if type(remotes) is not list: + remotes = [remotes] + self.remotes = remotes + random.shuffle(self.remotes) diff --git a/python/build/__init__.py b/python/ovs_build_helpers/__init__.py similarity index 100% rename from python/build/__init__.py @@ -2857,6 +3756,26 @@ index 25275d9ae..7bdb8154d 100644 printf("%s: ", prefix); for (i = 0; i < n_threads; i++) { if (thread_working_ms[i] >= TIMEOUT_MS) { +diff --git a/tests/test-jsonrpc.py b/tests/test-jsonrpc.py +index 1df5afa22..8a4a17593 100644 +--- a/tests/test-jsonrpc.py ++++ b/tests/test-jsonrpc.py +@@ -199,13 +199,13 @@ notify REMOTE METHOD PARAMS send notification and exit + sys.exit(1) + + func, n_args = commands[command_name] +- if type(n_args) == tuple: ++ if type(n_args) is tuple: + if len(args) < n_args[0]: + sys.stderr.write("%s: \"%s\" requires at least %d arguments but " + "only %d provided\n" + % (argv[0], command_name, n_args, len(args))) + sys.exit(1) +- elif type(n_args) == int: ++ elif type(n_args) is int: + if len(args) != n_args: + sys.stderr.write("%s: \"%s\" requires %d arguments but %d " + "provided\n" diff --git a/tests/test-mpsc-queue.c b/tests/test-mpsc-queue.c index a38bf9e6d..86a223caf 100644 --- a/tests/test-mpsc-queue.c @@ -2885,6 +3804,61 @@ index a38bf9e6d..86a223caf 100644 printf("%s: %6d", prefix, reader_elapsed); for (i = 0; i < n_threads; i++) { printf(" %6" PRIu64, thread_working_ms[i]); +diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py +index a841adba4..71248854f 100644 +--- a/tests/test-ovsdb.py ++++ b/tests/test-ovsdb.py +@@ -37,7 +37,7 @@ vlog.init(None) + + + def unbox_json(json): +- if type(json) == list and len(json) == 1: ++ if type(json) is list and len(json) == 1: + return json[0] + else: + return json +@@ -325,9 +325,9 @@ def substitute_uuids(json, symtab): + symbol = symtab.get(json) + if symbol: + return str(symbol) +- elif type(json) == list: ++ elif type(json) is list: + return [substitute_uuids(element, symtab) for element in json] +- elif type(json) == dict: ++ elif type(json) is dict: + d = {} + for key, value in json.items(): + d[key] = substitute_uuids(value, symtab) +@@ -341,10 +341,10 @@ def parse_uuids(json, symtab): + name = "#%d#" % len(symtab) + sys.stderr.write("%s = %s\n" % (name, json)) + symtab[name] = json +- elif type(json) == list: ++ elif type(json) is list: + for element in json: + parse_uuids(element, symtab) +- elif type(json) == dict: ++ elif type(json) is dict: + for value in json.values(): + parse_uuids(value, symtab) + +@@ -1049,14 +1049,14 @@ def main(argv): + sys.exit(1) + + func, n_args = commands[command_name] +- if type(n_args) == tuple: ++ if type(n_args) is tuple: + if len(args) < n_args[0]: + sys.stderr.write("%s: \"%s\" requires at least %d arguments but " + "only %d provided\n" + % (ovs.util.PROGRAM_NAME, command_name, + n_args[0], len(args))) + sys.exit(1) +- elif type(n_args) == int: ++ elif type(n_args) is int: + if len(args) != n_args: + sys.stderr.write("%s: \"%s\" requires %d arguments but %d " + "provided\n" diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index cfcde34ff..e400043ce 100644 --- a/vswitchd/vswitch.xml diff --git a/SPECS/openvswitch3.2.spec b/SPECS/openvswitch3.2.spec index d5fa780..38516aa 100644 --- a/SPECS/openvswitch3.2.spec +++ b/SPECS/openvswitch3.2.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.2.0 -Release: 31%{?dist} +Release: 32%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -761,6 +761,18 @@ exit 0 %endif %changelog +* Wed Nov 01 2023 Open vSwitch CI - 3.2.0-32 +- Merging upstream branch-3.2 [RH git: 109500e1ee] + Commit list: + 0dd10cd803 flake8: Fix E721 check failures. + c0275d6a16 build-aux: Enable flake8 checks for python extraction scripts. + bc261b9597 build-aux/extract-ofp-msgs: Fix flake8 and syntax errors. + 8e50fc7935 build-aux/extract-ofp-fields: Fix flake8 and syntax errors. + 374a7bf631 build-aux/extract-ofp-errors: Fix flake8 and syntax errors. + 0634be9426 build-aux/extract-ofp-actions: Fix flake8 and syntax errors. + e76ecab431 automake: Move build-aux EXTRA_DIST updates to their own file. + + * Tue Oct 31 2023 Open vSwitch CI - 3.2.0-31 - Merging upstream branch-3.2 [RH git: d76eaaa84f] Commit list: