From: Frank Li <Frank.li@nxp.com>
To: Wei Fang <wei.fang@nxp.com>
Cc: shenwei.wang@nxp.com, xiaoning.wang@nxp.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, eric@nelint.com,
imx@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/5] net: fec: remove struct fec_enet_priv_txrx_info
Date: Tue, 11 Nov 2025 17:30:22 -0500 [thread overview]
Message-ID: <aRO4/l1bMgugPYhN@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20251111100057.2660101-4-wei.fang@nxp.com>
On Tue, Nov 11, 2025 at 06:00:55PM +0800, Wei Fang wrote:
> The struct fec_enet_priv_txrx_info has three members: offset, page and
> skb. The offset is only initialized in the driver and is not used, and
the skb is never initialized and used in the driver. The both will not
be used in the future, Therefore, replace struct fec_enet_priv_txrx_info
directly with struct page.
> we can see that it likely will not be used in the future. The skb is
> never initialized and used in the driver. Therefore, struct
> fec_enet_priv_txrx_info can be directly replaced by struct page.
>
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---
> drivers/net/ethernet/freescale/fec.h | 8 +-------
> drivers/net/ethernet/freescale/fec_main.c | 11 +++++------
> 2 files changed, 6 insertions(+), 13 deletions(-)
>
...
>
> @@ -1834,7 +1833,7 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
> ndev->stats.rx_bytes += pkt_len;
>
> index = fec_enet_get_bd_index(bdp, &rxq->bd);
> - page = rxq->rx_skb_info[index].page;
> + page = rxq->rx_buf[index];
> cbd_bufaddr = bdp->cbd_bufaddr;
> if (fec_enet_update_cbd(rxq, bdp, index)) {
> ndev->stats.rx_dropped++;
> @@ -3309,7 +3308,8 @@ static void fec_enet_free_buffers(struct net_device *ndev)
> for (q = 0; q < fep->num_rx_queues; q++) {
> rxq = fep->rx_queue[q];
> for (i = 0; i < rxq->bd.ring_size; i++)
> - page_pool_put_full_page(rxq->page_pool, rxq->rx_skb_info[i].page, false);
> + page_pool_put_full_page(rxq->page_pool, rxq->rx_buf[i],
> + false);
move to previous line.
Frank
>
> for (i = 0; i < XDP_STATS_TOTAL; i++)
> rxq->stats[i] = 0;
> @@ -3443,8 +3443,7 @@ fec_enet_alloc_rxq_buffers(struct net_device *ndev, unsigned int queue)
> phys_addr = page_pool_get_dma_addr(page) + FEC_ENET_XDP_HEADROOM;
> bdp->cbd_bufaddr = cpu_to_fec32(phys_addr);
>
> - rxq->rx_skb_info[i].page = page;
> - rxq->rx_skb_info[i].offset = FEC_ENET_XDP_HEADROOM;
> + rxq->rx_buf[i] = page;
> bdp->cbd_sc = cpu_to_fec16(BD_ENET_RX_EMPTY);
>
> if (fep->bufdesc_ex) {
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-11-11 22:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 10:00 [PATCH net-next 0/5] net: fec: do some cleanup for the driver Wei Fang
2025-11-11 10:00 ` [PATCH net-next 1/5] net: fec: remove useless conditional preprocessor directives Wei Fang
2025-11-11 22:15 ` Frank Li
2025-11-12 20:13 ` Andrew Lunn
2025-11-13 1:35 ` Wei Fang
2025-11-11 10:00 ` [PATCH net-next 2/5] net: fec: simplify the " Wei Fang
2025-11-11 22:24 ` Frank Li
2025-11-12 1:53 ` Wei Fang
2025-11-13 16:27 ` Frank Li
2025-11-14 2:20 ` Wei Fang
2025-11-18 3:04 ` Wei Fang
2025-11-11 10:00 ` [PATCH net-next 3/5] net: fec: remove struct fec_enet_priv_txrx_info Wei Fang
2025-11-11 22:30 ` Frank Li [this message]
2025-11-12 1:56 ` Wei Fang
2025-11-11 10:00 ` [PATCH net-next 4/5] net: fec: remove rx_align from fec_enet_private Wei Fang
2025-11-11 22:34 ` Frank Li
2025-11-12 2:00 ` Wei Fang
2025-11-12 20:25 ` Andrew Lunn
2025-11-13 1:40 ` Wei Fang
2025-11-13 13:10 ` Andrew Lunn
2025-11-14 2:17 ` Wei Fang
2025-11-11 10:00 ` [PATCH net-next 5/5] net: fec: remove duplicate macros of the BD status Wei Fang
2025-11-11 22:39 ` Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aRO4/l1bMgugPYhN@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric@nelint.com \
--cc=imx@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox