From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EA95BA0552; Mon, 27 Jun 2022 17:03:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D3BF340691; Mon, 27 Jun 2022 17:03:57 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 2606740685; Mon, 27 Jun 2022 17:03:57 +0200 (CEST) Received: from [192.168.1.39] (unknown [188.170.75.69]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 3523FA2; Mon, 27 Jun 2022 18:03:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 3523FA2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1656342236; bh=MJKD4ndOqbs5itmxjkas5cYEf33HTbMNzumcKZLDkWQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=i5lkrVGSgujxjfmtMmbea0acbytS0PoekwAKopsW6h4T/kkAV74Oy6rnn+9TJja0W MXvEUlBIBpc7rrIcIzreyyV1HnK5lACjjg2sVAaBKdW0hGp4oRph7bcqnOF0e1vpB/ 2p93ATmCrRFYh6h3P2Gk/ro+hNRd80ndICI+0f5o= Message-ID: <3fc73f93-5248-2fd5-2779-04047ae0b750@oktetlabs.ru> Date: Mon, 27 Jun 2022 18:03:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] vdpa/sfc: handle sync issue between qemu and vhost-user Content-Language: en-US To: abhimanyu.saini@xilinx.com, dev@dpdk.org Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com, stable@dpdk.org, Abhimanyu Saini , Vijay Kumar Srivastava References: <20220627084917.2295-1-asaini@xilinx.com> From: Andrew Rybchenko In-Reply-To: <20220627084917.2295-1-asaini@xilinx.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When you send a new version, please, don't forget to specify -v on part format and use --in-reply-to with the first mail ID. See contributors guidelines. Also, new version should make it clear what is changed. See below. On 6/27/22 11:49, abhimanyu.saini@xilinx.com wrote: > From: Abhimanyu Saini > > When DPDK app is running in the VF, it sometimes rings the doorbell > before dev_config has had a chance to complete and hence it misses > the event. As workaround, ring the doorbell when vDPA reports the > notify_area to QEMU. > > Fixes: 5e7596ba7cb3 ("vdpa/sfc: introduce Xilinx vDPA driver") Above seems to be wrong. Nearby code is added later, so, it should be: Fixes: 630be406dcbf ("vdpa/sfc: get queue notify area info") > Cc: stable@dpdk.org > > Signed-off-by: Vijay Kumar Srivastava > Signed-off-by: Abhimanyu Saini > --- Version changelog here. > drivers/vdpa/sfc/sfc_vdpa_ops.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/vdpa/sfc/sfc_vdpa_ops.c b/drivers/vdpa/sfc/sfc_vdpa_ops.c > index b3d9b6c..63aa52d 100644 > --- a/drivers/vdpa/sfc/sfc_vdpa_ops.c > +++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c > @@ -794,6 +794,8 @@ > int vfio_dev_fd; > efx_rc_t rc; > unsigned int bar_offset; > + volatile void *doorbell; > + struct rte_pci_device *pci_dev; > struct rte_vdpa_device *vdpa_dev; > struct sfc_vdpa_ops_data *ops_data; > struct vfio_region_info reg = { .argsz = sizeof(reg) }; > @@ -856,6 +858,18 @@ > sfc_vdpa_info(dev, "vDPA ops get_notify_area :: offset : 0x%" PRIx64, > *offset); > > + pci_dev = sfc_vdpa_adapter_by_dev_handle(dev)->pdev; > + doorbell = (uint8_t *)pci_dev->mem_resource[reg.index].addr + *offset; > + > + /* > + * virtio-net driver in VM sends queue notifications before > + * vDPA has a chance to setup the queues and notification area, > + * and hence the HW misses these doorbell notifications. > + * Since, it is safe to send duplicate doorbell, send another > + * doorbell from vDPA driver as workaround for this timing issue. > + */ > + rte_write16(qid, doorbell); > + > return 0; > } >