Soft Patch Panel
 help / color / mirror / Atom feed
From: Yasufumi Ogawa <yasufum.o@gmail.com>
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 1/3] shared: add rte prefix for DPDK v19.08
Date: Fri, 27 Sep 2019 20:53:47 +0900	[thread overview]
Message-ID: <20190927115349.13081-2-yasufum.o@gmail.com> (raw)
In-Reply-To: <20190927115349.13081-1-yasufum.o@gmail.com>

As some structs and functions were renamed in DPDK while updating to
v19.08, this update is to follow the update.

From this update, it cannot compile with DPDK vf19.05 or before.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/shared/secondary/add_port.c               |  6 ++--
 .../secondary/spp_worker_th/cmd_utils.c       |  2 +-
 .../secondary/spp_worker_th/port_capability.c | 30 +++++++++----------
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/shared/secondary/add_port.c b/src/shared/secondary/add_port.c
index 2981085..b072140 100644
--- a/src/shared/secondary/add_port.c
+++ b/src/shared/secondary/add_port.c
@@ -142,7 +142,7 @@ int
 add_vhost_pmd(int index)
 {
 	struct rte_eth_conf port_conf = {
-		.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+		.rxmode = { .max_rx_pkt_len = RTE_ETHER_MAX_LEN }
 	};
 	struct rte_mempool *mp;
 	uint16_t vhost_port_id;
@@ -225,7 +225,7 @@ int
 add_pcap_pmd(int index)
 {
 	struct rte_eth_conf port_conf = {
-		.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+		.rxmode = { .max_rx_pkt_len = RTE_ETHER_MAX_LEN }
 	};
 
 	struct rte_mempool *mp;
@@ -306,7 +306,7 @@ int
 add_null_pmd(int index)
 {
 	struct rte_eth_conf port_conf = {
-			.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+			.rxmode = { .max_rx_pkt_len = RTE_ETHER_MAX_LEN }
 	};
 
 	struct rte_mempool *mp;
diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.c b/src/shared/secondary/spp_worker_th/cmd_utils.c
index f3d5de8..010a4b6 100644
--- a/src/shared/secondary/spp_worker_th/cmd_utils.c
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.c
@@ -759,7 +759,7 @@ sppwk_convert_mac_str_to_int64(const char *macaddr)
 			break;
 
 		/* Check for mal-formatted address */
-		if (unlikely(token_cnt >= ETHER_ADDR_LEN)) {
+		if (unlikely(token_cnt >= RTE_ETHER_ADDR_LEN)) {
 			RTE_LOG(ERR, WK_CMD_UTILS,
 					"Invalid MAC address `%s`.\n",
 					macaddr);
diff --git a/src/shared/secondary/spp_worker_th/port_capability.c b/src/shared/secondary/spp_worker_th/port_capability.c
index ccef496..5435db0 100644
--- a/src/shared/secondary/spp_worker_th/port_capability.c
+++ b/src/shared/secondary/spp_worker_th/port_capability.c
@@ -57,7 +57,7 @@ void
 sppwk_port_capability_init(void)
 {
 	int cnt = 0;
-	g_vlan_tpid = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+	g_vlan_tpid = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
 	memset(g_port_mng_info, 0x00, sizeof(g_port_mng_info));
 	for (cnt = 0; cnt < RTE_MAX_ETHPORTS; cnt++) {
 		g_port_mng_info[cnt].rx.ref_index = 0;
@@ -105,28 +105,28 @@ add_vlan_tag_one(
 		struct rte_mbuf *pkt,
 		const union sppwk_port_capability *capability)
 {
-	struct ether_hdr *old_ether = NULL;
-	struct ether_hdr *new_ether = NULL;
-	struct vlan_hdr  *vlan      = NULL;
+	struct rte_ether_hdr *old_ether = NULL;
+	struct rte_ether_hdr *new_ether = NULL;
+	struct rte_vlan_hdr  *vlan      = NULL;
 	const struct sppwk_vlan_tag *vlantag = &capability->vlantag;
 
-	old_ether = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+	old_ether = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 	if (old_ether->ether_type == g_vlan_tpid) {
 		/* For packets with VLAN tags, only VLAN ID is updated */
 		new_ether = old_ether;
-		vlan = (struct vlan_hdr *)&new_ether[1];
+		vlan = (struct rte_vlan_hdr *)&new_ether[1];
 	} else {
 		/* For packets without VLAN tag, add VLAN tag. */
-		new_ether = (struct ether_hdr *)rte_pktmbuf_prepend(pkt,
-				sizeof(struct vlan_hdr));
+		new_ether = (struct rte_ether_hdr *)rte_pktmbuf_prepend(pkt,
+				sizeof(struct rte_vlan_hdr));
 		if (unlikely(new_ether == NULL)) {
 			RTE_LOG(ERR, PORT, "Failed to "
 					"get additional header area.\n");
 			return SPPWK_RET_NG;
 		}
 
-		rte_memcpy(new_ether, old_ether, sizeof(struct ether_hdr));
-		vlan = (struct vlan_hdr *)&new_ether[1];
+		rte_memcpy(new_ether, old_ether, sizeof(struct rte_ether_hdr));
+		vlan = (struct rte_vlan_hdr *)&new_ether[1];
 		vlan->eth_proto = new_ether->ether_type;
 		new_ether->ether_type = g_vlan_tpid;
 	}
@@ -162,15 +162,15 @@ del_vlan_tag_one(
 		struct rte_mbuf *pkt,
 		const union sppwk_port_capability *cbl __attribute__ ((unused)))
 {
-	struct ether_hdr *old_ether = NULL;
-	struct ether_hdr *new_ether = NULL;
+	struct rte_ether_hdr *old_ether = NULL;
+	struct rte_ether_hdr *new_ether = NULL;
 	uint32_t *old, *new;
 
-	old_ether = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+	old_ether = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 	if (old_ether->ether_type == g_vlan_tpid) {
 		/* For packets without VLAN tag, delete VLAN tag. */
-		new_ether = (struct ether_hdr *)rte_pktmbuf_adj(pkt,
-				sizeof(struct vlan_hdr));
+		new_ether = (struct rte_ether_hdr *)rte_pktmbuf_adj(pkt,
+				sizeof(struct rte_vlan_hdr));
 		if (unlikely(new_ether == NULL)) {
 			RTE_LOG(ERR, PORT, "Failed to "
 					"delete unnecessary header area.\n");
-- 
2.17.1


  reply	other threads:[~2019-09-27 11:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27 11:53 [spp] [PATCH 0/3] Update to v19.08 Yasufumi Ogawa
2019-09-27 11:53 ` Yasufumi Ogawa [this message]
2019-09-27 11:53 ` [spp] [PATCH 2/3] spp_primary: add rte prefix for DPDK v19.08 Yasufumi Ogawa
2019-09-27 11:53 ` [spp] [PATCH 3/3] spp_vf: " Yasufumi Ogawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190927115349.13081-2-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).