DPDK usage discussions
 help / color / mirror / Atom feed
From: Alan Beadle <ab.beadle@gmail.com>
To: users@dpdk.org
Subject: UDP Checksum offload with X550-T2
Date: Fri, 7 Feb 2025 08:00:44 -0500	[thread overview]
Message-ID: <CANTAOdzc1egZvj_OKN36UQO7f+=oHyZFj7k7Vjd5EYGKQR9zEg@mail.gmail.com> (raw)

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

             reply	other threads:[~2025-02-07 13:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 13:00 Alan Beadle [this message]
2025-02-07 13:44 ` Alan Beadle
2025-02-07 22:34   ` Alan Beadle
2025-02-07 22:52     ` Stephen Hemminger

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='CANTAOdzc1egZvj_OKN36UQO7f+=oHyZFj7k7Vjd5EYGKQR9zEg@mail.gmail.com' \
    --to=ab.beadle@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).