lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACGkMEv4YY7z2eF2EHt=KvmJ+se5cAs3vRP0Wi2HdRYFhe80Hw@mail.gmail.com>
Date:   Mon, 10 Jan 2022 10:44:20 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     "Michael S. Tsirkin" <mst@...hat.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Eli Cohen <elic@...dia.com>, kernel test robot <lkp@...el.com>,
        virtualization <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH] vdpa/mlx5: fix endian-ness for max vqs

On Sun, Jan 9, 2022 at 2:00 AM Michael S. Tsirkin <mst@...hat.com> wrote:
>
> sparse warnings: (new ones prefixed by >>)
> >> drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast to restricted __le16
> >> drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast from restricted __virtio16
>
> > 1247                  num = le16_to_cpu(ndev->config.max_virtqueue_pairs);
>
> Address this using the appropriate wrapper.
>
> Fixes: 7620d51af29a ("vdpa/mlx5: Support configuring max data virtqueue")
> Cc: "Eli Cohen" <elic@...dia.com>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Michael S. Tsirkin <mst@...hat.com>

Acked-by: Jason Wang <jasowang@...hat.com>

> ---
>  drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index 84b1919015ce..d1ff65065fb1 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -1242,7 +1242,8 @@ static int create_rqt(struct mlx5_vdpa_net *ndev)
>         if (!(ndev->mvdev.actual_features & BIT_ULL(VIRTIO_NET_F_MQ)))
>                 num = 1;
>         else
> -               num = le16_to_cpu(ndev->config.max_virtqueue_pairs);
> +               num = mlx5vdpa16_to_cpu(&ndev->mvdev,
> +                                       ndev->config.max_virtqueue_pairs);
>
>         max_rqt = min_t(int, roundup_pow_of_two(num),
>                         1 << MLX5_CAP_GEN(ndev->mvdev.mdev, log_max_rqt_size));
> --
> MST
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ