[v6,19/23] examples/dma: use mbuf descriptor accessor

Message ID 1709012499-12813-20-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series stop and remove RTE_MARKER typedefs |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Feb. 27, 2024, 5:41 a.m. UTC
  RTE_MARKER typedefs are a GCC extension unsupported by MSVC. Use
new rte_mbuf_rx_descriptor_fields1 accessor that provides a compatible
type pointer without using the marker field.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 examples/dma/dmafwd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/examples/dma/dmafwd.c b/examples/dma/dmafwd.c
index f4a0bff..54991f6 100644
--- a/examples/dma/dmafwd.c
+++ b/examples/dma/dmafwd.c
@@ -294,9 +294,10 @@  struct dma_bufs {
 pktmbuf_metadata_copy(const struct rte_mbuf *src, struct rte_mbuf *dst)
 {
 	dst->data_off = src->data_off;
-	memcpy(&dst->rx_descriptor_fields1, &src->rx_descriptor_fields1,
+	memcpy(rte_mbuf_rx_descriptor_fields1(dst),
+		rte_mbuf_rx_descriptor_fields1((struct rte_mbuf *)(uintptr_t)src),
 		offsetof(struct rte_mbuf, buf_len) -
-		offsetof(struct rte_mbuf, rx_descriptor_fields1));
+		offsetof(struct rte_mbuf, data_off));
 }
 
 /* Copy packet data */