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 A62FC46BAE for ; Fri, 18 Jul 2025 21:38:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A08C740B8F; Fri, 18 Jul 2025 21:38:35 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 2E4E340E41 for ; Fri, 18 Jul 2025 21:38:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752867513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CyTBMRx4qUnQaXwMDVQbhXlGO7oDYjCfvFYJWAnGE4w=; b=Ge24Er7OqcbygRmYaH2zPhbLEEmInNkZxB7/LKPe/IGZDgTJNr6T6jsgDGbP6kjaRw300V 2TF7inDJu2fZ62ieN6vp+sVDX1+kS5BHhKK39Hz6Y7uuBSwdIFILULY2R6EJMQ1KvJ3siD 5qL69YYRaWPUXQh9kq1vXrC8yrCUWBI= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-539-076RtstIMjGrQW4yz0HYyg-1; Fri, 18 Jul 2025 15:38:32 -0400 X-MC-Unique: 076RtstIMjGrQW4yz0HYyg-1 X-Mimecast-MFC-AGG-ID: 076RtstIMjGrQW4yz0HYyg_1752867511 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D88AD1956080; Fri, 18 Jul 2025 19:38:30 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.40]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9B8D8180045B; Fri, 18 Jul 2025 19:38:29 +0000 (UTC) From: Kevin Traynor To: Long Li Cc: dpdk stable Subject: patch 'bus/vmbus: align ring buffer data to page boundary' has been queued to stable release 24.11.3 Date: Fri, 18 Jul 2025 20:31:37 +0100 Message-ID: <20250718193247.1008129-163-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-1-ktraynor@redhat.com> References: <20250718193247.1008129-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: q7bTDUc8aQ0Tw1PMmyTZEnCiX2PQBLmHO0xgzoi3WUY_1752867511 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 24.11.3 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/23/25. 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/254594c9522e8e9127f86d4cfd594f5f52e2abde Thanks. Kevin --- >From 254594c9522e8e9127f86d4cfd594f5f52e2abde Mon Sep 17 00:00:00 2001 From: Long Li Date: Fri, 18 Apr 2025 12:32:47 -0700 Subject: [PATCH] bus/vmbus: align ring buffer data to page boundary [ upstream commit c54fa45817932057dd8f275fa1b8e4dcaede7813 ] The ring buffer data region always starts at the system page boundary after ring buffer head. The current code assumes the system page size is 4k. This is not always correct. Fix this by using system page size for addressing ring buffer data. Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support") Signed-off-by: Long Li --- drivers/bus/vmbus/rte_vmbus_reg.h | 9 +++------ drivers/bus/vmbus/vmbus_bufring.c | 9 ++++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h index e3299aa871..a12c7e2715 100644 --- a/drivers/bus/vmbus/rte_vmbus_reg.h +++ b/drivers/bus/vmbus/rte_vmbus_reg.h @@ -101,12 +101,9 @@ struct vmbus_bufring { } feature_bits; - /* Pad it to rte_mem_page_size() so that data starts on page boundary */ - uint8_t reserved2[4028]; - /* - * Ring data starts here + RingDataStartOffset - * !!! DO NOT place any fields below this !!! + * This is the end of ring buffer head. The ring buffer data is system + * page aligned and starts at rte_mem_page_size() from the beginning + * of this structure */ - uint8_t data[]; } __rte_packed; diff --git a/drivers/bus/vmbus/vmbus_bufring.c b/drivers/bus/vmbus/vmbus_bufring.c index c78619dc44..fcb97287dc 100644 --- a/drivers/bus/vmbus/vmbus_bufring.c +++ b/drivers/bus/vmbus/vmbus_bufring.c @@ -37,5 +37,8 @@ void vmbus_br_setup(struct vmbus_br *br, void *buf, unsigned int blen) br->vbr = buf; br->windex = br->vbr->windex; - br->dsize = blen - sizeof(struct vmbus_bufring); + + /* The ring buffer data starts at the 2nd page of the ring buffer */ + RTE_VERIFY(blen > rte_mem_page_size()); + br->dsize = blen - rte_mem_page_size(); } @@ -73,5 +76,5 @@ vmbus_txbr_copyto(const struct vmbus_br *tbr, uint32_t windex, const void *src0, uint32_t cplen) { - uint8_t *br_data = tbr->vbr->data; + uint8_t *br_data = (uint8_t *)tbr->vbr + rte_mem_page_size(); uint32_t br_dsize = tbr->dsize; const uint8_t *src = src0; @@ -171,5 +174,5 @@ vmbus_rxbr_copyfrom(const struct vmbus_br *rbr, uint32_t rindex, void *dst0, size_t cplen) { - const uint8_t *br_data = rbr->vbr->data; + const uint8_t *br_data = (uint8_t *)rbr->vbr + rte_mem_page_size(); uint32_t br_dsize = rbr->dsize; uint8_t *dst = dst0; -- 2.50.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-07-18 20:29:16.690458446 +0100 +++ 0163-bus-vmbus-align-ring-buffer-data-to-page-boundary.patch 2025-07-18 20:29:11.172856915 +0100 @@ -1 +1 @@ -From c54fa45817932057dd8f275fa1b8e4dcaede7813 Mon Sep 17 00:00:00 2001 +From 254594c9522e8e9127f86d4cfd594f5f52e2abde Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c54fa45817932057dd8f275fa1b8e4dcaede7813 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 54a26d12bd..fb7e3043ec 100644 +index e3299aa871..a12c7e2715 100644 @@ -25 +26 @@ -@@ -101,12 +101,9 @@ struct __rte_packed_begin vmbus_bufring { +@@ -101,12 +101,9 @@ struct vmbus_bufring { @@ -39 +40 @@ - } __rte_packed_end; + } __rte_packed;