* [dpdk-users] HW offloaded calculation of UDP checksum not working
@ 2020-07-06 11:31 David Aldrich
0 siblings, 0 replies; only message in thread
From: David Aldrich @ 2020-07-06 11:31 UTC (permalink / raw)
To: users
Viewed 3 times
0
I am working with DPDK version 18.11.8 stable on Linux with an Intel X722
NIC.
My app works fine if I calculate IP and UDP checksums in software but I get
a segmentation fault if I calculate in hardware. Here is my code:
local_port_conf.txmode.offloads = local_port_conf.txmode.offloads |
DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM;
mb->ol_flags |= PKT_TX_IPV4 | PKT_TX_IP_CKSUM | PKT_TX_UDP_CKSUM;
mb->l2_len = sizeof(struct ether_hdr);
mb->l3_len = sizeof(struct ipv4_hdr);
mb->l4_len = sizeof(struct udp_hdr);
p_ip_hdr->hdr_checksum = 0;
p_udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum((const ipv4_hdr*)(mb->l3_len),
mb->ol_flags);
The rte_ipv4_phdr_cksum() call is mysterious, have I understood what to do
correctly?
Understandably, the C++ compiler gaves a warning:
warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
p_udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum((const
ipv4_hdr*)(ptMbuf->l3_len), ptMbuf->ol_flags);
^
What is wrong with my code?
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-07-06 11:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 11:31 [dpdk-users] HW offloaded calculation of UDP checksum not working David Aldrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).