On 20/08/2018 18:44, Tiago Lam wrote:
> Previous commits have added support to the dp_packet API to handle
> multi-segmented packets, where data is not stored contiguously in
> memory. However, in some cases, it is inevitable and data must be
> provided contiguously. Examples of such cases are when performing csums
> over the entire packet data, or when write()'ing to a file descriptor
> (for a tap interface, for example). For such cases, the dp_packet API
> has been extended to provide a way to transform a multi-segmented
> DPBUF_DPDK packet into a DPBUF_MALLOC system packet (at the expense of a
> copy of memory). If the packet's data is already stored in memory
> contigously then there's no need to convert the packet.
> 
> Additionally, the main use cases that were assuming that a dp_packet's
> data is always held contiguously in memory were changed to make use of
> the new "linear functions" in the dp_packet API when there's a need to
> traverse the entire's packet data. Per the example above, when the
> packet's data needs to be write() to the tap's file descriptor, or when
> the conntrack module needs to verify a packet's checksum, the data is
> now linearized.
> 
> Two new functions have also been added to the packets module to perform
> the checksum over a dp_packet's data (using the alredy used csum API).
> Initially, this is just a way to abstract the data's linearization, but
> in the future this could be optimized to perform the checksum over the
> multi-segmented packets, without the need to copy.
> 
> Signed-off-by: Tiago Lam <[email protected]>
> ---

Hi All,

This is the patch in the series that requires some more attention, since
the rest of the series didn't see much change from v7.

The problem it tries to solve is, when there's a need to traverse the
whole packet data, but the packet's data is spread across multiple
regions of memory (different mbufs) - as Ilya pointed out before,
calculating the checksum or sending the data over a tap interface or
sock in userspace are some of the examples, but there are other cases,
like when calculating the packet's size as "dp_packet_tail() -
dp_packet_data()", instead of simply using dp_packet_size().

For that, as proposed in [1], this patch extends the dp_packet API to
"linearize" DPBUF_DPDK packets that may not be contiguous (at the
expense of allocating system's memory and copying the data over). It
then modifies the cases, across the OvS codebase, where some assumptions
were being made on the data being contiguous in memory to use the new
dp_packet APIs.

What would be your thoughts with regards to this?

Tiago.

[1] https://mail.openvswitch.org/pipermail/ovs-dev/2018-August/351109.html
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to