From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BC4F9A00BE; Fri, 12 Jun 2020 17:55:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 40E8E1C05C; Fri, 12 Jun 2020 17:55:33 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id 56C432BF7 for ; Fri, 12 Jun 2020 02:48:42 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1004) id 87AC620B7192; Thu, 11 Jun 2020 17:48:41 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 87AC620B7192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1591922921; bh=nQ9bibBwR2ctKT8KhBL7ozXNEx5AkDnVshu9LRakKz8=; h=From:To:Cc:Subject:Date:From; b=Zd3oeHP3/60mYjv/cuiYkujdP4zeD3yu5bm8XwZcbT7T5pWwthYE7zuJFNo37PUAW OcAFA7lfcZIacyluEy2PVb0gEQc+L06bdwdHvaQt2hvWmitfVh/zfye0KIzU+1SaBJ y3bf1zuDHjEN5LaC9PuxttiLF2BqI+cF89idd4RA= From: longli@linuxonhyperv.com To: Stephen Hemminger Cc: dev@dpdk.org, Long Li Date: Thu, 11 Jun 2020 17:48:25 -0700 Message-Id: <1591922905-81259-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 X-Mailman-Approved-At: Fri, 12 Jun 2020 17:55:29 +0200 Subject: [dpdk-dev] [PATCH] bus/vmbus: calcuate the correct start address for mapping ring buffer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Long Li vmbus_map_addr is used as the next start virutal address for mapping ring buffer. However it's updated based on ring_buf, which is a pointer to an address on the stack. The next ring buffer may be mapped to an unexpected address. Fix this by calculating vmbus_map_addr based on returned virtual address. Signed-off-by: Long Li --- drivers/bus/vmbus/linux/vmbus_uio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c index 5451bfd15..5dc0c47de 100644 --- a/drivers/bus/vmbus/linux/vmbus_uio.c +++ b/drivers/bus/vmbus/linux/vmbus_uio.c @@ -242,7 +242,7 @@ static int vmbus_uio_map_subchan(const struct rte_vmbus_device *dev, *ring_size = file_size / 2; *ring_buf = mapaddr; - vmbus_map_addr = RTE_PTR_ADD(ring_buf, file_size); + vmbus_map_addr = RTE_PTR_ADD(mapaddr, file_size); return 0; } -- 2.25.1