Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174792781
D60384.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60384.diff
View Options
diff --git a/sys/dev/gve/gve_utils.c b/sys/dev/gve/gve_utils.c
--- a/sys/dev/gve/gve_utils.c
+++ b/sys/dev/gve/gve_utils.c
@@ -86,6 +86,7 @@
gve_dma_alloc_coherent(struct gve_priv *priv, int size, int align,
struct gve_dma_handle *dma)
{
+ int alloc_size = roundup2(size, align);
int err;
device_t dev = priv->dev;
@@ -95,9 +96,9 @@
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
- size, /* maxsize */
+ alloc_size, /* maxsize */
1, /* nsegments */
- size, /* maxsegsize */
+ alloc_size, /* maxsegsize */
BUS_DMA_ALLOCNOW, /* flags */
NULL, /* lockfunc */
NULL, /* lockarg */
@@ -113,13 +114,13 @@
&dma->map);
if (err != 0) {
device_printf(dev, "%s: bus_dmamem_alloc(%ju) failed: %d\n",
- __func__, (uintmax_t)size, err);
+ __func__, (uintmax_t)alloc_size, err);
goto destroy_tag;
}
/* An address set by the callback will never be -1 */
dma->bus_addr = (bus_addr_t)-1;
- err = bus_dmamap_load(dma->tag, dma->map, dma->cpu_addr, size,
+ err = bus_dmamap_load(dma->tag, dma->map, dma->cpu_addr, alloc_size,
gve_dmamap_load_callback, &dma->bus_addr, BUS_DMA_NOWAIT);
if (err != 0 || dma->bus_addr == (bus_addr_t)-1) {
device_printf(dev, "%s: bus_dmamap_load failed: %d\n", __func__, err);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 7, 12:51 AM (15 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40318865
Default Alt Text
D60384.diff (1 KB)
Attached To
Mode
D60384: gve: align dma buffers to requested boundary
Attached
Detach File
Event Timeline
Log In to Comment