[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200207.113413.1857068725421133796.davem@davemloft.net>
Date: Fri, 07 Feb 2020 11:34:13 +0100 (CET)
From: David Miller <davem@...emloft.net>
To: haiyangz@...rosoft.com
Cc: sashal@...nel.org, linux-hyperv@...r.kernel.org,
netdev@...r.kernel.org, kys@...rosoft.com, sthemmin@...rosoft.com,
olaf@...fle.de, vkuznets@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] hv_netvsc: Fix XDP refcnt for synthetic and VF NICs
From: Haiyang Zhang <haiyangz@...rosoft.com>
Date: Thu, 6 Feb 2020 14:01:05 -0800
> The caller of XDP_SETUP_PROG has already incremented refcnt in
> __bpf_prog_get(), so drivers should only increment refcnt by
> num_queues - 1.
>
> To fix the issue, update netvsc_xdp_set() to add the correct number
> to refcnt.
>
> Hold a refcnt in netvsc_xdp_set()’s other caller, netvsc_attach().
>
> And, do the same in netvsc_vf_setxdp(). Otherwise, every time when VF is
> removed and added from the host side, the refcnt will be decreased by one,
> which may cause page fault when unloading xdp program.
>
> Fixes: 351e1581395f ("hv_netvsc: Add XDP support")
> Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.com>
Applied, thank you.
Powered by blists - more mailing lists