[spp] [PATCH v3 03/17] spp_mirror: add support of multi-queue

x-fn-spp-ml at ntt-tx.co.jp x-fn-spp-ml at ntt-tx.co.jp
Tue Feb 25 06:56:25 CET 2020


From: Hideyuki Yamashita <yamashita.hideyuki at ntt-tx.co.jp>

By changing common code under shared directory to achieve multi-queue,
existing code of spp_mirror should be changed also for successful
compile.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki at ntt-tx.co.jp>
Signed-off-by: Naoki Takada <ntakada14 at gmail.com>
---
 src/mirror/mir_cmd_runner.c |  3 ++-
 src/mirror/spp_mirror.c     | 12 ++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/mirror/mir_cmd_runner.c b/src/mirror/mir_cmd_runner.c
index fb1695f..5153b65 100644
--- a/src/mirror/mir_cmd_runner.c
+++ b/src/mirror/mir_cmd_runner.c
@@ -156,7 +156,8 @@ update_port(enum sppwk_action wk_action,
 	sppwk_get_mng_data(NULL, &comp_info_base, NULL, NULL,
 			&change_component, NULL);
 	comp_info = (comp_info_base + comp_lcore_id);
-	port_info = get_sppwk_port(port->iface_type, port->iface_no);
+	port_info = get_sppwk_port(port->iface_type, port->iface_no,
+			port->queue_no);
 	if (dir == SPPWK_PORT_DIR_RX) {
 		nof_ports = &comp_info->nof_rx;
 		ports = comp_info->rx_ports;
diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index e5852aa..2bfbf66 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -340,7 +340,8 @@ mirror_proc(int id)
 	nb_rx = sppwk_eth_ring_stats_rx_burst(rx->ethdev_port_id,
 			rx->iface_type, rx->iface_no, 0, bufs, MAX_PKT_BURST);
 #else
-	nb_rx = rte_eth_rx_burst(rx->ethdev_port_id, 0, bufs, MAX_PKT_BURST);
+	nb_rx = rte_eth_rx_burst(rx->ethdev_port_id, rx->queue_no, bufs,
+			MAX_PKT_BURST);
 #endif
 
 	if (unlikely(nb_rx == 0))
@@ -403,8 +404,8 @@ mirror_proc(int id)
 					tx->ethdev_port_id, tx->iface_type,
 					tx->iface_no, 0, copybufs, cnt);
 #else
-			nb_tx2 = rte_eth_tx_burst(tx->ethdev_port_id, 0,
-					copybufs, cnt);
+			nb_tx2 = rte_eth_tx_burst(tx->ethdev_port_id,
+					tx->queue_no, copybufs, cnt);
 #endif
 	}
 
@@ -415,7 +416,8 @@ mirror_proc(int id)
 		nb_tx1 = sppwk_eth_ring_stats_tx_burst(tx->ethdev_port_id,
 				tx->iface_type, tx->iface_no, 0, bufs, nb_rx);
 #else
-		nb_tx1 = rte_eth_tx_burst(tx->ethdev_port_id, 0, bufs, nb_rx);
+		nb_tx1 = rte_eth_tx_burst(tx->ethdev_port_id, tx->queue_no,
+				bufs, nb_rx);
 #endif
 	nb_tx = nb_tx1;
 
@@ -685,12 +687,14 @@ get_mirror_status(unsigned int lcore_id, int id,
 	for (cnt = 0; cnt < path->nof_rx; cnt++) {
 		rx_ports[cnt].iface_type = path->ports[cnt].rx.iface_type;
 		rx_ports[cnt].iface_no   = path->ports[cnt].rx.iface_no;
+		rx_ports[cnt].queue_no   = path->ports[cnt].rx.queue_no;
 	}
 
 	memset(tx_ports, 0x00, sizeof(tx_ports));
 	for (cnt = 0; cnt < path->nof_tx; cnt++) {
 		tx_ports[cnt].iface_type = path->ports[cnt].tx.iface_type;
 		tx_ports[cnt].iface_no   = path->ports[cnt].tx.iface_no;
+		tx_ports[cnt].queue_no   = path->ports[cnt].tx.queue_no;
 	}
 
 	/* Set the information with the function specified by the command. */
-- 
2.17.1



More information about the spp mailing list