[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240612084244.2023254-1-Lianjie.Shi@amd.com>
Date: Wed, 12 Jun 2024 16:42:43 +0800
From: Lianjie Shi <Lianjie.Shi@....com>
To: <christian.koenig@....com>
CC: <linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<bhelgaas@...gle.com>, <HaiJun.Chang@....com>, <Jerry.Jiang@....com>,
<Andy.Zhang@....com>, <emily.deng@....com>, Lianjie Shi <Lianjie.Shi@....com>
Subject: [PATCH 0/1][v2] PCI: VF resizable BAR
Similar to regular BAR, drivers can use pci_resize_resource() to resize
an IOV BAR to the desired size provided that is supported by the
hardware, which can be queried using pci_rebar_get_possible_sizes().
This feature is based on the fact that (default VF BAR size) * (supported
VF number) covers all possible resource/address ranges (rounded up to the
power of 2 size). For example, the total size of the resource behind the
BAR is 256GB, the supported maximum VF number is 4, the default VF BAR
size should then be set to 64GB. When the enabled vf_num changes, the VF
BAR size will adjust accordingly as
- For 1 VF, VF BAR size is 256GB
- For 2 VFs, VF BAR size is 128GB
- For 4 VFs, VF BAR size is 64GB
This feature is necessary to accommodate the limited address per PCI port.
Lianjie Shi (1):
PCI: Support VF resizable BAR
drivers/pci/pci.c | 47 ++++++++++++++++++++++++++++++++++-
drivers/pci/setup-res.c | 45 +++++++++++++++++++++++++++------
include/uapi/linux/pci_regs.h | 1 +
3 files changed, 85 insertions(+), 8 deletions(-)
base-commit: cf87f46fd34d6c19283d9625a7822f20d90b64a4
--
2.34.1
Powered by blists - more mailing lists