public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Krowiak <akrowiak@linux.ibm.com>
To: "Jason J. Herne" <jjherne@linux.ibm.com>, linux-s390@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, pasic@linux.ibm.com,
	borntraeger@de.ibm.com, agordeev@linux.ibm.com,
	gor@linux.ibm.com
Subject: Re: [PATCH v2 3/5] s390/vfio-ap: Ignore duplicate link requests in vfio_ap_mdev_link_queue
Date: Mon, 11 Mar 2024 11:27:53 -0400	[thread overview]
Message-ID: <78d085ac-3759-46ff-be75-f8c70604ac41@linux.ibm.com> (raw)
In-Reply-To: <20240306140843.10782-4-jjherne@linux.ibm.com>

While I don't necessarily object to this change, it is not necessary 
because this function is only called in situations where the link will 
not have been made:

* When an adapter or domain is assigned to the vfio_ap mdev, in which 
case no queue with the APID of the adaper or the APQI of the domain will 
have been linked.

* When a queue device is probed, in which case the vfio_ap_queue object 
is created and linked if the its APQN is assigned to the vfio_ap mdev.

In any case, it certainly doesn't hurt and if a future change is made 
such that this could come into play, the code is already there. So I'll 
leave it up to you if you want to keep this; if so, you already have my r-b.

On 3/6/24 9:08 AM, Jason J. Herne wrote:
> vfio_ap_mdev_link_queue is changed to detect if a matrix_mdev has
> already linked the given queue. If so, it bails out.
>
> Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
> Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>
> ---
>   drivers/s390/crypto/vfio_ap_ops.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
> index b1c1dc0233e1..259130347d00 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -781,10 +781,11 @@ static int vfio_ap_mdev_probe(struct mdev_device *mdev)
>   static void vfio_ap_mdev_link_queue(struct ap_matrix_mdev *matrix_mdev,
>   				    struct vfio_ap_queue *q)
>   {
> -	if (q) {
> -		q->matrix_mdev = matrix_mdev;
> -		hash_add(matrix_mdev->qtable.queues, &q->mdev_qnode, q->apqn);
> -	}
> +	if (!q || vfio_ap_mdev_get_queue(matrix_mdev, q->apqn))
> +		return;
> +
> +	q->matrix_mdev = matrix_mdev;
> +	hash_add(matrix_mdev->qtable.queues, &q->mdev_qnode, q->apqn);
>   }
>   
>   static void vfio_ap_mdev_link_apqn(struct ap_matrix_mdev *matrix_mdev, int apqn)

  reply	other threads:[~2024-03-11 15:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 14:08 [PATCH v2 0/5] s390/vfio-ap: queue_configuration sysfs attribute for mdevctl automation Jason J. Herne
2024-03-06 14:08 ` [PATCH v2 1/5] s390/ap: Externalize AP bus specific bitmap reading function Jason J. Herne
2024-03-06 14:38   ` Matthew Rosato
2024-03-06 14:08 ` [PATCH v2 2/5] s390/vfio-ap: Add sysfs attr, queue_configuration, to export mdev state Jason J. Herne
2024-03-06 14:38   ` Matthew Rosato
2024-03-06 14:08 ` [PATCH v2 3/5] s390/vfio-ap: Ignore duplicate link requests in vfio_ap_mdev_link_queue Jason J. Herne
2024-03-11 15:27   ` Anthony Krowiak [this message]
2024-03-06 14:08 ` [PATCH v2 4/5] s390/vfio-ap: Add write support to sysfs attr ap_config Jason J. Herne
2024-03-11 18:15   ` Anthony Krowiak
2024-03-13 18:00     ` Jason J. Herne
2024-03-06 14:08 ` [PATCH v2 5/5] s390: doc: Update doc Jason J. Herne
2024-03-06 14:38   ` Matthew Rosato
2024-03-06 14:40     ` Jason J. Herne
2024-03-11 18:20   ` Anthony Krowiak
2024-03-06 14:39 ` [PATCH v2 0/5] s390/vfio-ap: queue_configuration sysfs attribute for mdevctl automation Matthew Rosato
2024-03-06 22:02 ` Matthew Rosato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78d085ac-3759-46ff-be75-f8c70604ac41@linux.ibm.com \
    --to=akrowiak@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=jjherne@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox