[spp] [PATCH 3/4] spp_vf: change type of port_id to uint16_t

x-fn-spp at sl.ntt-tx.co.jp x-fn-spp at sl.ntt-tx.co.jp
Wed Jan 10 03:48:00 CET 2018


From: Hiroyuki Nakamura <nakamura.hioryuki at po.ntt-tx.co.jp>

In SPP, type of port_id is int while it is changed from uint8_t to
uint16_t in DPDK 17.11. It causes compile errors for incompatible
pointer type.

Signed-off-by: Daiki Yamashita <yamashita.daiki.z01 at as.ntt-tx.co.jp>
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
 src/vf/classifier_mac.c | 6 +++---
 src/vf/spp_vf.c         | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c
index b42c4ac..2e502a5 100644
--- a/src/vf/classifier_mac.c
+++ b/src/vf/classifier_mac.c
@@ -68,7 +68,7 @@ struct classified_data {
 	enum port_type  if_type;              /* interface type (see "enum port_type") */
 	int             if_no;                /* index of ports handled by classifier  */
 	int             if_no_global;         /* id for interface generated by spp_vf  */
-	uint8_t         port;                 /* id for port generated by DPDK         */
+	uint16_t        port;                 /* port id generated by DPDK */
 	uint16_t        num_pkt;              /* the number of packets in pkts[]       */
 	struct rte_mbuf *pkts[MAX_PKT_BURST]; /* packet array to be classified         */
 };
@@ -310,7 +310,7 @@ transmit_packet(struct classified_data *classified_data)
 		for (i = n_tx; i < classified_data->num_pkt; i++)
 			rte_pktmbuf_free(classified_data->pkts[i]);
 		RTE_LOG(DEBUG, SPP_CLASSIFIER_MAC,
-				"drop packets(tx). num=%hu, dpdk_port=%hhu\n",
+				"drop packets(tx). num=%hu, dpdk_port=%hu\n",
 				classified_data->num_pkt - n_tx, classified_data->port);
 	}
 
@@ -348,7 +348,7 @@ push_packet(struct rte_mbuf *pkt, struct classified_data *classified_data)
 	if (unlikely(classified_data->num_pkt == MAX_PKT_BURST)) {
 		RTE_LOG(DEBUG, SPP_CLASSIFIER_MAC,
 				"transimit packets (buffer is filled). "
-				"if_type=%d, if_no={%d,%d}, tx_port=%hhd, num_pkt=%hu\n",
+				"if_type=%d, if_no={%d,%d}, tx_port=%hu, num_pkt=%hu\n",
 				classified_data->if_type,
 				classified_data->if_no_global,
 				classified_data->if_no,
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index feb7f4d..3613d46 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -161,7 +161,7 @@ add_vhost_pmd(int index, int client)
 		.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
 	};
 	struct rte_mempool *mp;
-	uint8_t vhost_port_id;
+	uint16_t vhost_port_id;
 	int nr_queues = 1;
 	const char *name;
 	char devargs[64];
-- 
1.9.1



More information about the spp mailing list