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 945D242800 for ; Wed, 22 Mar 2023 01:42:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8FCC640F18; Wed, 22 Mar 2023 01:42:30 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id 0F5C940E09 for ; Wed, 22 Mar 2023 01:42:30 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id fm20-20020a05600c0c1400b003ead37e6588so12058989wmb.5 for ; Tue, 21 Mar 2023 17:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679445750; 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=PW8qSqIDAP6q+s20oCYL/xdJlxgbKzUyXJS1Za2iQiU=; b=UzMaZjh0JQak4wPO+XKRLVjdNIcsxziJ5Bju1HSif4+X21lnXmMpkk3MMKQyVTqVes v44SFrr3kGN0m+lUulzaKzYohC91hDxEq1tmN4NVWm4WDMzc6ewgy7DvhBKeQacAov7m yscp2GmKVwuUcxwSCjcjRdfh2kDEXaLpOQhsJAd8EVXlJGilhU8ymabtKX4HcC3QZL14 Mz6aIStb8sGYjCRUeNLFEcYqLFxvYXwkwcDeR9mGPBxLnA0NEM8IOm94Oai+7YtPa8Xb o5AE2UG5ed4VyatD3r5lY+uui8Zwj4hL7Hmge5LZo0PcOefmTKkv7dSkN0gd/r+v5Q6H y5yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679445750; 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=PW8qSqIDAP6q+s20oCYL/xdJlxgbKzUyXJS1Za2iQiU=; b=cUvGNzrmbT2yzrXlCiTgPXBK+zzmzyd7GMAuE0owb+0sGo4GEH7LAg0nAQ5Zkk9aDX 1Rzg0Mov36JrDIiIpj2Pv/vTTlEORIenmjtdLTJpqjkBH6vVp2cb3uuwMXn27M8pMCFs j9Gpn7/6q8OJPy4MmmP+fRngdqVTpGkLF04AXGGAyluAmjCrvGhWpYXM0YKaDgeBzYEv LBx+maOQGbGXpczI7d+zY/OkFibfP/6Feed0LlQ33gXQ5ftSW6R+QDU3qIzLtGUPcT6z XvJV6uK5Oyi309a/Uibfm+b1ixn5RW0kTN3RAmODAxHZTy9Ogea9AugMN1cPdj+jYBj2 uMnA== X-Gm-Message-State: AO0yUKXU7CLIxGQHV4FiCWhghpGDsOrlIlduvQDuBu1bUR8exFQaUoCh SQ+pG4R9CAIkY14C5Zgv+wbP2tIfy3o= X-Google-Smtp-Source: AK7set8NtYB8J8wn7E5PJbhSCV5/sg+C6Fb9eGVeqUeXOl/sdr5jLa6ZFMQlfapTRGKxMeBiH2egCg== X-Received: by 2002:a05:600c:b55:b0:3ed:6693:138d with SMTP id k21-20020a05600c0b5500b003ed6693138dmr3821741wmr.4.1679445749611; Tue, 21 Mar 2023 17:42:29 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id z23-20020a7bc7d7000000b003ee1b2ab9a0sm4777858wmk.11.2023.03.21.17.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 17:42:29 -0700 (PDT) From: luca.boccassi@gmail.com To: David Marchand Cc: Maxime Coquelin , Andy Pei , Chenbo Xia , dpdk stable Subject: patch 'net/virtio: remove address width limit for modern devices' has been queued to stable release 20.11.8 Date: Wed, 22 Mar 2023 00:41:47 +0000 Message-Id: <20230322004155.2333903-11-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230322004155.2333903-1-luca.boccassi@gmail.com> References: <20230315224631.1025649-39-luca.boccassi@gmail.com> <20230322004155.2333903-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 20.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/23/23. 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/2f9b094042e64bb9ebd36ce8b2983b0a1c1c0f9b Thanks. Luca Boccassi --- >From 2f9b094042e64bb9ebd36ce8b2983b0a1c1c0f9b Mon Sep 17 00:00:00 2001 From: David Marchand Date: Tue, 14 Mar 2023 09:53:34 +0100 Subject: [PATCH] net/virtio: remove address width limit for modern devices [ upstream commit 8b76b3a0d327f6bedc1343149e03619337ab0408 ] Modern devices don't have the same limitation as legacy devices, because vring addresses are not configured using a 32-bit register. Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0") Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin Acked-by: Andy Pei Reviewed-by: Chenbo Xia --- drivers/net/virtio/virtio_pci.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 878a18555d..da5366802e 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -31,22 +31,6 @@ #define VIRTIO_PCI_CONFIG(hw) \ (((hw)->use_msix == VIRTIO_MSIX_ENABLED) ? 24 : 20) -static inline int -check_vq_phys_addr_ok(struct virtqueue *vq) -{ - /* Virtio PCI device VIRTIO_PCI_QUEUE_PF register is 32bit, - * and only accepts 32 bit page frame number. - * Check if the allocated physical memory exceeds 16TB. - */ - if ((vq->vq_ring_mem + vq->vq_ring_size - 1) >> - (VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) { - PMD_INIT_LOG(ERR, "vring address shouldn't be above 16TB!"); - return 0; - } - - return 1; -} - /* * Since we are in legacy mode: * http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf @@ -213,8 +197,15 @@ legacy_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) { uint32_t src; - if (!check_vq_phys_addr_ok(vq)) + /* Virtio PCI device VIRTIO_PCI_QUEUE_PFN register is 32bit, + * and only accepts 32 bit page frame number. + * Check if the allocated physical memory exceeds 16TB. + */ + if ((vq->vq_ring_mem + vq->vq_ring_size - 1) >> + (VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) { + PMD_INIT_LOG(ERR, "vring address shouldn't be above 16TB!"); return -1; + } rte_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, VIRTIO_PCI_QUEUE_SEL); @@ -366,9 +357,6 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) uint64_t desc_addr, avail_addr, used_addr; uint16_t notify_off; - if (!check_vq_phys_addr_ok(vq)) - return -1; - desc_addr = vq->vq_ring_mem; avail_addr = desc_addr + vq->vq_nentries * sizeof(struct vring_desc); used_addr = RTE_ALIGN_CEIL(avail_addr + offsetof(struct vring_avail, -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-21 21:56:37.495910124 +0000 +++ 0011-net-virtio-remove-address-width-limit-for-modern-dev.patch 2023-03-21 21:56:37.064806882 +0000 @@ -1 +1 @@ -From 8b76b3a0d327f6bedc1343149e03619337ab0408 Mon Sep 17 00:00:00 2001 +From 2f9b094042e64bb9ebd36ce8b2983b0a1c1c0f9b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8b76b3a0d327f6bedc1343149e03619337ab0408 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 9cf4d760b4..29eb739b04 100644 +index 878a18555d..da5366802e 100644 @@ -24,3 +25,3 @@ -@@ -33,22 +33,6 @@ - - struct virtio_pci_internal virtio_pci_internal[RTE_MAX_ETHPORTS]; +@@ -31,22 +31,6 @@ + #define VIRTIO_PCI_CONFIG(hw) \ + (((hw)->use_msix == VIRTIO_MSIX_ENABLED) ? 24 : 20) @@ -44,4 +45,4 @@ - #define PCI_MSIX_ENABLE 0x8000 - - static enum virtio_msix_status -@@ -273,8 +257,15 @@ legacy_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) + /* + * Since we are in legacy mode: + * http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf +@@ -213,8 +197,15 @@ legacy_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) @@ -64 +65 @@ -@@ -476,9 +467,6 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) +@@ -366,9 +357,6 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)