Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp82362lqm; Mon, 10 Jun 2024 13:25:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBrueOgiwm7YaSe1w8w8GLbPg/EvgR208hGJfUSvT3bGLkQJx9JKyx6n1f8T82WjL3ExPfVZhQ3RTAw2ap5WvnEkB8WgBvfEydoZhKAg== X-Google-Smtp-Source: AGHT+IFsHullEEWs94zCUdGnLAimHf/E8cLTohU6ZwQhv0ZVR8eQMAxQ1uB9+R82R9M8psKo54CH X-Received: by 2002:a05:6e02:20c9:b0:375:a077:7e3f with SMTP id e9e14a558f8ab-375a0778af0mr54125595ab.8.1718051157892; Mon, 10 Jun 2024 13:25:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718051157; cv=pass; d=google.com; s=arc-20160816; b=BEaw0sDpY6Y5/PZJI1o8WZn4plJ8dRvHM0dtegHlb8FoeFuX2d+yEiD+hrgWKflfi1 J0qyx+HdVlf9rnCoBlk57e8q++Ysz/37cbbEzGPGvcygm4Vq9xFTu6/T4ZtG47nn77jv 8A2//KCu8yfmLdJ2+89uBYChZDDBbh05c5hbsFPITkHlCV7GmHiSssLrCqJ4kx5sLaf5 eU4UUtotuASh6t5PV2Pn0J6/s1Bw9Gc2znJv/uQnOwjtqZX+Ongbl3nvdpwMg/5VfrgR c4RJftFUHeeotkuXXxz7zi2HDkNTxmn1oh6szwDWuD51BZbxv/OXtHkGVJX8ylNHb+cc T+ow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=/wH3mYXJPFC56KG/UdINpo4FbUx5USQeX53C3PDh1Bk=; fh=3tZ8B1CLs/hKrIaXZoOw7ZuRjdQiPjdGpm4/VEZUoo4=; b=ZRcEoo5x1ey0Gk4GWdEaibf5npsN6xceQhYBJqQEICHB6g8eiuSXtuOvYHLfWfxZW/ jxD+CxF8n0y31bxib0SKtLbqxwk27V1XrDjes6akx7mdOYXW5Z5Qr2ER+kmKd3wYlREb IJ9Zs/eYQsQBZf6md782CKRLWZhrZHBaubdF/zjs92Y0boJ6iJQXWq32KIyI7LD1Blwp Iio2Z8X1/W4hpWMw/voyxSUYD1BlIRKL6Q5MZcfeeU58g1UYdaJT+dh4kN0/yvWxQ9eQ l5vXVSAob5wOJfq8Uc5rZ1ReWCL2CtG3X7H0d4vQ0TFzqNpHF3ybDJlgPUE7Nb04YVFH KAEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=BS4mV88J; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-208857-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6eb09d137aasi3270194a12.646.2024.06.10.13.25.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 13:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208857-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=BS4mV88J; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-208857-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5C918284899 for ; Mon, 10 Jun 2024 20:25:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 475BB487AE; Mon, 10 Jun 2024 20:25:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="BS4mV88J" Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9AD22E859 for ; Mon, 10 Jun 2024 20:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718051149; cv=none; b=FolxuammWUT7bsmDDD8p70016hLca+k+uiA4fIoQLVdWK9jcR7BweqnnsqkFETNCdMzw8qUnvkTPA+xAyXpAE07C5PGGfOew+I/5e+rXGO3sg6hl+lAmEqJDKaZOo3xiljY39BBbqY56Y0QkVQNJCVkuCe4uQ1HBhkl31cFWzvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718051149; c=relaxed/simple; bh=SONlq9bXQbAkTw0EihI5/xjKerm7ff58Ryq6LfBbhF0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mDFrKfsCdIi2sAFe0+XqB0sKIMg90oC8S+infvPRtxYSpRcriyUmzyPJs9pSLvXDxdVZsHZ7/KgDi2CXsuLRUspf/a0bXU4AOMS827pPSYus94suFMWzo5Wjv1xPDkvYPvZaWVcStaycJ0aY617oT96Vzi8UWuv/j19qe7GXW30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com; spf=pass smtp.mailfrom=cloudflare.com; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b=BS4mV88J; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloudflare.com Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-57c61165af6so3758775a12.2 for ; Mon, 10 Jun 2024 13:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1718051146; x=1718655946; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/wH3mYXJPFC56KG/UdINpo4FbUx5USQeX53C3PDh1Bk=; b=BS4mV88JHJcQKOZH4AjD/VXAJRB4cGA+sC/iEuSHK1446agPTX8IyrvQxzYXAcDKrz /jxI4dUEFadkJGS9o+OFujWmP8VmZ5LHersUiOFaltIVoPQORYzB3qfd6xeMnlIOACA1 7ociECb8aVwKYIzvu7VHQY1nu840AiC10HUeseLxS28KI1IgwqUa8QQTlKhs71S6+Zlw XUZu4bfEmcnNt/X7iZF+Ext3RIfANRLjNA4G5sqHv0ketyjXscSebxmeLo5hoT2KVMP3 LdGLT1cItVzGnsZ3O8850AVnsYU8pW60fLbVNJgIf/sn1QdvyTKownzX3WKscDGgpMIs ozrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718051146; x=1718655946; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/wH3mYXJPFC56KG/UdINpo4FbUx5USQeX53C3PDh1Bk=; b=m25wruZTwYPdYir1Nt7Igj6wnwRH1enJJWnZI84aQomqrP538mWKomdtRm7W7ni54a xxIVx9rJxdfBQ43UtV2XsQvQ79rmAB6lqtUjiDz0uPI7pKMfX8fpaaVqeQ13Tw8jZduS ztMFx9r6aMrCmFIBPDc5NNBSiFABEq5WXiMJz60lPhSW07SWKpgKl8NcOh47jC6JySmy APxjhQ9H6uAlVz+iz7Vi5Rh5olkg/t04Yhr3GLEtDaVZhOyzkBrshkpL3dSjUoLzUY+9 D2GoABPKrsRQmNDxyjuiSfX9uweoyyySFvo39DeclHsJUxR0dx5URoqfok+JVuO7M505 RIhQ== X-Forwarded-Encrypted: i=1; AJvYcCVkNVma4VsAEQzFWj7Id4pTR+H6IGGZPU2wKucXyizapDIrPd0T7O/lAzaBSXh7+92TbeKjjnLGKx2obd6Jt3K5GrLtFGG87zK9C80j X-Gm-Message-State: AOJu0YwzanwZ+u9RaxGC84qYt3sLqUZZeKtBh/+vws0bVuU+Qi9xc7d8 3U006Dj2TU6Rd24fwAI3zWuq696LAzKoJfI86hMh7Ph+CvTwzVu1wWKJSWChar1itLvOBDMeHHK DqpUGa7Zvmq437FVnYpDMKlIXKxWYVlOKhC3edA== X-Received: by 2002:a50:8751:0:b0:57c:7f3b:6b9c with SMTP id 4fb4d7f45d1cf-57c7f3b6bbdmr2819913a12.5.1718051146118; Mon, 10 Jun 2024 13:25:46 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <983c54f98746bd42d778b99840435d0a93963cb3.1717529533.git.yan@cloudflare.com> <20240605195750.1a225963@gandalf.local.home> <20240610125422.252da487@rorschach.local.home> In-Reply-To: <20240610125422.252da487@rorschach.local.home> From: Yan Zhai Date: Mon, 10 Jun 2024 15:25:34 -0500 Message-ID: Subject: Re: [RFC v3 net-next 1/7] net: add rx_sk to trace_kfree_skb To: Steven Rostedt Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Abhishek Chauhan , Mina Almasry , Florian Westphal , Alexander Lobakin , David Howells , Jiri Pirko , Daniel Borkmann , Sebastian Andrzej Siewior , Lorenzo Bianconi , Pavel Begunkov , linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Jesper Dangaard Brouer , Masami Hiramatsu , Mathieu Desnoyers , Neil Horman , linux-trace-kernel@vger.kernel.org, Dan Carpenter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 10, 2024 at 11:54=E2=80=AFAM Steven Rostedt wrote: > > On Thu, 6 Jun 2024 10:37:46 -0500 > Yan Zhai wrote: > > > > name: kfree_skb > > > ID: 1799 > > > format: > > > field:unsigned short common_type; offset:0; size:= 2; signed:0; > > > field:unsigned char common_flags; offset:2; size:= 1; signed:0; > > > field:unsigned char common_preempt_count; offset:3; = size:1; signed:0; > > > field:int common_pid; offset:4; size:4; signed:1; > > > > > > field:void * skbaddr; offset:8; size:8; signed:0; > > > field:void * location; offset:16; size:8; signed:0; > > > field:unsigned short protocol; offset:24; size:2; signe= d:0; > > > field:enum skb_drop_reason reason; offset:28; size:= 4; signed:0; > > > > > > Notice that "protocol" is 2 bytes in size at offset 24, but "reason" = starts > > > at offset 28. This means at offset 26, there's a 2 byte hole. > > > > > The reason I added the pointer as the last argument is trying to > > minimize the surprise to existing TP users, because for common ABIs > > it's fine to omit later arguments when defining a function, but it > > needs change and recompilation if the order of arguments changed. > > Nothing should be hard coding the offsets of the fields. This is > exported to user space so that tools can see where the fields are. > That's the purpose of libtraceevent. The fields should be movable and > not affect anything. There should be no need to recompile. > Oh I misunderstood previously. I was also thinking about the argument order in TP_PROTO, but what you mentioned is just the order in TP_STRUCT__entry, correct? I'd prefer to not change the argument order but the struct field order can definitely be aligned better here. Yan > > > > Looking at the actual format after the change, it does not add a new > > hole since protocol and reason are already packed into the same 8-byte > > block, so rx_skaddr starts at 8-byte aligned offset: > > > > # cat /sys/kernel/debug/tracing/events/skb/kfree_skb/format > > name: kfree_skb > > ID: 2260 > > format: > > field:unsigned short common_type; offset:0; > > size:2; signed:0; > > field:unsigned char common_flags; offset:2; > > size:1; signed:0; > > field:unsigned char common_preempt_count; offset:3; > > size:1; signed:0; > > field:int common_pid; offset:4; size:4; signed:1; > > > > field:void * skbaddr; offset:8; size:8; signed:0; > > field:void * location; offset:16; size:8; signed:0; > > field:unsigned short protocol; offset:24; size:2; signed:= 0; > > field:enum skb_drop_reason reason; offset:28; > > size:4; signed:0; > > field:void * rx_skaddr; offset:32; size:8; signed:0; > > > > Do you think we still need to change the order? > > Up to you, just wanted to point it out. > > -- Steve >