Re: [PATCH v2 net] net: enetc: survive memory pressure without crashing

From: Jakub Kicinski
Date: Thu Oct 27 2022 - 13:58:32 EST


On Wed, 26 Oct 2022 15:13:30 +0300 Vladimir Oltean wrote:
> To fix this problem, memset the DMA coherent area used for RX buffer
> descriptors in enetc_dma_alloc_bdr(). This makes all BDs be "not ready"
> by default, which makes enetc_clean_rx_ring() exit early from the BD
> processing loop when there is no valid buffer available.

IIRC dma_alloc_coherent() always zeros, and I'd guess there is a cocci
script that checks this judging but the number of "fixes" we got for
this in the past.

scripts/coccinelle/api/alloc/zalloc-simple.cocci ?