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 077FC468E4 for ; Thu, 12 Jun 2025 23:09:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01CF742DD9; Thu, 12 Jun 2025 23:09:45 +0200 (CEST) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id 873D942DD9 for ; Thu, 12 Jun 2025 23:09:44 +0200 (CEST) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-450ce671a08so8748555e9.3 for ; Thu, 12 Jun 2025 14:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749762584; x=1750367384; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i4wP6c25TqhaZuxHVji37F1uqTH/0+eb8fABCD++vWM=; b=FZzJQQseWAo+/rljbb+T8MPAYlse5+PaEWL4kQKlAych0scr5GM+YlOXFVDes/V29s 4n/I597gFoU8jCfvkmpDeb36QiP1RcpDNFQweT1ECy+ibfWDQH4PX4yLffmQWsdaZE1R nyZtgVUoti1TV1rVhaspsOvvVwrT3tqYIoC3yIRJdCtvQlsQBsI9DRAsSZ16nh/KMiVN tv3MmZjpiZGC0ZMum/qiM31T1EhcgX5FPdGsJIUBJaco3SECVy9Q4kwPOsysQ5/7wLHB Js6Io0VW7XW3F9oWsPofnkUXXdj58J/+L0O4ahn18e8J+KsG4N7vF9WQDcNUodNFhDbC IUKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749762584; x=1750367384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i4wP6c25TqhaZuxHVji37F1uqTH/0+eb8fABCD++vWM=; b=Hn095p8pqnZmKtXdRtc1YYbi8L9KrS0fScbVATrJeE0sMyaGe7bgOq3jJihc1pM75B aFHOHK19xnR50q+hzNdkZxVl1JFHaXaMjibE5nq+hE36PuL0ibrITPIfCX+VgIyBqTsF 5HQTlGmvd+/T/1hbhfKLaiGxg1it9Vzk9V4eh3YnkLnNbDzGblWvNjjpNyplPp01AOr0 WggqcOZx4jLDxwZ7wCy5wKohRu7Ycmnw1nEOk9j8YqvONfy4yHfFP0cOxdvVEgoV8UCv faT5/zQQkrd8IZ7j5WbpPZZN0sY0Zqx8Ec3oiaVS2lV4M7AQJd48du3f44N17AbqCeWy WP5Q== X-Gm-Message-State: AOJu0YxtNzZKO1caYleAUHVrSe5f/QDn/F4DmHXnTGJOKBh+sYzwV/Ff FRbtm7AFoGPIU38NmOKSqM0KJbe7/+14fv0DZwiCoXN2FJKRM4301BLPrjdYOWsT X-Gm-Gg: ASbGncsDI3LyHbFBkxhy5YX+DEJlqm9PFNOwIDOSU4V0IVy13G5EJhDv1s5uyQIr3Qh SazzHh76fh9aP+xne/TSGg79eZDP5g7fgrBjZNX+NXNeOh4ujv3MS779+p5pEJr1r5tJJFZt7IK sWee713WhlTFwbqhVyvz0aJyekYyRyFOTZDpokepz9ipyY9PUkndqcEyI5aSeSY61listxDszAZ QDwTbzjXUuJ2L5VRzI8T2PsAkJole3OAt7HSDuuLd16dUMwWBTrrcikZQiyMKsRmH/lgtrbnQKk DZTI4l/KO8J5+3LglYs4zOpadZpfAZizobTg2fL7ryV5nbwgBCn4flvvXHFAAjZ13I9o X-Google-Smtp-Source: AGHT+IGHSByogWuMOFniGIJ2Sc+3IYLPdQoXOtgx66doDp30bCEr8FRZtzRUarxPSHWtqkp5/OXu8Q== X-Received: by 2002:a05:600c:4e09:b0:453:b1c:442a with SMTP id 5b1f17b1804b1-45334ae7e6fmr4327805e9.27.1749762583756; Thu, 12 Jun 2025 14:09:43 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:f2df:571a:ae4c:bef2]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4532e244392sm31655885e9.22.2025.06.12.14.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jun 2025 14:09:43 -0700 (PDT) From: luca.boccassi@gmail.com To: Long Li Cc: dpdk stable Subject: patch 'bus/vmbus: align ring buffer data to page boundary' has been queued to stable release 22.11.9 Date: Thu, 12 Jun 2025 22:06:54 +0100 Message-ID: <20250612210733.2506558-37-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250612210733.2506558-1-luca.boccassi@gmail.com> References: <20250612210733.2506558-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 22.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/14/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/bd19d0b8ddf448274260edc43761924e8831c738 Thanks. Luca Boccassi --- >From bd19d0b8ddf448274260edc43761924e8831c738 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 a17ce40763..6257774f29 100644 --- a/drivers/bus/vmbus/rte_vmbus_reg.h +++ b/drivers/bus/vmbus/rte_vmbus_reg.h @@ -100,14 +100,11 @@ struct vmbus_bufring { uint32_t value; } 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 @@ -36,7 +36,10 @@ 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(); } /* @@ -72,7 +75,7 @@ static inline uint32_t 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; @@ -170,7 +173,7 @@ static inline uint32_t 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.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-06-12 22:06:25.258591068 +0100 +++ 0037-bus-vmbus-align-ring-buffer-data-to-page-boundary.patch 2025-06-12 22:06:23.858044384 +0100 @@ -1 +1 @@ -From c54fa45817932057dd8f275fa1b8e4dcaede7813 Mon Sep 17 00:00:00 2001 +From bd19d0b8ddf448274260edc43761924e8831c738 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 a17ce40763..6257774f29 100644 @@ -25 +26 @@ -@@ -100,14 +100,11 @@ struct __rte_packed_begin vmbus_bufring { +@@ -100,14 +100,11 @@ struct vmbus_bufring { @@ -40 +41 @@ - } __rte_packed_end; + } __rte_packed;