Skip to content
  • Zoltan Balogh's avatar
    netdev-dpdk: reset packet_type for reused dp_packets. · 75fb9148
    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: default avatarZoltan Balogh <zoltan.balogh@ericsson.com>
    Signed-off-by: default avatarLaszlo Suru <laszlo.suru@ericsson.com>
    Co-authored-by: default avatarLaszlo 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: default avatarDarrell Ball <dlu998@gmail.com>
    75fb9148