[PATCH] net/virtio: fix descriptors buffer addresses on 32 bits builds

Maxime Coquelin maxime.coquelin at redhat.com
Thu Oct 12 15:50:09 CEST 2023



On 9/20/23 15:01, Maxime Coquelin wrote:
> With Virtio-user, the Virtio descriptor buffer address is the
> virtual address of the mbuf's buffer. On 32 bits builds, it is
> expected to be 32 bits.
> 
> With Virtio-PCI, the Virtio descriptor buffer address is the
> physical address of the mbuf's buffer. On 32 bits builds running
> on 64 bits kernel, it is expected to be up to 64 bits.
> 
> This patch introduces a new mask field in virtqueue's struct to
> filter our the upper 4 bytes of the address only when necessary.
> An optimization is introduced for 64 bits builds to remove the
> masking, as the address is always 64 bits wide.
> 
> Fixes: ba55c94a7ebc ("net/virtio: revert forcing IOVA as VA mode for virtio-user")
> Cc: stable at dpdk.org
> 
> Reported-by: Sampath Peechu <speechu at cisco.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> ---
>   drivers/net/virtio/virtqueue.c |  2 ++
>   drivers/net/virtio/virtqueue.h | 18 ++++++++++++++----
>   2 files changed, 16 insertions(+), 4 deletions(-)
> 

Applied to nex-virtio/for-next-net.

Thanks,
Maxime



More information about the stable mailing list