From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 797CF7263C for ; Tue, 6 May 2025 20:24:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746563092; cv=none; b=TkyQ+vbAZtHRG5kjH7d9H9aooHtvKrPO2lIlb/goIY97eQx7LnoQhWS8iWQH9Y5wX70MuQ1/c5LdGnBQYNo/PSsWFAlz9qvvpG+otLTUEJCQ09FamZV7mzQeOo6y9rYe1V3DHV1f0RYS7l3Kryx+TZbYTXzQVgpLo8NsWcISi6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746563092; c=relaxed/simple; bh=T6Wn0W3bK/1o7arEYvDyYgs/pRvSEyZXJEsHapHRN2Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lEddZevnfgvW7wtw3srDPl8J0S4L/sJ7+49qN+W+hp3sEdKXMZqOCHITgK/IZ3srqnQb49I2RAbgspd02/qkHxfa8JYMxgOL8MWykk3vyLGE7WOdVbXd7uq+ohbvORbCW2NpkFOlcOn7MSsXr9ki6g5FokPgzn6spVB75xK3jvs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=gxTfRViS; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gxTfRViS" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1746563077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Hk5IHJL/i2F/azVD9h3zUcZRECd4/4rkqvBQlEnV/Y=; b=gxTfRViStprrOmcu7JJz5WEsS2Dghtsju8+yo4jRYyZ+TQeG6SwHKeWl7jL22tksOIzZKw 3vOGN3bHFte2d6c6a5Yx70UJ7+FORIygOCEOX7ohwG8D5J8/PY8NjWTszBY7db4bz1AiJt oaGx4pwDPvYQOw/RGr0UGotKfdGgdRM= Date: Tue, 6 May 2025 13:24:26 -0700 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RESEND PATCH bpf-next v4 1/2] bpf, sockmap: Introduce tracing capability for sockmap To: Jiayuan Chen , Jakub Sitnicki , John Fastabend Cc: Cong Wang , Steven Rostedt , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Masami Hiramatsu , Mathieu Desnoyers , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jesper Dangaard Brouer , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org References: <20250506025131.136929-1-jiayuan.chen@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20250506025131.136929-1-jiayuan.chen@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 5/5/25 7:51 PM, Jiayuan Chen wrote: > Sockmap has the same high-performance forwarding capability as XDP, but > operates at Layer 7. > > Introduce tracing capability for sockmap, to trace the execution results > of BPF programs without modifying the programs themselves, similar to > the existing trace_xdp_redirect{_map}. There were advancements in bpf tracing since the trace_xdp_xxx additions. Have you considered the fexit bpf prog and why it is not sufficient ? > > It is crucial for debugging sockmap programs, especially in production > environments. > > Additionally, the new header file has to be added to bpf_trace.h to > automatically generate tracepoints. > > Test results: > $ echo "1" > /sys/kernel/tracing/events/sockmap/enable > > msg/skb: > ''' > sockmap_redirect: sk=000000000ec02a93, netns=4026531840, inode=318, \ > family=2, protocol=6, prog_id=59, len=8192, type=msg, action=REDIRECT, \ > redirect_type=ingress > > sockmap_redirect: sk=00000000d5d9c931, netns=4026531840, inode=64731, \ > family=2, protocol=6, prog_id=91, len=8221, type=skb, action=REDIRECT, \ > redirect_type=egress > > sockmap_redirect: sk=00000000106fc281, netns=4026531840, inode=64729, \ > family=2, protocol=6, prog_id=94, len=8192, type=msg, action=PASS, \ > redirect_type=none > ''' > > strparser: > ''' > sockmap_strparser: sk=00000000f15fc1c8, netns=4026531840, inode=52396, \ > family=2, protocol=6, prog_id=143, in_len=1000, full_len=10 > ''' > > Reviewed-by: Cong Wang > Suggested-by: Jakub Sitnicki > Suggested-by: Cong Wang > Suggested-by: Steven Rostedt > Signed-off-by: Jiayuan Chen > > --- > v3 -> v4: Resending this patch as v3 was incorrectly closed by Patchwork. > Additionally, carrying the Reviewed-by tag. John and JakubS, please take a look.