diff --git a/SOURCES/openvswitch-3.3.0.patch b/SOURCES/openvswitch-3.3.0.patch index 7da4a8a..6f4ea91 100644 --- a/SOURCES/openvswitch-3.3.0.patch +++ b/SOURCES/openvswitch-3.3.0.patch @@ -969,10 +969,21 @@ index c59b51b611..a8e3f457b9 100644 if (n) { diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c -index 45f61930d4..e77c881a77 100644 +index 45f61930d4..66396d7969 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c -@@ -607,6 +607,9 @@ int netdev_dpdk_get_vid(const struct netdev_dpdk *dev); +@@ -464,9 +464,8 @@ struct netdev_dpdk { + bool attached; + /* If true, rte_eth_dev_start() was successfully called */ + bool started; +- bool reset_needed; +- /* 1 pad byte here. */ + struct eth_addr hwaddr; ++ /* 2 pad bytes here. */ + int mtu; + int socket_id; + int buf_size; +@@ -607,6 +606,9 @@ int netdev_dpdk_get_vid(const struct netdev_dpdk *dev); struct ingress_policer * netdev_dpdk_get_ingress_policer(const struct netdev_dpdk *dev); @@ -982,7 +993,7 @@ index 45f61930d4..e77c881a77 100644 static bool is_dpdk_class(const struct netdev_class *class) { -@@ -1351,6 +1354,20 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) +@@ -1351,6 +1353,20 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) info.tx_offload_capa &= ~RTE_ETH_TX_OFFLOAD_TCP_CKSUM; } @@ -1003,7 +1014,29 @@ index 45f61930d4..e77c881a77 100644 if (info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM) { dev->hw_ol_features |= NETDEV_TX_IPV4_CKSUM_OFFLOAD; } else { -@@ -2364,17 +2381,16 @@ netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args, +@@ -1514,7 +1530,6 @@ common_construct(struct netdev *netdev, dpdk_port_t port_no, + dev->virtio_features_state = OVS_VIRTIO_F_CLEAN; + dev->attached = false; + dev->started = false; +- dev->reset_needed = false; + + ovsrcu_init(&dev->qos_conf, NULL); + +@@ -2137,13 +2152,11 @@ netdev_dpdk_run(const struct netdev_class *netdev_class OVS_UNUSED) + if (!pending_reset) { + continue; + } +- atomic_store_relaxed(&netdev_dpdk_pending_reset[port_id], false); + + ovs_mutex_lock(&dpdk_mutex); + dev = netdev_dpdk_lookup_by_port_id(port_id); + if (dev) { + ovs_mutex_lock(&dev->mutex); +- dev->reset_needed = true; + netdev_request_reconfigure(&dev->up); + VLOG_DBG_RL(&rl, "%s: Device reset requested.", + netdev_get_name(&dev->up)); +@@ -2364,17 +2377,16 @@ netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args, struct eth_addr mac; if (!dpdk_port_is_representor(dev)) { @@ -1029,7 +1062,7 @@ index 45f61930d4..e77c881a77 100644 } else if (!eth_addr_equals(dev->requested_hwaddr, mac)) { dev->requested_hwaddr = mac; netdev_request_reconfigure(netdev); -@@ -2567,73 +2583,133 @@ static bool +@@ -2567,73 +2579,133 @@ static bool netdev_dpdk_prep_hwol_packet(struct netdev_dpdk *dev, struct rte_mbuf *mbuf) { struct dp_packet *pkt = CONTAINER_OF(mbuf, struct dp_packet, mbuf); @@ -1155,14 +1188,14 @@ index 45f61930d4..e77c881a77 100644 - return false; - } + ovs_assert(l4); ++ ++ mbuf->l2_len = (char *) l3 - (char *) l2; ++ mbuf->l3_len = (char *) l4 - (char *) l3; - if (mbuf->ol_flags & (RTE_MBUF_F_TX_TUNNEL_GENEVE | - RTE_MBUF_F_TX_TUNNEL_VXLAN)) { - mbuf->tso_segsz = dev->mtu - mbuf->l2_len - mbuf->l3_len - - mbuf->l4_len - mbuf->outer_l3_len; -+ mbuf->l2_len = (char *) l3 - (char *) l2; -+ mbuf->l3_len = (char *) l4 - (char *) l3; -+ + if (mbuf->ol_flags & RTE_MBUF_F_TX_TCP_SEG) { + struct tcp_header *th = l4; + uint16_t link_tso_segsz; @@ -1213,7 +1246,7 @@ index 45f61930d4..e77c881a77 100644 return true; } -@@ -2664,6 +2740,35 @@ netdev_dpdk_prep_hwol_batch(struct netdev_dpdk *dev, struct rte_mbuf **pkts, +@@ -2664,6 +2736,35 @@ netdev_dpdk_prep_hwol_batch(struct netdev_dpdk *dev, struct rte_mbuf **pkts, return cnt; } @@ -1249,7 +1282,7 @@ index 45f61930d4..e77c881a77 100644 /* Tries to transmit 'pkts' to txq 'qid' of device 'dev'. Takes ownership of * 'pkts', even in case of failure. * -@@ -2680,6 +2785,8 @@ netdev_dpdk_eth_tx_burst(struct netdev_dpdk *dev, int qid, +@@ -2680,6 +2781,8 @@ netdev_dpdk_eth_tx_burst(struct netdev_dpdk *dev, int qid, VLOG_WARN_RL(&rl, "%s: Output batch contains invalid packets. " "Only %u/%u are valid: %s", netdev_get_name(&dev->up), nb_tx_prep, cnt, rte_strerror(rte_errno)); @@ -1258,6 +1291,50 @@ index 45f61930d4..e77c881a77 100644 } while (nb_tx != nb_tx_prep) { +@@ -5965,6 +6068,7 @@ static int + netdev_dpdk_reconfigure(struct netdev *netdev) + { + struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); ++ bool pending_reset; + bool try_rx_steer; + int err = 0; + +@@ -5976,6 +6080,9 @@ netdev_dpdk_reconfigure(struct netdev *netdev) + dev->requested_n_rxq += 1; + } + ++ atomic_read_relaxed(&netdev_dpdk_pending_reset[dev->port_id], ++ &pending_reset); ++ + if (netdev->n_txq == dev->requested_n_txq + && netdev->n_rxq == dev->requested_n_rxq + && dev->rx_steer_flags == dev->requested_rx_steer_flags +@@ -5985,7 +6092,7 @@ netdev_dpdk_reconfigure(struct netdev *netdev) + && dev->txq_size == dev->requested_txq_size + && eth_addr_equals(dev->hwaddr, dev->requested_hwaddr) + && dev->socket_id == dev->requested_socket_id +- && dev->started && !dev->reset_needed) { ++ && dev->started && !pending_reset) { + /* Reconfiguration is unnecessary */ + + goto out; +@@ -5994,10 +6101,14 @@ netdev_dpdk_reconfigure(struct netdev *netdev) + retry: + dpdk_rx_steer_unconfigure(dev); + +- if (dev->reset_needed) { ++ if (pending_reset) { ++ /* ++ * Set false before reset to avoid missing a new reset interrupt event ++ * in a race with event callback. ++ */ ++ atomic_store_relaxed(&netdev_dpdk_pending_reset[dev->port_id], false); + rte_eth_dev_reset(dev->port_id); + if_notifier_manual_report(); +- dev->reset_needed = false; + } else { + rte_eth_dev_stop(dev->port_id); + } diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c index cd7e85a818..e8bbf8d514 100644 --- a/lib/netdev-dummy.c diff --git a/SPECS/openvswitch3.3.spec b/SPECS/openvswitch3.3.spec index b793844..1b78fe1 100644 --- a/SPECS/openvswitch3.3.spec +++ b/SPECS/openvswitch3.3.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.3.0 -Release: 33%{?dist} +Release: 34%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -767,6 +767,12 @@ exit 0 %endif %changelog +* Tue Jul 02 2024 Open vSwitch CI - 3.3.0-34 +- Merging upstream branch-3.3 [RH git: c09d2d60bb] + Commit list: + 504efbe923 netdev-dpdk: Check pending reset when adding device. + + * Tue Jun 25 2024 Open vSwitch CI - 3.3.0-33 - Merging upstream branch-3.3 [RH git: 3ecc0a5b13] Commit list: