DPDK usage discussions
 help / color / mirror / Atom feed
* UDP Checksum offload with X550-T2
@ 2025-02-07 13:00 Alan Beadle
  2025-02-07 13:44 ` Alan Beadle
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Beadle @ 2025-02-07 13:00 UTC (permalink / raw)
  To: users

Hello,

I am trying to enable UDP checksum offload with an Intel X550-T2 NIC
with DPDK 23.11. The problem is that the rte_eth_tx_burst() fails when
I attempt to send an mbuf which is configured for checksum offload.

Here is what i see for this NIC when I run dpdk-devbind.py --status:
Network devices using DPDK-compatible driver
============================================
0000:65:00.1 'Ethernet Controller 10G X550T 1563' drv=vfio-pci
unused=uio_pci_generic

I have read the following page but it was difficult to tell if
anything described there applies in this case. Is what I'm trying to
do supported, or not?
https://doc.dpdk.org/guides-23.11/nics/ixgbe.html

The code was previously working when I was using a software-computed
checksum (with rte_ipv4_udptcp_cksum()).

Here is the new code I added for offload:

// When setting up the port
port_conf.txmode.offloads |= RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
RTE_ETH_TX_OFFLOAD_UDP_CKSUM;

// When configuring the device
if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_CKSUM) ||
!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM)) {
    rte_panic(" offload not supported");
}else{
    std::cout << "offload supported\n";
}

// Before copying the payload into the mbuf
pkt->ol_flags = RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM |
RTE_MBUF_F_TX_UDP_CKSUM;
pkt->l2_len = sizeof(struct rte_ether_hdr);
pkt->l3_len = sizeof(struct rte_ipv4_hdr);

// Right before the tx_burst() call
udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum(ip_hdr, pkt->ol_flags);
ip_hdr->hdr_checksum = 0;

Please let me know if I am doing anything wrong here. Thank you.
-Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-07 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-07 13:00 UDP Checksum offload with X550-T2 Alan Beadle
2025-02-07 13:44 ` Alan Beadle
2025-02-07 22:34   ` Alan Beadle
2025-02-07 22:52     ` Stephen Hemminger

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).