From 49ee228d257ced9f995faaa4b8fc5b4734a13ee1 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Oct 31 2023 18:38:25 +0000 Subject: Import openvswitch2.17-2.17.0-119 from Fast DataPath --- diff --git a/SOURCES/openvswitch-2.17.0.patch b/SOURCES/openvswitch-2.17.0.patch index c6781d5..7ee044d 100644 --- a/SOURCES/openvswitch-2.17.0.patch +++ b/SOURCES/openvswitch-2.17.0.patch @@ -53368,7 +53368,7 @@ index 66016eb099..7425dd44e7 100644 /* Statistics. */ struct dp_netdev_flow_stats stats; diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c -index 9f35713ef5..f1895aae36 100644 +index 9f35713ef5..6ef23ed5c3 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -93,7 +93,8 @@ VLOG_DEFINE_THIS_MODULE(dpif_netdev); @@ -53573,7 +53573,18 @@ index 9f35713ef5..f1895aae36 100644 if (put->pmd_id == PMD_ID_NULL) { if (cmap_count(&dp->poll_threads) == 0) { -@@ -4778,8 +4818,8 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) +@@ -4668,6 +4708,10 @@ dpif_netdev_offload_stats_get(struct dpif *dpif, + } + + nb_thread = netdev_offload_thread_nb(); ++ if (!nb_thread) { ++ return EINVAL; ++ } ++ + /* nb_thread counters for the overall total as well. */ + stats->size = ARRAY_SIZE(hwol_stats) * (nb_thread + 1); + stats->counters = xcalloc(stats->size, sizeof *stats->counters); +@@ -4778,8 +4822,8 @@ 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; @@ -53584,7 +53595,7 @@ index 9f35713ef5..f1895aae36 100644 bool log_autolb = false; enum sched_assignment_type pmd_rxq_assign_type; -@@ -4880,8 +4920,12 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) +@@ -4880,8 +4924,12 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) struct pmd_auto_lb *pmd_alb = &dp->pmd_alb; @@ -53599,7 +53610,7 @@ index 9f35713ef5..f1895aae36 100644 /* Input is in min, convert it to msec. */ rebalance_intvl = -@@ -4894,21 +4938,21 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) +@@ -4894,21 +4942,21 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) log_autolb = true; } @@ -53627,7 +53638,7 @@ index 9f35713ef5..f1895aae36 100644 if (rebalance_load > 100) { rebalance_load = ALB_LOAD_THRESHOLD; } -@@ -4916,7 +4960,7 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) +@@ -4916,7 +4964,7 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) if (rebalance_load != cur_rebalance_load) { atomic_store_relaxed(&pmd_alb->rebalance_load_thresh, rebalance_load); @@ -53636,7 +53647,7 @@ index 9f35713ef5..f1895aae36 100644 rebalance_load); log_autolb = true; } -@@ -5425,7 +5469,6 @@ port_reconfigure(struct dp_netdev_port *port) +@@ -5425,7 +5473,6 @@ port_reconfigure(struct dp_netdev_port *port) port->rxqs[i].port = port; port->rxqs[i].is_vhost = !strncmp(port->type, "dpdkvhost", 9); @@ -53644,7 +53655,7 @@ index 9f35713ef5..f1895aae36 100644 err = netdev_rxq_open(netdev, &port->rxqs[i].rx, i); if (err) { -@@ -5684,23 +5727,28 @@ sched_numa_list_put_in_place(struct sched_numa_list *numa_list) +@@ -5684,23 +5731,28 @@ sched_numa_list_put_in_place(struct sched_numa_list *numa_list) } } @@ -53678,7 +53689,7 @@ index 9f35713ef5..f1895aae36 100644 rxq->pmd->numa_id != netdev_get_numa_id(rxq->port->netdev)) { return true; -@@ -6000,10 +6048,10 @@ sched_numa_list_schedule(struct sched_numa_list *numa_list, +@@ -6000,10 +6052,10 @@ sched_numa_list_schedule(struct sched_numa_list *numa_list, /* Find any numa with available PMDs. */ for (int j = 0; j < n_numa; j++) { numa = sched_numa_list_next(numa_list, last_cross_numa); @@ -53690,7 +53701,7 @@ index 9f35713ef5..f1895aae36 100644 numa = NULL; } } -@@ -6111,7 +6159,7 @@ sched_numa_list_variance(struct sched_numa_list *numa_list) +@@ -6111,7 +6163,7 @@ sched_numa_list_variance(struct sched_numa_list *numa_list) * pmd_rebalance_dry_run() can be avoided when it is not needed. */ static bool @@ -53699,7 +53710,7 @@ index 9f35713ef5..f1895aae36 100644 OVS_REQ_RDLOCK(dp->port_rwlock) { struct dp_netdev_pmd_thread *pmd; -@@ -6342,11 +6390,11 @@ pmd_remove_stale_ports(struct dp_netdev *dp, +@@ -6342,11 +6394,11 @@ pmd_remove_stale_ports(struct dp_netdev *dp, OVS_EXCLUDED(pmd->port_mutex) OVS_REQ_RDLOCK(dp->port_rwlock) { @@ -53714,7 +53725,7 @@ index 9f35713ef5..f1895aae36 100644 struct dp_netdev_port *port = poll->rxq->port; if (port->need_reconfigure -@@ -6354,7 +6402,7 @@ pmd_remove_stale_ports(struct dp_netdev *dp, +@@ -6354,7 +6406,7 @@ pmd_remove_stale_ports(struct dp_netdev *dp, dp_netdev_del_rxq_from_pmd(pmd, poll); } } @@ -53723,7 +53734,7 @@ index 9f35713ef5..f1895aae36 100644 struct dp_netdev_port *port = tx->port; if (port->need_reconfigure -@@ -6430,8 +6478,7 @@ reconfigure_datapath(struct dp_netdev *dp) +@@ -6430,8 +6482,7 @@ reconfigure_datapath(struct dp_netdev *dp) /* We only reconfigure the ports that we determined above, because they're * not being used by any pmd thread at the moment. If a port fails to * reconfigure we remove it from the datapath. */ @@ -53733,7 +53744,7 @@ index 9f35713ef5..f1895aae36 100644 int err; if (!port->need_reconfigure) { -@@ -6487,10 +6534,10 @@ reconfigure_datapath(struct dp_netdev *dp) +@@ -6487,10 +6538,10 @@ reconfigure_datapath(struct dp_netdev *dp) } CMAP_FOR_EACH (pmd, node, &dp->poll_threads) { @@ -53746,7 +53757,7 @@ index 9f35713ef5..f1895aae36 100644 if (poll->rxq->pmd != pmd) { dp_netdev_del_rxq_from_pmd(pmd, poll); -@@ -6682,7 +6729,7 @@ dpif_netdev_run(struct dpif *dpif) +@@ -6682,7 +6733,7 @@ dpif_netdev_run(struct dpif *dpif) if (pmd_rebalance && !dp_netdev_is_reconf_required(dp) && !ports_require_restart(dp) && @@ -53755,7 +53766,7 @@ index 9f35713ef5..f1895aae36 100644 pmd_rebalance_dry_run(dp)) { VLOG_INFO("PMD auto load balance dry run. " "Requesting datapath reconfigure."); -@@ -7364,15 +7411,15 @@ static struct dp_netdev_pmd_thread * +@@ -7364,15 +7415,15 @@ static struct dp_netdev_pmd_thread * dp_netdev_get_pmd(struct dp_netdev *dp, unsigned core_id) { struct dp_netdev_pmd_thread *pmd; @@ -53777,7 +53788,7 @@ index 9f35713ef5..f1895aae36 100644 } /* Sets the 'struct dp_netdev_pmd_thread' for non-pmd threads. */ -@@ -7505,6 +7552,7 @@ dp_netdev_destroy_pmd(struct dp_netdev_pmd_thread *pmd) +@@ -7505,6 +7556,7 @@ dp_netdev_destroy_pmd(struct dp_netdev_pmd_thread *pmd) seq_destroy(pmd->reload_seq); ovs_mutex_destroy(&pmd->port_mutex); ovs_mutex_destroy(&pmd->bond_mutex); @@ -53785,7 +53796,7 @@ index 9f35713ef5..f1895aae36 100644 free(pmd); } -@@ -8020,17 +8068,15 @@ dp_netdev_hw_flow(const struct dp_netdev_pmd_thread *pmd, +@@ -8020,17 +8072,15 @@ dp_netdev_hw_flow(const struct dp_netdev_pmd_thread *pmd, #ifdef ALLOW_EXPERIMENTAL_API /* Packet restoration API required. */ /* Restore the packet if HW processing was terminated before completion. */ struct dp_netdev_rxq *rxq = pmd->ctx.last_rxq; @@ -53810,7 +53821,7 @@ index 9f35713ef5..f1895aae36 100644 } } #endif -@@ -9495,6 +9541,7 @@ dpif_netdev_bond_stats_get(struct dpif *dpif, uint32_t bond_id, +@@ -9495,6 +9545,7 @@ dpif_netdev_bond_stats_get(struct dpif *dpif, uint32_t bond_id, const struct dpif_class dpif_netdev_class = { "netdev", true, /* cleanup_required */ @@ -57062,7 +57073,7 @@ index 9845e8d3fe..6fa27d1dda 100644 } diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c -index fb108c0d50..ad7c0f199f 100644 +index fb108c0d50..9a4a8daac1 100644 --- a/lib/netdev-offload.c +++ b/lib/netdev-offload.c @@ -182,6 +182,7 @@ netdev_assign_flow_api(struct netdev *netdev) @@ -57374,6 +57385,16 @@ index fb108c0d50..ad7c0f199f 100644 } void +@@ -789,7 +813,8 @@ netdev_set_flow_api_enabled(const struct smap *ovs_other_config) + offload_thread_nb = smap_get_ullong(ovs_other_config, + "n-offload-threads", + DEFAULT_OFFLOAD_THREAD_NB); +- if (offload_thread_nb > MAX_OFFLOAD_THREAD_NB) { ++ if (offload_thread_nb == 0 || ++ offload_thread_nb > MAX_OFFLOAD_THREAD_NB) { + VLOG_WARN("netdev: Invalid number of threads requested: %u", + offload_thread_nb); + offload_thread_nb = DEFAULT_OFFLOAD_THREAD_NB; diff --git a/lib/netdev-offload.h b/lib/netdev-offload.h index 8237a85ddb..13ab06d116 100644 --- a/lib/netdev-offload.h @@ -58377,6 +58398,19 @@ index a90b926efb..102b183a8f 100644 return xasprintf("invalid numeric format %s", str); } *valuep = value; +diff --git a/lib/ofp-table.c b/lib/ofp-table.c +index a956754f2d..f9bd3b7f9c 100644 +--- a/lib/ofp-table.c ++++ b/lib/ofp-table.c +@@ -1416,7 +1416,7 @@ count_common_prefix_run(const char *ids[], size_t n, + if (!next) { + break; + } else if (next < extra_prefix_len) { +- next = extra_prefix_len; ++ extra_prefix_len = next; + } + i++; + } diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c index 271105bdea..879275a7a3 100644 --- a/lib/ofpbuf.c @@ -74981,7 +75015,7 @@ index 9259b0b3fc..e50c7c3807 100644 hmap_destroy(&hmap); } diff --git a/tests/test-id-fpool.c b/tests/test-id-fpool.c -index 25275d9aef..27800aa9ba 100644 +index 25275d9aef..7bdb8154d3 100644 --- a/tests/test-id-fpool.c +++ b/tests/test-id-fpool.c @@ -14,12 +14,12 @@ @@ -74999,6 +75033,15 @@ index 25275d9aef..27800aa9ba 100644 #include "command-line.h" #include "id-fpool.h" +@@ -237,7 +237,7 @@ print_result(const char *prefix) + for (i = 0; i < n_threads; i++) { + avg += thread_working_ms[i]; + } +- avg /= n_threads; ++ avg /= n_threads ? n_threads : 1; + printf("%s: ", prefix); + for (i = 0; i < n_threads; i++) { + if (thread_working_ms[i] >= TIMEOUT_MS) { diff --git a/tests/test-json.c b/tests/test-json.c index 072a537252..fa51bb31c5 100644 --- a/tests/test-json.c @@ -75255,7 +75298,7 @@ index 6f1fb059bc..ac82f2048e 100644 } } diff --git a/tests/test-mpsc-queue.c b/tests/test-mpsc-queue.c -index a38bf9e6df..16aa804a03 100644 +index a38bf9e6df..86a223caff 100644 --- a/tests/test-mpsc-queue.c +++ b/tests/test-mpsc-queue.c @@ -14,12 +14,12 @@ @@ -75273,6 +75316,15 @@ index a38bf9e6df..16aa804a03 100644 #include "command-line.h" #include "guarded-list.h" +@@ -315,7 +315,7 @@ print_result(const char *prefix, int reader_elapsed) + for (i = 0; i < n_threads; i++) { + avg += thread_working_ms[i]; + } +- avg /= n_threads; ++ avg /= n_threads ? n_threads : 1; + 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.c b/tests/test-ovsdb.c index ca4e87b811..cd1c31a6c2 100644 --- a/tests/test-ovsdb.c @@ -77083,7 +77135,7 @@ index 407bfc60eb..2b2afb44ca 100644 + } } diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml -index 0c66326171..60e2a494d2 100644 +index 0c66326171..ab851c3c02 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -222,6 +222,19 @@ @@ -77115,7 +77167,7 @@ index 0c66326171..60e2a494d2 100644 type='{"type": "integer"}'> The port path cost. The Port's contribution, when it is the Root Port, to the Root Path Cost for the Bridge. By default the -@@ -3636,6 +3649,10 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \ +@@ -3636,6 +3649,43 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \ Device ID of PCI device. @@ -77123,6 +77175,39 @@ index 0c66326171..60e2a494d2 100644 + Ethernet address set for this VF interface. Only reported for dpdk + VF representors. + ++ ++ ++ ++

++ dpdkvhostuser and dpdkvhostuserclient ++ netdev specific interface status information. ++

++ ++ client (connecting) or server (listening) in the socket ++ communication. ++ ++ ++ virtio features bitmap as per virtio specification. ++ ++ ++ The number of available virtqueues. ++ ++ ++ The numa id of the device and guest memory. ++ ++ ++ The path to the socket used for communication. ++ ++ ++ Status of connection to the device. ++ ++ ++ Each virtqueue will have it's size reported, where n is the ++ virtqueue number from 0..(num_of_vrings-1). ++ ++ ++ Whether userspace-tso is enabled or disabled. ++
diff --git a/SPECS/openvswitch2.17.spec b/SPECS/openvswitch2.17.spec index 006fab2..82b74b4 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: 118%{?dist} +Release: 119%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -751,6 +751,15 @@ exit 0 %endif %changelog +* Tue Oct 31 2023 Open vSwitch CI - 2.17.0-119 +- Merging upstream branch-2.17 [RH git: bde74ad3b0] + Commit list: + 8868756b8c netdev-offload: Fix Clang's static analyzer 'Division by zero' warnings. + 46e9cacaae ofp-table: Fix count_common_prefix_run() function. + 8e6d1cd042 vswitch.xml: Add entry for dpdkvhostuser userspace-tso. + 7838778ade vswitch.xml: Add dpdkvhostuser group status. + + * Thu Oct 26 2023 Open vSwitch CI - 2.17.0-118 - Merging upstream branch-2.17 [RH git: 7961c8a931] Commit list: