DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org, Matan Azrad <matan@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Viacheslav Ovsiienko <viacheslavo@mellanox.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Ray Kinsella <mdr@ashroe.eu>, Neil Horman <nhorman@tuxdriver.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH v2 5/7] ethdev: use hairpin helper functions
Date: Thu,  3 Sep 2020 22:09:57 +0100	[thread overview]
Message-ID: <20200903211000.244931-5-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20200903211000.244931-1-ferruh.yigit@intel.com>

Hairpin helper functions were not used by drivers, but it was used only
local to ethdev. They are:
'rte_eth_dev_is_rx_hairpin_queue()'
'rte_eth_dev_is_tx_hairpin_queue()'

Exposing them as internal APIs and update mlx5 driver (only user of
hairpin) to use them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/mlx5/mlx5_rxq.c              | 4 ++--
 drivers/net/mlx5/mlx5_txq.c              | 4 ++--
 lib/librte_ethdev/rte_ethdev_driver.h    | 2 ++
 lib/librte_ethdev/rte_ethdev_version.map | 2 ++
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 946f7454f6..1b729f7ab2 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -542,7 +542,7 @@ mlx5_rx_queue_stop(struct rte_eth_dev *dev, uint16_t idx)
 	eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
 	int ret;
 
-	if (dev->data->rx_queue_state[idx] == RTE_ETH_QUEUE_STATE_HAIRPIN) {
+	if (rte_eth_dev_is_rx_hairpin_queue(dev, idx)) {
 		DRV_LOG(ERR, "Hairpin queue can't be stopped");
 		rte_errno = EINVAL;
 		return -EINVAL;
@@ -653,7 +653,7 @@ mlx5_rx_queue_start(struct rte_eth_dev *dev, uint16_t idx)
 {
 	int ret;
 
-	if (dev->data->rx_queue_state[idx] == RTE_ETH_QUEUE_STATE_HAIRPIN) {
+	if (rte_eth_dev_is_rx_hairpin_queue(dev, idx)) {
 		DRV_LOG(ERR, "Hairpin queue can't be started");
 		rte_errno = EINVAL;
 		return -EINVAL;
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 66ad368e64..450d9641de 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -244,7 +244,7 @@ mlx5_tx_queue_stop(struct rte_eth_dev *dev, uint16_t idx)
 {
 	int ret;
 
-	if (dev->data->tx_queue_state[idx] == RTE_ETH_QUEUE_STATE_HAIRPIN) {
+	if (rte_eth_dev_is_tx_hairpin_queue(dev, idx)) {
 		DRV_LOG(ERR, "Hairpin queue can't be stopped");
 		rte_errno = EINVAL;
 		return -EINVAL;
@@ -371,7 +371,7 @@ mlx5_tx_queue_start(struct rte_eth_dev *dev, uint16_t idx)
 {
 	int ret;
 
-	if (dev->data->tx_queue_state[idx] == RTE_ETH_QUEUE_STATE_HAIRPIN) {
+	if (rte_eth_dev_is_tx_hairpin_queue(dev, idx)) {
 		DRV_LOG(ERR, "Hairpin queue can't be started");
 		rte_errno = EINVAL;
 		return -EINVAL;
diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h
index 3d1bc33272..5dfe9fdf1a 100644
--- a/lib/librte_ethdev/rte_ethdev_driver.h
+++ b/lib/librte_ethdev/rte_ethdev_driver.h
@@ -734,6 +734,7 @@ struct eth_dev_ops {
  * @return
  *   - (1) if the queue is hairpin queue, 0 otherwise.
  */
+__rte_internal
 int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
 
 /**
@@ -748,6 +749,7 @@ int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
  * @return
  *   - (1) if the queue is hairpin queue, 0 otherwise.
  */
+__rte_internal
 int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
 
 /**
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6a84f3d76d..5db3fb156a 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -237,6 +237,8 @@ INTERNAL {
 	rte_eth_dev_attach_secondary;
 	rte_eth_dev_create;
 	rte_eth_dev_destroy;
+	rte_eth_dev_is_rx_hairpin_queue;
+	rte_eth_dev_is_tx_hairpin_queue;
 	rte_eth_dev_probing_finish;
 	rte_eth_dev_release_port;
 	rte_eth_devargs_parse;
-- 
2.25.4


  parent reply	other threads:[~2020-09-03 21:11 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24  9:40 [dpdk-dev] [PATCH 1/7] ethdev: remove legacy descriptor status check API Ferruh Yigit
2020-08-24  9:40 ` [dpdk-dev] [PATCH 2/7] ethdev: move inline device operations Ferruh Yigit
2020-08-29 11:57   ` Andrew Rybchenko
2020-08-31 12:25     ` Ferruh Yigit
2020-08-24  9:40 ` [dpdk-dev] [PATCH 3/7] ethdev: make device operations struct private Ferruh Yigit
2020-08-29 12:03   ` Andrew Rybchenko
2020-08-24  9:40 ` [dpdk-dev] [PATCH 4/7] ethdev: mark internal functions Ferruh Yigit
2020-08-29 12:07   ` Andrew Rybchenko
2020-08-24  9:40 ` [dpdk-dev] [PATCH 5/7] ethdev: use hairpin helper functions Ferruh Yigit
2020-08-29 12:13   ` Andrew Rybchenko
2020-08-24  9:40 ` [dpdk-dev] [PATCH 6/7] ethdev: remove invalid symbols from map file Ferruh Yigit
2020-08-29 12:14   ` Andrew Rybchenko
2020-08-24  9:40 ` [dpdk-dev] [PATCH 7/7] ethdev: remove underscore prefix from internal API Ferruh Yigit
2020-08-29 12:16   ` Andrew Rybchenko
2020-08-29 11:47 ` [dpdk-dev] [PATCH 1/7] ethdev: remove legacy descriptor status check API Andrew Rybchenko
2020-09-03 21:09 ` [dpdk-dev] [PATCH v2 " Ferruh Yigit
2020-09-03 21:09   ` [dpdk-dev] [PATCH v2 2/7] ethdev: move inline device operations Ferruh Yigit
2020-09-03 21:09   ` [dpdk-dev] [PATCH v2 3/7] ethdev: make device operations struct private Ferruh Yigit
2020-09-08 12:19     ` Ferruh Yigit
2020-09-03 21:09   ` [dpdk-dev] [PATCH v2 4/7] ethdev: mark internal functions Ferruh Yigit
2020-09-03 21:09   ` Ferruh Yigit [this message]
2020-09-03 21:09   ` [dpdk-dev] [PATCH v2 6/7] ethdev: remove invalid symbols from map file Ferruh Yigit
2020-09-03 21:09   ` [dpdk-dev] [PATCH v2 7/7] ethdev: remove underscore prefix from internal API Ferruh Yigit
2020-09-09 11:12 ` [dpdk-dev] [PATCH v3 1/7] ethdev: deprecate descriptor status check API Ferruh Yigit
2020-09-09 11:12   ` [dpdk-dev] [PATCH v3 2/7] ethdev: move inline device operations Ferruh Yigit
2020-09-09 11:12   ` [dpdk-dev] [PATCH v3 3/7] ethdev: make device operations struct private Ferruh Yigit
2020-09-09 12:57     ` Ferruh Yigit
2020-09-09 11:12   ` [dpdk-dev] [PATCH v3 4/7] ethdev: mark internal functions Ferruh Yigit
2020-09-09 11:12   ` [dpdk-dev] [PATCH v3 5/7] ethdev: use hairpin helper functions Ferruh Yigit
2020-09-09 11:12   ` [dpdk-dev] [PATCH v3 6/7] ethdev: remove invalid symbols from map file Ferruh Yigit
2020-09-09 11:12   ` [dpdk-dev] [PATCH v3 7/7] ethdev: remove underscore prefix from internal API Ferruh Yigit
2020-09-09 12:07   ` [dpdk-dev] [PATCH v3 1/7] ethdev: deprecate descriptor status check API David Marchand
2020-09-09 13:01 ` [dpdk-dev] [PATCH v4 " Ferruh Yigit
2020-09-09 13:01   ` [dpdk-dev] [PATCH v4 2/7] ethdev: move inline device operations Ferruh Yigit
2020-09-10  1:56     ` Sachin Saxena (OSS)
2020-09-09 13:01   ` [dpdk-dev] [PATCH v4 3/7] ethdev: make device operations struct private Ferruh Yigit
2020-09-09 13:01   ` [dpdk-dev] [PATCH v4 4/7] ethdev: mark internal functions Ferruh Yigit
2020-09-09 13:01   ` [dpdk-dev] [PATCH v4 5/7] ethdev: use hairpin helper functions Ferruh Yigit
2020-09-09 13:01   ` [dpdk-dev] [PATCH v4 6/7] ethdev: remove invalid symbols from map file Ferruh Yigit
2020-09-09 13:01   ` [dpdk-dev] [PATCH v4 7/7] ethdev: remove underscore prefix from internal API Ferruh Yigit
2020-09-10  2:04     ` Sachin Saxena (OSS)
2020-09-10 12:50   ` [dpdk-dev] [PATCH v4 1/7] ethdev: deprecate descriptor status check API Ferruh Yigit
2020-11-19 11:58 ` [dpdk-dev] [v21.02 v3 00/10] cppcheck Ferruh Yigit
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 01/10] app/procinfo: fix redundant condition Ferruh Yigit
2021-01-08 10:36     ` David Marchand
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 02/10] app/procinfo: fix negative check on unsigned variable Ferruh Yigit
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 03/10] app/procinfo: remove suspicious sizeof Ferruh Yigit
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 04/10] app/procinfo: remove useless assignment Ferruh Yigit
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 05/10] net/pcap: remove local variable shadowing outer one Ferruh Yigit
2021-01-08 10:31     ` [dpdk-dev] [dpdk-stable] " David Marchand
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 06/10] net/bonding: " Ferruh Yigit
2021-01-08 10:34     ` David Marchand
2021-01-11  1:03     ` Min Hu (Connor)
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 07/10] net/af_xdp: remove useless assignment Ferruh Yigit
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 08/10] net/bnxt: fix redundant return Ferruh Yigit
2020-11-19 11:58   ` [dpdk-dev] [v21.02 v3 09/10] app/crypto-perf: remove always true condition Ferruh Yigit
2020-11-23 15:25     ` Zhang, Roy Fan
2020-11-19 11:59   ` [dpdk-dev] [v21.02 v3 10/10] net/avp: " Ferruh Yigit
2020-11-20 17:40     ` Steven Webster
2021-01-11  9:47   ` [dpdk-dev] [v21.02 v3 00/10] cppcheck David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200903211000.244931-5-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=mdr@ashroe.eu \
    --cc=nhorman@tuxdriver.com \
    --cc=shahafs@mellanox.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).