From 860bc9b28f70b64cfa9a10727007bc36e7d36c89 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Apr 03 2025 19:59:01 +0000 Subject: Import openvswitch3.5-3.5.0-15 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.5.0.patch b/SOURCES/openvswitch-3.5.0.patch index 062fe65..aeb40c6 100644 --- a/SOURCES/openvswitch-3.5.0.patch +++ b/SOURCES/openvswitch-3.5.0.patch @@ -36,6 +36,22 @@ index d90b9273a6..cea15fbb52 100644 - name: prepare run: ./.ci/linux-prepare.sh +diff --git a/Makefile.am b/Makefile.am +index a61a1cadfb..cdcc4e9bdb 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -406,9 +406,10 @@ ALL_LOCAL += flake8-check + # W504 line break after binary operator + # F*** -- warnings native to flake8 + # F811 redefinition of unused from line (only from flake8 v2.0) ++# F824 a `global` or `nonlocal` statement where the name is never reassigned + # D*** -- warnings from flake8-docstrings plugin + # H*** -- warnings from flake8 hacking plugin (custom style checks beyond PEP8) +-FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,E203,E722,W503,W504,F811,D,H,I ++FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,E203,E722,W503,W504,F811,F824,D,H,I + flake8-check: $(FLAKE8_PYFILES) + $(FLAKE8_WERROR)$(AM_V_GEN) \ + src='$^' && \ diff --git a/NEWS b/NEWS index 2e5356c5cd..c670cf8f35 100644 --- a/NEWS @@ -92,9 +108,45 @@ index e59ff17ade..d9962765f1 100644 nh_s_ip6 = s_ip6; } diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c -index bf43d5d4bc..2f79be79a3 100644 +index bf43d5d4bc..354357b50a 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c +@@ -102,7 +102,7 @@ struct ofbundle { + * NULL if all VLANs are trunked. */ + unsigned long *cvlans; + struct lacp *lacp; /* LACP if LACP is enabled, otherwise NULL. */ +- struct bond *bond; /* Nonnull iff more than one port. */ ++ struct bond *bond; /* Nonnull if more than one port. */ + enum port_priority_tags_mode use_priority_tags; + /* Use 802.1p tag for frames in VLAN 0? */ + +@@ -1508,7 +1508,7 @@ check_max_dp_hash_alg(struct dpif_backer *backer) + ofpbuf_use_stack(&key, &keybuf, sizeof keybuf); + odp_flow_key_from_flow(&odp_parms, &key); + +- /* All datapaths support algortithm 0 (OVS_HASH_ALG_L4). */ ++ /* All datapaths support algorithm 0 (OVS_HASH_ALG_L4). */ + for (int alg = 1; alg < __OVS_HASH_MAX; alg++) { + struct ofpbuf actions; + bool ok; +@@ -3642,7 +3642,7 @@ bundle_set(struct ofproto *ofproto_, void *aux, + bundle->bond = NULL; + } + +- /* Set proteced port mode */ ++ /* Set protected port mode. */ + if (s->protected != bundle->protected) { + bundle->protected = s->protected; + need_flush = true; +@@ -4609,7 +4609,7 @@ ofproto_dpif_credit_table_stats(struct ofproto_dpif *ofproto, uint8_t table_id, + + /* Look up 'flow' in 'ofproto''s classifier version 'version', starting from + * table '*table_id'. Returns the rule that was found, which may be one of the +- * special rules according to packet miss hadling. If 'may_packet_in' is ++ * special rules according to packet miss handling. If 'may_packet_in' is + * false, returning of the miss_rule (which issues packet ins for the + * controller) is avoided. Updates 'wc', if nonnull, to reflect the fields + * that were used during the lookup. @@ -5392,7 +5392,6 @@ group_set_selection_method(struct group_dpif *group) const struct ofputil_group_props *props = &group->up.props; const char *selection_method = props->selection_method; @@ -133,7 +185,69 @@ index bf43d5d4bc..2f79be79a3 100644 static enum ofperr group_get_stats(const struct ofgroup *group_, struct ofputil_group_stats *ogs) { -@@ -7299,7 +7314,7 @@ const struct ofproto_class ofproto_dpif_class = { +@@ -6477,7 +6492,7 @@ struct dpif_support_field { + enum dpif_support_field_type type; + }; + +-#define DPIF_SUPPORT_FIELD_INTIALIZER(RT_PTR, BT_PTR, TITLE, TYPE) \ ++#define DPIF_SUPPORT_FIELD_INITIALIZER(RT_PTR, BT_PTR, TITLE, TYPE) \ + (struct dpif_support_field) {RT_PTR, BT_PTR, TITLE, TYPE} + + static void +@@ -6543,26 +6558,26 @@ dpif_set_support(struct dpif_backer_support *rt_support, + struct shash_node *node; + bool changed = false; + +-#define DPIF_SUPPORT_FIELD(TYPE, NAME, TITLE) \ +- {\ +- struct dpif_support_field *f = xmalloc(sizeof *f); \ +- *f = DPIF_SUPPORT_FIELD_INTIALIZER(&rt_support->NAME, \ +- &bt_support->NAME, \ +- TITLE, \ +- DPIF_SUPPORT_FIELD_##TYPE);\ +- shash_add_once(&all_fields, #NAME, f); \ ++#define DPIF_SUPPORT_FIELD(TYPE, NAME, TITLE) \ ++ { \ ++ struct dpif_support_field *f = xmalloc(sizeof *f); \ ++ *f = DPIF_SUPPORT_FIELD_INITIALIZER(&rt_support->NAME, \ ++ &bt_support->NAME, \ ++ TITLE, \ ++ DPIF_SUPPORT_FIELD_##TYPE); \ ++ shash_add_once(&all_fields, #NAME, f); \ + } + DPIF_SUPPORT_FIELDS; + #undef DPIF_SUPPORT_FIELD + +-#define ODP_SUPPORT_FIELD(TYPE, NAME, TITLE) \ +- {\ +- struct dpif_support_field *f = xmalloc(sizeof *f); \ +- *f = DPIF_SUPPORT_FIELD_INTIALIZER(&rt_support->odp.NAME, \ +- &bt_support->odp.NAME, \ +- TITLE, \ +- DPIF_SUPPORT_FIELD_##TYPE);\ +- shash_add_once(&all_fields, #NAME, f); \ ++#define ODP_SUPPORT_FIELD(TYPE, NAME, TITLE) \ ++ { \ ++ struct dpif_support_field *f = xmalloc(sizeof *f); \ ++ *f = DPIF_SUPPORT_FIELD_INITIALIZER(&rt_support->odp.NAME, \ ++ &bt_support->odp.NAME, \ ++ TITLE, \ ++ DPIF_SUPPORT_FIELD_##TYPE); \ ++ shash_add_once(&all_fields, #NAME, f); \ + } + ODP_SUPPORT_FIELDS; + #undef ODP_SUPPORT_FIELD +@@ -6597,7 +6612,8 @@ dpif_set_support(struct dpif_backer_support *rt_support, + *(bool *) field->rt_ptr = true; + changed = true; + } else { +- ds_put_cstr(ds, "Can not enable features not supported by the datapth"); ++ ds_put_cstr(ds, ++ "Can not enable features not supported by the datapath"); + } + } else if (!strcasecmp(value, "false")) { + *(bool *)field->rt_ptr = false; +@@ -7299,7 +7315,7 @@ const struct ofproto_class ofproto_dpif_class = { group_construct, /* group_construct */ group_destruct, /* group_destruct */ group_dealloc, /* group_dealloc */ @@ -180,6 +294,104 @@ index 2282905ed6..4b4b07d032 100644 if sys.platform != 'win32': error, sock = ovs.socket_util.make_unix_socket( socket.SOCK_STREAM, True, bind_path, None) +diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service +index 558632320c..43ea3a5703 100644 +--- a/rhel/usr_lib_systemd_system_ovsdb-server.service ++++ b/rhel/usr_lib_systemd_system_ovsdb-server.service +@@ -18,7 +18,8 @@ EnvironmentFile=-/run/openvswitch.useropts + # OVS_USER_ID from default.conf or sysconfig. + ExecStartPre=/usr/bin/rm -f /run/openvswitch.useropts + +-ExecStartPre=-/usr/bin/chown ${OVS_USER_ID} /run/openvswitch /var/log/openvswitch ++ExecStartPre=-/usr/bin/chown -R ${OVS_USER_ID} \ ++ /etc/openvswitch /run/openvswitch /var/log/openvswitch + ExecStartPre=/bin/sh -c '/usr/bin/echo "OVS_USER_ID=${OVS_USER_ID}" > /run/openvswitch.useropts' + ExecStartPre=/bin/sh -c 'if [ "$${OVS_USER_ID/:*/}" != "root" ]; then /usr/bin/echo "OVS_USER_OPT=--ovs-user=${OVS_USER_ID}" >> /run/openvswitch.useropts; fi' + ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ +diff --git a/tests/checkpatch.at b/tests/checkpatch.at +index 2ed2ec878b..3182ca8808 100755 +--- a/tests/checkpatch.at ++++ b/tests/checkpatch.at +@@ -38,6 +38,31 @@ Subject: Patch this is. + $top_srcdir/utilities/checkpatch.py $3 -q test.patch]) + fi + } ++ ++# try_checkpatch_c_file SOURCE [ERRORS] [CHECKPATCH-ARGS] ++# ++# Runs checkpatch against test SOURCE expecting the set of specified ++# ERRORS (and warnings). Optionally, sets [CHECKPATCH-ARGS] ++try_checkpatch_c_file() { ++ echo "$1" | sed 's/^ //' > test.c ++ ++ # Take expected output from $2. ++ if test -n "$2"; then ++ echo "$2" | sed 's/^ //' > expout ++ else ++ : > expout ++ fi ++ ++ if test -s expout; then ++ AT_CHECK([OVS_SRC_DIR=$top_srcdir $PYTHON3 \ ++ $top_srcdir/utilities/checkpatch.py $3 -q -f test.c], ++ [1], [stdout]) ++ AT_CHECK([sed '/^Lines checked:/,$d' stdout], [0], [expout]) ++ else ++ AT_CHECK([OVS_SRC_DIR=$top_srcdir $PYTHON3 \ ++ $top_srcdir/utilities/checkpatch.py $3 -q -f test.c]) ++ fi ++} + OVS_END_SHELL_HELPERS + + AT_SETUP([checkpatch - sign-offs]) +@@ -657,3 +682,47 @@ try_checkpatch \ + "-a" + + AT_CLEANUP ++ ++AT_SETUP([checkpatch - file contents checks - bare return]) ++try_checkpatch_c_file \ ++ "#include ++ #include ++ ++ void foo() { ++ return; ++ }" \ ++ "WARNING: Empty return followed by brace, consider omitting ++ test.c:6: ++ } ++ " ++AT_CLEANUP ++ ++AT_SETUP([checkpatch - file contents checks - parenthesized constructs]) ++ ++for ctr in 'if' 'while' 'switch' 'HMAP_FOR_EACH' 'BITMAP_FOR_EACH_1'; do ++try_checkpatch_c_file \ ++ "#include ++ #include ++ ++ void foo() { ++ $ctr (check_node) { ++ something(check_node); ++ } ++ } ++ " ++ ++try_checkpatch_c_file \ ++ "#include ++ #include ++ ++ void foo() { ++ $ctr ( first_run) { ++ something(check_node); ++ } ++ }" \ ++ "ERROR: Improper whitespace around control block ++ test.c:5: ++ $ctr ( first_run) { ++ " ++done ++AT_CLEANUP diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at index 60060ee2e0..920bbcac0b 100644 --- a/tests/dpif-netdev.at @@ -619,6 +831,26 @@ index 57fc1d4497..b690b4f076 100644 elif name == "add_op": if len(args) != 1: sys.stderr.write('"add_op" command requires 1 argument\n') +diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py +index fe6aa79b0d..4a4d9dbaa3 100755 +--- a/utilities/checkpatch.py ++++ b/utilities/checkpatch.py +@@ -1184,10 +1184,12 @@ def ovs_checkpatch_file(filename): + else: + mail.add_header('Subject', sys.argv[-1]) + +- print("Subject missing! Your provisional subject is", +- mail['Subject']) ++ if not checking_file: ++ print("Subject missing! Your provisional subject is", ++ mail['Subject']) + +- if run_subject_checks('Subject: ' + mail['Subject'], spellcheck): ++ if not checking_file and run_subject_checks('Subject: ' + mail['Subject'], ++ spellcheck): + result = True + + ovs_checkpatch_print_result() diff --git a/dpdk/VERSION b/dpdk/VERSION index 0a492611a0..9e2934aa34 100644 --- a/dpdk/VERSION diff --git a/SPECS/openvswitch3.5.spec b/SPECS/openvswitch3.5.spec index 751da53..806b6ea 100644 --- a/SPECS/openvswitch3.5.spec +++ b/SPECS/openvswitch3.5.spec @@ -59,7 +59,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.5.0 -Release: 14%{?dist} +Release: 15%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -796,6 +796,15 @@ exit 0 %endif %changelog +* Thu Apr 03 2025 Open vSwitch CI - 3.5.0-15 +- Merging upstream branch-3.5 [RH git: 1d1bff6c83] + Commit list: + bb05933349 python: Disable check for globals with never reassigned names (F824). + c4045edc2b ofproto-dpif: Fix spelling in comments and the support field macro. + 073a2a1611 checkpatch.py: Don't run subject checks in source-file mode. + b6157a0366 rhel/systemd: Change owner recursively and also on /etc/openvswitch. + + * Wed Mar 26 2025 Open vSwitch CI - 3.5.0-14 - Merging upstream branch-3.5 [RH git: 560ba67c02] Commit list: