Thread (2 messages) 2 messages, 2 authors, 2020-07-15

Re: [PATCH 3/7] vhost_vdpa: implement IRQ offloading functions in vhost_vdpa

From: Zhu, Lingshan <hidden>
Date: 2020-07-15 11:12:11
Also in: kvm, virtualization

On 7/15/2020 5:42 PM, Jason Wang wrote:
On 2020/7/15 下午5:20, Zhu, Lingshan wrote:
quoted
quoted
quoted
quoted
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 = ctx;
    irq_bypass_register_producer(&vq->call_ctx.producer);

}

It just unregister and register.

I meant there's probably no need for the check and another check and 
unregister before. The whole function is as simple as I suggested 
above.

Thanks
IMHO we still need the checks, this function handles three cases:
(1)if the ctx == token, we do nothing. For this unregister and 
register can work, but waste of time.

But we have a more simple code and we don't care about the performance 
here since the operations is rare.

quoted
(2)if token exists but ctx is NULL, this means user space issued an 
unbind, so we need to only unregister the producer.

Note that the register/unregister have a graceful check of whether or 
not there's a token.

quoted
(3)if ctx exists and ctx!=token, this means there is a new ctx, we 
need to update producer by unregister and register.

I think we can not simply handle all these cases by "unregister and 
register".

So it looks to me the functions are equivalent.

Thanks
Sounds reasonable, thanks!
quoted
Thanks,
BR
Zhu Lingshan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help