From: Vladimir Medvedkin <medvedkinv@gmail.com>
To: William Rolinson <mydpdk@126.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] How to calculate checksum automically with NIC when sending a packet?
Date: Fri, 22 Nov 2013 16:07:42 +0400 [thread overview]
Message-ID: <CANDrEHkdfcSK0QKScAnHCMmH6s7p+jo-z=ANOL3AeAnD-T52mQ@mail.gmail.com> (raw)
In-Reply-To: <e0a6f7d.1be1c.1427dadac9d.Coremail.mydpdk@126.com>
Hi,
If you need only ip checksum:
struct rte_mbuf *m;
m->ol_flags |= PKT_TX_IP_CKSUM;
if you need to calculate tcp checksum add also PKT_TX_TCP_CKSUM flag to
ol_flags field and caclulate pseudoheader checksum (see get_ipv4_psd_sum()
in app/test-pmd/csumonly.c)
struct tcp_hdr *th;
th->cksum = get_ipv4_psd_sum(iph);
Regards,
Vladimir
2013/11/22 William Rolinson <mydpdk@126.com>
> RT~
>
next prev parent reply other threads:[~2013-11-22 12:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 2:40 William Rolinson
2013-11-22 12:07 ` Vladimir Medvedkin [this message]
2013-11-22 12:14 ` Vladimir Medvedkin
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='CANDrEHkdfcSK0QKScAnHCMmH6s7p+jo-z=ANOL3AeAnD-T52mQ@mail.gmail.com' \
--to=medvedkinv@gmail.com \
--cc=dev@dpdk.org \
--cc=mydpdk@126.com \
/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).