1 From e3c77d0a1b635d114c147fd2078afb57ed558b81 Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Mon, 3 Apr 2023 19:30:25 +0100
4 Subject: [PATCH 2/5] net: mvneta: mark mapped and tso buffers separately
6 Mark dma-mapped skbs and TSO buffers separately, so we can use
7 buf->type to identify their differences.
9 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
11 drivers/net/ethernet/marvell/mvneta.c | 6 ++++--
12 1 file changed, 4 insertions(+), 2 deletions(-)
14 --- a/drivers/net/ethernet/marvell/mvneta.c
15 +++ b/drivers/net/ethernet/marvell/mvneta.c
16 @@ -607,6 +607,7 @@ struct mvneta_rx_desc {
19 enum mvneta_tx_buf_type {
24 @@ -1852,7 +1853,8 @@ static void mvneta_txq_bufs_free(struct
25 dma_unmap_single(pp->dev->dev.parent,
26 tx_desc->buf_phys_addr,
27 tx_desc->data_size, DMA_TO_DEVICE);
28 - if (buf->type == MVNETA_TYPE_SKB && buf->skb) {
29 + if ((buf->type == MVNETA_TYPE_TSO ||
30 + buf->type == MVNETA_TYPE_SKB) && buf->skb) {
31 bytes_compl += buf->skb->len;
33 dev_kfree_skb_any(buf->skb);
34 @@ -2607,7 +2609,7 @@ mvneta_tso_put_hdr(struct sk_buff *skb,
35 tx_desc->command |= MVNETA_TXD_F_DESC;
36 tx_desc->buf_phys_addr = txq->tso_hdrs_phys +
37 txq->txq_put_index * TSO_HEADER_SIZE;
38 - buf->type = MVNETA_TYPE_SKB;
39 + buf->type = MVNETA_TYPE_TSO;
42 mvneta_txq_inc_put(txq);