Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp695765rdh; Thu, 23 Nov 2023 16:06:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEV8r94rJT34gFZQODilF0c6chN+Jk5I9ziH8hms5UklziKL26o7RhRDU7OW8B/OMTnOinx X-Received: by 2002:a17:90b:1e12:b0:281:416e:1c3f with SMTP id pg18-20020a17090b1e1200b00281416e1c3fmr999628pjb.28.1700784400175; Thu, 23 Nov 2023 16:06:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700784400; cv=none; d=google.com; s=arc-20160816; b=z9tDjpV4mvifHAnDx+blxeLmazrYJI2Cq4Dq3syZl0dh6U5xD/g7gkVusnfBmKGL+c Ha9wOXSWrUJSCgJQe3fNnll0zcxG5OmrIf55XU6aDc7xntIv4lPDp9cefybxEfzx1zT+ 79Ell9L5kkTqu8E1BbR9XrFv17GD2TJCJgAxAQgL0RChwooovZT33jE0cAv6MVL0ve8h iyqTESfLSSn+ftLFyhwtsoFF/MREtpF7UrQmyP6LL7tYw+l0dT+6aq5q/cewhpHCDCIq M+1nFDKUz0RjVLJBXo2WlAChnFhs+89dnP+IlozKNEOTtR3wOPZ4eQXJauLdSMrrJXY4 FImA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:subject :references:in-reply-to:message-id:cc:to:from:date:dkim-signature; bh=hGodACVCE2G5lTrEpFSbibZCGBS3bo1pjwu8ZCWoqM4=; fh=tCjht9WQ3QTpDKj7jRFLazf1XhlhIti8b2Ofrflgqa4=; b=rnHy1jrRNOn2j3UwZlEzpCpKON+b2HMrXJQNIIM5/YLU1GZ6qZoASsxmZvQsPPUydf FD/NahMeywl2a/HGDtGEZS08LdLRJCS+EtAIvVauX6d7hZfwrfha1Gw6Oklb3yeJNTCz 2+Me+8QtpmyKN+Di2dptwgyABAleM1ZaBhteZJ2wlE2AIuFqvKQL2ysMQIPhRTkU9LNI F4Szli7cLkutu4TxHC2RTxlRBV4WJlqWCWcjPDw8SyZlWSmjlaooIjydqpx6MtGuOgLM gs3SpG+UvgfCZVoXnyykXQclHfgYxCeN/z4GKlR40FhaG5OVbnYi3fwSLito1pHmtZ+K gguw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=d8xc749n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id x8-20020a17090a8a8800b002858a291a45si272409pjn.141.2023.11.23.16.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 16:06:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=d8xc749n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 1E52180628F7; Thu, 23 Nov 2023 16:06:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbjKXAFy (ORCPT + 99 others); Thu, 23 Nov 2023 19:05:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKXAFw (ORCPT ); Thu, 23 Nov 2023 19:05:52 -0500 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD3AD6F; Thu, 23 Nov 2023 16:05:59 -0800 (PST) Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3b837d974ecso804233b6e.2; Thu, 23 Nov 2023 16:05:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700784358; x=1701389158; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=hGodACVCE2G5lTrEpFSbibZCGBS3bo1pjwu8ZCWoqM4=; b=d8xc749ngLfdI15Fq31Ar/QgiExWslcpR8+ugeLDZN/ALvmMVpYU50QMghCbxl+VFZ 9sFoD6M2KA6Ufk+6MPdzRVTe9j2J2XwWgy9+5nM9K6UVDfUE/eDznM+fjH9e7b8VUSL2 4ioh8j325mOVt7umMUh2KcdeSHWDGxWpEFzxgF1IRN9oewpEIg5zDSrucb3m4B/rjLEk dOzlRteabbie6d75dSV4TfyCx0IgZmadYM9/mWuO7bUzM1hF+fp2VHX1+Emwi8dZdM25 arZwH9NzNsN9TNbKAnz9RHcWwOVSGgcRrmhCJ8Xf6EjAZDnQxsPxYqQfo5xlgeBJmYZD fWRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700784358; x=1701389158; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=hGodACVCE2G5lTrEpFSbibZCGBS3bo1pjwu8ZCWoqM4=; b=i6iYeBFH9AVjYgNjVHQ2dURZhQp9lmX8CuUYY3lsuX29vKExNnOIheleHokdqUIBx4 wE9ahla+mMatd+xcxzSvRhBAkN80TXxQyRKP0XZkSWqfAMad/4FdB0Zh7OS/p6BGoNzq T0FclPVWz4ChEEukFx4xbznbIspubDph9bH2EvpHNDU1ZYTQHi6laR7+A2updSn3EbAG qi9SH/HyF/AOXNg0JLgunZnRvy3Vmudn4wpkpsL1IR0Zy1dQkewjOgV/GERveg8Sf9wy CNn7JhgnwsR8n8mgEmuo3XLCpKezRHEmdrJM1QTihikNjdAzoVqkDBxh10ZB5xBJIgPv NgJw== X-Gm-Message-State: AOJu0YzgnVnjRO0uPT+nOjrF0XgdQmx44so6eggxlfN0tVn29m0F7Exv tR7gslTznFjQ1BRJ2ZL5cyaBAZNB9SY= X-Received: by 2002:a05:6808:2026:b0:3b2:f275:18a8 with SMTP id q38-20020a056808202600b003b2f27518a8mr1361814oiw.22.1700784358263; Thu, 23 Nov 2023 16:05:58 -0800 (PST) Received: from localhost (240.157.150.34.bc.googleusercontent.com. [34.150.157.240]) by smtp.gmail.com with ESMTPSA id cp8-20020ad44ae8000000b0067a0c767c26sm652868qvb.37.2023.11.23.16.05.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 16:05:57 -0800 (PST) Date: Thu, 23 Nov 2023 19:05:57 -0500 From: Willem de Bruijn To: Mike Pattrick , Willem de Bruijn Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org Message-ID: <655fe8e5b5cf5_d9fc5294a0@willemb.c.googlers.com.notmuch> In-Reply-To: References: <20231123183835.635210-1-mkp@redhat.com> <655fc32bb506e_d14d4294b3@willemb.c.googlers.com.notmuch> Subject: Re: [PATCH net-next] packet: Account for VLAN_HLEN in csum_start when virtio_net_hdr is enabled Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 23 Nov 2023 16:06:28 -0800 (PST) Mike Pattrick wrote: > On Thu, Nov 23, 2023 at 4:25=E2=80=AFPM Willem de Bruijn > wrote: > > > > Mike Pattrick wrote: > > > Af_packet provides checksum offload offsets to usermode application= s > > > through struct virtio_net_hdr when PACKET_VNET_HDR is enabled on th= e > > > 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 need= s > > > 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.=