Displaying 20 results from an estimated 236 matches for "call_ctx".
2020 Aug 04
3
[PATCH V5 1/6] vhost: introduce vhost_vring_call
On 2020/8/4 ??4:42, Zhu, Lingshan wrote:
>
>
> On 8/4/2020 4:38 PM, Jason Wang wrote:
>>
>> On 2020/7/31 ??2:55, Zhu Lingshan wrote:
>>> This commit introduces struct vhost_vring_call which replaced
>>> raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue.
>>> Besides eventfd_ctx, it contains a spin lock and an
>>> irq_bypass_producer in its structure.
>>>
>>> Signed-off-by: Zhu Lingshan <lingshan.zhu at intel.com>
>>> Suggested-by: Jason Wang <jasowang at redhat.com>...
2020 Aug 04
3
[PATCH V5 1/6] vhost: introduce vhost_vring_call
On 2020/8/4 ??4:42, Zhu, Lingshan wrote:
>
>
> On 8/4/2020 4:38 PM, Jason Wang wrote:
>>
>> On 2020/7/31 ??2:55, Zhu Lingshan wrote:
>>> This commit introduces struct vhost_vring_call which replaced
>>> raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue.
>>> Besides eventfd_ctx, it contains a spin lock and an
>>> irq_bypass_producer in its structure.
>>>
>>> Signed-off-by: Zhu Lingshan <lingshan.zhu at intel.com>
>>> Suggested-by: Jason Wang <jasowang at redhat.com>...
2020 Aug 05
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...gt;> +{
>>> +??? struct vhost_virtqueue *vq = &v->vqs[qid];
>>> +??? const struct vdpa_config_ops *ops = v->vdpa->config;
>>> +??? struct vdpa_device *vdpa = v->vdpa;
>>> +??? int ret, irq;
>>> +
>>> +??? spin_lock(&vq->call_ctx.ctx_lock);
>>> +??? irq = ops->get_vq_irq(vdpa, qid);
>>> +??? if (!vq->call_ctx.ctx || irq < 0) {
>>> +??????? spin_unlock(&vq->call_ctx.ctx_lock);
>>> +??????? return;
>>> +??? }
>>> +
>>> +??? vq->call_ctx.producer...
2020 Aug 04
0
[PATCH V5 1/6] vhost: introduce vhost_vring_call
On 2020/7/31 ??2:55, Zhu Lingshan wrote:
> This commit introduces struct vhost_vring_call which replaced
> raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue.
> Besides eventfd_ctx, it contains a spin lock and an
> irq_bypass_producer in its structure.
>
> Signed-off-by: Zhu Lingshan <lingshan.zhu at intel.com>
> Suggested-by: Jason Wang <jasowang at redhat.com>
> ---
> drivers/vhost/vdpa.c |...
2020 Jul 17
0
[PATCH V2 1/6] vhost: introduce vhost_call_ctx
On 2020/7/16 ??7:23, Zhu Lingshan wrote:
> This commit introduces struct vhost_call_ctx which replaced
> raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue.
> Besides eventfd_ctx, it contains a spin lock and an
> irq_bypass_producer in its structure.
>
> Signed-off-by: Zhu Lingshan <lingshan.zhu at intel.com>
> Suggested-by: Jason Wang <jasowang at r...
2020 Jul 22
0
[PATCH V3 1/6] vhost: introduce vhost_vring_call
Please ignore this patchset incorrect metadata, will resend soon. Thanks!
On 7/22/2020 5:49 PM, Zhu Lingshan wrote:
> From: Zhu Lingshan <lingshan.zhu at intel.com>
>
> This commit introduces struct vhost_vring_call which replaced
> raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue.
> Besides eventfd_ctx, it contains a spin lock and an
> irq_bypass_producer in its structure.
>
> Signed-off-by: Zhu Lingshan <lingshan.zhu at intel.com>
> Signed-off-by: lszhu <lszhu at localhost.localdomain>
> Signed-off-by: Zhu Lingshan &l...
2020 Aug 05
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...t_virtqueue *vq = &v->vqs[qid];
>>>>> +??? const struct vdpa_config_ops *ops = v->vdpa->config;
>>>>> +??? struct vdpa_device *vdpa = v->vdpa;
>>>>> +??? int ret, irq;
>>>>> +
>>>>> +??? spin_lock(&vq->call_ctx.ctx_lock);
>>>>> +??? irq = ops->get_vq_irq(vdpa, qid);
>>>>> +??? if (!vq->call_ctx.ctx || irq < 0) {
>>>>> + spin_unlock(&vq->call_ctx.ctx_lock);
>>>>> +??????? return;
>>>>> +??? }
>>>>> +
&...
2020 Aug 04
0
[PATCH V5 1/6] vhost: introduce vhost_vring_call
...4 ??4:42, Zhu, Lingshan wrote:
> >
> >
> > On 8/4/2020 4:38 PM, Jason Wang wrote:
> > >
> > > On 2020/7/31 ??2:55, Zhu Lingshan wrote:
> > > > This commit introduces struct vhost_vring_call which replaced
> > > > raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue.
> > > > Besides eventfd_ctx, it contains a spin lock and an
> > > > irq_bypass_producer in its structure.
> > > >
> > > > Signed-off-by: Zhu Lingshan <lingshan.zhu at intel.com>
> > > > Suggested-by: Jason...
2020 Aug 04
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...tatic void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid)
> +{
> + struct vhost_virtqueue *vq = &v->vqs[qid];
> + const struct vdpa_config_ops *ops = v->vdpa->config;
> + struct vdpa_device *vdpa = v->vdpa;
> + int ret, irq;
> +
> + spin_lock(&vq->call_ctx.ctx_lock);
> + irq = ops->get_vq_irq(vdpa, qid);
> + if (!vq->call_ctx.ctx || irq < 0) {
> + spin_unlock(&vq->call_ctx.ctx_lock);
> + return;
> + }
> +
> + vq->call_ctx.producer.token = vq->call_ctx.ctx;
> + vq->call_ctx.producer.irq = irq;
> +...
2020 Aug 04
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...+{
> +??? struct vhost_virtqueue *vq = &v->vqs[qid];
> +??? const struct vdpa_config_ops *ops = v->vdpa->config;
> +??? struct vdpa_device *vdpa = v->vdpa;
> +??? int ret, irq;
> +
> +??? spin_lock(&vq->call_ctx.ctx_lock);
> +??? irq = ops->get_vq_irq(vdpa, qid);
> +??? if (!vq->call_ctx.ctx || irq < 0) {
> +??????? spin_unlock(&vq->call_ctx.ctx_lock);
> +??????? return;
> +??? }
> +
> +??? vq->call_ctx.producer...
2020 Jul 15
0
[PATCH 3/7] vhost_vdpa: implement IRQ offloading functions in vhost_vdpa
...>>> +??? struct vhost_virtqueue *vq = &v->vqs[qid];
>>>>> +??? int ret;
>>>>> +
>>>>> +??? vq_err(vq, "setup irq bypass for vq %d with irq = %d\n", qid,
>>>>> irq);
>>>>> +??? spin_lock(&vq->call_ctx.ctx_lock);
>>>>> +??? if (!vq->call_ctx.ctx)
>>>>> +??????? return;
>>>>> +
>>>>> +??? vq->call_ctx.producer.token = vq->call_ctx.ctx;
>>>>> +??? vq->call_ctx.producer.irq = irq;
>>>>> +??? ret = i...
2020 Sep 09
0
[PATCH] vhost_vdpa: remove unnecessary spin_lock in vhost_vring_call
...> index 3fab94f88894..bc679d0b7b87 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -97,26 +97,20 @@ static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid)
> return;
>
> irq = ops->get_vq_irq(vdpa, qid);
> - spin_lock(&vq->call_ctx.ctx_lock);
> irq_bypass_unregister_producer(&vq->call_ctx.producer);
> - if (!vq->call_ctx.ctx || irq < 0) {
> - spin_unlock(&vq->call_ctx.ctx_lock);
> + if (!vq->call_ctx.ctx || irq < 0)
> return;
> - }
>
> vq->call_ctx.producer.to...
2020 Jul 13
0
[PATCH 3/7] vhost_vdpa: implement IRQ offloading functions in vhost_vdpa
...q(struct vdpa_device *dev, int qid, int irq)
> +{
> + struct vhost_vdpa *v = vdpa_get_drvdata(dev);
> + struct vhost_virtqueue *vq = &v->vqs[qid];
> + int ret;
> +
> + vq_err(vq, "setup irq bypass for vq %d with irq = %d\n", qid, irq);
> + spin_lock(&vq->call_ctx.ctx_lock);
> + if (!vq->call_ctx.ctx)
> + return;
> +
> + vq->call_ctx.producer.token = vq->call_ctx.ctx;
> + vq->call_ctx.producer.irq = irq;
> + ret = irq_bypass_register_producer(&vq->call_ctx.producer);
> + spin_unlock(&vq->call_ctx.ctx_lock);
>...
2020 Jul 15
0
[PATCH 3/7] vhost_vdpa: implement IRQ offloading functions in vhost_vdpa
...vhost_vdpa *v = vdpa_get_drvdata(dev);
>>> +??? struct vhost_virtqueue *vq = &v->vqs[qid];
>>> +??? int ret;
>>> +
>>> +??? vq_err(vq, "setup irq bypass for vq %d with irq = %d\n", qid,
>>> irq);
>>> +??? spin_lock(&vq->call_ctx.ctx_lock);
>>> +??? if (!vq->call_ctx.ctx)
>>> +??????? return;
>>> +
>>> +??? vq->call_ctx.producer.token = vq->call_ctx.ctx;
>>> +??? vq->call_ctx.producer.irq = irq;
>>> +??? ret = irq_bypass_register_producer(&vq->call_ctx...
2020 Jul 17
0
[PATCH V2 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...> return IRQ_HANDLED;
> }
>
> +static void vhost_vdpa_setup_vq_irq(struct vdpa_device *dev, int qid, int irq)
> +{
> + struct vhost_vdpa *v = vdpa_get_drvdata(dev);
> + struct vhost_virtqueue *vq = &v->vqs[qid];
> + int ret;
> +
> + spin_lock(&vq->call_ctx.ctx_lock);
> + if (!vq->call_ctx.ctx) {
> + spin_unlock(&vq->call_ctx.ctx_lock);
> + return;
> + }
I think we can simply remove this check as what is done in
vhost_vdpq_update_vq_irq().
> +
> + vq->call_ctx.producer.token = vq->call_ctx.ctx;
> + vq->ca...
2020 Jul 28
0
[PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...tatic void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, int qid)
> +{
> + struct vhost_virtqueue *vq = &v->vqs[qid];
> + const struct vdpa_config_ops *ops = v->vdpa->config;
> + struct vdpa_device *vdpa = v->vdpa;
> + int ret, irq;
> +
> + spin_lock(&vq->call_ctx.ctx_lock);
> + irq = ops->get_vq_irq(vdpa, qid);
> + if (!vq->call_ctx.ctx || irq == -EINVAL) {
It's better to check returned irq as "irq < 0" to be more robust.
Forcing a specific errno value is not good.
> + spin_unlock(&vq->call_ctx.ctx_lock);
> +...
2020 Aug 05
0
[PATCH 2/2] vhost_vdpa: unified set_vq_irq() and update_vq_irq()
...index 26f166a8192e..044e1f54582a 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -122,8 +122,12 @@ static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid)
> struct vdpa_device *vdpa = v->vdpa;
> int ret, irq;
>
> - spin_lock(&vq->call_ctx.ctx_lock);
> + if (!ops->get_vq_irq)
> + return;
> +
> irq = ops->get_vq_irq(vdpa, qid);
> + spin_lock(&vq->call_ctx.ctx_lock);
> + irq_bypass_unregister_producer(&vq->call_ctx.producer);
> if (!vq->call_ctx.ctx || irq < 0) {
> spin_unlock(&...
2020 Jul 17
0
[PATCH V2 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...+122 drivers/vhost/vdpa.c
117
118 static void vhost_vdpa_setup_vq_irq(struct vdpa_device *dev, int qid, int irq)
119 {
120 struct vhost_vdpa *v = vdpa_get_drvdata(dev);
121 struct vhost_virtqueue *vq = &v->vqs[qid];
> 122 int ret;
123
124 spin_lock(&vq->call_ctx.ctx_lock);
125 if (!vq->call_ctx.ctx) {
126 spin_unlock(&vq->call_ctx.ctx_lock);
127 return;
128 }
129
130 vq->call_ctx.producer.token = vq->call_ctx.ctx;
131 vq->call_ctx.producer.irq = irq;
132 ret = irq_bypass_register_producer(&vq->cal...
2020 Jul 15
0
[PATCH 3/7] vhost_vdpa: implement IRQ offloading functions in vhost_vdpa
On 2020/7/15 ??5:20, Zhu, Lingshan wrote:
>>>>
>>>> I meant something like:
>>>>
>>>> unregister();
>>>> vq->call_ctx.producer.token = ctx;
>>>> register();
>>> This is what we are doing now, or I must missed somethig:
>>> if (ctx && ctx != token) {
>>> ????irq_bypass_unregister_producer(&vq->call_ctx.producer);
>>> ????vq->call_ctx.producer.token =...
2023 Mar 16
1
[PATCH v3 08/11] vdpa: Add eventfd for the vdpa callback
...+)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index dc12dbd5b43b..ae89c0ccc2bb 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -599,9 +599,11 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
> if (vq->call_ctx.ctx) {
> cb.callback = vhost_vdpa_virtqueue_cb;
> cb.private = vq;
> + cb.irq_ctx = vq->call_ctx.ctx;
> } else {
> cb.callback = NULL;
> cb.private = NULL;
> + cb.irq_ctx = NULL;
> }
> ops->set_vq_cb(vdpa, idx, &cb);
>...