mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] vhost/net: use xdp_get_frame_len()
@ 2025-05-07 16:19 Jon Kohler
  0 siblings, 0 replies; only message in thread
From: Jon Kohler @ 2025-05-07 16:19 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang, Eugenio Pérez,
	Alexei Starovoitov, Daniel Borkmann, David S. Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend, kvm,
	virtualization, netdev, linux-kernel, bpf
  Cc: Jon Kohler

Use xdp_get_frame_len helper to ensure xdp frame size is calculated
correctly in both single buffer and multi buffer configurations.

Signed-off-by: Jon Kohler <jon@nutanix.com>
---
 drivers/vhost/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 7cbfc7d718b3..ff2fcb019900 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -199,7 +199,7 @@ static int vhost_net_buf_peek_len(void *ptr)
 	if (tun_is_xdp_frame(ptr)) {
 		struct xdp_frame *xdpf = tun_ptr_to_xdp(ptr);
 
-		return xdpf->len;
+		return xdp_get_frame_len(xdpf);
 	}
 
 	return __skb_array_len_with_tag(ptr);
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-07 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-07 16:19 [PATCH net-next] vhost/net: use xdp_get_frame_len() Jon Kohler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®