Hi Eli, Thanks for reviewing the series.
On Wed, 1 Jun 2022, Eli Britstein wrote:
"TUNNEL_ID" is a bad name, but that's how dpdk called it. There was a discussion about having this knowledge in OVS so we can avoid calling rte_flow_get_restore_info(). How else it is used?
As far as I know, avoiding rte_flow_get_restore_info() demands that tunnel ID be retrieved from mbufs themselves, using a dynamic field. That proposal does not discard the need to deliver tunnel data from the NIC to the PMD, and the patch that we discuss is still required.
-----Original Message----- From: Ivan Malov <[email protected]> Sent: Monday, May 30, 2022 5:16 PM To: [email protected] Cc: Andrew Rybchenko <[email protected]>; Ilya Maximets <[email protected]>; Ori Kam <[email protected]>; Eli Britstein <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>; Stephen Hemminger <[email protected]>; David Marchand <[email protected]>; Gaetan Rivet <[email protected]>; Maxime Coquelin <[email protected]> Subject: [PATCH 1/3] netdev-dpdk: negotiate delivery of per-packet Rx metadata External email: Use caution opening links or attachments This may be required by some PMDs in offload scenarios. Signed-off-by: Ivan Malov <[email protected]> Acked-by: Andrew Rybchenko <[email protected]> --- lib/netdev-dpdk.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index f9535bfb4..45e5d26d2 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1085,6 +1085,38 @@ dpdk_eth_flow_ctrl_setup(struct netdev_dpdk *dev) OVS_REQUIRES(dev->mutex) } } +#ifdef ALLOW_EXPERIMENTAL_API +static void +dpdk_eth_dev_init_rx_metadata(struct netdev_dpdk *dev) { + uint64_t rx_metadata = 0; + int ret; + + /* For the fallback offload (non-"transfer" rules) */ + rx_metadata |= RTE_ETH_RX_METADATA_USER_MARK; + /* For the full offload ("transfer" rules) */ + rx_metadata |= RTE_ETH_RX_METADATA_TUNNEL_ID; + + 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("The NIC will not provide per-packet USER_MARK on port " + DPDK_PORT_ID_FMT, dev->port_id); + } + if (!(rx_metadata & RTE_ETH_RX_METADATA_TUNNEL_ID)) { + VLOG_DBG("The NIC will not provide per-packet TUNNEL_ID on port " + DPDK_PORT_ID_FMT, dev->port_id); + } + } else if (ret == -ENOTSUP) { + VLOG_DBG("Rx metadata negotiate procedure is not supported on port " + DPDK_PORT_ID_FMT, dev->port_id); + } else { + VLOG_WARN("Cannot negotiate Rx metadata on port " + DPDK_PORT_ID_FMT, dev->port_id); + } +} +#endif /* ALLOW_EXPERIMENTAL_API */ + static int dpdk_eth_dev_init(struct netdev_dpdk *dev) OVS_REQUIRES(dev->mutex) @@ -1099,6 +1131,18 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) RTE_ETH_RX_OFFLOAD_TCP_CKSUM | RTE_ETH_RX_OFFLOAD_IPV4_CKSUM; +#ifdef ALLOW_EXPERIMENTAL_API + /* + * 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); +#endif /* ALLOW_EXPERIMENTAL_API */ + rte_eth_dev_info_get(dev->port_id, &info); if (strstr(info.driver_name, "vf") != NULL) { -- 2.30.2
_______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
