Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147311373
D43133.id132971.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
915 B
Referenced Files
None
Subscribers
None
D43133.id132971.diff
View Options
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
--- a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
@@ -1113,11 +1113,16 @@
block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE);
- memset(block, 0, MLX5_CMD_MBOX_SIZE);
-
if (i != (n - 1)) {
+ memset(block, 0, MLX5_CMD_MBOX_SIZE);
+
u64 dma = mlx5_fwp_get_dma(msg, (i + 1) * MLX5_CMD_MBOX_SIZE);
block->next = cpu_to_be64(dma);
+ } else {
+ /* Zero the rest of the page to satisfy KMSAN. */
+ memset(block, 0, MLX5_ADAPTER_PAGE_SIZE -
+ (i % MLX5_NUM_CMDS_IN_ADAPTER_PAGE) *
+ MLX5_CMD_MBOX_SIZE);
}
block->block_num = cpu_to_be32(i);
}
@@ -1508,6 +1513,7 @@
}
cmd->dma = mlx5_fwp_get_dma(cmd->cmd_page, 0);
cmd->cmd_buf = mlx5_fwp_get_virt(cmd->cmd_page, 0);
+ memset(cmd->cmd_buf, 0, MLX5_ADAPTER_PAGE_SIZE);
return (0);
failure_alloc_page:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 10, 9:11 PM (11 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29444742
Default Alt Text
D43133.id132971.diff (915 B)
Attached To
Mode
D43133: mlx5: Zero DMA memory in mlx5_fwp_alloc()
Attached
Detach File
Event Timeline
Log In to Comment