Displaying 13 results from an estimated 13 matches for "power_of_2".
2023 Mar 15
2
[PATCH v2 1/3] virtio_ring: Allow non power of 2 sizes for packed virtqueue
...of descriptors in that
queue, and it does not have to be a power of 2 for packed virtqueues.
However, the virtio_pci_modern driver enforced a power of 2 check for
virtqueue sizes, which is unnecessary and restrictive for packed
virtuqueue.
Split virtqueue still needs to check the virtqueue size is power_of_2
which has been done in vring_alloc_queue_split of the virtio_ring layer.
To validate this change, we tested various virtqueue sizes for packed
rings, including 128, 256, 512, 100, 200, 500, and 1000, with
CONFIG_PAGE_POISONING enabled, and all tests passed successfully.
Signed-off-by: Feng Liu &l...
2023 Mar 17
1
[PATCH v2 1/3] virtio_ring: Allow non power of 2 sizes for packed virtqueue
...ueue, and it does not have to be a power of 2 for packed virtqueues.
> However, the virtio_pci_modern driver enforced a power of 2 check for
> virtqueue sizes, which is unnecessary and restrictive for packed
> virtuqueue.
>
> Split virtqueue still needs to check the virtqueue size is power_of_2
> which has been done in vring_alloc_queue_split of the virtio_ring layer.
>
> To validate this change, we tested various virtqueue sizes for packed
> rings, including 128, 256, 512, 100, 200, 500, and 1000, with
> CONFIG_PAGE_POISONING enabled, and all tests passed successfully.
>...
2023 Mar 11
1
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
...not support non power of 2 how exactly
> did you configure non power of 2?
>
Hi, Michael
We can implement the test by modifying qemu; 1. force the
VIRTIO_F_RING_PACKED feature bit to be set, 2. set
VIRTIO_NET_RX_QUEUE_DEFAULT_SIZE and VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE to
the value of non power_of_2, 3. remove the check of is_power_of
virtqueue, then qemu can create the required virtual device (non power_2
size , packed virtqueue device) ;In this way, any length and packed ring
test can be performed;
remove the modified code, I can test split vq, and can see that the size
of power_of_2 can...
2023 Mar 12
1
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
...ly
> > did you configure non power of 2?
> >
>
> Hi, Michael
> We can implement the test by modifying qemu; 1. force the
> VIRTIO_F_RING_PACKED feature bit to be set, 2. set
> VIRTIO_NET_RX_QUEUE_DEFAULT_SIZE and VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE to the
> value of non power_of_2, 3. remove the check of is_power_of virtqueue, then
> qemu can create the required virtual device (non power_2 size , packed
> virtqueue device) ;In this way, any length and packed ring test can be
> performed;
> remove the modified code, I can test split vq, and can see that the size o...
2023 Mar 11
1
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
On Fri, Mar 10, 2023 at 08:21:31AM -0500, Feng Liu wrote:
>
>
> On 2023-03-10 a.m.3:06, Michael S. Tsirkin wrote:
> > External email: Use caution opening links or attachments
> >
> >
> > On Fri, Mar 10, 2023 at 07:34:25AM +0200, Feng Liu wrote:
> > > This patch series performs a clean up of the code in virtio_ring and
> > > virtio_pci,
2023 Mar 10
1
[PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues
On 2023-03-10 a.m.8:36, Parav Pandit wrote:
>
>
>> From: Feng Liu <feliu at nvidia.com>
>> Sent: Friday, March 10, 2023 12:34 AM
>
>>
>> - if (!is_power_of_2(num)) {
>> - dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u",
>> num);
>> - return ERR_PTR(-EINVAL);
>> - }
>> -
>
> The check is still valid for split q.
> Maybe the right place for such a check is not the pci transport driver.
>...
2023 Mar 11
1
[PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues
...ri, Mar 10, 2023 at 10:23:16AM -0500, Feng Liu wrote:
>
>
> On 2023-03-10 a.m.8:36, Parav Pandit wrote:
> >
> >
> > > From: Feng Liu <feliu at nvidia.com>
> > > Sent: Friday, March 10, 2023 12:34 AM
> >
> > >
> > > - if (!is_power_of_2(num)) {
> > > - dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u",
> > > num);
> > > - return ERR_PTR(-EINVAL);
> > > - }
> > > -
> >
> > The check is still valid for split q.
> > Maybe the right place for such...
2023 Mar 11
1
[PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues
...23:16AM -0500, Feng Liu wrote:
>>
>>
>> On 2023-03-10 a.m.8:36, Parav Pandit wrote:
>>>
>>>
>>>> From: Feng Liu <feliu at nvidia.com>
>>>> Sent: Friday, March 10, 2023 12:34 AM
>>>
>>>>
>>>> - if (!is_power_of_2(num)) {
>>>> - dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u",
>>>> num);
>>>> - return ERR_PTR(-EINVAL);
>>>> - }
>>>> -
>>>
>>> The check is still valid for split q.
>>>...
2023 Mar 12
1
[PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues
...On 2023-03-10 a.m.8:36, Parav Pandit wrote:
> > > >
> > > >
> > > > > From: Feng Liu <feliu at nvidia.com>
> > > > > Sent: Friday, March 10, 2023 12:34 AM
> > > >
> > > > >
> > > > > - if (!is_power_of_2(num)) {
> > > > > - dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u",
> > > > > num);
> > > > > - return ERR_PTR(-EINVAL);
> > > > > - }
> > > > > -
> > > >
> > >...
2023 Mar 15
4
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and
virtio_pci, modifying it to conform with the Linux kernel coding style
guidance [1]. The modifications ensure the code easy to read and
understand. This small series does few short cleanups in the code.
Patch-1 Allow non power of 2 sizes for packed virtqueues.
Patch-2 Avoid using inline for small functions.
Patch-3 Use const to
2023 Mar 10
1
[PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues
...eviewed-by: Parav Pandit <parav at nvidia.com>
Reviewed-by: Gavin Li <gavinl at nvidia.com>
Reviewed-by: Bodong Wang <bodong at nvidia.com>
Reviewed-by: David Edmondson <david.edmondson at oracle.com>
---
v1 -> v2
feedbacks from Jason Wang and Michael S. Tsirkin
- remove power_of_2 check of virtqueue size
---
drivers/virtio/virtio_pci_modern.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
index 9e496e288cfa..6e713904d8e8 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virti...
2023 Mar 07
3
[PATCH 0/3] virtio_ring: Clean up code for virtio ring and pci
...up of the code in virtio_ring and
virtio_pci, modifying it to conform with the Linux kernel coding style
guidance [1]. The modifications ensure the code easy to read and
understand. This small series does few short cleanups in the code.
Patch-1 Remove unnecessary num zero check, which performs in power_of_2.
Patch-2 Avoid using inline for small functions.
Patch-3 Use const to annotate read-only pointer params.
[1]
https://www.kernel.org/doc/html/v6.2-rc3/process/coding-style.html#the-inline-disease
Feng Liu (3):
virtio_pci_modern: Remove unnecessary num zero check
virtio_ring: Avoid using inline...
2023 Mar 10
4
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and
virtio_pci, modifying it to conform with the Linux kernel coding style
guidance [1]. The modifications ensure the code easy to read and
understand. This small series does few short cleanups in the code.
Patch-1 Allow non power of 2 sizes for virtqueues
Patch-2 Avoid using inline for small functions.
Patch-3 Use const to annotate