Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1461262
| From | Stephen Hemminger <stephen@networkplumber.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal |
| Date | 2016-08-12 16:50 +0200 |
| Message-ID | <s5lWy-2UE-31@gated-at.bofh.it> (permalink) |
| References | <s4VSv-2Iy-13@gated-at.bofh.it> <s4VSv-2Iy-11@gated-at.bofh.it> <s4WEN-3hd-5@gated-at.bofh.it> <s4X7P-3Hm-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, 11 Aug 2016 14:09:53 +0200
Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
> Yuval Mintz <Yuval.Mintz@qlogic.com> writes:
>
> >> +static void netvsc_inject_enable(struct net_device_context
> >> +*net_device_ctx) {
> >> + net_device_ctx->vf_inject = true;
> >> +}
> >> +
> >> +static void netvsc_inject_disable(struct net_device_context
> >> +*net_device_ctx) {
> >> + net_device_ctx->vf_inject = false;
> >> +
> >> + /* Wait for currently active users to drain out. */
> >> + while (atomic_read(&net_device_ctx->vf_use_cnt) != 0)
> >> + udelay(50);
> >> +}
> >
> > That was already the behavior before, but are you certain you
> > want to unconditionally block without any possible timeout?
>
> Yes, this is OK. After PATCH4 of this series there is only one place
> which takes the vf_use_cnt (netvsc_recv_callback()) and it is an
> interrupt handler, there are no sleepable operations there.
>
Since network devices are protected by RCU, it looks like the refcount
is not necessary. I think vf_inject flag and vf_use_cnt could just be replaced
by doing RCU on vf_netdev.
The callback is invoked from tasklet (softirq) context.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-08-11 13:00 +0200
RE: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal Yuval Mintz <Yuval.Mintz@qlogic.com> - 2016-08-11 13:50 +0200
Re: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-08-11 14:20 +0200
Re: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal Stephen Hemminger <stephen@networkplumber.org> - 2016-08-12 16:50 +0200
Re: [PATCH net 2/4] hv_netvsc: reset vf_inject on VF removal David Miller <davem@davemloft.net> - 2016-08-13 05:50 +0200
[RFC 2/2] netvsc: use RCU for VF net device reference Stephen Hemminger <stephen@networkplumber.org> - 2016-08-14 13:20 +0200
Re: [RFC 2/2] netvsc: use RCU for VF net device reference Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-08-15 12:10 +0200
[RFC 1/2] netvsc: reference counting fix Stephen Hemminger <stephen@networkplumber.org> - 2016-08-14 13:30 +0200
Re: [RFC 1/2] netvsc: reference counting fix David Miller <davem@davemloft.net> - 2016-08-15 06:40 +0200
csiph-web