DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Somalapuram, Amaranath" <Amaranath.Somalapuram@amd.com>
To: Jerin Jacob <jerinjacobk@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1 5/6] crypto/ccp: enable IOMMU for CCP
Date: Tue, 22 Oct 2019 05:13:17 +0000	[thread overview]
Message-ID: <CY4PR1201MB24716E1FB7945754EC7D293EF8680@CY4PR1201MB2471.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CALBAE1M=eGjtYKAy=GL+TJiR=h4ODN8kC-FNoK5vQK9s+h7kZg@mail.gmail.com>

Hi Jerin,
I will check how to improve this. Will resubmit this patch with your suggested changes.

Regards,
S.Amarnath

-----Original Message-----
From: Jerin Jacob <jerinjacobk@gmail.com> 
Sent: Tuesday, October 15, 2019 3:14 PM
To: Somalapuram, Amaranath <Amaranath.Somalapuram@amd.com>
Cc: dev@dpdk.org; stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v1 5/6] crypto/ccp: enable IOMMU for CCP

[CAUTION: External Email]

On Tue, Oct 15, 2019 at 2:05 PM Somalapuram, Amaranath <Amaranath.Somalapuram@amd.com> wrote:
>
> Problem statement: As of now vdev device do not support IOMMU.
> vdev device used to custom solution, even for software drives like openssl uses vdev.

I spend some time going through the driver.

#The ideal architecture of this driver would have been to introduce a bus driver(see drivers/bus/ifpga/) which does all the PCI probes(drivers/crypto/ccp/rte_ccp_pmd.c and
drivers/crypto/ccp/ccp_pci.c)
and arrange the devices on the bus scan and enable "non bus" specific driver crypto driver. So that no pci probe etc in crypto driver.
# On the upside, You DONT need to give vdev= on eal arguments, on AMD machines it can probe the crypto devices automatically and probe the crypto driver # I dont think, it is specific to vdev IOMMU support, If would have been PCI/Any bus driver, you would have similar changes. Right?
#  Major portion of this patch does following
+               if (iommu_mode == 2)
+                       pst.src_addr = (phys_addr_t)rte_mem_virt2iova(
+                                       (void *) lsb_buf);
+               else
+                       pst.src_addr = (phys_addr_t)rte_mem_virt2phy(
+                                       (void *) lsb_buf);
+

Since the following check already present common code, Do we need the above check, just calling rte_mem_virt2iova() is enough. Right?

rte_iova_t
rte_mem_virt2iova(const void *virtaddr)
{
        if (rte_eal_iova_mode() == RTE_IOVA_VA)
                return (uintptr_t)virtaddr;
        return rte_mem_virt2phy(virtaddr); }










> I feel its not advisable to put iommu in vdev.
> moving the changes to vdev will effect rest of the vdev drives.
> That will be big efforts. Every vdev drivers has their own implementation. Need better design to move it to vdev or common place.
>
> Regards,
> S.Amarnath
>
> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Tuesday, October 15, 2019 1:47 PM
> To: Somalapuram, Amaranath <Amaranath.Somalapuram@amd.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v1 5/6] crypto/ccp: enable IOMMU for 
> CCP
>
> [CAUTION: External Email]
>
> On Tue, Oct 15, 2019 at 12:32 PM <asomalap@amd.com> wrote:
> >
> > From: Amaranath Somalapuram <asomalap@amd.com>
> >
> > CCP use vdev framework, and vdev framework don’t support IOMMU.
> > Adding custom IOMMU support for AMD CCP drives.
> > Cc: stable@dpdk.org
> >
> > +       if (iommu_mode == 2)
> > +               pci->kdrv = RTE_KDRV_VFIO;
> > +       else if (iommu_mode == 0)
> > +               pci->kdrv = RTE_KDRV_IGB_UIO;
> > +       else if (iommu_mode == 1)
> > +               pci->kdrv = RTE_KDRV_UIO_GENERIC;
>
> The crypto driver should not have iommu mode-specific handling.
> I am not sure about the problem statement. If the problem is, iommu 
> support for PCI based vdev device then move the solution to common 
> layer so that everyone can use it. If not, please share the problem 
> statement

  reply	other threads:[~2019-10-22  5:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15  7:02 asomalap
2019-10-15  8:16 ` Jerin Jacob
2019-10-15  8:35   ` Somalapuram, Amaranath
2019-10-15  9:43     ` Jerin Jacob
2019-10-22  5:13       ` Somalapuram, Amaranath [this message]
2019-10-15 11:08 ` Akhil Goyal
2019-10-22  5:14   ` Somalapuram, Amaranath

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=CY4PR1201MB24716E1FB7945754EC7D293EF8680@CY4PR1201MB2471.namprd12.prod.outlook.com \
    --to=amaranath.somalapuram@amd.com \
    --cc=dev@dpdk.org \
    --cc=jerinjacobk@gmail.com \
    --cc=stable@dpdk.org \
    /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).