From patchwork Fri Sep 3 00:15:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 97845 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 5197BA0C4D; Fri, 3 Sep 2021 02:16:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2456840DFD; Fri, 3 Sep 2021 02:16:00 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 1942F40041 for ; Fri, 3 Sep 2021 02:15:57 +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 9930E7F609; Fri, 3 Sep 2021 03:15:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 9930E7F609 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1630628156; bh=W0jSsjeHHSEFCKHdJZARA73LfiCbZj5fBPaKRnu6X1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=N/WsX2tPrJ5G6p5wOYnEILMv/lfX9YfwWpVFZuP/N6Dg+wrtLdt8ZGsNubkLAlzrb J2kJiswBKJ0iK6mm8iyhWTDIugp942vFDtjnKvRDq0qcfPJXzMyGRvbPf59THYtheg acoIvzSXwPeu6KKrLn3iAndaLvAhgzVgUWwV/fAs= From: Ivan Malov To: dev@dpdk.org Cc: Jerin Jacob , Ray Kinsella , Andrew Rybchenko , Wisam Jaddo , Xiaoyun Li , Thomas Monjalon , Ferruh Yigit , Ori Kam Date: Fri, 3 Sep 2021 03:15:38 +0300 Message-Id: <20210903001542.15309-2-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210903001542.15309-1-ivan.malov@oktetlabs.ru> References: <20210902142359.28138-1-ivan.malov@oktetlabs.ru> <20210903001542.15309-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/5] ethdev: add API 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" Per-packet meta information (flag, mark and the likes) might be expensive to deliver in terms of small packet performance. If the features are not enabled by default, enabling them at short notice (for example, when a flow rule with action MARK gets created) without traffic disruption may not be possible. Letting applications request delivery of Rx meta information during initialisation can solve the said problem efficiently. Technically, that could be accomplished by defining new bits in DEV_RX_OFFLOAD namespace, but the ability to extract meta data cannot be considered an offload on its own. For example, Rx checksumming is an offload, while mark delivery is not as it needs an external party, a flow rule with action MARK, to hold the value and trigger mark insertion in the first place. With this in mind, add a means to let applications negotiate adapter support for the very delivery of Rx meta information. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Acked-by: Ray Kinsella --- app/test-flow-perf/main.c | 21 ++++++++ app/test-pmd/testpmd.c | 26 ++++++++++ doc/guides/rel_notes/release_21_11.rst | 10 ++++ 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 ++ 8 files changed, 185 insertions(+) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 9be8edc31d..48eafffb1d 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -1760,6 +1760,27 @@ init_port(void) rte_exit(EXIT_FAILURE, "Error: can't init mbuf pool\n"); for (port_id = 0; port_id < nr_ports; port_id++) { + uint64_t rx_meta_features = 0; + + rx_meta_features |= RTE_ETH_RX_META_USER_FLAG; + rx_meta_features |= RTE_ETH_RX_META_USER_MARK; + + ret = rte_eth_rx_meta_negotiate(port_id, &rx_meta_features); + if (ret == 0) { + if (!(rx_meta_features & RTE_ETH_RX_META_USER_FLAG)) { + printf(":: flow action FLAG will not affect Rx mbufs on port=%u\n", + port_id); + } + + if (!(rx_meta_features & RTE_ETH_RX_META_USER_MARK)) { + printf(":: flow action MARK will not affect Rx mbufs on port=%u\n", + port_id); + } + } else if (ret != -ENOTSUP) { + rte_exit(EXIT_FAILURE, "Error when negotiating Rx meta features on port=%u: %s\n", + port_id, rte_strerror(-ret)); + } + ret = rte_eth_dev_info_get(port_id, &dev_info); if (ret != 0) rte_exit(EXIT_FAILURE, diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9061cbf637..72addc59db 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1421,10 +1421,36 @@ static void init_config_port_offloads(portid_t pid, uint32_t socket_id) { struct rte_port *port = &ports[pid]; + uint64_t rx_meta_features = 0; uint16_t data_size; int ret; int i; + rx_meta_features |= RTE_ETH_RX_META_USER_FLAG; + rx_meta_features |= RTE_ETH_RX_META_USER_MARK; + rx_meta_features |= RTE_ETH_RX_META_TUNNEL_ID; + + ret = rte_eth_rx_meta_negotiate(pid, &rx_meta_features); + if (ret == 0) { + if (!(rx_meta_features & RTE_ETH_RX_META_USER_FLAG)) { + TESTPMD_LOG(INFO, "Flow action FLAG will not affect Rx mbufs on port %u\n", + pid); + } + + if (!(rx_meta_features & RTE_ETH_RX_META_USER_MARK)) { + TESTPMD_LOG(INFO, "Flow action MARK will not affect Rx mbufs on port %u\n", + pid); + } + + if (!(rx_meta_features & RTE_ETH_RX_META_TUNNEL_ID)) { + TESTPMD_LOG(INFO, "Flow tunnel offload support might be limited or unavailable on port %u\n", + pid); + } + } else if (ret != -ENOTSUP) { + rte_exit(EXIT_FAILURE, "Error when negotiating Rx meta features on port %u: %s\n", + pid, rte_strerror(-ret)); + } + port->dev_conf.txmode = tx_mode; port->dev_conf.rxmode = rx_mode; diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index d707a554ef..017b5a8239 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -55,6 +55,16 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added an API to negotiate support for Rx meta information** + + A new API, ``rte_eth_rx_meta_negotiate()``, was added to let applications + negotiate support for the very delivery of various Rx meta data fractions, + with the following definitions being available starting from this release: + + * ``RTE_ETH_RX_META_USER_FLAG`` + * ``RTE_ETH_RX_META_USER_MARK`` + * ``RTE_ETH_RX_META_TUNNEL_ID`` + Removed Items ------------- diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index 40e474aa7e..508d2e6bfb 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -789,6 +789,22 @@ typedef int (*eth_get_monitor_addr_t)(void *rxq, typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev, struct rte_eth_representor_info *info); +/** + * @internal + * Negotiate support for specific fractions of Rx meta information. + * + * @param dev + * Port (ethdev) handle + * + * @param[inout] features + * Feature selection buffer + * + * @return + * Negative errno value on error, zero otherwise + */ +typedef int (*eth_rx_meta_negotiate_t)(struct rte_eth_dev *dev, + uint64_t *features); + /** * @internal A structure containing the functions exported by an Ethernet driver. */ @@ -949,6 +965,9 @@ struct eth_dev_ops { eth_representor_info_get_t representor_info_get; /**< Get representor info. */ + + eth_rx_meta_negotiate_t rx_meta_negotiate; + /**< Negotiate support for specific fractions of Rx meta information. */ }; /** diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 9d95cd11e1..8010aa7a43 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -6311,6 +6311,31 @@ rte_eth_representor_info_get(uint16_t port_id, return eth_err(port_id, (*dev->dev_ops->representor_info_get)(dev, info)); } +int +rte_eth_rx_meta_negotiate(uint16_t port_id, uint64_t *features) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + dev = &rte_eth_devices[port_id]; + + if (dev->data->dev_configured != 0) { + RTE_ETHDEV_LOG(ERR, + "The port (id=%"PRIu16") is already configured\n", + port_id); + return -EBUSY; + } + + if (features == NULL) { + RTE_ETHDEV_LOG(ERR, "Invalid features (NULL)\n"); + return -EINVAL; + } + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_meta_negotiate, -ENOTSUP); + return eth_err(port_id, + (*dev->dev_ops->rx_meta_negotiate)(dev, features)); +} + RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO); RTE_INIT(ethdev_init_telemetry) diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index d2b27c351f..16af376866 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -4888,6 +4888,72 @@ __rte_experimental int rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_info *info); +/** + * The ethdev will be able to detect flagged packets provided that + * there are active flow rules comprising the corresponding action. + */ +#define RTE_ETH_RX_META_USER_FLAG (UINT64_C(1) << 0) + +/** + * The ethdev will manage to see mark IDs in packets provided that + * there are active flow rules comprising the corresponding action. + */ +#define RTE_ETH_RX_META_USER_MARK (UINT64_C(1) << 1) + +/** + * The ethdev will be able to identify partially offloaded packets + * and process rte_flow_get_restore_info() invocations accordingly + * provided that there're so-called "tunnel_set" flow rules in use. + */ +#define RTE_ETH_RX_META_TUNNEL_ID (UINT64_C(1) << 2) + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * Negotiate support for specific fractions of Rx meta information. + * + * This function has to be invoked as early as possible, precisely, + * before the first rte_eth_dev_configure() invocation, to let the + * PMD make preparations which might be hard to do on later stages. + * + * The negotiation process is assumed to be carried out as follows: + * + * - the application composes a mask of preferred Rx meta features + * intending to enable at least some of them and invokes the API; + * + * - the ethdev driver reports back the optimal (from its point of + * view) subset of the initial feature set thus agreeing to make + * those comprising the subset simultaneously available to users; + * + * - should the application find the result unsatisfactory, it may + * come up with another pick of preferred features and try again; + * + * - the application can pass zero to clear the negotiation result; + * + * - the last negotiated result takes effect upon the ethdev start. + * + * If the method itself is unsupported by the PMD, the application + * may just ignore that and proceed with the rest of configuration + * procedure intending to simply try using the features it prefers. + * + * @param port_id + * Port (ethdev) identifier + * + * @param[inout] features + * Feature selection buffer + * + * @return + * - (-EBUSY) if the port can't handle this in its current state; + * - (-ENOTSUP) if the method itself is not supported by the PMD; + * - (-ENODEV) if *port_id* is invalid; + * - (-EINVAL) if *features* is NULL; + * - (-EIO) if the device is removed; + * - (0) on success + */ +__rte_experimental +int rte_eth_rx_meta_negotiate(uint16_t port_id, uint64_t *features); + #include /** diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 70f455d47d..f8f2bc2e8c 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -1904,6 +1904,11 @@ enum rte_flow_action_type { * PKT_RX_FDIR_ID mbuf flags. * * See struct rte_flow_action_mark. + * + * The ethdev's ability to serve mark IDs with received packets + * has to be negotiated separately during initialisation period. + * @see rte_eth_rx_meta_negotiate() + * @see RTE_ETH_RX_META_USER_MARK */ RTE_FLOW_ACTION_TYPE_MARK, @@ -1912,6 +1917,11 @@ enum rte_flow_action_type { * sets the PKT_RX_FDIR mbuf flag. * * No associated configuration structure. + * + * The ethdev's ability to serve the flag with received packets + * has to be negotiated separately during initialisation period. + * @see rte_eth_rx_meta_negotiate() + * @see RTE_ETH_RX_META_USER_FLAG */ RTE_FLOW_ACTION_TYPE_FLAG, @@ -4223,6 +4233,11 @@ rte_flow_tunnel_match(uint16_t port_id, /** * Populate the current packet processing state, if exists, for the given mbuf. * + * The ethdev's ability to uncover such packet processing state + * has to be negotiated separately during initialisation period. + * @see rte_eth_rx_meta_negotiate() + * @see RTE_ETH_RX_META_TUNNEL_ID + * * @param port_id * Port identifier of Ethernet device. * @param[in] m diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 3eece75b72..2cf773f63a 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -249,6 +249,9 @@ EXPERIMENTAL { rte_mtr_meter_policy_delete; rte_mtr_meter_policy_update; rte_mtr_meter_policy_validate; + + # added in 21.11 + rte_eth_rx_meta_negotiate; }; INTERNAL { From patchwork Fri Sep 3 00:15:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 97846 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 02437A0C4D; Fri, 3 Sep 2021 02:16:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48B4040E78; Fri, 3 Sep 2021 02:16:01 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 4F18F4003E for ; Fri, 3 Sep 2021 02:15:57 +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 EA3B67F6C0; Fri, 3 Sep 2021 03:15:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru EA3B67F6C0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1630628157; bh=QVn0UwP4m1M6BFjlvaM+KWbJJR31uJ/3fdT7VqV5s78=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iRHWqiFiOeg55e+DScEXDu2WhzQ2WgKzhClX9qcsGMR9Tbny93niL0VWp7Y2XRwPA 9qft1BTjcQg3om9jvWSvxyXx36iegEHNO3HN80CajgX30KTB51W7sztmpaun9Xgiv0 to1j2205txslCM61VD3w29+jGhiWDfK5vUCU6xaQ= From: Ivan Malov To: dev@dpdk.org Cc: Jerin Jacob , Ray Kinsella , Andrew Rybchenko Date: Fri, 3 Sep 2021 03:15:39 +0300 Message-Id: <20210903001542.15309-3-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210903001542.15309-1-ivan.malov@oktetlabs.ru> References: <20210902142359.28138-1-ivan.malov@oktetlabs.ru> <20210903001542.15309-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/5] net/sfc: provide API to negotiate supported Rx meta features 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" This is a preparation step. Later patches will make features FLAG and MARK on EF100 native Rx datapath available to users. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- drivers/net/sfc/sfc.h | 2 ++ drivers/net/sfc/sfc_ethdev.c | 34 ++++++++++++++++++++++++++++++++++ drivers/net/sfc/sfc_flow.c | 10 +++++----- drivers/net/sfc/sfc_mae.c | 22 ++++++++++++++++++++-- 4 files changed, 61 insertions(+), 7 deletions(-) diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index 331e06bac6..2812d76cbb 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -312,6 +312,8 @@ struct sfc_adapter { boolean_t tso; boolean_t tso_encap; + uint64_t negotiated_rx_meta; + uint32_t rxd_wait_timeout_ns; }; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 2db0d000c3..94203616c3 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1859,6 +1859,27 @@ sfc_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t ethdev_qid) return sap->dp_rx->intr_disable(rxq_info->dp); } +static int +sfc_rx_meta_negotiate(struct rte_eth_dev *dev, uint64_t *features) +{ + struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev); + + sfc_adapter_lock(sa); + + if ((sa->priv.dp_rx->features & SFC_DP_RX_FEAT_FLOW_FLAG) != 0) + sa->negotiated_rx_meta |= RTE_ETH_RX_META_USER_FLAG; + + if ((sa->priv.dp_rx->features & SFC_DP_RX_FEAT_FLOW_MARK) != 0) + sa->negotiated_rx_meta |= RTE_ETH_RX_META_USER_MARK; + + sa->negotiated_rx_meta &= *features; + *features = sa->negotiated_rx_meta; + + sfc_adapter_unlock(sa); + + return 0; +} + static const struct eth_dev_ops sfc_eth_dev_ops = { .dev_configure = sfc_dev_configure, .dev_start = sfc_dev_start, @@ -1906,6 +1927,7 @@ static const struct eth_dev_ops sfc_eth_dev_ops = { .xstats_get_by_id = sfc_xstats_get_by_id, .xstats_get_names_by_id = sfc_xstats_get_names_by_id, .pool_ops_supported = sfc_pool_ops_supported, + .rx_meta_negotiate = sfc_rx_meta_negotiate, }; /** @@ -1998,6 +2020,18 @@ sfc_eth_dev_set_ops(struct rte_eth_dev *dev) goto fail_dp_rx_name; } + if (strcmp(dp_rx->dp.name, SFC_KVARG_DATAPATH_EF10_ESSB) == 0) { + /* + * Datapath EF10 ESSB is available only on EF10 NICs running + * Rx FW variant DPDK, which always provides fields FLAG and + * MARK in Rx prefix, so point this fact out below. This way, + * legacy applications from EF10 era, which are not aware of + * rte_eth_rx_meta_negotiate(), can keep the workflow intact. + */ + sa->negotiated_rx_meta |= RTE_ETH_RX_META_USER_FLAG; + sa->negotiated_rx_meta |= RTE_ETH_RX_META_USER_MARK; + } + sfc_notice(sa, "use %s Rx datapath", sas->dp_rx_name); rc = sfc_kvargs_process(sa, SFC_KVARG_TX_DATAPATH, diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index 4f5993a68d..a2034b5f5e 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -1759,7 +1759,7 @@ sfc_flow_parse_actions(struct sfc_adapter *sa, int rc; struct sfc_flow_spec *spec = &flow->spec; struct sfc_flow_spec_filter *spec_filter = &spec->filter; - const unsigned int dp_rx_features = sa->priv.dp_rx->features; + const uint64_t rx_meta = sa->negotiated_rx_meta; uint32_t actions_set = 0; const uint32_t fate_actions_mask = (1UL << RTE_FLOW_ACTION_TYPE_QUEUE) | (1UL << RTE_FLOW_ACTION_TYPE_RSS) | @@ -1827,10 +1827,10 @@ sfc_flow_parse_actions(struct sfc_adapter *sa, if ((actions_set & mark_actions_mask) != 0) goto fail_actions_overlap; - if ((dp_rx_features & SFC_DP_RX_FEAT_FLOW_FLAG) == 0) { + if ((rx_meta & RTE_ETH_RX_META_USER_FLAG) == 0) { rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, NULL, - "FLAG action is not supported on the current Rx datapath"); + "Action FLAG is unsupported on the current Rx datapath or has not been negotiated"); return -rte_errno; } @@ -1844,10 +1844,10 @@ sfc_flow_parse_actions(struct sfc_adapter *sa, if ((actions_set & mark_actions_mask) != 0) goto fail_actions_overlap; - if ((dp_rx_features & SFC_DP_RX_FEAT_FLOW_MARK) == 0) { + if ((rx_meta & RTE_ETH_RX_META_USER_MARK) == 0) { rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, NULL, - "MARK action is not supported on the current Rx datapath"); + "Action MARK is unsupported on the current Rx datapath or has not been negotiated"); return -rte_errno; } diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 4b520bc619..89c161ef88 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -2963,6 +2963,7 @@ sfc_mae_rule_parse_action(struct sfc_adapter *sa, efx_mae_actions_t *spec, struct rte_flow_error *error) { + const uint64_t rx_meta = sa->negotiated_rx_meta; bool custom_error = B_FALSE; int rc = 0; @@ -3012,12 +3013,29 @@ sfc_mae_rule_parse_action(struct sfc_adapter *sa, case RTE_FLOW_ACTION_TYPE_FLAG: SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_FLAG, bundle->actions_mask); - rc = efx_mae_action_set_populate_flag(spec); + if ((rx_meta & RTE_ETH_RX_META_USER_FLAG) != 0) { + rc = efx_mae_action_set_populate_flag(spec); + } else { + rc = rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, + action, + "Action FLAG has not been negotiated"); + custom_error = B_TRUE; + } break; case RTE_FLOW_ACTION_TYPE_MARK: SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_MARK, bundle->actions_mask); - rc = sfc_mae_rule_parse_action_mark(sa, action->conf, spec); + if ((rx_meta & RTE_ETH_RX_META_USER_MARK) != 0) { + rc = sfc_mae_rule_parse_action_mark(sa, action->conf, + spec); + } else { + rc = rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, + action, + "Action MARK has not been negotiated"); + custom_error = B_TRUE; + } break; case RTE_FLOW_ACTION_TYPE_PHY_PORT: SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_PHY_PORT, From patchwork Fri Sep 3 00:15:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 97847 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 3A7E7A0C4D; Fri, 3 Sep 2021 02:16:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 534564003E; Fri, 3 Sep 2021 02:16:02 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 920D54003E for ; Fri, 3 Sep 2021 02:15:57 +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 3AC1A7F6CB; Fri, 3 Sep 2021 03:15:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 3AC1A7F6CB DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1630628157; bh=PWWPjv+3NWjp4CYhGwswXAFPlTr6WUHQhEe84xHEmXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Jt0lcsbl/O55cMcZve55FIvpm4aGgONHX1GMKuY6D7C11+pgMaRKZW4FRqUvHzsiI 6aUlb2H7hIu3w49ufPNDsq/qUAyiHs6gFhmWpxeKeWvjL6t53b96mGMnfwRYZpYCdS Dzz68ToxvyfdzVHVvhM1YMIr7B5IHQEA1hSbbM9E= From: Ivan Malov To: dev@dpdk.org Cc: Jerin Jacob , Ray Kinsella , Andrew Rybchenko Date: Fri, 3 Sep 2021 03:15:40 +0300 Message-Id: <20210903001542.15309-4-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210903001542.15309-1-ivan.malov@oktetlabs.ru> References: <20210902142359.28138-1-ivan.malov@oktetlabs.ru> <20210903001542.15309-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 3/5] net/sfc: allow to use EF100 native datapath Rx mark in flows 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" As of now, reading out mark on EF100 native datapath is used only by MAE counter support for delivery of generation count values. Make the feature available to flow action MARK users. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- drivers/net/sfc/sfc_ef100_rx.c | 1 + drivers/net/sfc/sfc_rx.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/sfc/sfc_ef100_rx.c b/drivers/net/sfc/sfc_ef100_rx.c index d4cb96881c..e0cafbc579 100644 --- a/drivers/net/sfc/sfc_ef100_rx.c +++ b/drivers/net/sfc/sfc_ef100_rx.c @@ -914,6 +914,7 @@ struct sfc_dp_rx sfc_ef100_rx = { .hw_fw_caps = SFC_DP_HW_FW_CAP_EF100, }, .features = SFC_DP_RX_FEAT_MULTI_PROCESS | + SFC_DP_RX_FEAT_FLOW_MARK | SFC_DP_RX_FEAT_INTR, .dev_offload_capa = 0, .queue_offload_capa = DEV_RX_OFFLOAD_CHECKSUM | diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 280e8a61f9..c1acd2ed99 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -1178,6 +1178,9 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, if (offloads & DEV_RX_OFFLOAD_RSS_HASH) rxq_info->type_flags |= EFX_RXQ_FLAG_RSS_HASH; + if ((sa->negotiated_rx_meta & RTE_ETH_RX_META_USER_MARK) != 0) + rxq_info->type_flags |= EFX_RXQ_FLAG_USER_MARK; + rc = sfc_ev_qinit(sa, SFC_EVQ_TYPE_RX, sw_index, evq_entries, socket_id, &evq); if (rc != 0) From patchwork Fri Sep 3 00:15:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 97848 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 D53F2A0C4D; Fri, 3 Sep 2021 02:16:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 76F52410F2; Fri, 3 Sep 2021 02:16:03 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id B57F440041 for ; Fri, 3 Sep 2021 02:15:57 +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 82DAC7F6D3; Fri, 3 Sep 2021 03:15:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 82DAC7F6D3 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1630628157; bh=rJ0CHgcOHu8xUQDG/unm/YMgbCgbCAaTz7GVv85u0js=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fEszoZ7urVE36wdNY0AIvd/bgV/UBisR5LDp8+n/lTwZMV1vdkp4tgzYoaesfoy+I 3ITFc98Czvh4F1orx9ozSqgp4o8ke2xllWQnL3sGUVz03iCyRgpYKfindNZ6O5IWg4 1Fg7y8YwaLqGwwMChLSmijmu1ybnvutif6acxKvw= From: Ivan Malov To: dev@dpdk.org Cc: Jerin Jacob , Ray Kinsella , Andrew Rybchenko Date: Fri, 3 Sep 2021 03:15:41 +0300 Message-Id: <20210903001542.15309-5-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210903001542.15309-1-ivan.malov@oktetlabs.ru> References: <20210902142359.28138-1-ivan.malov@oktetlabs.ru> <20210903001542.15309-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 4/5] common/sfc_efx/base: add RxQ flag to use Rx prefix user flag 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" Add an RxQ flag to request support for user flag field of Rx prefix. The feature is supported only on EF100 and EF10 ESSB. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- 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 ++ 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/drivers/common/sfc_efx/base/ef10_rx.c b/drivers/common/sfc_efx/base/ef10_rx.c index 0c3f9413cf..a658e0dba2 100644 --- a/drivers/common/sfc_efx/base/ef10_rx.c +++ b/drivers/common/sfc_efx/base/ef10_rx.c @@ -930,6 +930,10 @@ ef10_rx_qcreate( rc = ENOTSUP; goto fail2; } + if (flags & EFX_RXQ_FLAG_USER_FLAG) { + rc = ENOTSUP; + goto fail3; + } /* * Ignore EFX_RXQ_FLAG_RSS_HASH since if RSS hash is calculated * it is always delivered from HW in the pseudo-header. @@ -940,7 +944,7 @@ ef10_rx_qcreate( erpl = &ef10_packed_stream_rx_prefix_layout; if (type_data == NULL) { rc = EINVAL; - goto fail3; + goto fail4; } switch (type_data->ertd_packed_stream.eps_buf_size) { case EFX_RXQ_PACKED_STREAM_BUF_SIZE_1M: @@ -960,17 +964,21 @@ ef10_rx_qcreate( break; default: rc = ENOTSUP; - goto fail4; + goto fail5; } erp->er_buf_size = type_data->ertd_packed_stream.eps_buf_size; /* Packed stream pseudo header does not have RSS hash value */ if (flags & EFX_RXQ_FLAG_RSS_HASH) { rc = ENOTSUP; - goto fail5; + goto fail6; } if (flags & EFX_RXQ_FLAG_USER_MARK) { rc = ENOTSUP; - goto fail6; + goto fail7; + } + if (flags & EFX_RXQ_FLAG_USER_FLAG) { + rc = ENOTSUP; + goto fail8; } break; #endif /* EFSYS_OPT_RX_PACKED_STREAM */ @@ -979,7 +987,7 @@ ef10_rx_qcreate( erpl = &ef10_essb_rx_prefix_layout; if (type_data == NULL) { rc = EINVAL; - goto fail7; + goto fail9; } params.es_bufs_per_desc = type_data->ertd_es_super_buffer.eessb_bufs_per_desc; @@ -997,7 +1005,7 @@ ef10_rx_qcreate( #endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ default: rc = ENOTSUP; - goto fail8; + goto fail10; } #if EFSYS_OPT_RX_PACKED_STREAM @@ -1005,13 +1013,13 @@ ef10_rx_qcreate( /* Check if datapath firmware supports packed stream mode */ if (encp->enc_rx_packed_stream_supported == B_FALSE) { rc = ENOTSUP; - goto fail9; + goto fail11; } /* Check if packed stream allows configurable buffer sizes */ if ((params.ps_buf_size != MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M) && (encp->enc_rx_var_packed_stream_supported == B_FALSE)) { rc = ENOTSUP; - goto fail10; + goto fail12; } } #else /* EFSYS_OPT_RX_PACKED_STREAM */ @@ -1022,17 +1030,17 @@ ef10_rx_qcreate( if (params.es_bufs_per_desc > 0) { if (encp->enc_rx_es_super_buffer_supported == B_FALSE) { rc = ENOTSUP; - goto fail11; + goto fail13; } if (!EFX_IS_P2ALIGNED(uint32_t, params.es_max_dma_len, EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) { rc = EINVAL; - goto fail12; + goto fail14; } if (!EFX_IS_P2ALIGNED(uint32_t, params.es_buf_stride, EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) { rc = EINVAL; - goto fail13; + goto fail15; } } #else /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ @@ -1041,7 +1049,7 @@ ef10_rx_qcreate( if (flags & EFX_RXQ_FLAG_INGRESS_MPORT) { rc = ENOTSUP; - goto fail14; + goto fail16; } /* Scatter can only be disabled if the firmware supports doing so */ @@ -1057,7 +1065,7 @@ ef10_rx_qcreate( if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep, label, index, esmp, ¶ms)) != 0) - goto fail15; + goto fail17; erp->er_eep = eep; erp->er_label = label; @@ -1070,40 +1078,44 @@ ef10_rx_qcreate( return (0); +fail17: + EFSYS_PROBE(fail15); +fail16: + EFSYS_PROBE(fail14); +#if EFSYS_OPT_RX_ES_SUPER_BUFFER fail15: EFSYS_PROBE(fail15); fail14: EFSYS_PROBE(fail14); -#if EFSYS_OPT_RX_ES_SUPER_BUFFER fail13: EFSYS_PROBE(fail13); +#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ +#if EFSYS_OPT_RX_PACKED_STREAM fail12: EFSYS_PROBE(fail12); fail11: EFSYS_PROBE(fail11); -#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ -#if EFSYS_OPT_RX_PACKED_STREAM +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail10: EFSYS_PROBE(fail10); +#if EFSYS_OPT_RX_ES_SUPER_BUFFER fail9: EFSYS_PROBE(fail9); -#endif /* EFSYS_OPT_RX_PACKED_STREAM */ +#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ +#if EFSYS_OPT_RX_PACKED_STREAM fail8: EFSYS_PROBE(fail8); -#if EFSYS_OPT_RX_ES_SUPER_BUFFER fail7: EFSYS_PROBE(fail7); -#endif /* EFSYS_OPT_RX_ES_SUPER_BUFFER */ -#if EFSYS_OPT_RX_PACKED_STREAM fail6: EFSYS_PROBE(fail6); fail5: EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail3: EFSYS_PROBE(fail3); -#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail2: EFSYS_PROBE(fail2); fail1: diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index 24e1314cc3..bed1029f59 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -3007,6 +3007,10 @@ typedef enum efx_rxq_type_e { * Request user mark field in the Rx prefix of a queue. */ #define EFX_RXQ_FLAG_USER_MARK 0x10 +/* + * Request user flag field in the Rx prefix of a queue. + */ +#define EFX_RXQ_FLAG_USER_FLAG 0x20 LIBEFX_API extern __checkReturn efx_rc_t diff --git a/drivers/common/sfc_efx/base/rhead_rx.c b/drivers/common/sfc_efx/base/rhead_rx.c index 76b8ce302a..9d3258b503 100644 --- a/drivers/common/sfc_efx/base/rhead_rx.c +++ b/drivers/common/sfc_efx/base/rhead_rx.c @@ -635,6 +635,9 @@ rhead_rx_qcreate( if (flags & EFX_RXQ_FLAG_USER_MARK) fields_mask |= 1U << EFX_RX_PREFIX_FIELD_USER_MARK; + if (flags & EFX_RXQ_FLAG_USER_FLAG) + fields_mask |= 1U << EFX_RX_PREFIX_FIELD_USER_FLAG; + /* * LENGTH is required in EF100 host interface, as receive events * do not include the packet length. From patchwork Fri Sep 3 00:15:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 97849 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 28A11A0C4D; Fri, 3 Sep 2021 02:16:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBFBA41120; Fri, 3 Sep 2021 02:16:04 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 2051F4003E for ; Fri, 3 Sep 2021 02:15:58 +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 BDA1B7F6D5; Fri, 3 Sep 2021 03:15:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru BDA1B7F6D5 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1630628157; bh=fTDiO4E/Vn43wAv723oBKLlXBo1jE0XLLtfFuLxQwgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=n2sevJh/L1zcGLF5YiSACptPGynnn9N6g8VS1N6aPXH1YLld5g/ySs0IK9KpZ0C7Q M2Rd0rHWnKsZqIi6J3MvUgGGWHx2zwIdH/CbPeBbfTyDw9A4Q9yPuRH3zdZaQHTDvE jdxf7VKavdyc9M1ewX4BHbkcjRLPfLYYW/vIehGI= From: Ivan Malov To: dev@dpdk.org Cc: Jerin Jacob , Ray Kinsella , Andrew Rybchenko Date: Fri, 3 Sep 2021 03:15:42 +0300 Message-Id: <20210903001542.15309-6-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210903001542.15309-1-ivan.malov@oktetlabs.ru> References: <20210902142359.28138-1-ivan.malov@oktetlabs.ru> <20210903001542.15309-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 5/5] net/sfc: allow to discern user flag on EF100 native datapath 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" Read out user flag from Rx prefix and indicate it to callers. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- drivers/net/sfc/sfc_ef100_rx.c | 18 ++++++++++++++++++ drivers/net/sfc/sfc_rx.c | 3 +++ 2 files changed, 21 insertions(+) diff --git a/drivers/net/sfc/sfc_ef100_rx.c b/drivers/net/sfc/sfc_ef100_rx.c index e0cafbc579..ba43e12739 100644 --- a/drivers/net/sfc/sfc_ef100_rx.c +++ b/drivers/net/sfc/sfc_ef100_rx.c @@ -62,6 +62,7 @@ struct sfc_ef100_rxq { #define SFC_EF100_RXQ_RSS_HASH 0x10 #define SFC_EF100_RXQ_USER_MARK 0x20 #define SFC_EF100_RXQ_FLAG_INTR_EN 0x40 +#define SFC_EF100_RXQ_USER_FLAG 0x80 unsigned int ptr_mask; unsigned int evq_phase_bit_shift; unsigned int ready_pkts; @@ -371,6 +372,7 @@ static const efx_rx_prefix_layout_t sfc_ef100_rx_prefix_layout = { SFC_EF100_RX_PREFIX_FIELD(RSS_HASH_VALID, B_FALSE), SFC_EF100_RX_PREFIX_FIELD(CLASS, B_FALSE), SFC_EF100_RX_PREFIX_FIELD(RSS_HASH, B_FALSE), + SFC_EF100_RX_PREFIX_FIELD(USER_FLAG, B_FALSE), SFC_EF100_RX_PREFIX_FIELD(USER_MARK, B_FALSE), #undef SFC_EF100_RX_PREFIX_FIELD @@ -407,6 +409,15 @@ sfc_ef100_rx_prefix_to_offloads(const struct sfc_ef100_rxq *rxq, ESF_GZ_RX_PREFIX_RSS_HASH); } + if (rxq->flags & SFC_EF100_RXQ_USER_FLAG) { + uint32_t user_flag; + + user_flag = EFX_OWORD_FIELD(rx_prefix[0], + ESF_GZ_RX_PREFIX_USER_FLAG); + if (user_flag != 0) + ol_flags |= PKT_RX_FDIR; + } + if (rxq->flags & SFC_EF100_RXQ_USER_MARK) { uint32_t user_mark; @@ -800,6 +811,12 @@ sfc_ef100_rx_qstart(struct sfc_dp_rxq *dp_rxq, unsigned int evq_read_ptr, else rxq->flags &= ~SFC_EF100_RXQ_RSS_HASH; + if ((unsup_rx_prefix_fields & + (1U << EFX_RX_PREFIX_FIELD_USER_FLAG)) == 0) + rxq->flags |= SFC_EF100_RXQ_USER_FLAG; + else + rxq->flags &= ~SFC_EF100_RXQ_USER_FLAG; + if ((unsup_rx_prefix_fields & (1U << EFX_RX_PREFIX_FIELD_USER_MARK)) == 0) rxq->flags |= SFC_EF100_RXQ_USER_MARK; @@ -914,6 +931,7 @@ struct sfc_dp_rx sfc_ef100_rx = { .hw_fw_caps = SFC_DP_HW_FW_CAP_EF100, }, .features = SFC_DP_RX_FEAT_MULTI_PROCESS | + SFC_DP_RX_FEAT_FLOW_FLAG | SFC_DP_RX_FEAT_FLOW_MARK | SFC_DP_RX_FEAT_INTR, .dev_offload_capa = 0, diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index c1acd2ed99..a3331c5089 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -1178,6 +1178,9 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, if (offloads & DEV_RX_OFFLOAD_RSS_HASH) rxq_info->type_flags |= EFX_RXQ_FLAG_RSS_HASH; + if ((sa->negotiated_rx_meta & RTE_ETH_RX_META_USER_FLAG) != 0) + rxq_info->type_flags |= EFX_RXQ_FLAG_USER_FLAG; + if ((sa->negotiated_rx_meta & RTE_ETH_RX_META_USER_MARK) != 0) rxq_info->type_flags |= EFX_RXQ_FLAG_USER_MARK;