From patchwork Mon Oct 4 23:50:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 100459 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 18A83A0C41; Tue, 5 Oct 2021 01:50:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9A0B41276; Tue, 5 Oct 2021 01:50:26 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 7A67C4124E for ; Tue, 5 Oct 2021 01:50:23 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.137]) (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 B6FAD7F51B; Tue, 5 Oct 2021 02:50:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru B6FAD7F51B DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633391422; bh=peEQOJJJVLu9CJqmfEZxeF4K7u3bL4EpZDIsOMdvk18=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RtxrPN0MB1b1cxMmfRzW2tTjuHARjJg0ndAgqJVF17WLnMYfqaAV0LX8bTgXc94uR OEzJ5QJ9K04KqAHhakdOoqHgfs7M/ih1rVR1orLsWiPtC6AebpEdQVaQ492jYBw2L/ +foDI8dzSbNJE6ngwGPKrwlVTI9xksRvBM6Rpj+w= From: Ivan Malov To: dev@dpdk.org Cc: Ray Kinsella , Jerin Jacob , Thomas Monjalon , Ori Kam , Ajit Khaparde , Andrew Rybchenko , Andy Moreton , Wisam Jaddo , Xiaoyun Li , Ferruh Yigit Date: Tue, 5 Oct 2021 02:50:03 +0300 Message-Id: <20211004235007.12293-2-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211004235007.12293-1-ivan.malov@oktetlabs.ru> References: <20210923112012.14595-1-ivan.malov@oktetlabs.ru> <20211004235007.12293-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 1/5] ethdev: negotiate delivery of packet metadata from HW to 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" Provide an API to let the application control the NIC's ability to deliver specific kinds of per-packet metadata to the PMD. Checks for the NIC's ability to set these kinds of metadata in the first place (support for the flow actions) belong in flow API responsibility domain (flow validate mechanism). This topic is out of scope of the new API in question. The PMD's ability to deliver received metadata to the user by virtue of mbuf fields should be covered by mbuf library. It is also out of scope of the new API in question. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton Acked-by: Ray Kinsella Acked-by: Jerin Jacob --- app/test-flow-perf/main.c | 21 ++++++++++ app/test-pmd/testpmd.c | 37 ++++++++++++++++++ doc/guides/rel_notes/release_21_11.rst | 9 +++++ lib/ethdev/ethdev_driver.h | 22 +++++++++++ lib/ethdev/rte_ethdev.c | 25 ++++++++++++ lib/ethdev/rte_ethdev.h | 53 ++++++++++++++++++++++++++ lib/ethdev/rte_flow.h | 12 ++++++ lib/ethdev/version.map | 3 ++ 8 files changed, 182 insertions(+) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 9be8edc31d..4d01791f6f 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_metadata = 0; + + rx_metadata |= RTE_ETH_RX_METADATA_USER_FLAG; + rx_metadata |= RTE_ETH_RX_METADATA_USER_MARK; + + ret = rte_eth_rx_metadata_negotiate(port_id, &rx_metadata); + if (ret == 0) { + if (!(rx_metadata & RTE_ETH_RX_METADATA_USER_FLAG)) { + printf(":: flow action FLAG will not affect Rx mbufs on port=%u\n", + port_id); + } + + if (!(rx_metadata & RTE_ETH_RX_METADATA_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 97ae52e17e..bf80de4e80 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -533,6 +533,41 @@ int proc_id; */ unsigned int num_procs = 1; +static void +eth_rx_metadata_negotiate_mp(uint16_t port_id) +{ + uint64_t rx_meta_features = 0; + int ret; + + if (!is_proc_primary()) + return; + + rx_meta_features |= RTE_ETH_RX_METADATA_USER_FLAG; + rx_meta_features |= RTE_ETH_RX_METADATA_USER_MARK; + rx_meta_features |= RTE_ETH_RX_METADATA_TUNNEL_ID; + + ret = rte_eth_rx_metadata_negotiate(port_id, &rx_meta_features); + if (ret == 0) { + if (!(rx_meta_features & RTE_ETH_RX_METADATA_USER_FLAG)) { + TESTPMD_LOG(DEBUG, "Flow action FLAG will not affect Rx mbufs on port %u\n", + port_id); + } + + if (!(rx_meta_features & RTE_ETH_RX_METADATA_USER_MARK)) { + TESTPMD_LOG(DEBUG, "Flow action MARK will not affect Rx mbufs on port %u\n", + port_id); + } + + if (!(rx_meta_features & RTE_ETH_RX_METADATA_TUNNEL_ID)) { + TESTPMD_LOG(DEBUG, "Flow tunnel offload support might be limited or unavailable 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)); + } +} + static int eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf) @@ -1489,6 +1524,8 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id) int ret; int i; + eth_rx_metadata_negotiate_mp(pid); + 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 f099b1cca2..48fd045db7 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -129,6 +129,15 @@ New Features * Added tests to validate packets hard expiry. * Added tests to verify tunnel header verification in IPsec inbound. +* **Added an API to control delivery of Rx metadata from the HW to the PMD** + + A new API, ``rte_eth_rx_metadata_negotiate()``, was added. + The following parts of Rx metadata were defined: + + * ``RTE_ETH_RX_METADATA_USER_FLAG`` + * ``RTE_ETH_RX_METADATA_USER_MARK`` + * ``RTE_ETH_RX_METADATA_TUNNEL_ID`` + Removed Items ------------- diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index cc2c75261c..d073d63ba8 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -785,6 +785,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 the NIC's ability to deliver specific kinds of metadata to the PMD. + * + * @param dev + * Port (ethdev) handle + * + * @param[inout] features + * Feature selection buffer + * + * @return + * Negative errno value on error, zero otherwise + */ +typedef int (*eth_rx_metadata_negotiate_t)(struct rte_eth_dev *dev, + uint64_t *features); + /** * @internal A structure containing the functions exported by an Ethernet driver. */ @@ -945,6 +961,12 @@ struct eth_dev_ops { eth_representor_info_get_t representor_info_get; /**< Get representor info. */ + + /** + * Negotiate the NIC's ability to deliver specific + * kinds of metadata to the PMD. + */ + eth_rx_metadata_negotiate_t rx_metadata_negotiate; }; /** diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index daf5ca9242..a41fb8a398 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -6310,6 +6310,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_metadata_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_metadata_negotiate, -ENOTSUP); + return eth_err(port_id, + (*dev->dev_ops->rx_metadata_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 afdc53b674..6b2da6de0a 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -4902,6 +4902,59 @@ __rte_experimental int rte_eth_representor_info_get(uint16_t port_id, struct rte_eth_representor_info *info); +/** The NIC is able to deliver flag (if set) with packets to the PMD. */ +#define RTE_ETH_RX_METADATA_USER_FLAG (UINT64_C(1) << 0) + +/** The NIC is able to deliver mark ID with packets to the PMD. */ +#define RTE_ETH_RX_METADATA_USER_MARK (UINT64_C(1) << 1) + +/** The NIC is able to deliver tunnel ID with packets to the PMD. */ +#define RTE_ETH_RX_METADATA_TUNNEL_ID (UINT64_C(1) << 2) + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * Negotiate the NIC's ability to deliver specific kinds of metadata to the PMD. + * + * Invoke this API before the first rte_eth_dev_configure() invocation + * to let the PMD make preparations that are inconvenient to do later. + * + * The negotiation process is as follows: + * + * - the application requests features intending to use at least some of them; + * - the PMD responds with the guaranteed subset of the requested feature set; + * - the application can retry negotiation with another set of features; + * - the application can pass zero to clear the negotiation result; + * - the last negotiated result takes effect upon the ethdev start. + * + * @note + * The PMD is supposed to first consider enabling the requested feature set + * in its entirety. Only if it fails to do so, does it have the right to + * respond with a smaller set of the originally requested features. + * + * @note + * Return code (-ENOTSUP) does not necessarily mean that the requested + * features are unsupported. In this case, the application should just + * assume that these features can be used without prior negotiations. + * + * @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_metadata_negotiate(uint16_t port_id, uint64_t *features); + #include /** diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 7b1ed7f110..75656ff9f8 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -1904,6 +1904,10 @@ enum rte_flow_action_type { * PKT_RX_FDIR_ID mbuf flags. * * See struct rte_flow_action_mark. + * + * One should negotiate mark delivery from the NIC to the PMD. + * @see rte_eth_rx_metadata_negotiate() + * @see RTE_ETH_RX_METADATA_USER_MARK */ RTE_FLOW_ACTION_TYPE_MARK, @@ -1912,6 +1916,10 @@ enum rte_flow_action_type { * sets the PKT_RX_FDIR mbuf flag. * * No associated configuration structure. + * + * One should negotiate flag delivery from the NIC to the PMD. + * @see rte_eth_rx_metadata_negotiate() + * @see RTE_ETH_RX_METADATA_USER_FLAG */ RTE_FLOW_ACTION_TYPE_FLAG, @@ -4223,6 +4231,10 @@ rte_flow_tunnel_match(uint16_t port_id, /** * Populate the current packet processing state, if exists, for the given mbuf. * + * One should negotiate tunnel metadata delivery from the NIC to the HW. + * @see rte_eth_rx_metadata_negotiate() + * @see RTE_ETH_RX_METADATA_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 904bce6ea1..2e638c680e 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -247,6 +247,9 @@ EXPERIMENTAL { rte_mtr_meter_policy_delete; rte_mtr_meter_policy_update; rte_mtr_meter_policy_validate; + + # added in 21.11 + rte_eth_rx_metadata_negotiate; }; INTERNAL { From patchwork Mon Oct 4 23:50:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 100458 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 3BFD1A0C41; Tue, 5 Oct 2021 01:50:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C26D441262; Tue, 5 Oct 2021 01:50:25 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 7474941240 for ; Tue, 5 Oct 2021 01:50:23 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.137]) (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 0CB757F6CD; Tue, 5 Oct 2021 02:50:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 0CB757F6CD DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633391423; bh=pLjA/nyeVLw4juocgY7L6x0uphvxFYGP4YyQ2oID+V0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fD6DpY2vfDfSsciknKNqLishv7MaAC61pP4IZ6oFcIkveYLrFqtLDC7lmEnAGWfpa xg3J7IYIP0Z9NDTwT1VOu8BuAzbZ9sO8iT2jqx0eupMwTWUmeliLn3YP9Pq02B8RCP VnbmoZcn/2nBy19irL1v2Vzce7jFu3/1idspvOfI= From: Ivan Malov To: dev@dpdk.org Cc: Ray Kinsella , Jerin Jacob , Thomas Monjalon , Ori Kam , Ajit Khaparde , Andrew Rybchenko , Andy Moreton Date: Tue, 5 Oct 2021 02:50:04 +0300 Message-Id: <20211004235007.12293-3-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211004235007.12293-1-ivan.malov@oktetlabs.ru> References: <20210923112012.14595-1-ivan.malov@oktetlabs.ru> <20211004235007.12293-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 2/5] net/sfc: support API to negotiate delivery of Rx metadata 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" Initial support for the method. Later patches will extend it to make FLAG and MARK delivery available on EF100 native datapath. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc.h | 2 ++ drivers/net/sfc/sfc_ethdev.c | 29 +++++++++++++++++++++++++++++ drivers/net/sfc/sfc_flow.c | 13 +++++++++++++ drivers/net/sfc/sfc_mae.c | 22 ++++++++++++++++++++-- 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index 331e06bac6..079216c1fb 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_metadata; + uint32_t rxd_wait_timeout_ns; }; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 2db0d000c3..00b2c84b46 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1859,6 +1859,28 @@ 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_metadata_negotiate(struct rte_eth_dev *dev, uint64_t *features) +{ + struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev); + uint64_t supported = 0; + + sfc_adapter_lock(sa); + + if ((sa->priv.dp_rx->features & SFC_DP_RX_FEAT_FLOW_FLAG) != 0) + supported |= RTE_ETH_RX_METADATA_USER_FLAG; + + if ((sa->priv.dp_rx->features & SFC_DP_RX_FEAT_FLOW_MARK) != 0) + supported |= RTE_ETH_RX_METADATA_USER_MARK; + + sa->negotiated_rx_metadata = supported & *features; + *features = sa->negotiated_rx_metadata; + + 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 +1928,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_metadata_negotiate = sfc_rx_metadata_negotiate, }; /** @@ -1998,6 +2021,12 @@ 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) { + /* FLAG and MARK are always available from Rx prefix. */ + sa->negotiated_rx_metadata |= RTE_ETH_RX_METADATA_USER_FLAG; + sa->negotiated_rx_metadata |= RTE_ETH_RX_METADATA_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..1f54bea3d9 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -1760,6 +1760,7 @@ sfc_flow_parse_actions(struct sfc_adapter *sa, 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_metadata = sa->negotiated_rx_metadata; uint32_t actions_set = 0; const uint32_t fate_actions_mask = (1UL << RTE_FLOW_ACTION_TYPE_QUEUE) | (1UL << RTE_FLOW_ACTION_TYPE_RSS) | @@ -1832,6 +1833,12 @@ sfc_flow_parse_actions(struct sfc_adapter *sa, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "FLAG action is not supported on the current Rx datapath"); return -rte_errno; + } else if ((rx_metadata & + RTE_ETH_RX_METADATA_USER_FLAG) == 0) { + rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, NULL, + "flag delivery has not been negotiated"); + return -rte_errno; } spec_filter->template.efs_flags |= @@ -1849,6 +1856,12 @@ sfc_flow_parse_actions(struct sfc_adapter *sa, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "MARK action is not supported on the current Rx datapath"); return -rte_errno; + } else if ((rx_metadata & + RTE_ETH_RX_METADATA_USER_MARK) == 0) { + rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, NULL, + "mark delivery has not been negotiated"); + return -rte_errno; } rc = sfc_flow_parse_mark(sa, actions->conf, flow); diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 4b520bc619..63b917a323 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_metadata = sa->negotiated_rx_metadata; 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_metadata & RTE_ETH_RX_METADATA_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, + "flag delivery 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_metadata & RTE_ETH_RX_METADATA_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, + "mark delivery 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 Mon Oct 4 23:50:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 100460 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 6273EA0C41; Tue, 5 Oct 2021 01:50:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ECC8941281; Tue, 5 Oct 2021 01:50:27 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id B141F41240 for ; Tue, 5 Oct 2021 01:50:23 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.137]) (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 4E2017F6D6; Tue, 5 Oct 2021 02:50:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 4E2017F6D6 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633391423; bh=2hcDPm6K8eXAAwpYzMtcDdLoA1xgnZ1wVPoV6mK7rU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gsNx1MCAFYtHbmWp7GxOu0K1pE59KSp5XhHpat4PDWQb45lsR1N1kIT4v3IwJm/r8 wySGEmM2+X1BH45cO6+FCRA/k4IpxlH2Bm8Lshi9WfUe+ywHOOGP1foAFCripXN5+J biKAF8I321Qyw3m6j33/sEVKS0Hhn9eiB84xwhww= From: Ivan Malov To: dev@dpdk.org Cc: Ray Kinsella , Jerin Jacob , Thomas Monjalon , Ori Kam , Ajit Khaparde , Andrew Rybchenko , Andy Moreton Date: Tue, 5 Oct 2021 02:50:05 +0300 Message-Id: <20211004235007.12293-4-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211004235007.12293-1-ivan.malov@oktetlabs.ru> References: <20210923112012.14595-1-ivan.malov@oktetlabs.ru> <20211004235007.12293-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 3/5] net/sfc: support flow mark delivery 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" MAE counter engine gets generation counts by virtue of the mark, so the code to extract the field is already in place, but flow action MARK doesn't benefit from it. Support this use case, too. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- 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 1bf04f565a..b634c8f23a 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..5b924010bd 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_metadata & RTE_ETH_RX_METADATA_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 Mon Oct 4 23:50:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 100461 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 39518A0C41; Tue, 5 Oct 2021 01:50:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54F23412A8; Tue, 5 Oct 2021 01:50:29 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id CFED44124E for ; Tue, 5 Oct 2021 01:50:23 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.137]) (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 90BDE7F6D7; Tue, 5 Oct 2021 02:50:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 90BDE7F6D7 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633391423; bh=FYFAy2q8aTX04sYVV8zbCFD+wk4hhkWDUgz1hm8ivM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=k8J/6JU9gw8MzxJLTMcv861bKEzh3UBtMzP0zp/lE8RfH7c4sB/wLq0BXVyb9prWC Lhbt6P254WgMNPvYhym4oi9zXg35nSeVzcEEbFSgZvioky0JLf3/gBnzMlSwpZi2PY yBGzak6gZ4ZqTjRMJn6VD0RVNnxjRIciZDqyUJy0= From: Ivan Malov To: dev@dpdk.org Cc: Ray Kinsella , Jerin Jacob , Thomas Monjalon , Ori Kam , Ajit Khaparde , Andrew Rybchenko , Andy Moreton Date: Tue, 5 Oct 2021 02:50:06 +0300 Message-Id: <20211004235007.12293-5-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211004235007.12293-1-ivan.malov@oktetlabs.ru> References: <20210923112012.14595-1-ivan.malov@oktetlabs.ru> <20211004235007.12293-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 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 Reviewed-by: Andy Moreton --- 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 Mon Oct 4 23:50:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 100462 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 E9E92A0C41; Tue, 5 Oct 2021 01:50:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A72A412B3; Tue, 5 Oct 2021 01:50:30 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 2EF6D41240 for ; Tue, 5 Oct 2021 01:50:24 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.137]) (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 D25C67F523; Tue, 5 Oct 2021 02:50:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru D25C67F523 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633391423; bh=j9oTzJyFB0jyeeA2LelFqmMk9PQvxNeRk+OkqrfB5II=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UjRzZulwLjf45J1kYwrkime3FfYX6JN+F6tx9NfTb9URec23ZZC89RP/I7lyG+arJ B6OBDlNRcqQDoswZKIouxO5bm49g17xaln7quTqCjfYyyoVDEkXXkVh1cAc/PW+0xD /ybWDmfog2m5+p6T9MmOifSAm+XR6MnAE5/JAnXg= From: Ivan Malov To: dev@dpdk.org Cc: Ray Kinsella , Jerin Jacob , Thomas Monjalon , Ori Kam , Ajit Khaparde , Andrew Rybchenko , Andy Moreton Date: Tue, 5 Oct 2021 02:50:07 +0300 Message-Id: <20211004235007.12293-6-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211004235007.12293-1-ivan.malov@oktetlabs.ru> References: <20210923112012.14595-1-ivan.malov@oktetlabs.ru> <20211004235007.12293-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 5/5] net/sfc: report 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" Detect the flag in Rx prefix and pass it to users. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- 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 b634c8f23a..7d0d6b3d00 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 5b924010bd..5e120f5851 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_metadata & RTE_ETH_RX_METADATA_USER_FLAG) != 0) + rxq_info->type_flags |= EFX_RXQ_FLAG_USER_FLAG; + if ((sa->negotiated_rx_metadata & RTE_ETH_RX_METADATA_USER_MARK) != 0) rxq_info->type_flags |= EFX_RXQ_FLAG_USER_MARK;