vdpa/mlx5: Fix is_index_valid() to refer to features
Si-Wei Liu
Reviewed-byQuoted 4 lines · Eli Cohen
Make sure the decision whether an index received trough a callback is valid or not consults the negotiated features.
Signed-off-by Eli Cohen <[email protected]>
Is there more for this series? Subject says there're 4 patches in total?
Quoted 16 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +2
-2@@ -133,10 +133,14 @@ struct mlx5_vdpa_virtqueue {static bool is_index_valid (struct mlx5_vdpa_dev *mvdev,u16 idx) { -if (unlikely (idx > mvdev->max_idx)) -return false; +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_MQ ))) { +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_CTRL_VQ )))
drivers/vdpa/mlx5/net/mlx5_vnet.c struct mlx5_vdpa_virtqueue { · line 146
Quoted 10 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c +5
-1+return idx <2 ; + else + return idx < 3; + } -return true; +return idx <= mvdev->max_idx; }struct mlx5_vdpa_net {
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Michael S. Tsirkin
maintainerQuoted 8 lines · Eli Cohen
Quoted 7 lines · Si-Wei Liu
Quoted 4 lines · Eli Cohen
Make sure the decision whether an index received trough a callback is valid or not consults the negotiated features.
Signed-off-by Eli Cohen <[email protected]>
Quoted 8 lines
Quoted 3 lines
Reviewed-by Si-Wei Liu<[email protected]>Is there more for this series? Subject says there're 4 patches in total?
No,there were unrelated patches in my tree that went out.
Let me see if there are more patches for me to send and if I do, I will resend this in the previous one again.
Yea the series is malformed. Not a single thread, etc.
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +3
-2@@ -133,10 +133,14 @@ struct mlx5_vdpa_virtqueue {static bool is_index_valid (struct mlx5_vdpa_dev *mvdev,u16 idx) { -if (unlikely (idx > mvdev->max_idx)) -return false; +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_MQ ))) { +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_CTRL_VQ ))) +return idx <2 ;
Quoted 8 lines
Quoted 8 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c struct mlx5_vdpa_virtqueue { · line 143
Quoted 7 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c +4
-1+else +return idx <3 ; + } -return true; +return idx <= mvdev->max_idx; } struct mlx5_vdpa_net {
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Michael S. Tsirkin
maintainerQuoted 10 lines · Si-Wei Liu
Quoted 4 lines · Eli Cohen
Make sure the decision whether an index received trough a callback is valid or not consults the negotiated features.
Signed-off-by Eli Cohen <[email protected]>Reviewed-by Si-Wei Liu<[email protected]>Is there more for this series? Subject says there're 4 patches in total?
OK so with this + 1/4 are we OK with v7 of the big patchset now? I'm kind of beginning to worry it's rushed ...
Jason?
Quoted 15 lines
Quoted 15 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +2
-2@@ -133,10 +133,14 @@ struct mlx5_vdpa_virtqueue {static bool is_index_valid (struct mlx5_vdpa_dev *mvdev,u16 idx) { -if (unlikely (idx > mvdev->max_idx)) -return false; +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_MQ ))) { +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_CTRL_VQ )))
Quoted 8 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c struct mlx5_vdpa_virtqueue { · line 143
Quoted 8 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c +5
-1+return idx <2 ; + else + return idx < 3; + } -return true; +return idx <= mvdev->max_idx; }struct mlx5_vdpa_net {
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Michael S. Tsirkin
maintainerQuoted 1 line · Eli Cohen
Make sure the decision whether an index received trough a callback is
through
Quoted 3 lines
valid or not consults the negotiated features.
Signed-off-by Eli Cohen <[email protected]>
Which commit does this fix?
Quoted 28 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +7
-3@@ -133,10 +133,14 @@ struct mlx5_vdpa_virtqueue {static bool is_index_valid (struct mlx5_vdpa_dev *mvdev,u16 idx) { -if (unlikely (idx > mvdev->max_idx)) -return false; +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_MQ ))) { +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_CTRL_VQ ))) +return idx <2 ; +else +return idx <3 ; + } -return true; +return idx <= mvdev->max_idx; }struct mlx5_vdpa_net {Signature · 1 line
2.34.1
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Michael S. Tsirkin
maintainerQuoted 11 lines · Eli Cohen
Quoted 4 lines · Michael S. Tsirkin
Quoted 1 line · Eli Cohen
Make sure the decision whether an index received trough a callback is
through
Wil fix.
Quoted 3 lines
Quoted 3 lines
valid or not consults the negotiated features.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Eli Cohen <[email protected]>Which commit does this fix?
No specific commit. It's just that I get called for VQ rellated callbacks (e.g.
get_vq_state), after the device has been reset. So this patch provides protection against such cases. I hit this issue while testing locally.
To include in the commit log then.
The point of providing the fixes tag with the commit is that it's then easier to figure out how do changes interact with each other.
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +6
-2@@ -133,10 +133,14 @@ struct mlx5_vdpa_virtqueue {static bool is_index_valid (struct mlx5_vdpa_dev *mvdev,u16 idx) { -if (unlikely (idx > mvdev->max_idx)) -return false; +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_MQ ))) { +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_CTRL_VQ ))) +return idx <2 ; +else +return idx <3 ; + }
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c +1
-1-return true; +return idx <= mvdev->max_idx; }struct mlx5_vdpa_net {Signature · 1 line
2.34.1
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 8 lines · Michael S. Tsirkin
Quoted 6 lines · Si-Wei Liu
Quoted 3 lines · Eli Cohen
Make sure the decision whether an index received trough a callback is valid or not consults the negotiated features.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Eli Cohen <[email protected]>Reviewed-by Si-Wei Liu<[email protected]>Is there more for this series? Subject says there're 4 patches in total?
OK so with this + 1/4 are we OK with v7 of the big patchset now? I'm kind of beginning to worry it's rushed ...
Jason?
With Eli's new series [PATCH 0/4] Fixes to confing max virtqueues series
We are almost fine, Siwei promise to post other minor issues if necessary.
Thanks
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +2
-2@@ -133,10 +133,14 @@ struct mlx5_vdpa_virtqueue {static bool is_index_valid (struct mlx5_vdpa_dev *mvdev,u16 idx) { -if (unlikely (idx > mvdev->max_idx)) -return false; +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_MQ ))) { +if (!(mvdev->actual_features &BIT_ULL (VIRTIO_NET_F_CTRL_VQ )))
Quoted 9 lines
Quoted 8 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c struct mlx5_vdpa_virtqueue { · line 143
Quoted 8 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c +5
-1+return idx <2 ; + else + return idx < 3; + } -return true; +return idx <= mvdev->max_idx; }struct mlx5_vdpa_net {
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization