ethdev: fix compilation related to hairpin

Message ID 1572967943-129125-1-git-send-email-orika@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: fix compilation related to hairpin |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/Intel-compilation fail apply issues
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Ori Kam Nov. 5, 2019, 3:32 p.m. UTC
This patch solves a compilation issue that is caused due to using
internal function (is_rx_hairpin_queue) inside inline function.

The solution is to remove the usage of the functions
from the burst functions.

Fixes: 60b476d5da3c ("ethdev: add support for hairpin queue")
Cc: orika@mellanox.com

Signed-off-by: Ori Kam <orika@mellanox.com>
---

---
 lib/librte_ethdev/rte_ethdev.h        | 40 -----------------------------------
 lib/librte_ethdev/rte_ethdev_driver.h | 28 ++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 40 deletions(-)
  

Comments

Ferruh Yigit Nov. 5, 2019, 5:29 p.m. UTC | #1
On 11/5/2019 3:32 PM, Ori Kam wrote:
> This patch solves a compilation issue that is caused due to using
> internal function (is_rx_hairpin_queue) inside inline function.
> 
> The solution is to remove the usage of the functions
> from the burst functions.
> 
> Fixes: 60b476d5da3c ("ethdev: add support for hairpin queue")
> Cc: orika@mellanox.com
> 
> Signed-off-by: Ori Kam <orika@mellanox.com>

Squashed into relevant commit in next-net, thanks.
  

Patch

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index e6ef4b4..f0df03d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -4259,36 +4259,6 @@  int rte_eth_dev_hairpin_capability_get(uint16_t port_id,
 #include <rte_ethdev_core.h>
 
 /**
- * @internal
- * Check if the selected Rx queue is hairpin queue.
- *
- * @param dev
- *  Pointer to the selected device.
- * @param queue_id
- *  The selected queue.
- *
- * @return
- *   - (1) if the queue is hairpin queue, 0 otherwise.
- */
-int
-rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
-
-/**
- * @internal
- * Check if the selected Tx queue is hairpin queue.
- *
- * @param dev
- *  Pointer to the selected device.
- * @param queue_id
- *  The selected queue.
- *
- * @return
- *   - (1) if the queue is hairpin queue, 0 otherwise.
- */
-int
-rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
-
-/**
  *
  * Retrieve a burst of input packets from a receive queue of an Ethernet
  * device. The retrieved packets are stored in *rte_mbuf* structures whose
@@ -4385,11 +4355,6 @@  int rte_eth_dev_hairpin_capability_get(uint16_t port_id,
 		RTE_ETHDEV_LOG(ERR, "Invalid RX queue_id=%u\n", queue_id);
 		return 0;
 	}
-	if (rte_eth_dev_is_rx_hairpin_queue(dev, queue_id)) {
-		RTE_ETHDEV_LOG(ERR, "Rx burst failed, queue_id=%u is hairpin queue\n",
-			       queue_id);
-		return 0;
-	}
 #endif
 	nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
 				     rx_pkts, nb_pkts);
@@ -4656,11 +4621,6 @@  static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
 		return 0;
 	}
-	if (rte_eth_dev_is_tx_hairpin_queue(dev, queue_id)) {
-		RTE_ETHDEV_LOG(ERR, "Tx burst failed, queue_id=%u is hairpin queue\n",
-			       queue_id);
-		return 0;
-	}
 #endif
 
 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h
index 59d4c01..99d4cd6 100644
--- a/lib/librte_ethdev/rte_ethdev_driver.h
+++ b/lib/librte_ethdev/rte_ethdev_driver.h
@@ -30,6 +30,34 @@ 
 
 /**
  * @internal
+ * Check if the selected Rx queue is hairpin queue.
+ *
+ * @param dev
+ *  Pointer to the selected device.
+ * @param queue_id
+ *  The selected queue.
+ *
+ * @return
+ *   - (1) if the queue is hairpin queue, 0 otherwise.
+ */
+int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
+
+/**
+ * @internal
+ * Check if the selected Tx queue is hairpin queue.
+ *
+ * @param dev
+ *  Pointer to the selected device.
+ * @param queue_id
+ *  The selected queue.
+ *
+ * @return
+ *   - (1) if the queue is hairpin queue, 0 otherwise.
+ */
+int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
+
+/**
+ * @internal
  * Returns a ethdev slot specified by the unique identifier name.
  *
  * @param	name