From patchwork Fri Sep 3 00:15:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 97844 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 875F1A0C4D; Fri, 3 Sep 2021 02:15:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05F8A40041; Fri, 3 Sep 2021 02:15:59 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 004604003E for ; Fri, 3 Sep 2021 02:15:56 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.122.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 3E72A7F52E; Fri, 3 Sep 2021 03:15:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 3E72A7F52E DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1630628156; bh=G1qoOvZXm5UZiWn4hLSnya8xNsU+a4qQBpHy+5z+Tb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rHccT3POUOLkP0QllYmenL4CyAY+7X6tyHv2Z1dLeNnrpPHu0o006LpRKoPDWIPZa wy+Pw8cR2eG1Eu2g7QuT7QVza3+R/y/sTESrGtf5l5rXq1PYYAH8X9Mp6nzY7DEZwS C9mSr9Pl/1wbClc7nrWopZiZ3Ke+hPsB2lxNswrw= From: Ivan Malov To: dev@dpdk.org Cc: Jerin Jacob , Ray Kinsella Date: Fri, 3 Sep 2021 03:15:37 +0300 Message-Id: <20210903001542.15309-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210902142359.28138-1-ivan.malov@oktetlabs.ru> References: <20210902142359.28138-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 0/5] A means to negotiate support for Rx meta information X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Back in 2019, commit c5b2e78d1172 ("doc: announce ethdev API changes in offload flags") announced changes in DEV_RX_OFFLOAD namespace intending to add new flags, RSS_HASH and FLOW_MARK. Since then, only the former has been added. Currently, there's no way for the application to configure the ethdev's ability to read out user FLAG, user MARK or whatever else meta information that might be required in the case of tunnel offload. The application assumes that no extra efforts are needed to make such data available. The team behind sfc poll-mode driver would like to take over these efforts since the lack of said controls has started impacting us in a number of ways. Riverhead, a cutting edge Xilinx smart NIC family, allows to switch between several Rx prefix formats, with the short one being the most suited for small packet performance. Features like RSS hash and user mark, in turn, are provided when long prefix is used, but the driver does not enable it by default. Some leverage has to be implemented to let the application express its interest in relying on various sorts of Rx meta data. Our research indicates that, while RSS_HASH is a legitimate offload flag (it requests the very computation of RSS hash and not just its delivery via mbufs), adding similar flags for user FLAG, user MARK and tunnel ID information has a better alternative. The first patch in the series provides a dedicated API to control precisely the very ability to deliver Rx meta data from the HW to the ethdev and, later, to the callers. While adding a new dedicated API might at first seem a bit awkward, it does have its benefits, with the most notorious one being its clear and concise contract for users. The documentation provided in the patch explains concrete workflow to be implemented. The most important use case for this might be Open vSwitch. The application has to be patched separately to make use of the new API. Right now OvS tries to use tunnel offload and, if it fails to insert the corresponding flow rules, falls back to MARK + RSS scheme, which also can fail in the case when the port doesn't support MARK. With this API, OvS will be able to negotiate supported types of Rx meta information in advance thus avoiding many unnecessary flow insertion attempts later on. Changes in v2: * [1/5] has review notes from Jerin Jacob applied and the ack from Ray Kinsella added * [2/5] has minor adjustments incorporated to follow changes in [1/5] Ivan Malov (5): ethdev: add API to negotiate support for Rx meta information net/sfc: provide API to negotiate supported Rx meta features net/sfc: allow to use EF100 native datapath Rx mark in flows common/sfc_efx/base: add RxQ flag to use Rx prefix user flag net/sfc: allow to discern user flag on EF100 native datapath app/test-flow-perf/main.c | 21 ++++++++ app/test-pmd/testpmd.c | 26 ++++++++++ doc/guides/rel_notes/release_21_11.rst | 10 ++++ drivers/common/sfc_efx/base/ef10_rx.c | 54 +++++++++++++-------- drivers/common/sfc_efx/base/efx.h | 4 ++ drivers/common/sfc_efx/base/rhead_rx.c | 3 ++ drivers/net/sfc/sfc.h | 2 + drivers/net/sfc/sfc_ef100_rx.c | 19 ++++++++ drivers/net/sfc/sfc_ethdev.c | 34 +++++++++++++ drivers/net/sfc/sfc_flow.c | 10 ++-- drivers/net/sfc/sfc_mae.c | 22 ++++++++- drivers/net/sfc/sfc_rx.c | 6 +++ lib/ethdev/ethdev_driver.h | 19 ++++++++ lib/ethdev/rte_ethdev.c | 25 ++++++++++ lib/ethdev/rte_ethdev.h | 66 ++++++++++++++++++++++++++ lib/ethdev/rte_flow.h | 15 ++++++ lib/ethdev/version.map | 3 ++ 17 files changed, 311 insertions(+), 28 deletions(-)