patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kyo Liu <kyo.liu@nebula-matrix.com>
To: kyo.liu@nebula-matrix.com, dimon.zhao@nebula-matrix.com
Cc: Long Li <longli@microsoft.com>, stable@dpdk.org
Subject: [PATCH v1 07/10] bus/vmbus: use Hyper-V page size for mapping to UIO pages
Date: Fri, 25 Apr 2025 02:07:55 +0000	[thread overview]
Message-ID: <20250425020758.3794-7-kyo.liu@nebula-matrix.com> (raw)
In-Reply-To: <20250425020758.3794-1-kyo.liu@nebula-matrix.com>

From: Long Li <longli@microsoft.com>

The interrupt and monitor pages mapped from Hyper-V via kernel are always
4k in sizes. Use Hyper-V page size to map them.

Fixes: 831dba47bd ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
---
 drivers/bus/vmbus/linux/vmbus_uio.c  | 2 +-
 drivers/bus/vmbus/vmbus_common_uio.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c
index 8edec869ac..fbafc5027d 100644
--- a/drivers/bus/vmbus/linux/vmbus_uio.c
+++ b/drivers/bus/vmbus/linux/vmbus_uio.c
@@ -268,7 +268,7 @@ static int vmbus_uio_map_subchan(const struct rte_vmbus_device *dev,
 	}
 	file_size = sb.st_size;
 
-	if (file_size == 0 || (file_size & (rte_mem_page_size() - 1))) {
+	if (file_size == 0 || (file_size & (HYPERV_PAGE_SIZE - 1))) {
 		VMBUS_LOG(ERR, "incorrect size %s: %zu",
 			  ring_path, file_size);
 
diff --git a/drivers/bus/vmbus/vmbus_common_uio.c b/drivers/bus/vmbus/vmbus_common_uio.c
index d55aee6537..c6e7e07302 100644
--- a/drivers/bus/vmbus/vmbus_common_uio.c
+++ b/drivers/bus/vmbus/vmbus_common_uio.c
@@ -204,7 +204,7 @@ vmbus_uio_map_resource(struct rte_vmbus_device *dev)
 	}
 
 	dev->int_page = (uint32_t *)((char *)uio_res->maps[HV_INT_PAGE_MAP].addr
-				     + (rte_mem_page_size() >> 1));
+				     + (HYPERV_PAGE_SIZE >> 1));
 	dev->monitor_page = uio_res->maps[HV_MON_PAGE_MAP].addr;
 	return 0;
 }
-- 
2.43.0


  parent reply	other threads:[~2025-04-25  2:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250425020758.3794-1-kyo.liu@nebula-matrix.com>
2025-04-25  2:07 ` [PATCH v1 05/10] bus/vmbus: align ring buffer data to page boundary Kyo Liu
2025-04-25  2:07 ` [PATCH v1 06/10] bus/vmbus: define Hyper-V page size Kyo Liu
2025-04-25  2:07 ` Kyo Liu [this message]
2025-04-25  2:07 ` [PATCH v1 08/10] net/netvsc: use Hyper-V page size for the driver Kyo Liu
2025-04-25  2:07 ` [PATCH v1 09/10] net/netvsc: add stats counters from VF Kyo Liu

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=20250425020758.3794-7-kyo.liu@nebula-matrix.com \
    --to=kyo.liu@nebula-matrix.com \
    --cc=dimon.zhao@nebula-matrix.com \
    --cc=longli@microsoft.com \
    --cc=stable@dpdk.org \
    /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).