[dpdk-dev] How to calculate checksum automically with NIC when sending a packet?
Vladimir Medvedkin
medvedkinv at gmail.com
Fri Nov 22 13:14:12 CET 2013
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 at 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 at 126.com>
>
>> RT~
>>
>
>
More information about the dev
mailing list