DPDK patches and discussions
 help / color / mirror / Atom feed
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:14:12 +0400	[thread overview]
Message-ID: <CANDrEH=EknUZvnHvocZ5aQvbasW+RFstoSsQJU1axaLeiGqhhA@mail.gmail.com> (raw)
In-Reply-To: <CANDrEHkdfcSK0QKScAnHCMmH6s7p+jo-z=ANOL3AeAnD-T52mQ@mail.gmail.com>

Of course you have to properly set
m->pkt.vlan_macip.f.l2_len and
m->pkt.vlan_macip.f.l3_len fields.

Regards,
Vladimir


2013/11/22 Vladimir Medvedkin <medvedkinv@gmail.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~
>>
>
>

      reply	other threads:[~2013-11-22 12:13 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
2013-11-22 12:14   ` Vladimir Medvedkin [this message]

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='CANDrEH=EknUZvnHvocZ5aQvbasW+RFstoSsQJU1axaLeiGqhhA@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).