From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
To: Wei Fang <wei.fang@nxp.com>
Cc: Shenwei Wang <shenwei.wang@nxp.com>,
Clark Wang <xiaoning.wang@nxp.com>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"imx@lists.linux.dev" <imx@lists.linux.dev>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: fec: remove unnecessary DMA mapping of TSO header
Date: Thu, 23 Jan 2025 16:04:09 +0530 [thread overview]
Message-ID: <Z5IbIeOxrkMoASdJ@HOME-PC> (raw)
In-Reply-To: <PAXPR04MB85106CE97288D52A04EB685388E02@PAXPR04MB8510.eurprd04.prod.outlook.com>
On Thu, Jan 23, 2025 at 02:58:32AM +0000, Wei Fang wrote:
>
> Hi Dheeraj,
>
> I must admit that I misread it too. There is another case in the TSO
> header where txq->tx_bounce may be used in some cases. I think
> the most correct fix is to make txq->tso_hdrs aligned to 32/64 bytes
> when allocating tso_hdrs, then we do not need to use txq->tx_bounce
> in fec_enet_txq_put_hdr_tso(), because (bufaddr) & fep->tx_align)
> will not be true. This way we can safely remove dma_map_single()
> from fec_enet_txq_put_hdr_tso().
Hi Fang, Simon,
Thank you for the feedback. I have a clarification question regarding
the alignment of txq->tso_hdrs.
In the current code, txq->tso_hdrs is allocated using fec_dma_alloc(),
which internally calls dma_alloc_coherent(). As I understand it,
dma_alloc_coherent() guarantees that the allocated buffer is properly aligned.
Given this, should we remove the alignment check
((unsigned long)bufaddr) & fep->tx_align and the associated dma_map_single()
logic entirely from fec_enet_txq_put_hdr_tso() as you have suggested?
-Dheeraj
next prev parent reply other threads:[~2025-01-23 10:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-22 10:43 [PATCH net] net: fec: remove unnecessary DMA mapping of TSO header Dheeraj Reddy Jonnalagadda
2025-01-22 12:57 ` Simon Horman
2025-01-23 2:58 ` Wei Fang
2025-01-23 10:34 ` Dheeraj Reddy Jonnalagadda [this message]
2025-01-24 1:39 ` Wei Fang
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=Z5IbIeOxrkMoASdJ@HOME-PC \
--to=dheeraj.linuxdev@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=imx@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.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.