On Tue, Oct 31, 2023 at 03:51:38PM -0400, Mike Pattrick wrote:
> From: Flavio Leitner <[email protected]>
> 
> This provides a software implementation in the case
> the egress netdev doesn't support segmentation in hardware.
> 
> The challenge here is to guarantee packet ordering in the
> original batch that may be full of TSO packets. Each TSO
> packet can go up to ~64kB, so with segment size of 1440
> that means about 44 packets for each TSO. Each batch has
> 32 packets, so the total batch amounts to 1408 normal
> packets.
> 
> The segmentation estimates the total number of packets
> and then the total number of batches. Then allocate
> enough memory and finally do the work.
> 
> Finally each batch is sent in order to the netdev.
> 
> Signed-off-by: Flavio Leitner <[email protected]>
> Co-authored-by: Mike Pattrick <[email protected]>
> Signed-off-by: Mike Pattrick <[email protected]>

...

> diff --git a/lib/dp-packet-gso.c b/lib/dp-packet-gso.c

...

> +/* Returns the calculated number of TCP segments in packet 'p'. */
> +int
> +dp_packet_gso_nr_segs(struct dp_packet *p)
> +{
> +    uint16_t segsz = dp_packet_get_tso_segsz(p);
> +    const char *data_tail;
> +    const char *data_pos;
> +
> +    data_pos = dp_packet_get_tcp_payload(p);
> +    data_tail = (char *) dp_packet_tail(p) - dp_packet_l2_pad_size(p);
> +
> +    return DIV_ROUND_UP((data_tail - data_pos), segsz);

Hi Mike,

I don't think there is any need to respin just because of this.
But, FWIIW, I don't think the inner parentheses are needed here,
and possibly a few other places in this patchset.

The above notwithstanding this patch looks good to me.

Acked-by: Simon Horman <[email protected]>

...
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to