DPDK usage discussions
 help / color / Atom feed
* [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, back to index

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

DPDK usage discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox