-
Zoltan Balogh authored
DPDK uses dp-packet pool for storing received packets. The pool is reused by rxq_recv funcions of the DPDK netdevs. The datapath is capable to modify the packet_type property of packets. For instance when encapsulated L3 packets are received on a ptap gre port. In this case the packet_type property of struct dp_packet can be modified and later the same dp_packet with the modified packet_type can be reused in the rxq_rec function, so it can contain corrupted data. The dp_packet_batch_init_cutlen() in the rxq_recv functions iterates over dp_packets and sets their cutlen. So I modified this function to set packet_type to Ethernet for the dp_packets as well. I also renamed this function because of the added functionality. The dp_packet_batch_init_cutlen() iterates over batch->count dp_packet. Therefore setting of batch->count = nb_rx needs to be done before the former function is invoked. This is an additional fix. Signed-off-by: Zoltan Balogh <zoltan.balogh@ericsson.com> Signed-off-by: Laszlo Suru <laszlo.suru@ericsson.com> Co-authored-by: Laszlo Suru <laszlo.suru@ericsson.com> CC: Jan Scheurich <jan.scheurich@ericsson.com> CC: Sugesh Chandran <sugesh.chandran@intel.com> CC: Darrell Ball <dlu998@gmail.com> Signed-off-by: Darrell Ball <dlu998@gmail.com>
75fb9148