From patchwork Sun Sep 13 15:48:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bing Zhao X-Patchwork-Id: 77544 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2E3C7A04C9; Sun, 13 Sep 2020 17:49:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0C2811C012; Sun, 13 Sep 2020 17:49:26 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 8A87EE07 for ; Sun, 13 Sep 2020 17:49:24 +0200 (CEST) From: Bing Zhao To: thomas@monjalon.net, orika@nvidia.com, ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org Date: Sun, 13 Sep 2020 23:48:57 +0800 Message-Id: <1600012140-70151-2-git-send-email-bingz@nvidia.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1600012140-70151-1-git-send-email-bingz@nvidia.com> References: <1600012140-70151-1-git-send-email-bingz@nvidia.com> Subject: [dpdk-dev] [RFC PATCH v2 1/4] ethdev: add support for flow item transmit queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" New rte_flow_item_tx_queue is introduced to support matching on the traffic from a specific transmit queue. This is only for the egress direction. For ingress, the receive queue index will be part of the actions with ACTION QUEUE or RSS and there is no needs to match. By adding this flow item, it will be easy for the application to create some wildcard rules to distribute the egress traffic for the further handling. Normally, all the traffic from software to wire will have the same wildcard rule. If the packets need to be handled in different ways, packets' headers and metadata, etc. will be used for matching. But in some cases, for example: 1. Packets from different TX queues will have different next common behaviors. 2. Hairpin TX traffic should have different behavior from software egress traffic. Matching on the TX queue will help to reduce the rules number and simplify the rules management. The support for this new item will be decided by the PMD driver and the capacity of the NIC. Signed-off-by: Bing Zhao --- lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c index f8fdd68..4600e27 100644 --- a/lib/librte_ethdev/rte_flow.c +++ b/lib/librte_ethdev/rte_flow.c @@ -96,6 +96,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { MK_FLOW_ITEM(L2TPV3OIP, sizeof(struct rte_flow_item_l2tpv3oip)), MK_FLOW_ITEM(PFCP, sizeof(struct rte_flow_item_pfcp)), MK_FLOW_ITEM(ECPRI, sizeof(struct rte_flow_item_ecpri)), + MK_FLOW_ITEM(TX_QUEUE, sizeof(struct rte_flow_item_tx_queue)), }; /** Generate flow_action[] entry. */ diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index da8bfa5..264755a 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -537,6 +537,13 @@ enum rte_flow_item_type { */ RTE_FLOW_ITEM_TYPE_ECPRI, + /** + * Matches TX queue ID of a specific port for egress traffic. + * + * See struct rte_flow_item_tx_queue. + */ + RTE_FLOW_ITEM_TYPE_TX_QUEUE, + }; /** @@ -1580,6 +1587,29 @@ static const struct rte_flow_item_ecpri rte_flow_item_ecpri_mask = { #endif /** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ITEM_TYPE_TX_QUEUE + * + * Match egress traffic originating from a TX queue of a port. Port refers to + * a struct rte_eth_dev object on the application side and the transmit queue + * index must be in the range [0, nb_tx_queue - 1] previously supplied to + * rte_eth_dev_configure(). Normally only supported if the TX queue ID is known + * by the underlying PMD. + */ +struct rte_flow_item_tx_queue { + uint32_t queue; /**< DPDK TX queue ID of a specific port. */ +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_TX_QUEUE. */ +#ifndef __cplusplus +static const struct rte_flow_item_tx_queue rte_flow_item_tx_queue_mask = { + .queue = 0xffffffff, +}; +#endif + +/** * Matching pattern item definition. * * A pattern is formed by stacking items starting from the lowest protocol From patchwork Sun Sep 13 15:48:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bing Zhao X-Patchwork-Id: 77545 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7496BA04C9; Sun, 13 Sep 2020 17:49:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5417E1BE81; Sun, 13 Sep 2020 17:49:49 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 971C9E07 for ; Sun, 13 Sep 2020 17:49:47 +0200 (CEST) From: Bing Zhao To: thomas@monjalon.net, orika@nvidia.com, ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org Date: Sun, 13 Sep 2020 23:48:58 +0800 Message-Id: <1600012140-70151-3-git-send-email-bingz@nvidia.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1600012140-70151-1-git-send-email-bingz@nvidia.com> References: <1600012140-70151-1-git-send-email-bingz@nvidia.com> Subject: [dpdk-dev] [RFC PATCH v2 2/4] testpmd: add item transmit queue in flow CLI X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 the testpmd command line for flow creation, add the keyword 'tx_queue' in the pattern scope so the item transmit queue ID could be specified during the flow creation. The index of the transmit queue should be in the range [0, nb_tx_queue - 1] supplied to rte_eth_dev_configure() during initialization. Normal TX queues and hairpin TX queues will have a unified index number sequence. Signed-off-by: Bing Zhao --- app/test-pmd/cmdline_flow.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 6263d30..f7816fc 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -109,6 +109,8 @@ enum index { ITEM_PHY_PORT_INDEX, ITEM_PORT_ID, ITEM_PORT_ID_ID, + ITEM_TX_QUEUE, + ITEM_TX_QUEUE_ID, ITEM_MARK, ITEM_MARK_ID, ITEM_RAW, @@ -759,6 +761,7 @@ static const enum index next_item[] = { ITEM_VF, ITEM_PHY_PORT, ITEM_PORT_ID, + ITEM_TX_QUEUE, ITEM_MARK, ITEM_RAW, ITEM_ETH, @@ -1954,6 +1957,21 @@ static const struct token token_list[] = { .next = NEXT(item_port_id, NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY(struct rte_flow_item_port_id, id)), }, + [ITEM_TX_QUEUE] = { + .name = "tx_queue", + .help = "match traffic from a given transmit queue", + .priv = PRIV_ITEM(QUEUE, + sizeof(struct rte_flow_item_tx_queue)), + .next = NEXT(NEXT_ENTRY(ITEM_TX_QUEUE_ID)), + .call = parse_vc, + }, + [ITEM_TX_QUEUE_ID] = { + .name = "index", + .help = "TX queue index of this port", + .next = NEXT(NEXT_ENTRY(ITEM_NEXT), NEXT_ENTRY(UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_tx_queue, queue)), + }, [ITEM_MARK] = { .name = "mark", .help = "match traffic against value set in previously matched rule", From patchwork Sun Sep 13 15:48:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bing Zhao X-Patchwork-Id: 77546 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B138AA04C9; Sun, 13 Sep 2020 17:49:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 976811C0CD; Sun, 13 Sep 2020 17:49:57 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id B648DE07 for ; Sun, 13 Sep 2020 17:49:56 +0200 (CEST) From: Bing Zhao To: thomas@monjalon.net, orika@nvidia.com, ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org Date: Sun, 13 Sep 2020 23:48:59 +0800 Message-Id: <1600012140-70151-4-git-send-email-bingz@nvidia.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1600012140-70151-1-git-send-email-bingz@nvidia.com> References: <1600012140-70151-1-git-send-email-bingz@nvidia.com> Subject: [dpdk-dev] [RFC PATCH v2 3/4] ethdev: add hairpin bind APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 single port hairpin mode, all the hairpin TX and RX queues belong to the same device. After the queues are set up properly, there is no other dependency between the TX queue and its RX peer queue. The binding process that connected the TX and RX queues together from hardware level will be done automatically during the device start procedure. Everything required for binding will be configured and initialized before. But in two ports hairpin mode, there will be some cross-dependences between two different ports. Usually, the ports will be initialized serially by the master thread but not in parallel. The earlier port will not be able to enable the bind if the following peer port is not configured done with HW resources. What's more, if one port is detached / attached dynamically, it would introduce more trouble for the hairpin binding. To overcome these, new APIs for binding and unbinding are added. During startup, only the hairpin TX and RX peer queues will be set up. Nothing will be done when starting the device if the queues are without auto bind attribute. Only after the required ports pair started, the rte_eth_hairpin_bind() API can be called to bind the all TX queues of the egress port to the RX queues of the peer port. The connection between the egress and ingress ports pair will be established. rte_eth_hairpin_unbind() API could be used to disconnect the egress and the peer ingress ports. This should only be called before the device is closed if needed. Signed-off-by: Bing Zhao --- lib/librte_ethdev/rte_ethdev.c | 100 ++++++++++++++++++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 51 +++++++++++++++++ lib/librte_ethdev/rte_ethdev_driver.h | 52 ++++++++++++++++++ 3 files changed, 203 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 066751f..8a3dc73 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2175,6 +2175,106 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, return eth_err(port_id, ret); } +int +rte_eth_hairpin_bind(uint16_t tx_port, uint16_t rx_port) +{ + struct rte_eth_dev *dev; + struct rte_eth_dev *rdev; + uint16_t p; + uint16_t rp; + int ret = 0; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port, -EINVAL); + dev = &rte_eth_devices[tx_port]; + if (!dev->data->dev_started) { + RTE_ETHDEV_LOG(ERR, "TX port %d is not started", tx_port); + return -EBUSY; + } + + if (rx_port == RTE_MAX_ETHPORTS) { + RTE_ETH_FOREACH_DEV(p) { + rdev = &rte_eth_devices[p]; + if (!rdev->data->dev_started) { + RTE_ETHDEV_LOG(ERR, + "RX port %d is not started", p); + ret = -EBUSY; + goto error; + } + ret = (*dev->dev_ops->hairpin_bind)(dev, p); + if (ret) { + RTE_ETHDEV_LOG(ERR, "Failed to bind hairpin TX " + "%d to RX %d", tx_port, p); + goto error; + } + } + } else { + RTE_ETH_VALID_PORTID_OR_ERR_RET(rx_port, -EINVAL); + rdev = &rte_eth_devices[rx_port]; + if (!rdev->data->dev_started) { + RTE_ETHDEV_LOG(ERR, + "RX port %d is not started", rx_port); + return -EBUSY; + } + ret = (*dev->dev_ops->hairpin_bind)(dev, rx_port); + if (ret) + RTE_ETHDEV_LOG(ERR, "Failed to bind hairpin TX %d " + "to RX %d", tx_port, rx_port); + } + + return ret; + +error: + RTE_ETH_FOREACH_DEV(rp) { + if (rp < p) + (*dev->dev_ops->hairpin_unbind)(dev, rp); + } + return ret; +} + +int +rte_eth_hairpin_unbind(uint16_t tx_port, uint16_t rx_port) +{ + struct rte_eth_dev *dev; + struct rte_eth_dev *rdev; + uint16_t p; + uint16_t rp; + int ret = 0; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port, -EINVAL); + dev = &rte_eth_devices[tx_port]; + if (!dev->data->dev_started) { + RTE_ETHDEV_LOG(ERR, "TX port %d is stopped", tx_port); + return -EBUSY; + } + + if (rx_port == RTE_MAX_ETHPORTS) { + RTE_ETH_FOREACH_DEV(p) { + rdev = &rte_eth_devices[p]; + if (!rdev->data->dev_started) { + RTE_ETHDEV_LOG(ERR, "RX port %d is stopped", p); + ret = -EBUSY; + break; + } + ret = (*dev->dev_ops->hairpin_unbind)(dev, p); + if (ret) { + RTE_ETHDEV_LOG(ERR, "Failed to unbind hairpin " + "TX %d from RX %d", tx_port, p); + break; + } + } + } else { + RTE_ETH_VALID_PORTID_OR_ERR_RET(rx_port, -EINVAL); + rdev = &rte_eth_devices[rx_port]; + if (!rdev->data->dev_started) { + RTE_ETHDEV_LOG(ERR, "RX port %d is stopped", rx_port); + return -EBUSY; + } + ret = (*dev->dev_ops->hairpin_unbind)(dev, rx_port); + } + + return ret; +} + void rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent, void *userdata __rte_unused) diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index e7733d8..fb217b4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -2101,6 +2101,57 @@ int rte_eth_tx_hairpin_queue_setup const struct rte_eth_hairpin_conf *conf); /** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * Bind all hairpin TX queues of one port to the RX queues of the peer port. + * Only allowed after all hairpin queues are configured properly and the + * devices of TX and peer RX are in started state. + * + * @param tx_port + * The TX port identifier of the Ethernet device. + * @param rx_port + * The peer RX port identifier of the Ethernet device. + * RTE_MAX_ETHPORTS is allowed for traversal of all devices. + * RX port ID could have the same value with TX port ID. + * + * @return + * - (0) if successful. + * - (-EINVAL) if bad parameter. + * - (-EBUSY) if device is not in started state. + * - (-ENOTSUP) if hardware doesn't support. + * - Others detailed errors from PMD drivers. + */ +__rte_experimental +int rte_eth_hairpin_bind(uint16_t tx_port, uint16_t rx_port); + +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * Unbind all hairpin TX queues of one port from the RX queues of the peer port. + * This should be called before closing the TX or RX devices (optional). After + * unbind the hairpin ports pair, it is allowed to bind them again. + * Changing queues configuration should be after stopping a device. + * + * @param tx_port + * The TX port identifier of the Ethernet device. + * @param rx_port + * The peer RX port identifier of the Ethernet device. + * RTE_MAX_ETHPORTS is allowed for traversal of all devices. + * RX port ID could have the same value with TX port ID. + * + * @return + * - (0) if successful. + * - (-EINVAL) if bad parameter. + * - (-EBUSY) if device is not in started state. + * - (-ENOTSUP) if hardware doesn't support. + * - Others detailed errors from PMD drivers. + */ +__rte_experimental +int rte_eth_hairpin_unbind(uint16_t tx_port, uint16_t rx_port); + +/** * Return the NUMA socket to which an Ethernet device is connected * * @param port_id diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index 23cc1e0..b4efad6 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -575,6 +575,54 @@ typedef int (*eth_tx_hairpin_queue_setup_t) const struct rte_eth_hairpin_conf *hairpin_conf); /** + * @internal + * Bind all hairpin TX queues of one port to the RX queues of the peer port. + * + * @param dev + * ethdev handle of port. + * @param rx_port + * the peer RX port. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, bind successfully. + * @retval -ENOTSUP + * Bind API is not supported. + * @retval -EINVAL + * One of the parameters is invalid. + * @retval -EBUSY + * Device is not started. + */ +typedef int (*eth_hairpin_bind)(struct rte_eth_dev *dev, + uint16_t rx_port); + +/** + * @internal + * Unbind all hairpin TX queues of one port from the RX queues of the peer port. + * + * @param dev + * ethdev handle of port. + * @param rx_port + * the peer RX port. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, bind successfully. + * @retval -ENOTSUP + * Bind API is not supported. + * @retval -EINVAL + * One of the parameters is invalid. + * @retval -EBUSY + * Device is already stopped. + */ +typedef int (*eth_hairpin_unbind)(struct rte_eth_dev *dev, + uint16_t rx_port); + +/** * @internal A structure containing the functions exported by an Ethernet driver. */ struct eth_dev_ops { @@ -713,6 +761,10 @@ struct eth_dev_ops { /**< Set up device RX hairpin queue. */ eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup; /**< Set up device TX hairpin queue. */ + eth_hairpin_bind hairpin_bind; + /**< Bind all hairpin TX queues of device to the peer port RX queues. */ + eth_hairpin_unbind hairpin_unbind; + /**< Unbind all hairpin TX queues from the peer port RX queues. */ }; /** From patchwork Sun Sep 13 15:49:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bing Zhao X-Patchwork-Id: 77547 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4A65A04C9; Sun, 13 Sep 2020 17:50:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F5581C0D9; Sun, 13 Sep 2020 17:50:01 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 01D931C08C for ; Sun, 13 Sep 2020 17:50:00 +0200 (CEST) From: Bing Zhao To: thomas@monjalon.net, orika@nvidia.com, ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org Date: Sun, 13 Sep 2020 23:49:00 +0800 Message-Id: <1600012140-70151-5-git-send-email-bingz@nvidia.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1600012140-70151-1-git-send-email-bingz@nvidia.com> References: <1600012140-70151-1-git-send-email-bingz@nvidia.com> Subject: [dpdk-dev] [RFC PATCH v2 4/4] ethdev: add new attributes to hairpin queues config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" To support two ports hairpin mode and keep the backward compatibility for application, two new attribute members of hairpin queue config structure are added. `tx_explicit` means if PMD or application itself will insert the TX part flow rules. `manual_bind` means if the hairpin TX queue and peer RX queue will be bound automatically during device start stage. Different TX and RX queue pairs could have different values, but it is highly recommend that all paired queues between one egress and its peer ingress ports have the same values, in order not to bring any chaos to the system. The actual support of these attribute parameters will be checked and decided by the PMD driver. In a single port hairpin, if both are zero without any setting, the behavior will remain the same as before. It means no bind API needs to be called and no TX flow rules need to be inserted manually by the application. Signed-off-by: Bing Zhao --- lib/librte_ethdev/rte_ethdev.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index fb217b4..9560d60 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -996,6 +996,21 @@ struct rte_eth_hairpin_cap { #define RTE_ETH_MAX_HAIRPIN_PEERS 32 +/* + * Hairpin queue attribute parameters. + * Each TX queue and peer RX queue should have the same value. + * Default value 0 is for backward-compatibility, the same behaviors should + * remain if the value is not set (0). + */ +/**< Hairpin queues will be bound automatically */ +#define RTE_ETH_HAIRPIN_BIND_AUTO (0) +/**< Hairpin queues will be bound manually with bind API */ +#define RTE_ETH_HAIRPIN_BIND_MANUAL (1) +/**< Hairpin TX part flow rule will be inserted implicitly by PMD */ +#define RTE_ETH_HAIRPIN_TXRULE_IMPLICIT (0) +/**< Hairpin TX part flow rule will be inserted explicitly by APP */ +#define RTE_ETH_HAIRPIN_TXRULE_EXPLICIT (1) + /** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice @@ -1016,6 +1031,8 @@ struct rte_eth_hairpin_peer { struct rte_eth_hairpin_conf { uint16_t peer_count; /**< The number of peers. */ struct rte_eth_hairpin_peer peers[RTE_ETH_MAX_HAIRPIN_PEERS]; + uint16_t tx_explicit; /**< Explicit TX flow rule by APP. */ + uint16_t manual_bind; /**< Manually binding hairpin queues. */ }; /**