mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: fec: remove struct fec_enet_priv_txrx_info
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, 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. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251119025148.2817602-4-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -528,12 +528,6 @@ struct bufdesc_prop {
|
||||
unsigned char dsize_log2;
|
||||
};
|
||||
|
||||
struct fec_enet_priv_txrx_info {
|
||||
int offset;
|
||||
struct page *page;
|
||||
struct sk_buff *skb;
|
||||
};
|
||||
|
||||
enum {
|
||||
RX_XDP_REDIRECT = 0,
|
||||
RX_XDP_PASS,
|
||||
@@ -573,7 +567,7 @@ struct fec_enet_priv_tx_q {
|
||||
|
||||
struct fec_enet_priv_rx_q {
|
||||
struct bufdesc_prop bd;
|
||||
struct fec_enet_priv_txrx_info rx_skb_info[RX_RING_SIZE];
|
||||
struct page *rx_buf[RX_RING_SIZE];
|
||||
|
||||
/* page_pool */
|
||||
struct page_pool *page_pool;
|
||||
|
||||
@@ -1655,8 +1655,7 @@ static int fec_enet_update_cbd(struct fec_enet_priv_rx_q *rxq,
|
||||
if (unlikely(!new_page))
|
||||
return -ENOMEM;
|
||||
|
||||
rxq->rx_skb_info[index].page = new_page;
|
||||
rxq->rx_skb_info[index].offset = FEC_ENET_XDP_HEADROOM;
|
||||
rxq->rx_buf[index] = new_page;
|
||||
phys_addr = page_pool_get_dma_addr(new_page) + FEC_ENET_XDP_HEADROOM;
|
||||
bdp->cbd_bufaddr = cpu_to_fec32(phys_addr);
|
||||
|
||||
@@ -1836,7 +1835,7 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
|
||||
ndev->stats.rx_bytes -= 2;
|
||||
|
||||
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++;
|
||||
@@ -3312,7 +3311,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);
|
||||
|
||||
for (i = 0; i < XDP_STATS_TOTAL; i++)
|
||||
rxq->stats[i] = 0;
|
||||
@@ -3446,8 +3446,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) {
|
||||
|
||||
Reference in New Issue
Block a user