All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, netdev@vger.kernel.org,
	Xuegang Lu <xuegang.lu@airoha.com>
Subject: Re: [PATCH net-next 1/2] net: airoha: Add the capability to consume out-of-order DMA tx descriptors
Date: Tue, 4 Nov 2025 18:30:28 -0800	[thread overview]
Message-ID: <20251104183028.7412aba6@kernel.org> (raw)
In-Reply-To: <20251103-airoha-tx-linked-list-v1-1-baa07982cc30@kernel.org>

On Mon, 03 Nov 2025 11:27:55 +0100 Lorenzo Bianconi wrote:
> +		__list_del_entry(&e->list);
> +		list_add_tail(&e->list, &tx_list);

list_move_tail()

> +		e->skb = i ? NULL : skb;
> +		e->dma_addr = addr;
> +		e->dma_len = len;
> +
> +		e = list_first_entry(&q->tx_list, struct airoha_queue_entry,
> +				     list);
> +		index = e - q->entry;
>  
>  		val = FIELD_PREP(QDMA_DESC_LEN_MASK, len);
>  		if (i < nr_frags - 1)

> @@ -2029,10 +2020,14 @@ static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb,
>  	return NETDEV_TX_OK;
>  
>  error_unmap:
> -	for (i--; i >= 0; i--) {
> -		index = (q->head + i) % q->ndesc;
> -		dma_unmap_single(dev->dev.parent, q->entry[index].dma_addr,
> -				 q->entry[index].dma_len, DMA_TO_DEVICE);
> +	while (!list_empty(&tx_list)) {
> +		e = list_first_entry(&tx_list, struct airoha_queue_entry,
> +				     list);
> +		__list_del_entry(&e->list);
> +		dma_unmap_single(dev->dev.parent, e->dma_addr, e->dma_len,
> +				 DMA_TO_DEVICE);
> +		e->dma_addr = 0;
> +		list_add_tail(&e->list, &q->tx_list);

and here


  parent reply	other threads:[~2025-11-05  2:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 10:27 [PATCH net-next 0/2] net: airoha: Allow mapping out-of-order DMA tx descriptors Lorenzo Bianconi
2025-11-03 10:27 ` [PATCH net-next 1/2] net: airoha: Add the capability to consume " Lorenzo Bianconi
2025-11-03 23:32   ` Jacob Keller
2025-11-05  2:30   ` Jakub Kicinski [this message]
2025-11-05  8:18     ` Lorenzo Bianconi
2025-11-03 10:27 ` [PATCH net-next 2/2] net: airoha: Reorganize airoha_queue struct Lorenzo Bianconi
2025-11-03 23:36   ` Jacob Keller
2025-11-05  2:32   ` Jakub Kicinski
2025-11-05  7:53     ` Lorenzo Bianconi
2025-11-06  0:28       ` Jakub Kicinski
2025-11-06  8:27         ` Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251104183028.7412aba6@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xuegang.lu@airoha.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.