[CATERPILLAR,v1,1/2] linux-dpdk: buffer: remove handle/index in metadata

Message ID 1514282408-4987-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • remove some metadata with less effort from odp_buffer
Related show

Commit Message

Github ODP bot Dec. 26, 2017, 10 a.m.
From: Joyce Kong <joyce.kong@arm.com>


Signed-off-by: Joyce Kong <joyce.kong@arm.com>

---
/** Email created from pull request 368 (JoyceKong-arm:buffer_metadata)
 ** https://github.com/Linaro/odp/pull/368
 ** Patch: https://github.com/Linaro/odp/pull/368.patch
 ** Base sha: bbbe6c0ef65c16f6d7d327712f177fbf6740e96f
 ** Merge commit sha: 8d61f6ed1d683276c6c3108517741a543b05a574
 **/
 platform/linux-dpdk/include/odp_buffer_internal.h |  4 ----
 platform/linux-dpdk/odp_packet.c                  | 10 +---------
 platform/linux-dpdk/pool/dpdk.c                   |  5 +----
 3 files changed, 2 insertions(+), 17 deletions(-)

Patch

diff --git a/platform/linux-dpdk/include/odp_buffer_internal.h b/platform/linux-dpdk/include/odp_buffer_internal.h
index fcb300abd..08accdd9f 100644
--- a/platform/linux-dpdk/include/odp_buffer_internal.h
+++ b/platform/linux-dpdk/include/odp_buffer_internal.h
@@ -51,8 +51,6 @@  typedef union odp_buffer_bits_t {
 struct odp_buffer_hdr_t {
 	/* Underlying DPDK rte_mbuf */
 	struct rte_mbuf mb;
-	/* Handle union */
-	odp_buffer_bits_t handle;
 
 	 /* ODP buffer type, not DPDK buf type */
 	int type;
@@ -85,8 +83,6 @@  struct odp_buffer_hdr_t {
 
 	/* Total size of all allocated segs */
 	uint32_t totsize;
-	/* Index in the rte_mempool */
-	uint32_t index;
 };
 
 ODP_STATIC_ASSERT(BUFFER_BURST_SIZE < 256, "BUFFER_BURST_SIZE_TOO_LARGE");
diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c
index 2391f13d6..996a953f9 100644
--- a/platform/linux-dpdk/odp_packet.c
+++ b/platform/linux-dpdk/odp_packet.c
@@ -74,7 +74,7 @@  ODP_STATIC_ASSERT(sizeof(dummy.ol_flags) == sizeof(uint64_t),
 
 static inline odp_buffer_t buffer_handle(odp_packet_hdr_t *pkt_hdr)
 {
-	return pkt_hdr->buf_hdr.handle.handle;
+	return (odp_buffer_t)pkt_hdr;
 }
 
 static inline odp_packet_hdr_t *buf_to_packet_hdr(odp_buffer_t buf)
@@ -261,9 +261,6 @@  void *odp_packet_push_head(odp_packet_t pkt, uint32_t len)
 static void _copy_head_metadata(struct rte_mbuf *newhead,
 				struct rte_mbuf *oldhead)
 {
-	odp_packet_t pkt = (odp_packet_t)newhead;
-	uint32_t saved_index = odp_packet_hdr(pkt)->buf_hdr.index;
-
 	rte_mbuf_refcnt_set(newhead, rte_mbuf_refcnt_read(oldhead));
 	newhead->port = oldhead->port;
 	newhead->ol_flags = oldhead->ol_flags;
@@ -276,9 +273,6 @@  static void _copy_head_metadata(struct rte_mbuf *newhead,
 	memcpy(&newhead->tx_offload, &oldhead->tx_offload,
 	       sizeof(odp_packet_hdr_t) -
 	       offsetof(struct rte_mbuf, tx_offload));
-	odp_packet_hdr(pkt)->buf_hdr.handle.handle =
-			(odp_buffer_t)newhead;
-	odp_packet_hdr(pkt)->buf_hdr.index = saved_index;
 }
 
 int odp_packet_extend_head(odp_packet_t *pkt, uint32_t len, void **data_ptr,
@@ -1121,8 +1115,6 @@  void odp_packet_print_data(odp_packet_t pkt, uint32_t offset,
 	len += snprintf(&str[len], n - len, "Packet\n------\n");
 	len += snprintf(&str[len], n - len,
 			"  pool index    %" PRIu32 "\n", pool_handle_to_index(pool));
-	len += snprintf(&str[len], n - len,
-			"  buf index     %" PRIu32 "\n", hdr->buf_hdr.index);
 	len += snprintf(&str[len], n - len,
 			"  data len      %" PRIu32 "\n", data_len);
 	len += snprintf(&str[len], n - len,
diff --git a/platform/linux-dpdk/pool/dpdk.c b/platform/linux-dpdk/pool/dpdk.c
index 94143dfe8..d2f510c9b 100644
--- a/platform/linux-dpdk/pool/dpdk.c
+++ b/platform/linux-dpdk/pool/dpdk.c
@@ -194,7 +194,7 @@  static void
 odp_dpdk_mbuf_ctor(struct rte_mempool *mp,
 		   void *opaque_arg,
 		   void *raw_mbuf,
-		   unsigned i)
+		   unsigned i ODP_UNUSED)
 {
 	struct mbuf_ctor_arg *mb_ctor_arg;
 	struct rte_mbuf *mb = raw_mbuf;
@@ -231,10 +231,7 @@  odp_dpdk_mbuf_ctor(struct rte_mempool *mp,
 	mb->pool         = mp;
 	mb->ol_flags     = 0;
 
-	/* Save index, might be useful for debugging purposes */
 	buf_hdr = (struct odp_buffer_hdr_t *)raw_mbuf;
-	buf_hdr->index = i;
-	buf_hdr->handle.handle = (odp_buffer_t)buf_hdr;
 	buf_hdr->pool_hdl = mbp_ctor_arg->pool_hdl;
 	buf_hdr->type = mb_ctor_arg->type;
 	buf_hdr->event_type = mb_ctor_arg->type;