From: David Aldrich <david.aldrich.ntml@gmail.com>
To: users <users@dpdk.org>
Subject: [dpdk-users] HW offloaded calculation of UDP checksum not working
Date: Mon, 6 Jul 2020 12:31:52 +0100 [thread overview]
Message-ID: <CAJK_ieiBuEPiMai14+g7R_nXBJeX_EJ_kMQR83Zx9efKK+vBLQ@mail.gmail.com> (raw)
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?
reply other threads:[~2020-07-06 11:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJK_ieiBuEPiMai14+g7R_nXBJeX_EJ_kMQR83Zx9efKK+vBLQ@mail.gmail.com \
--to=david.aldrich.ntml@gmail.com \
--cc=users@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).