mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
virtio-net: xsk: rx: move the xdp->data adjustment to buf_to_xdp()
This commit does not do any functional changes. It moves xdp->data adjustment for buffer other than first buffer to buf_to_xdp() helper so that the xdp_buff adjustment does not scatter over different functions. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com> Link: https://patch.msgid.link/20250705075515.34260-1-minhquangbui99@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
b4bb2ac099
commit
f47e8f618c
|
|
@ -1179,7 +1179,14 @@ static struct xdp_buff *buf_to_xdp(struct virtnet_info *vi,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
xsk_buff_set_size(xdp, len);
|
||||
if (first_buf) {
|
||||
xsk_buff_set_size(xdp, len);
|
||||
} else {
|
||||
xdp_prepare_buff(xdp, xdp->data_hard_start,
|
||||
XDP_PACKET_HEADROOM - vi->hdr_len, len, 1);
|
||||
xdp->flags = 0;
|
||||
}
|
||||
|
||||
xsk_buff_dma_sync_for_cpu(xdp);
|
||||
|
||||
return xdp;
|
||||
|
|
@ -1304,7 +1311,7 @@ static int xsk_append_merge_buffer(struct virtnet_info *vi,
|
|||
goto err;
|
||||
}
|
||||
|
||||
memcpy(buf, xdp->data - vi->hdr_len, len);
|
||||
memcpy(buf, xdp->data, len);
|
||||
|
||||
xsk_buff_free(xdp);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user