Skip to content

Commit d0fbdc3

Browse files
Amit Cohenkuba-moo
authored andcommitted
mlxsw: pci: Sync Rx buffers for device
Non-coherent architectures, like ARM, may require invalidating caches before the device can use the DMA mapped memory, which means that before posting pages to device, drivers should sync the memory for device. Sync for device can be configured as page pool responsibility. Set the relevant flag and define max_len for sync. Cc: Jiri Pirko <[email protected]> Fixes: b5b60bb ("mlxsw: pci: Use page pool for Rx buffers allocation") Signed-off-by: Amit Cohen <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: Petr Machata <[email protected]> Link: https://patch.msgid.link/92e01f05c4f506a4f0a9b39c10175dcc01994910.1729866134.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 15f73e6 commit d0fbdc3

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+2
-1
lines changed

drivers/net/ethernet/mellanox/mlxsw/pci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,12 +996,13 @@ static int mlxsw_pci_cq_page_pool_init(struct mlxsw_pci_queue *q,
996996
if (cq_type != MLXSW_PCI_CQ_RDQ)
997997
return 0;
998998

999-
pp_params.flags = PP_FLAG_DMA_MAP;
999+
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
10001000
pp_params.pool_size = MLXSW_PCI_WQE_COUNT * mlxsw_pci->num_sg_entries;
10011001
pp_params.nid = dev_to_node(&mlxsw_pci->pdev->dev);
10021002
pp_params.dev = &mlxsw_pci->pdev->dev;
10031003
pp_params.napi = &q->u.cq.napi;
10041004
pp_params.dma_dir = DMA_FROM_DEVICE;
1005+
pp_params.max_len = PAGE_SIZE;
10051006

10061007
page_pool = page_pool_create(&pp_params);
10071008
if (IS_ERR(page_pool))

0 commit comments

Comments
 (0)