Re: [PATCH net-next v4 08/14] sfc: implement vdpa vring config operations
From: Simon Horman
Date: Mon Apr 10 2023 - 08:48:57 EST
On Fri, Apr 07, 2023 at 01:40:09PM +0530, Gautam Dawar wrote:
> This patch implements the vDPA config operations related to
> virtqueues or vrings. These include setting vring address,
> getting vq state, operations to enable/disable a vq etc.
> The resources required for vring operations eg. VI, interrupts etc.
> are also allocated.
>
> Signed-off-by: Gautam Dawar <gautam.dawar@xxxxxxx>
...
> diff --git a/drivers/net/ethernet/sfc/ef100_vdpa_ops.c b/drivers/net/ethernet/sfc/ef100_vdpa_ops.c
...
> +static void ef100_vdpa_set_vq_ready(struct vdpa_device *vdev, u16 idx,
> + bool ready)
> +{
> + struct ef100_vdpa_nic *vdpa_nic = get_vdpa_nic(vdev);
> +
> + if (is_qid_invalid(vdpa_nic, idx, __func__))
> + return;
> +
> + mutex_lock(&vdpa_nic->lock);
> + if (ready) {
> + vdpa_nic->vring[idx].vring_state |=
> + EF100_VRING_READY_CONFIGURED;
> + } else {
> + vdpa_nic->vring[idx].vring_state &=
> + ~EF100_VRING_READY_CONFIGURED;
> + }
nit: the if/else above does not need { }
> + mutex_unlock(&vdpa_nic->lock);
> +}
...