On Tue, 9 Dec 2025 at 19:53, Kevin Traynor <[email protected]> wrote:
>
> On 12/11/2025 17:04, David Marchand via dev wrote:
> > In case no inner checksum is requested, we can consider the inner data
> > as opaque since there is nothing to do and rely on simple HW UDP checksum
> > without considering support for HW outer UDP checksum.
> >
> > Cleanup the DPDK helper accordingly.
> >
> > Signed-off-by: David Marchand <[email protected]>
> > ---
> > lib/dp-packet.c | 16 +++++++++++-----
> > lib/netdev-dpdk.c | 5 +----
> > 2 files changed, 12 insertions(+), 9 deletions(-)
> >
> > diff --git a/lib/dp-packet.c b/lib/dp-packet.c
> > index b34bcf26f3..3093bd2163 100644
> > --- a/lib/dp-packet.c
> > +++ b/lib/dp-packet.c
> > @@ -553,12 +553,18 @@ dp_packet_compare_offsets(struct dp_packet *b1,
> > struct dp_packet *b2,
> > void
> > dp_packet_ol_send_prepare(struct dp_packet *p, uint64_t flags)
> > {
> > - if (!dp_packet_ip_checksum_partial(p)
> > - && !dp_packet_l4_checksum_partial(p)
> > - && !dp_packet_inner_ip_checksum_partial(p)
> > + if (!dp_packet_inner_ip_checksum_partial(p)
> > && !dp_packet_inner_l4_checksum_partial(p)) {
> > - /* Only checksumming needs actions. */
> > - return;
> > +
> > + if (!dp_packet_ip_checksum_partial(p)
> > + && !dp_packet_l4_checksum_partial(p)) {
> > + /* Only checksumming needs actions. */
>
> nit: not added by this commit and the comment is true, but
> "No checksumming needed." or similar would be better for the path this
> comment is placed in.
Ack.
>
> > + return;
> > + }
> > +
> > + if (OVS_UNLIKELY(dp_packet_tunnel(p))) {
> > + p->offloads &= ~DP_PACKET_OL_TUNNEL_MASK;
> > + }
> > }
> >
> > if (!dp_packet_tunnel(p)) {
> > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> > index f6ae235af3..29b1b21d64 100644
> > --- a/lib/netdev-dpdk.c
> > +++ b/lib/netdev-dpdk.c
> > @@ -2647,10 +2647,7 @@ netdev_dpdk_prep_hwol_packet(struct netdev_dpdk
> > *dev, struct rte_mbuf *mbuf)
> > return true;
> > }
> >
> > - if (dp_packet_tunnel(pkt)
> > - && (dp_packet_inner_ip_checksum_partial(pkt)
> > - || dp_packet_inner_l4_checksum_partial(pkt)
> > - || mbuf->tso_segsz)) {
>
> I'm a bit confused about why mbuf->tso_segsz is not considered anymore
>
> > + if (dp_packet_tunnel(pkt)) {
> > if (dp_packet_ip_checksum_partial(pkt)
> > || dp_packet_l4_checksum_partial(pkt)) {
> > mbuf->outer_l2_len = (char *) dp_packet_l3(pkt) -
Mm, good catch.
The logic (spirit?) of this change is that if a tunnel flag is set,
then OVS core code did set something to do for inner.
If there is neither a inner csum, nor a tso request, then
dp_packet_tunnel() should not have been set in the first place before
calling a netdev specific implementation.
I did not update dp_packet_ol_send_prepare() accordingly: it means
that a TSO packet with no inner csums will get stripped of tunnel
info.
In practice, this is not a problem with netdev-dpdk (which always sets
L4 no csum for TSO packets), but netdev-linux (and other netdevs) may
be affected.
I'll update in next revision.
--
David Marchand
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev