[PATCH v4 15/23] net/r8169: get network headers

Stephen Hemminger <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
This driver was getting network protocol headers indirectly
via rte_ethdev.h. Use iwyu to update to full list of includes.

Replace POSIX/libc byte swap with equivalent DPDK function.

Signed-off-by: Stephen Hemminger <[email protected]>
---
 drivers/net/r8169/r8169_rxtx.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/net/r8169/r8169_rxtx.c b/drivers/net/r8169/r8169_rxtx.c
index 00de0471f4..5786624e27 100644
--- a/drivers/net/r8169/r8169_rxtx.c
+++ b/drivers/net/r8169/r8169_rxtx.c
@@ -5,21 +5,28 @@
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
-
-#include <rte_eal.h>
+#include <stdbool.h>
+#include <string.h>
 
 #include <rte_common.h>
-#include <rte_interrupts.h>
+#include <rte_atomic.h>
 #include <rte_byteorder.h>
 #include <rte_debug.h>
-#include <rte_pci.h>
+#include <rte_log.h>
 #include <bus_pci_driver.h>
 #include <rte_ether.h>
+#include <rte_ethdev.h>
 #include <ethdev_driver.h>
 #include <ethdev_pci.h>
-#include <rte_memory.h>
+#include <rte_bitops.h>
+#include <rte_memzone.h>
 #include <rte_malloc.h>
+#include <rte_mbuf.h>
+#include <rte_prefetch.h>
+#include <rte_random.h>
+#include <rte_stdatomic.h>
 #include <dev_driver.h>
+#include <rte_udp.h>
 
 #include "r8169_ethdev.h"
 #include "r8169_hw.h"
@@ -1535,7 +1542,7 @@ rtl8125_get_patch_pad_len(struct rte_mbuf *tx_pkt)
 
 	if (trans_data_len > 3 && trans_data_len < MIN_PATCH_LENGTH) {
 		udp_hdr = rte_pktmbuf_mtod_offset(tx_pkt, struct rte_udp_hdr *, l4_offset);
-		dest_port = ntohs(udp_hdr->dst_port);
+		dest_port = rte_be_to_cpu_16(udp_hdr->dst_port);
 		if (dest_port == 0x13f || dest_port == 0x140) {
 			pad_len = MIN_PATCH_LENGTH - trans_data_len;
 			goto out;
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.