Re: [PATCH net-next v25 02/13] rtase: Implement the .ndo_open function

From: Jakub Kicinski
Date: Mon Jul 29 2024 - 22:16:46 EST


On Mon, 29 Jul 2024 14:21:10 +0800 Justin Lai wrote:
> + page = page_pool_dev_alloc_pages(tp->page_pool);
> + if (!page) {
> + netdev_err(tp->dev, "failed to alloc page\n");
> + goto err_out;
> + }
> +
> + buf_addr = page_address(page);
> + mapping = page_pool_get_dma_addr(page);
> +
> + skb = build_skb(buf_addr, PAGE_SIZE);

Don't build_skb() before packet was received.

One of the benefits of build_skb() is that the skb is supposed
to be more likely to be still in CPU cache.