* How to calculate checksum automically with NIC when sending a packet?
@ 2013-11-22 2:40 William Rolinson
[not found] ` <e0a6f7d.1be1c.1427dadac9d.Coremail.mydpdk-KN7UnAbNpbg@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: William Rolinson @ 2013-11-22 2:40 UTC (permalink / raw)
To: dev-VfR2kkLFssw@public.gmane.org
RT~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to calculate checksum automically with NIC when sending a packet?
[not found] ` <e0a6f7d.1be1c.1427dadac9d.Coremail.mydpdk-KN7UnAbNpbg@public.gmane.org>
@ 2013-11-22 12:07 ` Vladimir Medvedkin
[not found] ` <CANDrEHkdfcSK0QKScAnHCMmH6s7p+jo-z=ANOL3AeAnD-T52mQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Medvedkin @ 2013-11-22 12:07 UTC (permalink / raw)
To: William Rolinson; +Cc: dev-VfR2kkLFssw@public.gmane.org
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-KN7UnAbNpbg@public.gmane.org>
> RT~
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to calculate checksum automically with NIC when sending a packet?
[not found] ` <CANDrEHkdfcSK0QKScAnHCMmH6s7p+jo-z=ANOL3AeAnD-T52mQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-11-22 12:14 ` Vladimir Medvedkin
0 siblings, 0 replies; 3+ messages in thread
From: Vladimir Medvedkin @ 2013-11-22 12:14 UTC (permalink / raw)
To: William Rolinson; +Cc: dev-VfR2kkLFssw@public.gmane.org
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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 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-KN7UnAbNpbg@public.gmane.org>
>
>> RT~
>>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-22 12:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-22 2:40 How to calculate checksum automically with NIC when sending a packet? William Rolinson
[not found] ` <e0a6f7d.1be1c.1427dadac9d.Coremail.mydpdk-KN7UnAbNpbg@public.gmane.org>
2013-11-22 12:07 ` Vladimir Medvedkin
[not found] ` <CANDrEHkdfcSK0QKScAnHCMmH6s7p+jo-z=ANOL3AeAnD-T52mQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-22 12:14 ` Vladimir Medvedkin
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).