DPDK patches and discussions
 help / color / mirror / Atom feed
From: Padam Jeet Singh <padam.singh@inventum.net>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] Wrong TCP Checkum computed by hardware
Date: Wed, 28 Oct 2015 12:20:22 +0530	[thread overview]
Message-ID: <9E9D668A-17B5-4047-85B3-13519F898467@inventum.net> (raw)

Hi,

While implementing a sample packet generation code, I am setting up the offload flags so that the hardware (82599ES in my case) computes the IP and TCP Checksums. However, it seems that only the IP checksum is computed whereas the TCP Checksum is computed, but computed wrong. Here is a snippet of what I doing:

/* First reset all offload flags */
mbuf->ol_flags = (uint16_t) (mbuf->ol_flags & (~PKT_TX_OFFLOAD_MASK));
/* Then enable IP Checksum offload */
mbuf->ol_flags |= PKT_TX_IP_CKSUM;
/* This is required to be set to 0 */
ipv4hdr->hdr_checksum = 0;
mbuf->ol_flags |= PKT_TX_TCP_CKSUM;
/* Compute the PSD header */
tcphdr->cksum = rte_ipv4_phdr_cksum(ipv4hdr);

When I replace the checksum computation from hardware-offload to a software implementation, the checksum computed is correct. I have verified both the cases with Wireshark on the system receiving the packets.

Any hint what could I be doing wrong here?

Thanks,
Padam

             reply	other threads:[~2015-10-28  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28  6:50 Padam Jeet Singh [this message]
2015-10-28  6:57 ` Matthew Hall
2015-10-28  7:19   ` Padam Jeet Singh
2015-10-28  8:01     ` Liu, Jijiang
2015-10-28  8:12       ` Padam Jeet Singh
2015-10-28  8:16         ` Liu, Jijiang
2015-10-28  8:30           ` Padam Jeet Singh
2015-10-28  8:34             ` Liu, Jijiang
2015-10-28 11:02               ` Padam Jeet Singh

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=9E9D668A-17B5-4047-85B3-13519F898467@inventum.net \
    --to=padam.singh@inventum.net \
    --cc=dev@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).