mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
net: fec: transmit XDP frames in bulk
Currently, the driver writes the ENET_TDAR register for every XDP frame to trigger transmit start. Frequent MMIO writes consume more CPU cycles and may reduce XDP TX performance, so transmit XDP frames in bulk. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260205085742.2685134-9-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
8a3344bb73
commit
2ff7a7d392
|
|
@ -2006,6 +2006,8 @@ static int fec_enet_rx_queue_xdp(struct fec_enet_private *fep, int queue,
|
|||
rxq->stats[RX_XDP_TX_ERRORS]++;
|
||||
fec_xdp_drop(rxq, &xdp, sync);
|
||||
trace_xdp_exception(ndev, prog, XDP_TX);
|
||||
} else {
|
||||
xdp_res |= FEC_ENET_XDP_TX;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -2056,6 +2058,10 @@ static int fec_enet_rx_queue_xdp(struct fec_enet_private *fep, int queue,
|
|||
if (xdp_res & FEC_ENET_XDP_REDIR)
|
||||
xdp_do_flush();
|
||||
|
||||
if (xdp_res & FEC_ENET_XDP_TX)
|
||||
/* Trigger transmission start */
|
||||
fec_txq_trigger_xmit(fep, fep->tx_queue[tx_qid]);
|
||||
|
||||
return pkt_received;
|
||||
}
|
||||
|
||||
|
|
@ -4037,9 +4043,6 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
|
|||
|
||||
txq->bd.cur = bdp;
|
||||
|
||||
/* Trigger transmission start */
|
||||
fec_txq_trigger_xmit(fep, txq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -4089,6 +4092,9 @@ static int fec_enet_xdp_xmit(struct net_device *dev,
|
|||
sent_frames++;
|
||||
}
|
||||
|
||||
if (sent_frames)
|
||||
fec_txq_trigger_xmit(fep, txq);
|
||||
|
||||
__netif_tx_unlock(nq);
|
||||
|
||||
return sent_frames;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user