Article View: linux.kernel.netdev
Article #11735Re: [PATCH net 1/2] net: pass the XDP action to generic_xdp_tx() for tracing
From: Simon Horman
Date: Thu, 05 Nov 2026 13:23
Date: Thu, 05 Nov 2026 13:23
28 lines
10098 bytes
10098 bytes
On Fri, Oct 30, 2026 at 01:47:52PM +0200, Vladimir Oltean wrote:
> When generic_xdp_tx() fails to transmit an skb, it reports the drop
> through trace_xdp_exception() with the action hardcoded to XDP_TX.
> That was right when generic XDP was added, and XDP_TX was the only
> caller. Since then, two XDP_REDIRECT paths have started to transmit
> through generic_xdp_tx() as well:
>
> - xdp_do_generic_redirect(), for a redirect to an ifindex
> - dev_map_generic_redirect(), for DEVMAP and DEVMAP_HASH redirects,
> including broadcast
>
> Drops on those paths are reported as XDP_TX, an action which the
> program never returned. Tools which count xdp:xdp_exception events per
> action, such as the samples/bpf programs built on xdp_sample, therefore
> attribute generic XDP redirect drops to the wrong action. Drivers with
> native XDP already report XDP_TX and XDP_REDIRECT drops separately.
>
> Add an "act" argument to generic_xdp_tx(), and have each caller pass
> the action that led to the transmission: XDP_TX from do_xdp_generic(),
> XDP_REDIRECT from the two redirect paths. generic_xdp_tx() is not
> exported, so these are all of its users.
>
> Fixes: 6103aa96ec07 ("net: implement XDP_REDIRECT for xdp generic")
> Fixes: 6d5fc1957989 ("xdp: Fix handling of devmap in generic XDP")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261105132327.GQ865646@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357375-linux-kernel-netdev=dewy.ruReferences:
<20261030114753.185281-1-vladimir.oltean@nxp.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357375-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/2] net: pass the XDP action to generic_xdp_tx() for tracing Date: Thu, 5 Nov 2026 13:23:27 +0000 Organization: Usenet Network Message-ID: <20261105132327.GQ865646@horms.kernel.org> References: <20261030114753.185281-1-vladimir.oltean@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="3648783"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:qkLAzLsX6x45jyNwDhMf9/0/GNQ= sha256:jLoxG0BfCy4deR8P74tqhaZXDhfwcCmxU/L6PD8Byaw= sha1:9rYWfECfplmGo5quurGdhfWsbow= sha256:6oTN0OXFsYnLGxlxwcT3ohV9AONDwEgm7RtrfXmrorw= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 9528F112FB8; Thu, 5 Nov 2026 16:55:07 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tqXvU4VT5Pkc; Thu, 5 Nov 2026 16:55:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-357375-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 60B3A112FB5; Thu, 5 Nov 2026 16:54:52 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 2A93B2E629; Thu, 5 Nov 2026 13:24:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793885031; b=JGhcm2PfScvBycnZ2bdK6tWMr3HhKm5grGF95vSJ0d3k81WkLu3kCrXUJIZi763k12QK P769EGEjwy1W5/KKp4SpkylVX4lVjCoaOiHhrA/3wjD3blwtH/h9K2IsfM0mFA9E+9kdh KS3kGFEpS7pfVdlfyhKckZmhM+YbD5NgHViaQp4xAuQCfKJLHFWX2N320ksOkIXFE3FAz HSzRaVt5k/tahEL+ga/Y/eWc6MWPgNqm0COWoNbT/o24aKQwdQsrdTyLxYWt0xRyesrmg cvqIJGQjzPO8tdHdD3DIqmCH49KwJTGe1ZNsuN2gK8TJ8yBzyih9YsdtzOVJ5NkwFwQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793885031; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=2Rg54/UgthSrrGMQdksoyYG0Dil1YdHkzpnilCgBW5E=; b=Xplm3iPqFOLzFLqBPLp/obd7kL7XWuvFzFu1gZTtHIRJbcu/ADhIxSlp2cbn1qngHXyN 93ERKjR8bWDigPXUMdQY0YjCAVCVxr0mAXVHYM9yiAAUs+fXRx0CFfS1hSkHYn2LsEqic 0nDh/20/qYZhX2Dwvj7sxsvyL807sNbv7I0T811CP9AeT5/tjkSiDaFSEjfYai5P7eo9/ MHG18mwVV2z5N7D2JxExk0XBN1Rqt/sh1kK6OoQxaK1/BQ4rXhV5wrMigQRq4quAIwwdF WFhNSqSj2QF5oC09A1Mnhb2FuRElGn2z6yHxAAqz3ro5oReSaO80tZck00IXXpM5/cg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="T2rPD2F/"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B0B1606D839; Thu, 5 Nov 2026 13:23:51 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T2rPD2F/ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793885015; b=h0VYNAAVxeglJA59YUccLD07r11a+7uB3IptHwv60UgUW2FW9hqf1Zgk+/MspJ84Ze7z t/jfogRLFAeun/QwxTQ63n7fUeoHFNAt7FzvMNFpvn2dEdsjdMrX7ZN7bJzb5W+AWqnn7 g8yi6uz9EQuYq1xEjEAkMMjtdHKR1aYHzFjC9mCw0LEzbx5oCRfT4KgnXwWLnM9CB8FMX 58P9gmgGC7Vi3Yb7aaBwKzw2uxwzfwNSPCT2IV240UZFRsL0S6f44jJ2q6hNfTJbr4bIO 7nNNw2P60wTDvwW0hJPVw/FR2DiQoF7RH0Pfz4ZVSA1DQ0rmkZwYwLDt3StZdwhxBzg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793885015; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=2Rg54/UgthSrrGMQdksoyYG0Dil1YdHkzpnilCgBW5E=; b=pGKMb20+8j7t+RpTto6+Ua47z0u5ZYsTSX2dJ8x9zKWb/G+cLXrdtGwg6PZuFrM1v7KH egJjTnTEnshIIcSV94yIzv4ryoySgFC7admYmHrSJj06a1x1p1WoArKKXEQMiFh1IYjsC qz75hJqWyab+zsnAKguVdo664p3VjX67RNKVTg5NoUFoYtuy5sRyPEnkJGAg4z5P5wk8i LERc1aRzKmVcRVbH9QkZkyMuASG5IGqoAGmTkX/GcC176cGFSLJ+KS7XF6dp5T10VrOeL 7JubUkKKzLsRRoxNLf5QZeNz2rTXvxLpwuxOvF4WKzH9iVXCJr0zU4Nek3cp1B2ybkg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="T2rPD2F/"; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 293F1606A333; Thu, 5 Nov 2026 13:23:34 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A7CA1F00919; Thu, 5 Nov 2026 13:23:29 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793885014; bh=2Rg54/UgthSrrGMQdksoyYG0Dil1YdHkzpnilCgBW5E=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=T2rPD2F/8wB/Id9kJGmahcqSsoxr/veB4/lmXtIYfHDLOA2gm/gWqlPvURULID7vQ LtacLEo7B1C69FdrJKvPQd9K78YzTlKRNJzUfxZVafVk1YTK8KERGpRvIds6+PuxbU mHvHYmQnYLQU7juP4XZ7p+4W68tg3G1cSpC0Dyr50TfMAKZo4IOarRT1wY6NJG1Rc0 LJBoXc75+1vtJIq6aLAzSjKybc6xBxDLJh/2yj1oEQav9g003hQjHrd+OCgg4bpmSJ mDy0ySDl+yndoqVDuctfygFAERhYrbv+qFh/KXpd9EekUVsHlmm9NTMPPlD2TeO7yR 08No/SVeu6Rig== X-Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Jesper Dangaard Brouer <hawk@kernel.org>, John Fastabend <john.fastabend@gmail.com>, Stanislav Fomichev <sdf@fomichev.me>, Andrii Nakryiko <andrii@kernel.org>, Eduard Zingerman <eddyz87@gmail.com>, Kumar Kartikeya Dwivedi <memxor@gmail.com>, Martin KaFai Lau <martin.lau@linux.dev>, Song Liu <song@kernel.org>, Yonghong Song <yonghong.song@linux.dev>, Jiri Olsa <jolsa@kernel.org>, Emil Tsalapatis <emil@etsalapatis.com>, Ihor Solodrai <ihor.solodrai@linux.dev>, Kuniyuki Iwashima <kuniyu@google.com>, Wang Zhan <wang.zhan@smartx.com>, Martin Karsten <mkarsten@uwaterloo.ca>, Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowangio@gmail.com>, Eugenio PΓ©rez <eperezma@redhat.com>, Xuan Zhuo <xuanzhuo@linux.alibaba.com>, virtualization@lists.linux.dev, Willem de Bruijn <willemdebruijn.kernel@gmail.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261030114753.185281-1-vladimir.oltean@nxp.com>