On 2/28/25 2:23 PM, Carlos Sergio Bederian wrote: > I work at an HPC center and I've been trying to figure out why the > knem intra-node communication kernel module stopped being able to use > IOAT to offload memcpy at some point in time, presumably a long time > ago. > The knem module uses dma_find_channel(DMA_MEMCPY) to get a dma_chan so > I wrote a test kernel module that tries to grab a dma_chan using both > dma_find_channel and dma_request_channel and then submits a memcpy. > dma_request_channel succeeds in returning a DMA_MEMCPY channel, but > dma_find_channel never does, regardless of order. This is on a Debian > 6.12.9 kernel. > Is there anything I'm missing? Does dmatest work for you? Also, make sure dmatest isn't loaded when you have your module loaded. Or any other kernel module that uses dma like ntb_transport isn't claiming the channels. DJ > > static struct dma_chan* dma_req(void) { > struct dma_chan* chan = NULL; > dma_cap_mask_t mask; > dma_cap_zero(mask); > dma_cap_set(DMA_MEMCPY, mask); > chan = dma_request_channel(mask, NULL, NULL); > if (!chan) { > pr_err("dmacopy: dma_request_channel didn't return a channel"); > } else { > pr_info("dmacopy: dma_request_channel succeeded"); > } > return chan; > } > > static struct dma_chan* dma_find(void) { > struct dma_chan* chan = NULL; > dmaengine_get(); > chan = dma_find_channel(DMA_MEMCPY); > if (!chan) { > pr_err("dmacopy: dma_find_channel didn't return a channel"); > dmaengine_put(); > } else { > pr_info("dmacopy: dma_find_channel succeeded"); > } > return chan; > } >