lkml.org 
[lkml]   [2023]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next] packet: Account for VLAN_HLEN in csum_start when virtio_net_hdr is enabled
Mike Pattrick wrote:
> On Thu, Nov 23, 2023 at 4:25 PM Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> >
> > Mike Pattrick wrote:
> > > Af_packet provides checksum offload offsets to usermode applications
> > > through struct virtio_net_hdr when PACKET_VNET_HDR is enabled on the
> > > socket. For skbuffs with a vlan being sent to a SOCK_RAW socket,
> > > af_packet will include the link level header and so csum_start needs
> > > to be adjusted accordingly.
> >
> > Is this patch based on observing an incorrect offset in a workload,
> > or on code inspection?
>
> Based on an incorrect offset in a workload. The setup involved sending
> vxlan traffic though a veth interface configured with a vlan. The
> vnet_hdr's csum_start value was off by 4, and this problem went away
> when the vlan was removed.
>
> I'll take another look at this patch.

This is a vlan device on top of a veth device? On which device and at
which point (ingress or egress) are you receiving the packet over the
packet socket?

From a quick glance, in all cases that I see the VLAN tag is kept in
skb->vlan_tci, so is never part of the packet payload.

But checksum offload with VXLAN can be non-trivial on its own. If
type & SKB_GSO_UDP_TUNNEL_CSUM | SKB_GSO_TUNNEL_REMCSUM, say. Then
csum_start will point to the checksum in vxlanhdr.
\
 
 \ /
  Last update: 2023-11-24 01:07    [W:2.412 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site