[PATCH net-next] vhost/net: use xdp_get_frame_len()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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





[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux