[RFC PATCH 6/9] caif_virtio: convert to new unified vringh APIs
From: Shunsuke Mie
Date: Mon Dec 26 2022 - 21:27:20 EST
vringh_*_kern APIs are being removed without vringh_init_kern(), so change
to use new APIs.
Signed-off-by: Shunsuke Mie <mie@xxxxxxxxxx>
---
drivers/net/caif/caif_virtio.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c
index 0b0f234b0b50..f9dd79807afa 100644
--- a/drivers/net/caif/caif_virtio.c
+++ b/drivers/net/caif/caif_virtio.c
@@ -265,18 +265,12 @@ static int cfv_rx_poll(struct napi_struct *napi, int quota)
*/
if (riov->i == riov->used) {
if (cfv->ctx.head != USHRT_MAX) {
- vringh_complete_kern(cfv->vr_rx,
- cfv->ctx.head,
- 0);
+ vringh_complete(cfv->vr_rx, cfv->ctx.head, 0);
cfv->ctx.head = USHRT_MAX;
}
- err = vringh_getdesc_kern(
- cfv->vr_rx,
- riov,
- NULL,
- &cfv->ctx.head,
- GFP_ATOMIC);
+ err = vringh_getdesc(cfv->vr_rx, riov, NULL,
+ &cfv->ctx.head);
if (err <= 0)
goto exit;
@@ -317,9 +311,9 @@ static int cfv_rx_poll(struct napi_struct *napi, int quota)
/* Really out of packets? (stolen from virtio_net)*/
napi_complete(napi);
- if (unlikely(!vringh_notify_enable_kern(cfv->vr_rx)) &&
+ if (unlikely(!vringh_notify_enable(cfv->vr_rx)) &&
napi_schedule_prep(napi)) {
- vringh_notify_disable_kern(cfv->vr_rx);
+ vringh_notify_disable(cfv->vr_rx);
__napi_schedule(napi);
}
break;
@@ -329,7 +323,7 @@ static int cfv_rx_poll(struct napi_struct *napi, int quota)
dev_kfree_skb(skb);
/* Stop NAPI poll on OOM, we hope to be polled later */
napi_complete(napi);
- vringh_notify_enable_kern(cfv->vr_rx);
+ vringh_notify_enable(cfv->vr_rx);
break;
default:
@@ -337,12 +331,12 @@ static int cfv_rx_poll(struct napi_struct *napi, int quota)
netdev_warn(cfv->ndev, "Bad ring, disable device\n");
cfv->ndev->stats.rx_dropped = riov->used - riov->i;
napi_complete(napi);
- vringh_notify_disable_kern(cfv->vr_rx);
+ vringh_notify_disable(cfv->vr_rx);
netif_carrier_off(cfv->ndev);
break;
}
out:
- if (rxcnt && vringh_need_notify_kern(cfv->vr_rx) > 0)
+ if (rxcnt && vringh_need_notify(cfv->vr_rx) > 0)
vringh_notify(cfv->vr_rx);
return rxcnt;
}
@@ -352,7 +346,7 @@ static void cfv_recv(struct virtio_device *vdev, struct vringh *vr_rx)
struct cfv_info *cfv = vdev->priv;
++cfv->stats.rx_kicks;
- vringh_notify_disable_kern(cfv->vr_rx);
+ vringh_notify_disable(cfv->vr_rx);
napi_schedule(&cfv->napi);
}
@@ -460,7 +454,7 @@ static int cfv_netdev_close(struct net_device *netdev)
/* Disable interrupts, queues and NAPI polling */
netif_carrier_off(netdev);
virtqueue_disable_cb(cfv->vq_tx);
- vringh_notify_disable_kern(cfv->vr_rx);
+ vringh_notify_disable(cfv->vr_rx);
napi_disable(&cfv->napi);
/* Release any TX buffers on both used and available rings */
--
2.25.1