From: Jakub Kicinski <kuba@kernel.org>
To: Bharat Bhushan <bharatb.linux@gmail.com>
Cc: Bharat Bhushan <bbhushan2@marvell.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
hkelam@marvell.com, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, jerinj@marvell.com, lcherian@marvell.com,
richardcochran@gmail.com, b@mx0a-0016f401.pphosted.com
Subject: Re: [net-next,v6 1/8] octeontx2-pf: map skb data as device writeable
Date: Thu, 22 Aug 2024 07:48:45 -0700 [thread overview]
Message-ID: <20240822074845.5f932d6d@kernel.org> (raw)
In-Reply-To: <CAAeCc_=Nmh25RDaY4SA2CHsu2mqgdtKEo62b4QKSV4V8icHMMw@mail.gmail.com>
On Thu, 22 Aug 2024 09:15:43 +0530 Bharat Bhushan wrote:
> On Wed, Aug 21, 2024 at 4:06 AM Jakub Kicinski <kuba@kernel.org> wrote:
> > On Mon, 19 Aug 2024 17:53:41 +0530 Bharat Bhushan wrote:
> > > Crypto hardware need write permission for in-place encrypt
> > > or decrypt operation on skb-data to support IPsec crypto
> > > offload. So map this memory as device read-write.
> >
> > How do you know the fragments are not read only?
>
> IOMMU permission faults will be reported if the DMA_TO_DEVICE direction flag
> is used in dma_map_page_attrs(). This is because iommu creates read only mapping
> if the DMA_TO_DEVICE direction flag is used. If the direction flag used in
> dma_map_pages() is DMA_BIDIRECTIONAL then iommu creates mapping with
> both read and write permission.
The other way around, I understand that your code makes the pages
writable for the device. What I'm concerned about is that if this
code path is fed Tx skbs you will corrupt them. Are these not Tx
skbs that you're mapping? Have you fully CoW'd them to make sure
they are writable?
next prev parent reply other threads:[~2024-08-22 14:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 12:23 [net-next,v6 0/8] cn10k-ipsec: Add outbound inline ipsec support Bharat Bhushan
2024-08-19 12:23 ` [net-next,v6 1/8] octeontx2-pf: map skb data as device writeable Bharat Bhushan
2024-08-20 22:35 ` Jakub Kicinski
2024-08-22 3:45 ` Bharat Bhushan
2024-08-22 14:48 ` Jakub Kicinski [this message]
2024-08-23 11:25 ` Bharat Bhushan
2024-08-24 13:59 ` Bharat Bhushan
2024-08-19 12:23 ` [net-next,v6 2/8] octeontx2-pf: Move skb fragment map/unmap to common code Bharat Bhushan
2024-08-19 12:23 ` [net-next,v6 3/8] octeontx2-af: Disable backpressure between CPT and NIX Bharat Bhushan
2024-08-19 12:23 ` [net-next,v6 4/8] cn10k-ipsec: Init hardware for outbound ipsec crypto offload Bharat Bhushan
2024-08-19 12:23 ` [net-next,v6 5/8] cn10k-ipsec: Add SA add/del support for outb " Bharat Bhushan
2024-08-19 12:23 ` [net-next,v6 6/8] cn10k-ipsec: Process outbound " Bharat Bhushan
2024-08-19 12:23 ` [net-next,v6 7/8] cn10k-ipsec: Allow ipsec crypto offload for skb with SA Bharat Bhushan
2024-08-19 12:23 ` [net-next,v6 8/8] cn10k-ipsec: Enable outbound ipsec crypto offload Bharat Bhushan
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=20240822074845.5f932d6d@kernel.org \
--to=kuba@kernel.org \
--cc=b@mx0a-0016f401.pphosted.com \
--cc=bbhushan2@marvell.com \
--cc=bharatb.linux@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=jerinj@marvell.com \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).