From 2e892a7097d351d94a9d5e1a559c1a6150f40a41 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Jul 25 2023 22:58:32 +0000 Subject: Import openvswitch3.1-3.1.0-38 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.1.0.patch b/SOURCES/openvswitch-3.1.0.patch index 7a558aa..084fbeb 100644 --- a/SOURCES/openvswitch-3.1.0.patch +++ b/SOURCES/openvswitch-3.1.0.patch @@ -873,10 +873,20 @@ index a1a20366d..bdd12f6a7 100644 diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c -index ab5b8223e..ac182436b 100644 +index ab5b8223e..ab4a4e9d8 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c -@@ -840,7 +840,7 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu) +@@ -489,6 +489,9 @@ struct netdev_dpdk { + + /* Array of vhost rxq states, see vring_state_changed. */ + bool *vhost_rxq_enabled; ++ ++ /* Ensures that Rx metadata delivery is configured only once. */ ++ bool rx_metadata_delivery_configured; + ); + + PADDED_MEMBERS(CACHE_LINE_SIZE, +@@ -840,7 +843,7 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu) static struct dpdk_mp * dpdk_mp_get(struct netdev_dpdk *dev, int mtu) { @@ -885,6 +895,80 @@ index ab5b8223e..ac182436b 100644 bool reuse = false; ovs_mutex_lock(&dpdk_mp_mutex); +@@ -1140,6 +1143,45 @@ dpdk_eth_flow_ctrl_setup(struct netdev_dpdk *dev) OVS_REQUIRES(dev->mutex) + } + } + ++static void ++dpdk_eth_dev_init_rx_metadata(struct netdev_dpdk *dev) ++{ ++ uint64_t rx_metadata = 0; ++ int ret; ++ ++ if (dev->rx_metadata_delivery_configured) { ++ return; ++ } ++ ++ /* For the fallback offload (non-"transfer" rules). */ ++ rx_metadata |= RTE_ETH_RX_METADATA_USER_MARK; ++ ++#ifdef ALLOW_EXPERIMENTAL_API ++ /* For the tunnel offload. */ ++ rx_metadata |= RTE_ETH_RX_METADATA_TUNNEL_ID; ++#endif /* ALLOW_EXPERIMENTAL_API */ ++ ++ ret = rte_eth_rx_metadata_negotiate(dev->port_id, &rx_metadata); ++ if (ret == 0) { ++ if (!(rx_metadata & RTE_ETH_RX_METADATA_USER_MARK)) { ++ VLOG_DBG("%s: The NIC will not provide per-packet USER_MARK", ++ netdev_get_name(&dev->up)); ++ } ++#ifdef ALLOW_EXPERIMENTAL_API ++ if (!(rx_metadata & RTE_ETH_RX_METADATA_TUNNEL_ID)) { ++ VLOG_DBG("%s: The NIC will not provide per-packet TUNNEL_ID", ++ netdev_get_name(&dev->up)); ++ } ++#endif /* ALLOW_EXPERIMENTAL_API */ ++ } else { ++ VLOG(ret == -ENOTSUP ? VLL_DBG : VLL_WARN, ++ "%s: Cannot negotiate Rx metadata: %s", ++ netdev_get_name(&dev->up), rte_strerror(-ret)); ++ } ++ ++ dev->rx_metadata_delivery_configured = true; ++} ++ + static int + dpdk_eth_dev_init(struct netdev_dpdk *dev) + OVS_REQUIRES(dev->mutex) +@@ -1154,6 +1196,18 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) + RTE_ETH_RX_OFFLOAD_TCP_CKSUM | + RTE_ETH_RX_OFFLOAD_IPV4_CKSUM; + ++ if (netdev_is_flow_api_enabled()) { ++ /* ++ * Full tunnel offload requires that tunnel ID metadata be ++ * delivered with "miss" packets from the hardware to the ++ * PMD. The same goes for megaflow mark metadata which is ++ * used in MARK + RSS offload scenario. ++ * ++ * Request delivery of such metadata. ++ */ ++ dpdk_eth_dev_init_rx_metadata(dev); ++ } ++ + rte_eth_dev_info_get(dev->port_id, &info); + + if (strstr(info.driver_name, "vf") != NULL) { +@@ -1320,6 +1374,8 @@ common_construct(struct netdev *netdev, dpdk_port_t port_no, + /* Initilize the hardware offload flags to 0 */ + dev->hw_ol_features = 0; + ++ dev->rx_metadata_delivery_configured = false; ++ + dev->flags = NETDEV_UP | NETDEV_PROMISC; + + ovs_list_push_back(&dpdk_list, &dev->list_node); diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 65bdd51db..94b99a7be 100644 --- a/lib/netdev-linux.c diff --git a/SPECS/openvswitch3.1.spec b/SPECS/openvswitch3.1.spec index 3decb7c..318f1b5 100644 --- a/SPECS/openvswitch3.1.spec +++ b/SPECS/openvswitch3.1.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.1.0 -Release: 37%{?dist} +Release: 38%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -754,6 +754,12 @@ exit 0 %endif %changelog +* Tue Jul 25 2023 Open vSwitch CI - 3.1.0-38 +- Merging upstream branch-3.1 [RH git: 63dcdf1a37] + Commit list: + 11c542104e netdev-dpdk: Negotiate delivery of per-packet Rx metadata. + + * Fri Jul 21 2023 Open vSwitch CI - 3.1.0-37 - Merging upstream branch-3.1 [RH git: de746f5ab8] Commit list: