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

Stephen Hemminger stephen at networkplumber.org
Thu Aug 6 07:09:09 CEST 2026


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 <stephen at networkplumber.org>
---
 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



More information about the dev mailing list