vdpa/mlx5: fix endian-ness for max vqs
Subsystems (2)
Michael S. Tsirkin
maintainerPATCH 1/1 vdpa/mlx5: fix endian-ness for max vqs
sparse warnings: (new ones prefixed by >>)
Quoted 4 lines
Quoted 2 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast to restricted__le16drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast from restricted__virtio161247 num =
le16_to_cpu(ndev->config.max_virtqueue_pairs);
Address this using the appropriate wrapper.
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/vdpa/mlx5/net/mlx5_vnet.c +2 -1
@@ -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));
Signature · 1 line
MST
Quoted 5 lines · Michael S. Tsirkin
sparse warnings: (new ones prefixed by >>)
Quoted 2 lines
Quoted 2 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast to restricted__le16drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast from restricted__virtio16
Quoted 8 lines
Quoted 1 line
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" <[email protected]>Reported-by kernel test robot <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
Quoted 21 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +2
-2@@ -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
Quoted 6 lines · Michael S. Tsirkin
sparse warnings: (new ones prefixed by >>)
Quoted 4 lines
Quoted 2 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast to restricted__le16drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast from restricted__virtio161247 num =
le16_to_cpu(ndev->config.max_virtqueue_pairs);
Quoted 7 lines
Address this using the appropriate wrapper.
Fixes 7620d51af29a ("vdpa/mlx5: Support configuring max data virtqueue")Cc "Eli Cohen" <[email protected]>Reported-by kernel test robot <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Quoted 20 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +2
-1@@ -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));Signature · 1 line
MST