Soft Patch Panel
 help / color / Atom feed
* [spp] [PATCH 0/3] Update to v19.08
@ 2019-09-27 11:53 Yasufumi Ogawa
  2019-09-27 11:53 ` [spp] [PATCH 1/3] shared: add rte prefix for DPDK v19.08 Yasufumi Ogawa
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2019-09-27 11:53 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

Some structs and functions have renamed in DPDK v19.08, SPP should also
change for the changes. This series of patches is to rename them as
following.

  * ether_hdr to rte_ether_hdr
  * ether_addr to rte_ether_addr
  * vlan_hdr to rte_vlan_hdr
  * ETHER_ADDR_LEN to RTE_ETHER_ADDR_LEN
  * ETHER_TYPE_VLAN to RTE_ETHER_TYPE_VLAN
  * ether_format_addr() to rte_ether_format_addr()
  * is_multicast_ether_addr() to rte_is_multicast_ether_addr()

Yasufumi Ogawa (3):
  shared: add rte prefix for DPDK v19.08
  spp_primary: add rte prefix for DPDK v19.08
  spp_vf: add rte prefix for DPDK v19.08

 src/primary/main.c                            |  2 +-
 src/shared/secondary/add_port.c               |  6 +--
 .../secondary/spp_worker_th/cmd_utils.c       |  2 +-
 .../secondary/spp_worker_th/port_capability.c | 30 +++++++--------
 src/vf/classifier.c                           | 38 +++++++++----------
 5 files changed, 39 insertions(+), 39 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [spp] [PATCH 1/3] shared: add rte prefix for DPDK v19.08
  2019-09-27 11:53 [spp] [PATCH 0/3] Update to v19.08 Yasufumi Ogawa
@ 2019-09-27 11:53 ` Yasufumi Ogawa
  2019-09-27 11:53 ` [spp] [PATCH 2/3] spp_primary: " Yasufumi Ogawa
  2019-09-27 11:53 ` [spp] [PATCH 3/3] spp_vf: " Yasufumi Ogawa
  2 siblings, 0 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2019-09-27 11:53 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [spp] [PATCH 2/3] spp_primary: add rte prefix for DPDK v19.08
  2019-09-27 11:53 [spp] [PATCH 0/3] Update to v19.08 Yasufumi Ogawa
  2019-09-27 11:53 ` [spp] [PATCH 1/3] shared: add rte prefix for DPDK v19.08 Yasufumi Ogawa
@ 2019-09-27 11:53 ` " Yasufumi Ogawa
  2019-09-27 11:53 ` [spp] [PATCH 3/3] spp_vf: " Yasufumi Ogawa
  2 siblings, 0 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2019-09-27 11:53 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

As previous patch, this update is to follow DPDK v19.08.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/primary/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/primary/main.c b/src/primary/main.c
index afa26c4..74fb33c 100644
--- a/src/primary/main.c
+++ b/src/primary/main.c
@@ -76,7 +76,7 @@ get_printable_mac_addr(uint16_t port)
 		return err_address;
 
 	if (unlikely(addresses[port][0] == '\0')) {
-		struct ether_addr mac;
+		struct rte_ether_addr mac;
 
 		rte_eth_macaddr_get(port, &mac);
 		snprintf(addresses[port], sizeof(addresses[port]),
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [spp] [PATCH 3/3] spp_vf: add rte prefix for DPDK v19.08
  2019-09-27 11:53 [spp] [PATCH 0/3] Update to v19.08 Yasufumi Ogawa
  2019-09-27 11:53 ` [spp] [PATCH 1/3] shared: add rte prefix for DPDK v19.08 Yasufumi Ogawa
  2019-09-27 11:53 ` [spp] [PATCH 2/3] spp_primary: " Yasufumi Ogawa
@ 2019-09-27 11:53 ` " Yasufumi Ogawa
  2 siblings, 0 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2019-09-27 11:53 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

As previous patch, this update is to follow DPDK v19.08.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/vf/classifier.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/vf/classifier.c b/src/vf/classifier.c
index fa47ed7..8a4c8fc 100644
--- a/src/vf/classifier.c
+++ b/src/vf/classifier.c
@@ -114,7 +114,7 @@ static const size_t HASH_TABLE_NAME_BUF_SZ =
 
 /* MAC address string(xx:xx:xx:xx:xx:xx) buffer size */
 static const size_t ETHER_ADDR_STR_BUF_SZ =
-		ETHER_ADDR_LEN * 2 + (ETHER_ADDR_LEN - 1) + 1;
+		RTE_ETHER_ADDR_LEN * 2 + (RTE_ETHER_ADDR_LEN - 1) + 1;
 
 /**
  * Hash table count used for making a name of hash table.
@@ -128,13 +128,13 @@ static rte_atomic16_t g_hash_table_count = RTE_ATOMIC16_INIT(0xff);
 static inline uint16_t
 get_vid(const struct rte_mbuf *pkt)
 {
-	struct ether_hdr *eth;
-	struct vlan_hdr *vh;
+	struct rte_ether_hdr *eth;
+	struct rte_vlan_hdr *vh;
 
-	eth = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
-	if (eth->ether_type == rte_cpu_to_be_16(ETHER_TYPE_VLAN)) {
+	eth = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
+	if (eth->ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN)) {
 		/* vlan tagged */
-		vh = (struct vlan_hdr *)(eth + 1);
+		vh = (struct rte_vlan_hdr *)(eth + 1);
 		return rte_be_to_cpu_16(vh->vlan_tci) & 0x0fff;
 	}
 
@@ -152,11 +152,11 @@ static void
 log_packet(const char *name, struct rte_mbuf *pkt,
 		const char *func_name, int line_num)
 {
-	struct ether_hdr *eth;
+	struct rte_ether_hdr *eth;
 	uint16_t vid;
 	char mac_addr_str[2][ETHER_ADDR_STR_BUF_SZ];
 
-	eth = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+	eth = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 	vid = get_vid(pkt);
 
 	ether_format_addr(mac_addr_str[0], sizeof(mac_addr_str),
@@ -181,12 +181,12 @@ log_classification(long clsd_idx, struct rte_mbuf *pkt,
 		struct cls_port_info *clsd_data,
 		const char *func_name, int line_num)
 {
-	struct ether_hdr *eth;
+	struct rte_ether_hdr *eth;
 	uint16_t vid;
 	char mac_addr_str[2][ETHER_ADDR_STR_BUF_SZ];
 	char iface_str[STR_LEN_NAME];
 
-	eth = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+	eth = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 	vid = get_vid(pkt);
 
 	ether_format_addr(mac_addr_str[0], sizeof(mac_addr_str),
@@ -281,7 +281,7 @@ create_mac_classification(void)
 	struct rte_hash_parameters hash_params = {
 			.name      = hash_tab_name,
 			.entries   = NOF_CLS_TABLE_ENTRIES,
-			.key_len   = sizeof(struct ether_addr),
+			.key_len   = sizeof(struct rte_ether_addr),
 			.hash_func = DEFAULT_HASH_FUNC,
 			.hash_func_init_val = 0,
 			.socket_id = rte_socket_id(),
@@ -308,7 +308,7 @@ init_component_info(struct cls_comp_info *cmp_info,
 	int ret = SPPWK_RET_NG;
 	int i;
 	struct mac_classifier *mac_cls;
-	struct ether_addr eth_addr;
+	struct rte_ether_addr eth_addr;
 	char mac_addr_str[ETHER_ADDR_STR_BUF_SZ];
 	/* Classifier has one RX port and several TX ports. */
 	struct cls_port_info *cls_rx_port_info = &cmp_info->rx_port_i;
@@ -384,8 +384,8 @@ init_component_info(struct cls_comp_info *cmp_info,
 
 		/* Add entry to classifier table. */
 		rte_memcpy(&eth_addr, &tx_port->cls_attrs.mac_addr,
-				ETHER_ADDR_LEN);
-		ether_format_addr(mac_addr_str, sizeof(mac_addr_str),
+				RTE_ETHER_ADDR_LEN);
+		rte_ether_format_addr(mac_addr_str, sizeof(mac_addr_str),
 				&eth_addr);
 
 		ret = rte_hash_add_key_data(mac_cls->cls_tbl,
@@ -552,12 +552,12 @@ select_classified_index(const struct rte_mbuf *pkt,
 		struct cls_comp_info *cmp_info)
 {
 	int ret;
-	struct ether_hdr *eth;
+	struct rte_ether_hdr *eth;
 	void *lookup_data;
 	struct mac_classifier *mac_cls;
 	uint16_t vid;
 
-	eth = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+	eth = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 	vid = get_vid(pkt);
 
 	/* select mac address classification by vid */
@@ -582,7 +582,7 @@ select_classified_index(const struct rte_mbuf *pkt,
 			"(EINVAL=%d, ENOENT=%d)\n", ret, EINVAL, ENOENT);
 
 	/* check if packet is l2 multicast */
-	if (unlikely(is_multicast_ether_addr(&eth->d_addr)))
+	if (unlikely(rte_is_multicast_ether_addr(&eth->d_addr)))
 		return -2;
 
 	/* if default is not set, use untagged's default */
@@ -858,8 +858,8 @@ add_mac_entry(struct classifier_table_params *params,
 		if (unlikely(ret < 0))
 			break;
 
-		ether_format_addr(mac_addr_str, sizeof(mac_addr_str),
-				(const struct ether_addr *)key);
+		rte_ether_format_addr(mac_addr_str, sizeof(mac_addr_str),
+				(const struct rte_ether_addr *)key);
 
 		port.iface_type = (port_info + (long)data)->iface_type;
 		port.iface_no = (port_info + (long)data)->iface_no_global;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 11:53 [spp] [PATCH 0/3] Update to v19.08 Yasufumi Ogawa
2019-09-27 11:53 ` [spp] [PATCH 1/3] shared: add rte prefix for DPDK v19.08 Yasufumi Ogawa
2019-09-27 11:53 ` [spp] [PATCH 2/3] spp_primary: " Yasufumi Ogawa
2019-09-27 11:53 ` [spp] [PATCH 3/3] spp_vf: " Yasufumi Ogawa

Soft Patch Panel

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/spp/0 spp/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 spp spp/ http://inbox.dpdk.org/spp \
		spp@dpdk.org
	public-inbox-index spp


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.spp


AGPL code for this site: git clone https://public-inbox.org/ public-inbox