[spp] [PATCH 2/4] spp_vf: change to use burst funcs with VLAN

yasufum.o at gmail.com yasufum.o at gmail.com
Mon Jul 1 06:11:24 CEST 2019


From: Yasufumi Ogawa <yasufum.o at gmail.com>

This update is to change to use RX and TX burst functions which were
added in the previous patch.

Signed-off-by: Yasufumi Ogawa <yasufum.o at gmail.com>
---
 src/vf/Makefile         | 2 +-
 src/vf/classifier_mac.c | 8 ++++----
 src/vf/forwarder.c      | 5 +++--
 src/vf/spp_vf.c         | 1 +
 src/vf/vf_cmd_runner.c  | 1 +
 5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/vf/Makefile b/src/vf/Makefile
index 1d6cb7c..35f13e5 100644
--- a/src/vf/Makefile
+++ b/src/vf/Makefile
@@ -20,7 +20,7 @@ SRCS-y += $(SPP_SEC_DIR)/string_buffer.c
 SRCS-y += $(SPP_SEC_DIR)/json_helper.c
 SRCS-y += $(SPP_SEC_DIR)/utils.c $(SPP_SEC_DIR)/add_port.c
 SRCS-y += $(SPP_WKT_DIR)/ringlatencystats.c
-SRCS-y += $(SPP_WKT_DIR)/spp_port.c
+SRCS-y += $(SPP_WKT_DIR)/port_capability.c
 SRCS-y += $(SPP_WKT_DIR)/conn_spp_ctl.c
 SRCS-y += $(SPP_WKT_DIR)/cmd_parser.c
 SRCS-y += ../shared/common.c
diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c
index a1d6ba4..6850962 100644
--- a/src/vf/classifier_mac.c
+++ b/src/vf/classifier_mac.c
@@ -28,7 +28,7 @@
 #include "shared/secondary/json_helper.h"
 #include "shared/secondary/spp_worker_th/cmd_res_formatter.h"
 #include "shared/secondary/spp_worker_th/vf_deps.h"
-#include "shared/secondary/spp_worker_th/spp_port.h"
+#include "shared/secondary/spp_worker_th/port_capability.h"
 
 #define RTE_LOGTYPE_SPP_CLASSIFIER_MAC RTE_LOGTYPE_USER1
 
@@ -460,7 +460,7 @@ transmit_packet(struct cls_port_info *clsd_data)
 	uint16_t n_tx;
 
 	/* transmit packets */
-	n_tx = spp_eth_tx_burst(clsd_data->ethdev_port_id, 0,
+	n_tx = sppwk_eth_vlan_tx_burst(clsd_data->ethdev_port_id, 0,
 			clsd_data->pkts, clsd_data->nof_pkts);
 
 	/* free cannot transmit packets */
@@ -797,8 +797,8 @@ spp_classifier_mac_do(int id)
 		return SPP_RET_OK;
 
 	/* retrieve packets */
-	n_rx = spp_eth_rx_burst(clsd_data_rx->ethdev_port_id, 0, rx_pkts,
-			MAX_PKT_BURST);
+	n_rx = sppwk_eth_vlan_rx_burst(clsd_data_rx->ethdev_port_id, 0,
+			rx_pkts, MAX_PKT_BURST);
 	if (unlikely(n_rx == 0))
 		return SPP_RET_OK;
 
diff --git a/src/vf/forwarder.c b/src/vf/forwarder.c
index e5cc963..77afc4e 100644
--- a/src/vf/forwarder.c
+++ b/src/vf/forwarder.c
@@ -9,6 +9,7 @@
 #include "shared/secondary/return_codes.h"
 #include "shared/secondary/spp_worker_th/vf_deps.h"
 #include "shared/secondary/spp_worker_th/spp_port.h"
+#include "shared/secondary/spp_worker_th/port_capability.h"
 
 #define RTE_LOGTYPE_FORWARD RTE_LOGTYPE_USER1
 
@@ -212,14 +213,14 @@ forward_packets(int id)
 		tx = &path->ports[cnt].tx;
 
 		/* Receive packets */
-		nb_rx = spp_eth_rx_burst(rx->ethdev_port_id, 0,
+		nb_rx = sppwk_eth_vlan_rx_burst(rx->ethdev_port_id, 0,
 				bufs, MAX_PKT_BURST);
 		if (unlikely(nb_rx == 0))
 			continue;
 
 		/* Send packets */
 		if (tx->ethdev_port_id >= 0)
-			nb_tx = spp_eth_tx_burst(tx->ethdev_port_id,
+			nb_tx = sppwk_eth_vlan_tx_burst(tx->ethdev_port_id,
 					0, bufs, nb_rx);
 
 		/* Discard remained packets to release mbuf */
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index 18a3619..504ee26 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -16,6 +16,7 @@
 #include "shared/secondary/spp_worker_th/cmd_runner.h"
 #include "shared/secondary/spp_worker_th/cmd_parser.h"
 #include "shared/secondary/spp_worker_th/spp_port.h"
+#include "shared/secondary/spp_worker_th/port_capability.h"
 
 /* Declare global variables */
 /* Interface management information */
diff --git a/src/vf/vf_cmd_runner.c b/src/vf/vf_cmd_runner.c
index fe37a19..5246af7 100644
--- a/src/vf/vf_cmd_runner.c
+++ b/src/vf/vf_cmd_runner.c
@@ -6,6 +6,7 @@
 #include "forwarder.h"
 #include "shared/secondary/return_codes.h"
 #include "shared/secondary/json_helper.h"
+#include "shared/secondary/spp_worker_th/port_capability.h"
 #include "shared/secondary/spp_worker_th/cmd_parser.h"
 #include "shared/secondary/spp_worker_th/cmd_runner.h"
 #include "shared/secondary/spp_worker_th/cmd_res_formatter.h"
-- 
2.17.1



More information about the spp mailing list