[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f87a4326-ffd7-18b8-e128-2a583421cb1d@linux.ibm.com>
Date: Wed, 17 Jun 2020 08:10:23 -0400
From: Tony Krowiak <akrowiak@...ux.ibm.com>
To: Christian Borntraeger <borntraeger@...ibm.com>,
linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: freude@...ux.ibm.com, cohuck@...hat.com, mjrosato@...ux.ibm.com,
pasic@...ux.ibm.com, alex.williamson@...hat.com,
kwankhede@...dia.com, fiuczy@...ux.ibm.com
Subject: Re: [PATCH v8 03/16] s390/vfio-ap: manage link between queue struct
and matrix mdev
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;
>> + }
>> +}
>> +
Powered by blists - more mailing lists