net/sfc: support initialising different Rx queue types
[dpdk.git] / drivers / net / sfc / sfc_ev.h
index 2c401c7..3f3c4b5 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- * Copyright (c) 2016-2018 Solarflare Communications Inc.
- * All rights reserved.
+ * Copyright(c) 2019-2021 Xilinx, Inc.
+ * Copyright(c) 2016-2019 Solarflare Communications Inc.
  *
  * This software was jointly developed between OKTET Labs (under contract
  * for Solarflare) and Solarflare Communications, Inc.
@@ -10,7 +10,7 @@
 #ifndef _SFC_EV_H_
 #define _SFC_EV_H_
 
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
 
 #include "efx.h"
 
@@ -60,6 +60,12 @@ struct sfc_evq {
        unsigned int                    entries;
 };
 
+static inline sfc_sw_index_t
+sfc_mgmt_evq_sw_index(__rte_unused const struct sfc_adapter_shared *sas)
+{
+       return 0;
+}
+
 /*
  * Functions below define event queue to transmit/receive queue and vice
  * versa mapping.
@@ -69,15 +75,48 @@ struct sfc_evq {
  * Tx event queues follow Rx event queues.
  */
 
-static inline unsigned int
-sfc_evq_index_by_rxq_sw_index(__rte_unused struct sfc_adapter *sa,
-                             unsigned int rxq_sw_index)
+static inline sfc_ethdev_qid_t
+sfc_ethdev_rx_qid_by_rxq_sw_index(__rte_unused struct sfc_adapter_shared *sas,
+                                 sfc_sw_index_t rxq_sw_index)
+{
+       /* Only ethdev queues are present for now */
+       return rxq_sw_index;
+}
+
+static inline sfc_sw_index_t
+sfc_rxq_sw_index_by_ethdev_rx_qid(__rte_unused struct sfc_adapter_shared *sas,
+                                 sfc_ethdev_qid_t ethdev_qid)
+{
+       /* Only ethdev queues are present for now */
+       return ethdev_qid;
+}
+
+static inline sfc_sw_index_t
+sfc_evq_sw_index_by_rxq_sw_index(__rte_unused struct sfc_adapter *sa,
+                                sfc_sw_index_t rxq_sw_index)
 {
        return 1 + rxq_sw_index;
 }
 
-static inline unsigned int
-sfc_evq_index_by_txq_sw_index(struct sfc_adapter *sa, unsigned int txq_sw_index)
+static inline sfc_ethdev_qid_t
+sfc_ethdev_tx_qid_by_txq_sw_index(__rte_unused struct sfc_adapter_shared *sas,
+                                 sfc_sw_index_t txq_sw_index)
+{
+       /* Only ethdev queues are present for now */
+       return txq_sw_index;
+}
+
+static inline sfc_sw_index_t
+sfc_txq_sw_index_by_ethdev_tx_qid(__rte_unused struct sfc_adapter_shared *sas,
+                                 sfc_ethdev_qid_t ethdev_qid)
+{
+       /* Only ethdev queues are present for now */
+       return ethdev_qid;
+}
+
+static inline sfc_sw_index_t
+sfc_evq_sw_index_by_txq_sw_index(struct sfc_adapter *sa,
+                                sfc_sw_index_t txq_sw_index)
 {
        return 1 + sa->eth_dev->data->nb_rx_queues + txq_sw_index;
 }