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 890B1A0540 for ; Wed, 6 Jul 2022 22:35:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8360B4113D; Wed, 6 Jul 2022 22:35:53 +0200 (CEST) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mails.dpdk.org (Postfix) with ESMTP id 1A81B4113D for ; Wed, 6 Jul 2022 22:35:52 +0200 (CEST) Received: by mail-wm1-f53.google.com with SMTP id m184so9492229wme.1 for ; Wed, 06 Jul 2022 13:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NUVC49OjKVjZakZSE/triOF/SEaH9zayp3PtDNgP0yg=; b=f4VlVQdzHRbGZvHlCVjIUnNKM+2djSAwZvJgKzCpepcKwxyO86k4i9oCmtA/8KgZg+ y2PS6iCm3bKaKgS+qqkzQZwtqKY6MPjSyPK2JXucz+XfcWRyVJ70smkJv9DmJrYsdU/C Ndl1BzOBQZW/eM2LzglygHKtM2d/oxxYnoCEA+gEaEgC7RErSYUyQ/wt+D7m6Mu1wQ91 cx3ED+Be1WT2GRyu3bl36S5YiebbqD9R8d8AunzstTSV2rywO273EWQ6uqWSAweEIX3X X/py0uCA+Ds4yVLeVZv8IlYAjz7cYjwWKIKJw9dEEF0WwuWK2OnHBcxupDYHgOIRDNff RrNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NUVC49OjKVjZakZSE/triOF/SEaH9zayp3PtDNgP0yg=; b=AtCpqQYhnee20Hn1xOblgeqnl4KryCZrGy7hhKkVd0v4D8CsvjHsCNgrdwLWo8LKS4 a7VV8JOMSm38Q65IWiT5F5uwD7Nn+pZBsAJNbNNWhx69Gfjkv2RUkYS2CdAz0Dfx/drG pAM+62aDwjPlDFfretdYGmhB0f5tLqZgPQj5FALWChRtNblrCCqgHPfB5je1L1jWOvFT KbzLSNEXQ2SyoZgL2KPntZk7KiJoIkQDhITNeUMaGXU0ArhQFZ3vR9U88dBPWh1RZ3v6 FNa+BNvkbBu5sSePfCkvzJtiqBWrQ3qbP9hrDLYLU/N6dCXirpCKxSFAvh+VRptm6Z8Z 63NQ== X-Gm-Message-State: AJIora+1dFMiKANHXPR+OzEl7bsb/4pTRIA5qT2LDYNsXUo7LuSL1WwV fn2h3ERPZMBP2mUvL2hanRw/D+o7FVoCfw== X-Google-Smtp-Source: AGRyM1soyHF3I85goTTsoMUFBMCDnbjiuwwlgiAuzEzaievrHfqXyzmK8/ekZoRQnGjoAP43FNAdqA== X-Received: by 2002:a1c:f018:0:b0:3a0:3f8d:d71e with SMTP id a24-20020a1cf018000000b003a03f8dd71emr460016wmb.104.1657139751890; Wed, 06 Jul 2022 13:35:51 -0700 (PDT) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id b15-20020adff90f000000b0021b90cc66a1sm36575180wrr.2.2022.07.06.13.35.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 13:35:51 -0700 (PDT) From: luca.boccassi@gmail.com To: Abhimanyu Saini Cc: Vijay Kumar Srivastava , Andrew Rybchenko , Maxime Coquelin , dpdk stable Subject: patch 'vdpa/sfc: fix sync between QEMU and vhost-user' has been queued to stable release 21.11.2 Date: Wed, 6 Jul 2022 21:34:49 +0100 Message-Id: <20220706203506.3422496-14-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220706203506.3422496-1-luca.boccassi@gmail.com> References: <20220628151938.2278711-26-ktraynor@redhat.com> <20220706203506.3422496-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/08/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/4ef6a79d4a99f3f5be2d5671e6affbc402eb81a0 Thanks. Luca Boccassi --- >From 4ef6a79d4a99f3f5be2d5671e6affbc402eb81a0 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saini Date: Tue, 28 Jun 2022 10:59:26 +0530 Subject: [PATCH] vdpa/sfc: fix sync between QEMU and vhost-user [ upstream commit 2eb13ddea3847fe57653d1ffef1e8e3d9e3cc84c ] 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: 630be406dcbf ("vdpa/sfc: get queue notify area info") Signed-off-by: Vijay Kumar Srivastava Signed-off-by: Abhimanyu Saini Acked-by: Andrew Rybchenko Reviewed-by: Maxime Coquelin --- 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 b3d9b6cd56..63aa52da49 100644 --- a/drivers/vdpa/sfc/sfc_vdpa_ops.c +++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c @@ -794,6 +794,8 @@ sfc_vdpa_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size) 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_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size) 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; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-06 21:07:54.048666364 +0100 +++ 0014-vdpa-sfc-fix-sync-between-QEMU-and-vhost-user.patch 2022-07-06 21:07:53.543518707 +0100 @@ -1 +1 @@ -From 2eb13ddea3847fe57653d1ffef1e8e3d9e3cc84c Mon Sep 17 00:00:00 2001 +From 4ef6a79d4a99f3f5be2d5671e6affbc402eb81a0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2eb13ddea3847fe57653d1ffef1e8e3d9e3cc84c ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org