UDP Checksum offload with X550-T2
Alan Beadle
ab.beadle at gmail.com
Fri Feb 7 14:00:44 CET 2025
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
More information about the users
mailing list