]> git.proxmox.com Git - mirror_ovs.git/commit - lib/dp-packet.h
netdev-dpdk: reset packet_type for reused dp_packets.
authorZoltan Balogh <zoltan.balogh@ericsson.com>
Fri, 22 Sep 2017 09:58:13 +0000 (02:58 -0700)
committerDarrell Ball <dlu998@gmail.com>
Fri, 22 Sep 2017 09:58:13 +0000 (02:58 -0700)
commit75fb914892d9d11c1d86d580c9f73bd544ea76c5
tree796b4c42f33b153397b6a07890410fc5d43b60fa
parent899363ed03c9d0933e4b9dfbfca85e7ca014a3a5
netdev-dpdk: reset packet_type for reused dp_packets.

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>
lib/dp-packet.c
lib/dp-packet.h
lib/netdev-dpdk.c