Subject: RE: linux-next: manual merge of the net-next tree with the net tree

From: "Ong, Boon Leong" <[email-masked]>
Date: Thu, 15 Apr 2021 14:00:16 +0000

>Hi all,
>
>Today's linux-next merge of the net-next tree got a conflict in:
>
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>
>between commit:
>
>  00423969d806 ("Revert "net: stmmac: re-init rx buffers when mac resume
>back"")
>
>from the net tree and commits:
>
>  bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy")
>  de0b90e52a11 ("net: stmmac: rearrange RX and TX desc init into per-queue
>basis")
>
>from the net-next tree.
>
>I fixed it up (see below) and can carry the fix as necessary. This
>is now fixed as far as linux-next is concerned, but any non trivial
>conflicts should be mentioned to your upstream maintainer when your tree
>is submitted for merging.  You may also want to consider cooperating
>with the maintainer of the conflicting tree to minimise any particularly
>complex conflicts.

I check linux-next merge fix above and spotted an additional fix needed.
Please see below. 

>+ /**
>+  * dma_recycle_rx_skbufs - recycle RX dma buffers
>+  * @priv: private structure
>+  * @queue: RX queue index
>+  */
>+ static void dma_recycle_rx_skbufs(struct stmmac_priv *priv, u32 queue)
>+ {
>+ 	struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
>+ 	int i;
>+
>+ 	for (i = 0; i < priv->dma_rx_size; i++) {
>+ 		struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
>+
>+ 		if (buf->page) {
>+ 			page_pool_recycle_direct(rx_q->page_pool, buf-
>>page);
>+ 			buf->page = NULL;
>+ 		}
>+
>+ 		if (priv->sph && buf->sec_page) {
>+ 			page_pool_recycle_direct(rx_q->page_pool, buf-
>>sec_page);
>+ 			buf->sec_page = NULL;
>+ 		}
>+ 	}
>+ }

With https://git.kernel.org/netdev/net/c/00423969d806 that reverts
stmmac_reinit_rx_buffers(), then the above dma_recycle_rx_skbufs()
is no longer needed when net-next is sent for merge.  

> -/**
> - * stmmac_reinit_rx_buffers - reinit the RX descriptor buffer.
> - * @priv: driver private structure
> - * Description: this function is called to re-allocate a receive buffer, perform
> - * the DMA mapping and init the descriptor.
> - */
> -static void stmmac_reinit_rx_buffers(struct stmmac_priv *priv)
> -{
> -	u32 rx_count = priv->plat->rx_queues_to_use;
> -	u32 queue;
> -
> -	for (queue = 0; queue < rx_count; queue++) {
> -		struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
> -
> -		if (rx_q->xsk_pool)
> -			dma_free_rx_xskbufs(priv, queue);

dma_recycle_rx_skbufs() is only called here.