Commit b0bd1b07 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Paolo Abeni

net: mvneta: mark mapped and tso buffers separately

Mark dma-mapped skbs and TSO buffers separately, so we can use
buf->type to identify their differences.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent fef99e84
...@@ -638,6 +638,7 @@ struct mvneta_rx_desc { ...@@ -638,6 +638,7 @@ struct mvneta_rx_desc {
#endif #endif
enum mvneta_tx_buf_type { enum mvneta_tx_buf_type {
MVNETA_TYPE_TSO,
MVNETA_TYPE_SKB, MVNETA_TYPE_SKB,
MVNETA_TYPE_XDP_TX, MVNETA_TYPE_XDP_TX,
MVNETA_TYPE_XDP_NDO, MVNETA_TYPE_XDP_NDO,
...@@ -1883,7 +1884,8 @@ static void mvneta_txq_bufs_free(struct mvneta_port *pp, ...@@ -1883,7 +1884,8 @@ static void mvneta_txq_bufs_free(struct mvneta_port *pp,
dma_unmap_single(pp->dev->dev.parent, dma_unmap_single(pp->dev->dev.parent,
tx_desc->buf_phys_addr, tx_desc->buf_phys_addr,
tx_desc->data_size, DMA_TO_DEVICE); tx_desc->data_size, DMA_TO_DEVICE);
if (buf->type == MVNETA_TYPE_SKB && buf->skb) { if ((buf->type == MVNETA_TYPE_TSO ||
buf->type == MVNETA_TYPE_SKB) && buf->skb) {
bytes_compl += buf->skb->len; bytes_compl += buf->skb->len;
pkts_compl++; pkts_compl++;
dev_kfree_skb_any(buf->skb); dev_kfree_skb_any(buf->skb);
...@@ -2674,7 +2676,7 @@ mvneta_tso_put_hdr(struct sk_buff *skb, struct mvneta_tx_queue *txq) ...@@ -2674,7 +2676,7 @@ mvneta_tso_put_hdr(struct sk_buff *skb, struct mvneta_tx_queue *txq)
tx_desc->command |= MVNETA_TXD_F_DESC; tx_desc->command |= MVNETA_TXD_F_DESC;
tx_desc->buf_phys_addr = txq->tso_hdrs_phys + tx_desc->buf_phys_addr = txq->tso_hdrs_phys +
txq->txq_put_index * TSO_HEADER_SIZE; txq->txq_put_index * TSO_HEADER_SIZE;
buf->type = MVNETA_TYPE_SKB; buf->type = MVNETA_TYPE_TSO;
buf->skb = NULL; buf->skb = NULL;
mvneta_txq_inc_put(txq); mvneta_txq_inc_put(txq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment