From patchwork Tue Oct 5 15:56:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 100528 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 1F86FA0C4C; Tue, 5 Oct 2021 17:56:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4375413ED; Tue, 5 Oct 2021 17:56:54 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 40981413E7 for ; Tue, 5 Oct 2021 17:56:53 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.121.98]) (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 A1B6D7F4FD; Tue, 5 Oct 2021 18:56:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru A1B6D7F4FD DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633449412; bh=egvnC8QHWlRUFicJqV155gAy8lrMlVjIG+YfCurHRds=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rrUnCKCwqaScVXPYArTHyqPJApiGoqltM6JMaI7Lirejmc0rrxaaNX1T00Sma5Wmn 3Eg6p3k1fn9q8x65pUCjDmuWllaCpTjObSFGvUmZXp20c2g+OIwpL8yp4ydz8TZHUR UFVEhipDzp6pJcktgt/hrTP7seCh4x6MiKo2ocjg= From: Ivan Malov To: dev@dpdk.org Cc: Ray Kinsella , Jerin Jacob , Thomas Monjalon , Ori Kam , Ajit Khaparde Date: Tue, 5 Oct 2021 18:56:34 +0300 Message-Id: <20211005155639.12277-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210923112012.14595-1-ivan.malov@oktetlabs.ru> References: <20210923112012.14595-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 0/5] ethdev: negotiate the NIC's ability to deliver Rx metadata to the PMD 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" In 2019, commit [1] 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. The issue has not been solved. Applications still assume that metadata features always work and do not need to be configured in advance. The team behind net/sfc driver has given this problem more thought. Conclusions that have been reached are as follows. 1. Not all kinds of metadata can be represented by device offload flags. For instance, having flag RSS_HASH is legitimate because the NIC is supposed to actually compute something when this feature is active. However, if similar flag existed for Rx mark, requesting it would not make the NIC actually compute anything. The HW needs external stimuli (flow rules) in order to set the mark in the first place. 2. As a consequence of (1), it is apparent that the user's ability to use Rx metadata features is complex and consists of multiple parts: a) the NIC's ability to conduct the flow actions (set metadata); b) the NIC's ability to deliver metadata (if set) to the PMD; c) the PMD's ability to provide metadata received from the NIC to the user by virtue of filling out mbuf fields. 3. Aspects (2-a) and (2-c) are already addressed by flow validate API and the procedure of dynamic mbuf field registration respectively, hence, the only problem which really needs a solution is (2-b). Patch [1/5] of this series adds a generic API to let the application negotiate the NIC's ability to deliver specific kinds of metadata to the PMD. This API is supposed to be invoked during initialisation period in order to let the PMD configure HW resources which might be hard to (re-)configure in the adapter's started state without causing traffic disruption and other unwanted consequences. [1] c5b2e78d1172 ("doc: announce ethdev API changes in offload flags") 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] Changes in v3: * [1/5] through [5/5] have review notes from Andy Moreton applied (mostly rewording) * [1/5] has the ack from Jerin Jacob added Changes in v4: * [1/5] has the API contract clarified to address concerns raised by Ori Kam * [1/5] has the API name fixed to use term "metadata" instead of "meta" * [1/5] has testpmd loglevel changed as per the note by Ajit Khaparde * [1/5] has testpmd code revisited to take multi-process into account * [2/5] through [5/5] have the corresponding adjustments incorporated Changes in v5: * [1/5] has the API comment improved as per the note by Ori Kam Ivan Malov (5): ethdev: negotiate delivery of packet metadata from HW to PMD net/sfc: support API to negotiate delivery of Rx metadata net/sfc: support flow mark delivery on EF100 native datapath common/sfc_efx/base: add RxQ flag to use Rx prefix user flag net/sfc: report user flag on EF100 native datapath app/test-flow-perf/main.c | 21 ++++++++++ app/test-pmd/testpmd.c | 37 ++++++++++++++++++ doc/guides/rel_notes/release_21_11.rst | 9 +++++ 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 | 29 ++++++++++++++ drivers/net/sfc/sfc_flow.c | 13 +++++++ drivers/net/sfc/sfc_mae.c | 22 ++++++++++- drivers/net/sfc/sfc_rx.c | 6 +++ lib/ethdev/ethdev_driver.h | 22 +++++++++++ lib/ethdev/rte_ethdev.c | 25 ++++++++++++ lib/ethdev/rte_ethdev.h | 54 ++++++++++++++++++++++++++ lib/ethdev/rte_flow.h | 12 ++++++ lib/ethdev/version.map | 3 ++ 17 files changed, 312 insertions(+), 23 deletions(-)