[v1,21/24] i40e: add dummy vector implementation for LoongArch

Message ID 20220528093311.123946-22-zhoumin@loongson.cn (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Support LoongArch architecture |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Min Zhou May 28, 2022, 9:33 a.m. UTC
The purpose of this patch is used to fix building issues for
LoongArch architecture. The hardware instructions based vector
implementation will come in a future patch.

Signed-off-by: Min Zhou <zhoumin@loongson.cn>
---
 drivers/net/i40e/i40e_rxtx_vec_lsx.c | 54 ++++++++++++++++++++++++++++
 drivers/net/i40e/meson.build         |  2 ++
 2 files changed, 56 insertions(+)
 create mode 100644 drivers/net/i40e/i40e_rxtx_vec_lsx.c
  

Patch

diff --git a/drivers/net/i40e/i40e_rxtx_vec_lsx.c b/drivers/net/i40e/i40e_rxtx_vec_lsx.c
new file mode 100644
index 0000000000..727dc178f2
--- /dev/null
+++ b/drivers/net/i40e/i40e_rxtx_vec_lsx.c
@@ -0,0 +1,54 @@ 
+/*
+ * SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2022 Loongson Technology Corporation Limited
+ */
+
+#include "i40e_ethdev.h"
+#include "i40e_rxtx.h"
+
+/* The vector support will come later */
+#ifdef RTE_ARCH_NO_VECTOR
+uint16_t
+i40e_recv_scattered_pkts_vec(__rte_unused void *rx_queue,
+		__rte_unused struct rte_mbuf **rx_pkts,
+		__rte_unused uint16_t nb_pkts)
+{
+	return 0;
+}
+
+uint16_t
+i40e_recv_pkts_vec(__rte_unused void *rx_queue,
+		__rte_unused struct rte_mbuf **rx_pkts,
+		__rte_unused uint16_t nb_pkts)
+{
+	return 0;
+}
+uint16_t
+i40e_xmit_fixed_burst_vec(__rte_unused void *tx_queue,
+		__rte_unused struct rte_mbuf **tx_pkts,
+		__rte_unused uint16_t nb_pkts)
+{
+	return 0;
+}
+void __rte_cold
+i40e_rx_queue_release_mbufs_vec(__rte_unused struct i40e_rx_queue *rxq)
+{
+}
+int __rte_cold
+i40e_rxq_vec_setup(__rte_unused struct i40e_rx_queue *rxq)
+{
+	return -1;
+}
+int __rte_cold
+i40e_txq_vec_setup(__rte_unused struct i40e_tx_queue *txq)
+{
+	return -1;
+}
+int __rte_cold
+i40e_rx_vec_dev_conf_condition_check(__rte_unused struct rte_eth_dev *dev)
+{
+	return -1;
+}
+#else
+#error "The current version of LoongArch does not support vector!"
+#endif
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index efc5f93e35..9775f05da1 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -75,6 +75,8 @@  elif arch_subdir == 'ppc'
        sources += files('i40e_rxtx_vec_altivec.c')
 elif arch_subdir == 'arm'
        sources += files('i40e_rxtx_vec_neon.c')
+elif arch_subdir == 'loongarch'
+       sources += files('i40e_rxtx_vec_lsx.c')
 endif
 
 headers = files('rte_pmd_i40e.h')