summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMD Danish Anwar <danishanwar@ti.com>2024-03-20 18:39:54 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2024-03-20 09:43:33 -0500
commit2e423244f8c09173a344e7069f0fe2bdf26cccee (patch)
tree221bd4c2e164e9b5158a781ea060a6795cba0bbd
parentc72af0557dc07ad497dbf5ee555d1647e6290935 (diff)
net: ethernet: ti: icssg-prueth: Fix RX frame drops in XDP
The driver drops RX frames due to flags not being cleared during XDP buffer init. XDP framework provides helper APIs to initialize and prepare XDP buffer. Fix the RX frame drops by calling these helper APIs. Fixes: 78264a1200f8 ("net: ethernet: ti: icssg_prueth: Add AF_XDP support") Signed-off-by: MD Danish Anwar <danishanwar@ti.com> Reviewed-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
-rw-r--r--drivers/net/ethernet/ti/icssg_prueth.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/ethernet/ti/icssg_prueth.c b/drivers/net/ethernet/ti/icssg_prueth.c
index f3d033723857..0a19381c6561 100644
--- a/drivers/net/ethernet/ti/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg_prueth.c
@@ -645,16 +645,8 @@ static int emac_rx_packet(struct prueth_emac *emac, u32 flow_id, int *xdp_state)
pa = page_address(page);
if (emac->xdp_prog) {
- /* xdp_init_buff(&xdp, PAGE_SIZE, rx_chn->xdp_rxq); */
- xdp.frame_sz = PAGE_SIZE;
- xdp.rxq = &rx_chn->xdp_rxq;
-
- /* xdp_prepare_buff(&xdp, pa, PRUETH_HEADROOM, pkt_len, false); */
- xdp.data_hard_start = pa;
- xdp.data = pa + PRUETH_HEADROOM;
- xdp.data_end = xdp.data + pkt_len;
- xdp.data_meta = xdp.data + 1;
-
+ xdp_init_buff(&xdp, PAGE_SIZE, &rx_chn->xdp_rxq);
+ xdp_prepare_buff(&xdp, pa, PRUETH_HEADROOM, pkt_len, false);
*xdp_state = emac_run_xdp(emac, &xdp, page);
if (*xdp_state != ICSSG_XDP_PASS)
goto requeue;