Re: [PATCH net-next v3 3/3] net: stmmac: Introducing support for Page Pool

From: Ilias Apalodimas
Date: Fri Jul 05 2019 - 09:29:15 EST


Hi Jose,

I think this look ok for now. One request though, on page_pool_free

On Fri, Jul 05, 2019 at 09:23:00AM +0200, Jose Abreu wrote:
> Mapping and unmapping DMA region is an high bottleneck in stmmac driver,
> specially in the RX path.
>
> This commit introduces support for Page Pool API and uses it in all RX
> queues. With this change, we get more stable troughput and some increase
> of banwidth with iperf:
> - MAC1000 - 950 Mbps
> - XGMAC: 9.22 Gbps
>
> Changes from v2:
> - Uncoditionally call page_pool_free() (Jesper)
> Changes from v1:
> - Use page_pool_get_dma_addr() (Jesper)
> - Add a comment (Jesper)
> - Add page_pool_free() call (Jesper)
> - Reintroduce sync_single_for_device (Arnd / Ilias)
>
> Signed-off-by: Jose Abreu <joabreu@xxxxxxxxxxxx>
> Cc: Joao Pinto <jpinto@xxxxxxxxxxxx>
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@xxxxxx>
> Cc: Alexandre Torgue <alexandre.torgue@xxxxxx>
> Cc: Ilias Apalodimas <ilias.apalodimas@xxxxxxxxxx>
> Cc: Jesper Dangaard Brouer <brouer@xxxxxxxxxx>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> drivers/net/ethernet/stmicro/stmmac/Kconfig | 1 +
> drivers/net/ethernet/stmicro/stmmac/stmmac.h | 10 +-
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 203 +++++++---------------
> 3 files changed, 70 insertions(+), 144 deletions(-)
>

[...]
> @@ -1498,8 +1480,11 @@ static void free_dma_rx_desc_resources(struct stmmac_priv *priv)
> sizeof(struct dma_extended_desc),
> rx_q->dma_erx, rx_q->dma_rx_phy);
>
> - kfree(rx_q->rx_skbuff_dma);
> - kfree(rx_q->rx_skbuff);
> + kfree(rx_q->buf_pool);
> + if (rx_q->page_pool) {
> + page_pool_request_shutdown(rx_q->page_pool);
> + page_pool_free(rx_q->page_pool);

A patch currently under review will slightly change that [1] and [2]
Can you defer this a bit till that one gets merged?
The only thing you'll have to do is respin this and replace page_pool_free()
with page_pool_destroy()

[1] 20190705094346.13b06da6@carbon/">https://lore.kernel.org/netdev/20190705094346.13b06da6@carbon/
[2] 156225871578.1603.6630229522953924907.stgit@firesoul/">https://lore.kernel.org/netdev/156225871578.1603.6630229522953924907.stgit@firesoul/