Skip to contentSkip to conversation

ixgbe tcp cksum offload

DISCUSSION Tim Deng 2 participants 3 messages May 25, 2015

lore
Share & tools
lore

Tim Deng

author
#0 lore raw

Hi,

I am trying to use ixgbe tcp cksum h/w offload by following steps:
- populate pseudo cksum
- set l2_len, l3_len, l4_len
- set ol_flags

But I found the pkt doesn't get right h/w checksum by sniffing on recv side, and TCP cksum still leave with the original pseudo cksum. And I verified those meta are correctly set, e.g. a TCP syn pkt:
l2_len = 14, l3_len = 20, l4_len = 40 (with some tcp options),
and ol_flags = 0x90000000000000 which means PKT_TX_IPV4 | PKT_TX_TCP_CKSUM

Did I miss any step?

Thanks in advance,
Tim

#1 lore raw
Quoted 15 lines · Tim Deng

Hi,

I am trying to use ixgbe tcp cksum h/w offload by following steps:
- populate pseudo cksum
- set l2_len, l3_len, l4_len
- set ol_flags

But I found the pkt doesn't get right h/w checksum by sniffing on recv side, and TCP cksum still leave with the original pseudo cksum. And I verified those meta are correctly set, e.g. a TCP syn pkt:
l2_len = 14, l3_len = 20, l4_len = 40 (with some tcp options),
and ol_flags = 0x90000000000000 which means PKT_TX_IPV4 | PKT_TX_TCP_CKSUM

Quoted 6 lines

Did I miss any step?

Thanks in advance,
Tim

Check that you have not got TX offloads disabled in your port configuration. If you pass in NULL for the rte_eth_txconf pointer on tx queue setup, then offloads will be disabled. To get offloads such as checksums to work, you need to explicitly set the flags to allow them. (Generally, this means just setting txqflags to 0)

Regards,
/Bruce

author
#2 lore raw

Thanks Bruce so much! That perfectly solves my problem. Tim

Quoted 30 lines · Bruce Richardson
Quoted 15 lines · Tim Deng

Hi,

I am trying to use ixgbe tcp cksum h/w offload by following steps:
- populate pseudo cksum
- set l2_len, l3_len, l4_len
- set ol_flags

But I found the pkt doesn't get right h/w checksum by sniffing on recv side, and TCP cksum still leave with the original pseudo cksum. And I verified those meta are correctly set, e.g. a TCP syn pkt:
l2_len = 14, l3_len = 20, l4_len = 40 (with some tcp options),
and ol_flags = 0x90000000000000 which means PKT_TX_IPV4 | PKT_TX_TCP_CKSUM

Quoted 6 lines

Did I miss any step?

Thanks in advance,
Tim

Check that you have not got TX offloads disabled in your port configuration. If you pass in NULL for the rte_eth_txconf pointer on tx queue setup, then offloads will be disabled. To get offloads such as checksums to work, you need to explicitly set the flags to allow them. (Generally, this means just setting txqflags to 0)

Regards,
/Bruce