[ovs-dev] [PATCH dpdk-latest v2 1/4] dp-packet: preserve headroom when cloning a pkt batch

Stokes, Ian ian.stokes at intel.com
Mon Jan 6 20:23:54 UTC 2020



On 12/31/2019 8:14 PM, Flavio Leitner wrote:
> The headroom is useful if the packet needs to insert additional
> header, so preserve the original headroom when cloning the batch.
> 

Seems reasonable to me.

Acked-by: Ian Stokes <ian.stokes at intel.com>

> Signed-off-by: Flavio Leitner <fbl at sysclose.org>
> ---
>   lib/dp-packet.h | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/dp-packet.h b/lib/dp-packet.h
> index 14f0897fa..1e5362304 100644
> --- a/lib/dp-packet.h
> +++ b/lib/dp-packet.h
> @@ -874,7 +874,11 @@ dp_packet_batch_clone(struct dp_packet_batch *dst,
>   
>       dp_packet_batch_init(dst);
>       DP_PACKET_BATCH_FOR_EACH (i, packet, src) {
> -        dp_packet_batch_add(dst, dp_packet_clone(packet));
> +        uint32_t headroom = dp_packet_headroom(packet);
> +        struct dp_packet *pkt_clone;
> +
> +        pkt_clone  = dp_packet_clone_with_headroom(packet, headroom);
> +        dp_packet_batch_add(dst, pkt_clone);
>       }
>       dst->trunc = src->trunc;
>   }
> 


More information about the dev mailing list