On Mon, Jul 31, 2023 at 11:44 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote: > Maybe I'm misunderstanding. Let me tell you how I think this works and > perhaps we should update the docs based on this discussion. > > Note that the max_len is applied to the full host page when the full > host page is returned. Not to fragments, and not at allocation. > I think I am beginning to understand what the confusion is. These 32K page fragments within the page may not belong to the same (GRO) packet. So we cannot dma_sync the whole page at the same time. Without setting PP_FLAG_DMA_SYNC_DEV, the driver code should be something like this: mapping = page_pool_get_dma_addr(page) + offset; dma_sync_single_for_device(dev, mapping, BNXT_RX_PAGE_SIZE, bp->rx_dir); offset may be 0, 32K, etc. Since the PP_FLAG_DMA_SYNC_DEV logic is not aware of this offset, we actually must do our own dma_sync and not use PP_FLAG_DMA_SYNC_DEV in this case. Does that sound right?
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature