We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5d4a89 commit 4e4b08eCopy full SHA for 4e4b08e
drivers/net/tun.c
@@ -2385,6 +2385,7 @@ static int tun_xdp_one(struct tun_struct *tun,
2385
struct tun_file *tfile,
2386
struct xdp_buff *xdp, int *flush)
2387
{
2388
+ unsigned int datasize = xdp->data_end - xdp->data;
2389
struct tun_xdp_hdr *hdr = xdp->data_hard_start;
2390
struct virtio_net_hdr *gso = &hdr->gso;
2391
struct tun_pcpu_stats *stats;
@@ -2461,7 +2462,7 @@ static int tun_xdp_one(struct tun_struct *tun,
2461
2462
stats = get_cpu_ptr(tun->pcpu_stats);
2463
u64_stats_update_begin(&stats->syncp);
2464
stats->rx_packets++;
- stats->rx_bytes += skb->len;
2465
+ stats->rx_bytes += datasize;
2466
u64_stats_update_end(&stats->syncp);
2467
put_cpu_ptr(stats);
2468
0 commit comments