From: Prarit Bhargava <prarit@redhat.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: herbert@gondor.apana.org.au, bruce.w.allan@intel.com,
qat-linux@intel.com, john.griffin@intel.com,
linux-crypto@vger.kernel.org, naleksan@redhat.com,
davem@davemloft.net
Subject: Re: [PATCH 2/2] crypto: qat - Enforce valid numa configuration.
Date: Wed, 08 Oct 2014 14:35:44 -0400 [thread overview]
Message-ID: <54358400.5060405@redhat.com> (raw)
In-Reply-To: <54357E5B.2090401@intel.com>
On 10/08/2014 02:11 PM, Tadeusz Struk wrote:
> On 10/08/2014 10:57 AM, Prarit Bhargava wrote:
>>> node = adf_get_dev_node_id(pdev);
>> ^^^ I don't think you should ever make this call. IMO it is wrong to do it that
>> way. Just stick with
>>
>> node = dev_to_node(&pdev->dev)
>>
>> as the line below forces a default to that anyway.
>
> But then how do I know which node I'm physically connected to?
The pci_dev maps to the bus which maps to a numa node. The pci_dev's numa value
is copied directly from the bus (or busses depending on how deep it is).
I'd argue (strongly) that the pci_dev's numa ID better be correct o/w that is a
FW bug (and a bad one at that these days).
dev_to_node() should return the correct value.
>>
>>>> + if (node != dev_to_node(&pdev->dev) && dev_to_node(&pdev->dev) > 0) {
>>>> + /* If the accelerator is connected to a node with no memory
>>>> + * there is no point in using the accelerator since the remote
>>>> + * memory transaction will be very slow. */
>>>> + dev_err(&pdev->dev, "Invalid NUMA configuration.\n");
>>>> + return -EINVAL;
>> Hmm ... I wonder if it would be safe to do
>>
>> /* force allocations to node 0 */
>> node = 0;
>> dev_err(&pdev->dev, "Invalid NUMA configuration detected, node id = %d .
>> Defaulting node to 0. \n",
>> node);
>>
>> and then continue?
>
> As the comment say there is no point continuing if the configuration is
> wrong. Defaulting to 0 will cause the same panic you pointed out in your
> first patch if node 0 has no memory.
Okay, but at least fix up the warning message to output the node_id. That's
sort of the important piece here.
P.
>
>>
>> And maybe even a FW_WARN of some sort here might be appropriate to indicate that
>> something is wrong with the mapping? In any case a better error message is a
>> always good idea IMO.
>
next prev parent reply other threads:[~2014-10-08 18:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 17:38 [PATCH 0/2] crypto: qat - Fix for invalid dma mapping and numa Tadeusz Struk
2014-10-08 17:38 ` [PATCH 1/2] crypto: qat - Prevent dma mapping zero length assoc data Tadeusz Struk
2014-10-08 17:38 ` [PATCH 2/2] crypto: qat - Enforce valid numa configuration Tadeusz Struk
2014-10-08 17:57 ` Prarit Bhargava
2014-10-08 18:11 ` Tadeusz Struk
2014-10-08 18:35 ` Prarit Bhargava [this message]
2014-10-08 18:57 ` Tadeusz Struk
2014-10-08 19:01 ` Prarit Bhargava
2014-10-08 19:25 ` Tadeusz Struk
2014-10-09 11:23 ` Prarit Bhargava
2014-10-09 16:14 ` Tadeusz Struk
2014-10-09 17:32 ` Prarit Bhargava
2014-10-09 19:55 ` Tadeusz Struk
2014-10-09 21:42 ` Prarit Bhargava
2014-10-09 23:12 ` Tadeusz Struk
2014-10-10 11:23 ` Prarit Bhargava
2014-10-10 13:25 ` Tadeusz Struk
2014-10-10 22:15 ` Prarit Bhargava
2014-10-11 17:05 ` Tadeusz Struk
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=54358400.5060405@redhat.com \
--to=prarit@redhat.com \
--cc=bruce.w.allan@intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=john.griffin@intel.com \
--cc=linux-crypto@vger.kernel.org \
--cc=naleksan@redhat.com \
--cc=qat-linux@intel.com \
--cc=tadeusz.struk@intel.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).