From: "Saini, Abhimanyu" <abhimanyu.saini@amd.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
"abhimanyu.saini@xilinx.com" <abhimanyu.saini@xilinx.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "chenbo.xia@intel.com" <chenbo.xia@intel.com>,
"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>
Subject: RE: [PATCH] vdpa/sfc: resolve race between libvhost and dev_conf
Date: Fri, 8 Jul 2022 10:25:49 +0000 [thread overview]
Message-ID: <SA0PR12MB435292012901F5F172E183E8E3829@SA0PR12MB4352.namprd12.prod.outlook.com> (raw)
In-Reply-To: <4fdc44d3-d9af-88ee-ebc1-7109cc69ce41@redhat.com>
[AMD Official Use Only - General]
Sorry Maxime, I forgot to copy stable.
Yes it's required, the faulty commit is : 630be406dcbfc26260e9d9688c40a381d0f012db
-----Original Message-----
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Sent: Friday, July 8, 2022 2:55 PM
To: abhimanyu.saini@xilinx.com; dev@dpdk.org
Cc: chenbo.xia@intel.com; andrew.rybchenko@oktetlabs.ru; Saini, Abhimanyu <abhimanyu.saini@amd.com>
Subject: Re: [PATCH] vdpa/sfc: resolve race between libvhost and dev_conf
[CAUTION: External Email]
On 7/8/22 11:23, Maxime Coquelin wrote:
>
>
> On 7/6/22 11:24, abhimanyu.saini@xilinx.com wrote:
>> From: Abhimanyu Saini <absaini@amd.com>
>>
>> libvhost calls dev_conf() before prosessing the
>> VHOST_USER_SET_VRING_CALL message for the last VQ. So
>> this message is processed after dev_conf() returns.
>>
>> However, the dev_conf() function spawns a thread to set
>> rte_vhost_host_notifier_ctrl() before returning control to
>> libvhost. This parallel thread in turn invokes get_notify_area().
>> To get the notify_area, the vdpa driver needs to query the HW and
>> for this query it needs an enabled VQ.
>>
>> But at the same time libvhost is processing the last
>> VHOST_USER_SET_VRING_CALL, and to do that it disables the last VQ.
>>
>> Hence there is a race b/w the libvhost and the vdpa driver.
>>
>> To resolve this race condition, query the HW and cache notify_area
>> inside dev_conf() instead of doing it the parallel thread.
>>
>> Signed-off-by: Abhimanyu Saini <absaini@amd.com>
>> ---
>> drivers/vdpa/sfc/sfc_vdpa_ops.c | 36
>> ++++++++++++++++++------------------
>> drivers/vdpa/sfc/sfc_vdpa_ops.h | 1 +
>> 2 files changed, 19 insertions(+), 18 deletions(-)
>>
>
> Applied to dpdk-next-virtio/main.
Sorry, I notice it is missing the Fixes tag, and cc'ing stable.
Can you confirm this is needed and provide the faulty commit?
Thanks,
Maxime
> Thanks,
> Maxime
next prev parent reply other threads:[~2022-07-08 10:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 9:24 abhimanyu.saini
2022-07-06 12:32 ` Maxime Coquelin
2022-07-07 12:38 ` Maxime Coquelin
2022-07-08 8:13 ` David Marchand
2022-07-08 9:02 ` Srivastava, Vijay
2022-07-08 9:23 ` Maxime Coquelin
2022-07-08 9:25 ` Maxime Coquelin
2022-07-08 10:25 ` Saini, Abhimanyu [this message]
2022-07-08 10:39 ` Maxime Coquelin
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=SA0PR12MB435292012901F5F172E183E8E3829@SA0PR12MB4352.namprd12.prod.outlook.com \
--to=abhimanyu.saini@amd.com \
--cc=abhimanyu.saini@xilinx.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.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).