From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7B8BF3806CE; Tue, 10 Feb 2026 17:22:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770744130; cv=none; b=B6YNYfb9AN7QViGcQez4lE2Mt4JLNGJeRdTUeeBnat4jFQVeEeRbnfVJd+mLID3J7P+2lQGmIKL8YzT/y0X09TP1Hy7YXp78CcqyZjtQ2CtGjZLo8s6+MJTzV3blCT6qyIDn3aVaKINJutOuZjttIcPYPQsNvvMm3Fi3sx9tBwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770744130; c=relaxed/simple; bh=JAEMyV1TNwzlux2cgmKyDqshObhiQMHMmD4rd7uoQPY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dL4525qRAa8iTAESHqJqiXs0wE7blOBmKB3JtyhPxUgOaQqym3uqiPzK5RPU8b4gy1wRRa3jVYlRxT3ywBkukMaf3a1ZGXxGnL26Vkwk9ta9aXjQKTxFmi/qGaISkboO7dk+TmClz+7dfy1lIqsYFfJZ8Y12nZ7watx7b6IisV4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rU41223K; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rU41223K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A469C116C6; Tue, 10 Feb 2026 17:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770744130; bh=JAEMyV1TNwzlux2cgmKyDqshObhiQMHMmD4rd7uoQPY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rU41223K2+rA1C3nyhJokzdaYOw2NxYHmp9tP+Qb2kzw7GeNMX9P7KqqSnp1InX4z 4vroi5OSAlhUtWf59Ik0F6C+IIV04WJx4jGw+pJ6TazI0V/TsUgowmxhtYDgoInkgu glNyOvhoQ16jcVVi7Xkxd+Uk+gX6HBDWd3Onfsc9pRuFqBCR6ci6pgeqC0KE/CCXVd z3k5tAfAofmPjgRLJOLeEtfWErDIXWx4Dr+f5q4NR4YTPuGwO3sW9tco790xEaMYTJ mEHsqgvguPN7kJ4MdlK99CbDvB8XqEfDyJNK2edUIeOKCyhJ6QaoqrkKnIzhtQh8aa qo/Y1Iok8XRQQ== From: Lorenzo Bianconi Date: Tue, 10 Feb 2026 18:21:48 +0100 Subject: [PATCH bpf-next 2/5] net: veth: Add xmo_rx_checksum callback to veth driver Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260210-bpf-xdp-meta-rxcksum-v1-2-e5d55caa0541@kernel.org> References: <20260210-bpf-xdp-meta-rxcksum-v1-0-e5d55caa0541@kernel.org> In-Reply-To: <20260210-bpf-xdp-meta-rxcksum-v1-0-e5d55caa0541@kernel.org> To: Donald Hunter , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Andrew Lunn , Tony Nguyen , Przemek Kitszel , Alexander Lobakin , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa , Shuah Khan , Maciej Fijalkowski Cc: Jakub Sitnicki , netdev@vger.kernel.org, bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kselftest@vger.kernel.org, Lorenzo Bianconi X-Mailer: b4 0.14.2 Implement xmo_rx_checksum callback in veth driver to report RX checksum result to the eBPF program bounded to the veth device. Signed-off-by: Lorenzo Bianconi --- drivers/net/veth.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 14e6f2a2fb7783334d8f6afd54e658cf9a0e6f3d..38b70ad62db7e92cccc6c6c9ed1f5573d8baf48b 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1693,6 +1693,25 @@ static int veth_xdp_rx_vlan_tag(const struct xdp_md *ctx, __be16 *vlan_proto, return err; } +static int veth_xdp_rx_checksum(const struct xdp_md *ctx, + enum xdp_checksum *ip_summed, + u32 *cksum_meta) +{ + const struct veth_xdp_buff *_ctx = (void *)ctx; + const struct sk_buff *skb = _ctx->skb; + + if (!skb) + return -ENODATA; + + /* For locally generated packets ip_summed is set to + * CHECKSUM_PARTIAL. + */ + *ip_summed = skb->ip_summed; + *cksum_meta = 0; + + return 0; +} + static const struct net_device_ops veth_netdev_ops = { .ndo_init = veth_dev_init, .ndo_open = veth_open, @@ -1718,6 +1737,7 @@ static const struct xdp_metadata_ops veth_xdp_metadata_ops = { .xmo_rx_timestamp = veth_xdp_rx_timestamp, .xmo_rx_hash = veth_xdp_rx_hash, .xmo_rx_vlan_tag = veth_xdp_rx_vlan_tag, + .xmo_rx_checksum = veth_xdp_rx_checksum, }; #define VETH_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HW_CSUM | \ -- 2.53.0