linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sunil Kovvuri <sunil.kovvuri@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	LAKML <linux-arm-kernel@lists.infradead.org>,
	Sunil Goutham <sgoutham@cavium.com>
Subject: Re: [PATCH 1/4] net: thunderx: Fix IOMMU translation faults
Date: Sat, 4 Mar 2017 11:24:51 +0530	[thread overview]
Message-ID: <CA+sq2CcFxk=LuqYhR-sFaVVSu3rMaZUcytx-3tC9kEiRFNwREg@mail.gmail.com> (raw)
In-Reply-To: <20170303.095635.355325147613813698.davem@davemloft.net>

On Fri, Mar 3, 2017 at 11:26 PM, David Miller <davem@davemloft.net> wrote:
> From: sunil.kovvuri@gmail.com
> Date: Fri,  3 Mar 2017 16:17:47 +0530
>
>> @@ -1643,6 +1650,9 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>>       if (!pass1_silicon(nic->pdev))
>>               nic->hw_tso = true;
>>
>> +     /* Check if we are attached to IOMMU */
>> +     nic->iommu_domain = iommu_get_domain_for_dev(dev);
>
> This function is not universally available.

Even if CONFIG_IOMMU_API is not enabled, it will return NULL and will be okay.
http://lxr.free-electrons.com/source/include/linux/iommu.h#L400

>
> This looks very hackish to me anyways, how all of this stuff is supposed
> to work is that you simply use the DMA interfaces unconditionally and
> whatever is behind the operations takes care of everything.
>
> Doing it conditionally in the driver with all of this special IOMMU
> domain et al. knowledge makes no sense to me at all.
>
> I don't see other drivers doing stuff like this at all, so if you're
> going to handle this in a unique way like this you better write
> several paragraphs in your commit message explaining why this weird
> crap is necessary.

I already tried to explain in the commit message that HW anyway takes care
of data coherency, so calling DMA interfaces when there is no IOMMU will
only result in performance drop.

We are seeing a 0.75Mpps drop with IP forwarding rate due to that.
Hence I have restricted calling DMA interfaces to only when IOMMU is enabled.

  reply	other threads:[~2017-03-04  5:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03 10:47 [PATCH 0/4] net: thunderx: Miscellaneous fixes sunil.kovvuri
2017-03-03 10:47 ` [PATCH 1/4] net: thunderx: Fix IOMMU translation faults sunil.kovvuri
2017-03-03 17:56   ` David Miller
2017-03-04  5:54     ` Sunil Kovvuri [this message]
2017-03-06 12:46       ` Robin Murphy
2017-03-06 12:57         ` Sunil Kovvuri
2017-03-06 16:32           ` Robin Murphy
2017-03-07 12:44             ` Sunil Kovvuri
2017-03-03 10:47 ` [PATCH 2/4] net: thunderx: Fix LMAC mode debug prints for QSGMII mode sunil.kovvuri
2017-03-03 10:47 ` [PATCH 3/4] net: thunderx: Fix invalid mac addresses for node1 interfaces sunil.kovvuri
2017-03-03 10:47 ` [PATCH 4/4] net: thunderx: Allow IPv6 frames with zero UDP checksum sunil.kovvuri

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='CA+sq2CcFxk=LuqYhR-sFaVVSu3rMaZUcytx-3tC9kEiRFNwREg@mail.gmail.com' \
    --to=sunil.kovvuri@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgoutham@cavium.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).