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 219FDA034E; Wed, 22 Dec 2021 09:34:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95F0E410F1; Wed, 22 Dec 2021 09:34:20 +0100 (CET) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id 8257140DDA for ; Wed, 22 Dec 2021 09:34:19 +0100 (CET) Received: by mail-pj1-f53.google.com with SMTP id v16so1673024pjn.1 for ; Wed, 22 Dec 2021 00:34:19 -0800 (PST) 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=1Ro0tRQ9PNgeAMC4xSi0kaxHbVSqcoMQhYCVA6ef/u0=; b=PSGdvBDXUPFOw00HEmbQqohBFnMq8ms2alxWoQzMtp/E/SBeNFa5x8kPmVTTE6o5BZ otE4XgStLmqTt1U9ExlQjwKU8IQBBuG54tkUBbA+XQWcNZa2/jfbx4Uf40XgF5d8mFp+ 5dcQYQNeQwDB+hkOIuI1zDotHLFtdeTUa5Gj7XAwQEZ69akFh+/jJUno/cQbvcQsFCnc sGvtWhnQtz+k/9GNCRWPJpe3mMJJNLTuF9WMOOy7bUda2VVNRaEp8aKGU5bV+5C8FCp/ TStzZRC+Z38sAYRmZdodaxbxDX5JXGJLBhPi0yG+pnmWkIuPFokxvzvtNHg+emwVqmyb 9eUQ== 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=1Ro0tRQ9PNgeAMC4xSi0kaxHbVSqcoMQhYCVA6ef/u0=; b=iZul7ZNIR+xuEM8MdEuFOMogkfSZRFAJt4GtAIpsX+7my6t3jGxiStKzABYhdzf6+1 NhkUJXSoTwUVNX+arOjFZ2/I075R+hnLFwubCH2BQ5QpsDWDFMe7j6CEI2SQZ0fZ/xvG uYCRBlVe/3eunxFsXqBoUSokmqw7/aO1SBq4kTxYqiDzhn8m+J7CcbZa1jg1iGDcvhKu ZirrJKMFK2Gm3QrgX2HPYpW6IM/V8e+XG68jXR1aYNGNOTbXgqHVhpcWnAXRzplocCCr 0Ac9eWchs+Px9+hjFyKElFpCFmKIlsb0DroC9Bmd4Dcg9yTIQXUcObYDdCzvtIrfxq6B CkQw== X-Gm-Message-State: AOAM533ZpsTmYcMJ49WfG3HnnL32JXSIqm/4tSgV95KYcv//kUEvCOZ2 4+/j1CFHi8PQy3edwlSbJAu8FAhVXnf2TA== X-Google-Smtp-Source: ABdhPJxOPFmVGfTw8GXfdT4xAUawOUYFCUNQ1YoKxHYtBmhVXquoskFCKODlWGUtNmkFj6s5H79JjA== X-Received: by 2002:a17:902:a40e:b0:143:ca72:be9d with SMTP id p14-20020a170902a40e00b00143ca72be9dmr1989746plq.67.1640162058570; Wed, 22 Dec 2021 00:34:18 -0800 (PST) Received: from localhost.localdomain ([157.255.44.217]) by smtp.gmail.com with ESMTPSA id n11sm1307179pgp.15.2021.12.22.00.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 00:34:18 -0800 (PST) From: Harold Huang To: dev@dpdk.org Cc: Maxime Coquelin , Chenbo Xia Subject: [PATCH v3] net/virtio: fix unregister virtio user memory event cb problem Date: Wed, 22 Dec 2021 16:33:49 +0800 Message-Id: <20211222083349.2034178-1-baymaxhuang@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211220124100.1307675-1-baymaxhuang@gmail.com> References: <20211220124100.1307675-1-baymaxhuang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 eth_virtio_dev_init is failed, the registered virtio user memory event cb is not released and creating a new vdev could be failed because the new virtio_user_dev could use the same address pointer and register memory event cb to the same address is not allowed. Signed-off-by: Harold Huang --- Compared PATCH v2, commit message is changed. The problem this patch want to solve can be reproduced by ovs 2.16.90 and the latest dpdk. drivers/net/virtio/virtio_user_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 0271098f0d..16eca2f940 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -666,6 +666,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *vdev) /* previously called by pci probing for physical dev */ if (eth_virtio_dev_init(eth_dev) < 0) { PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails"); + virtio_user_dev_uninit(dev); virtio_user_eth_dev_free(eth_dev); goto end; } -- 2.27.0