diff options
author | Nithin Dabilpuram <ndabilpuram@marvell.com> | 2020-10-14 20:51:29 +0530 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2020-11-02 13:31:11 +0200 |
commit | 9220b824cf95583206879c8175fa929de6ea2681 (patch) | |
tree | 5c0d45572c03e83de7a88effd99f3236752f3d9c /example/generator/odp_generator.c | |
parent | ec384365ce6861f8250d742bd90e2241adbea6d5 (diff) |
example: generator: update l3 and l4 type for checksum insertion
As per new API spec, for pktio to generate checksum, it is mandatory
that application keeps L3 and L4 types in packet meta data valid
along with L3 and L4 offsets. So this patch updates the same.
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'example/generator/odp_generator.c')
-rw-r--r-- | example/generator/odp_generator.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 1ed734c6e..a7043fefa 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -405,8 +405,10 @@ static int setup_udp_pkt(odp_packet_t pkt, odp_pktout_config_opt_t *pktout_cfg, if (pktout_cfg->bit.ipv4_chksum || pktout_cfg->bit.udp_chksum) { odp_packet_l2_offset_set(pkt, 0); odp_packet_l3_offset_set(pkt, ODPH_ETHHDR_LEN); + odp_packet_has_ipv4_set(pkt, 1); odp_packet_l4_offset_set(pkt, ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN); + odp_packet_has_udp_set(pkt, 1); } return 0; } @@ -518,6 +520,7 @@ static int setup_icmp_pkt(odp_packet_t pkt, if (pktout_cfg->bit.ipv4_chksum) { odp_packet_l2_offset_set(pkt, 0); odp_packet_l3_offset_set(pkt, ODPH_ETHHDR_LEN); + odp_packet_has_ipv4_set(pkt, 1); odp_packet_l4_offset_set(pkt, ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN); } |