net: microchip: sparx5: correctly free skb in xmit
Subsystems (3)
PATCH v3 1/1 net: microchip: sparx5: correctly free skb in xmit
consume_skb on transmitted, kfree_skb on dropped, do not free on TX_BUSY.
Previously the xmit function could return -EBUSY without freeing, which supposedly is interpreted as a drop. And was using kfree on successfully transmitted packets.
sparx5_fdma_xmit and sparx5_inject returns error code, where -EBUSY indicates TX_BUSY and any other error code indicates dropped.
---v2->v3:
Removed empty line between Fixes and Signed-off-by
.../ethernet/microchip/sparx5/sparx5_fdma.c | 2 +- .../ethernet/microchip/sparx5/sparx5_packet.c | 41 +++++++++++-------- 2 files changed, 25 insertions(+), 18 deletions(-)
drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c +1 -1
@@ -317,7 +317,7 @@ int sparx5_fdma_xmit(struct sparx5 *sparx5, u32 *ifh, struct sk_buff *skb) next_dcb_hw =sparx5_fdma_next_dcb (tx, tx->curr_entry); db_hw = &next_dcb_hw->db[0 ];if (!(db_hw->status &FDMA_DCB_STATUS_DONE )) - tx->dropped++; +return -EINVAL ; db = list_first_entry(&tx->db_list, struct sparx5_db, list);list_move_tail (&db->list, &tx->db_list); next_dcb_hw->nextptr =FDMA_DCB_INVALID_DATA ;
drivers/net/ethernet/microchip/sparx5/sparx5_packet.c +24 -17
56 lines not on this page · raw message
Signature · 1 line
2.34.1
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Fri, 2 Dec 2022 09:35:44 +0100 you wrote:
consume_skbon transmitted,kfree_skbon dropped, do not free onTX_BUSY.Previously the xmit function could return
-EBUSYwithout freeing, which supposedly is interpreted as a drop. And was using kfree on successfully transmitted packets.[...]
Here is the summary with links:
- [v3,net] net: microchip: sparx5: correctly free skb in xmit
https://git.kernel.org/netdev/net/c/121c6672b019
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html