Skip to content

Commit 513072f

Browse files
jfrakerkuba-moo
authored andcommitted
gve: Add page size register to the register_page_list command.
This register is required on platforms with page sizes greater than 4k. This is because the tx side of the driver vmaps the entire queue page list of pages into a single flat address space, then uses the entire space. Without communicating the guest page size to the backend, the backend will only access the first 4k of each page in the queue page list. Signed-off-by: Jordan Kimbrough <jrkim@google.com> Signed-off-by: John Fraker <jfraker@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20231128002648.320892-5-jfraker@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent ce260cb commit 513072f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/net/ethernet/google/gve/gve_adminq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,7 @@ int gve_adminq_register_page_list(struct gve_priv *priv,
917917
.page_list_id = cpu_to_be32(qpl->id),
918918
.num_pages = cpu_to_be32(num_entries),
919919
.page_address_list_addr = cpu_to_be64(page_list_bus),
920+
.page_size = cpu_to_be64(PAGE_SIZE),
920921
};
921922

922923
err = gve_adminq_execute_cmd(priv, &cmd);

drivers/net/ethernet/google/gve/gve_adminq.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,10 @@ struct gve_adminq_register_page_list {
219219
__be32 page_list_id;
220220
__be32 num_pages;
221221
__be64 page_address_list_addr;
222+
__be64 page_size;
222223
};
223224

224-
static_assert(sizeof(struct gve_adminq_register_page_list) == 16);
225+
static_assert(sizeof(struct gve_adminq_register_page_list) == 24);
225226

226227
struct gve_adminq_unregister_page_list {
227228
__be32 page_list_id;

0 commit comments

Comments
 (0)