Skip to content

Commit 60524f1

Browse files
MeghanaMalladiTIkuba-moo
authored andcommitted
net: ti: icssg-prueth: Fix packet handling for XDP_TX
While transmitting XDP frames for XDP_TX, page_pool is used to get the DMA buffers (already mapped to the pages) and need to be freed/reycled once the transmission is complete. This need not be explicitly done by the driver as this is handled more gracefully by the xdp driver while returning the xdp frame. __xdp_return() frees the XDP memory based on its memory type, under which page_pool memory is also handled. This change fixes the transmit queue timeout while running XDP_TX. logs: [ 309.069682] icssg-prueth icssg1-eth eth2: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 45860 ms [ 313.933780] icssg-prueth icssg1-eth eth2: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 50724 ms [ 319.053656] icssg-prueth icssg1-eth eth2: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 55844 ms ... Fixes: 62aa324 ("net: ti: icssg-prueth: Add XDP support") Signed-off-by: Meghana Malladi <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1224b21 commit 60524f1

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

drivers/net/ethernet/ti/icssg/icssg_common.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,11 @@ void prueth_xmit_free(struct prueth_tx_chn *tx_chn,
9898
{
9999
struct cppi5_host_desc_t *first_desc, *next_desc;
100100
dma_addr_t buf_dma, next_desc_dma;
101-
struct prueth_swdata *swdata;
102-
struct page *page;
103101
u32 buf_dma_len;
104102

105103
first_desc = desc;
106104
next_desc = first_desc;
107105

108-
swdata = cppi5_hdesc_get_swdata(desc);
109-
if (swdata->type == PRUETH_SWDATA_PAGE) {
110-
page = swdata->data.page;
111-
page_pool_recycle_direct(page->pp, swdata->data.page);
112-
goto free_desc;
113-
}
114-
115106
cppi5_hdesc_get_obuf(first_desc, &buf_dma, &buf_dma_len);
116107
k3_udma_glue_tx_cppi5_to_dma_addr(tx_chn->tx_chn, &buf_dma);
117108

@@ -135,7 +126,6 @@ void prueth_xmit_free(struct prueth_tx_chn *tx_chn,
135126
k3_cppi_desc_pool_free(tx_chn->desc_pool, next_desc);
136127
}
137128

138-
free_desc:
139129
k3_cppi_desc_pool_free(tx_chn->desc_pool, first_desc);
140130
}
141131
EXPORT_SYMBOL_GPL(prueth_xmit_free);
@@ -612,13 +602,8 @@ u32 emac_xmit_xdp_frame(struct prueth_emac *emac,
612602
k3_udma_glue_tx_dma_to_cppi5_addr(tx_chn->tx_chn, &buf_dma);
613603
cppi5_hdesc_attach_buf(first_desc, buf_dma, xdpf->len, buf_dma, xdpf->len);
614604
swdata = cppi5_hdesc_get_swdata(first_desc);
615-
if (page) {
616-
swdata->type = PRUETH_SWDATA_PAGE;
617-
swdata->data.page = page;
618-
} else {
619-
swdata->type = PRUETH_SWDATA_XDPF;
620-
swdata->data.xdpf = xdpf;
621-
}
605+
swdata->type = PRUETH_SWDATA_XDPF;
606+
swdata->data.xdpf = xdpf;
622607

623608
/* Report BQL before sending the packet */
624609
netif_txq = netdev_get_tx_queue(ndev, tx_chn->id);

0 commit comments

Comments
 (0)