DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] DPDK RX TCP checksum failed
@ 2022-03-26  8:13 jiangheng (H)
  2022-03-26 18:59 ` Stephen Hemminger
  0 siblings, 1 reply; 7+ messages in thread
From: jiangheng (H) @ 2022-03-26  8:13 UTC (permalink / raw)
  To: users

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

Hi all,

I tried using the checksum offloads feature in DPDK and it did not see working under virtual machine.

Port only support TCP checksum and do not support IP checksum:
rx_offload_capa = DEV_RX_OFFLOAD_TCP_CKSUM
tx_offload_capa = DEV_TX_OFFLOAD_TCP_CKSUM

so I config rxmode.offload txmode.offloads as below:
rxmode.offloads = DEV_RX_OFFLOAD_TCP_CKSUM
txmode.offloads = DEV_TX_OFFLOAD_TCP_CKSUM

For TX, I set the following parameters, it works good.
mbuf->l2_len = sizeof(*ethhdr)
mbuf->l3_len = ip header len
mbuf-ol_flags = RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_TCP_CKSUM


For RX, It will execute the following code:
In drivers/net/virtio/virtio_rxtx.c  virtio_rx_offload function :
    if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
        hdrlen = hdr_lens.l2_len + hdr_lens.l3_len + hdr_lens.l4_len;
        if (hdr->csum_start <= hdrlen && l4_supported) {
            m->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_NONE;
        } else {

m->ol_flags set to RTE_MBUF_F_RX_L4_CKSUM_NONE, causing the TCP RX checksum failed.
How do I avoid the above code going into this branch?

Thanks,
Jinag.








[-- Attachment #2: Type: text/html, Size: 5709 bytes --]

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

end of thread, other threads:[~2022-04-07 13:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-26  8:13 [dpdk-users] DPDK RX TCP checksum failed jiangheng (H)
2022-03-26 18:59 ` Stephen Hemminger
2022-03-28  1:50   ` 答复: " jiangheng (H)
2022-03-28  2:15     ` Harold Huang
2022-04-07 12:50       ` 答复: " jiangheng (H)
2022-03-28  3:11   ` fwefew 4t4tg
2022-04-07 13:42     ` 答复: " jiangheng (H)

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