lkml.org 
[lkml]   [2020]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v8 03/16] s390/vfio-ap: manage link between queue struct and matrix mdev
From
Date


On 6/16/20 1:50 PM, Christian Borntraeger wrote:
>
> On 05.06.20 23:39, Tony Krowiak wrote:
> [...]
>> +static void vfio_ap_mdev_link_queues(struct ap_matrix_mdev *matrix_mdev,
>> + enum qlink_type type,
>> + unsigned long qlink_id)
>> +{
>> + unsigned long id;
>> + struct vfio_ap_queue *q;
>> +
>> + switch (type) {
>> + case LINK_APID:
>> + case UNLINK_APID:
>> + for_each_set_bit_inv(id, matrix_mdev->matrix.aqm,
>> + matrix_mdev->matrix.aqm_max + 1) {
>> + q = vfio_ap_get_queue(AP_MKQID(qlink_id, id));
>> + if (q) {
>> + if (type == LINK_APID)
>> + q->matrix_mdev = matrix_mdev;
>> + else
>> + q->matrix_mdev = NULL;> + }
>> + }
>> + break;
>> + default:
> Can you rather use
> case LINK_APQI:
> case UNLINK_APQI:
>
> and add a default case with a WARN_ON_ONCE?

Yes I can.

>
>> + for_each_set_bit_inv(id, matrix_mdev->matrix.apm,
>> + matrix_mdev->matrix.apm_max + 1) {
>> + q = vfio_ap_get_queue(AP_MKQID(id, qlink_id));
>> + if (q) {
>> + if (type == LINK_APQI)
>> + q->matrix_mdev = matrix_mdev;
>> + else
>> + q->matrix_mdev = NULL;
>> + }
>> + }
>> + break;
>> + }
>> +}
>> +

\
 
 \ /
  Last update: 2020-06-17 14:10    [W:0.087 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site