From: David Miller <davem@davemloft.net>
To: haiyangz@microsoft.com
Cc: sashal@kernel.org, linux-hyperv@vger.kernel.org,
netdev@vger.kernel.org, kys@microsoft.com,
sthemmin@microsoft.com, olaf@aepfle.de, vkuznets@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] hv_netvsc: Fix XDP refcnt for synthetic and VF NICs
Date: Fri, 07 Feb 2020 11:34:13 +0100 (CET) [thread overview]
Message-ID: <20200207.113413.1857068725421133796.davem@davemloft.net> (raw)
In-Reply-To: <1581026465-36161-1-git-send-email-haiyangz@microsoft.com>
From: Haiyang Zhang <haiyangz@microsoft.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@microsoft.com>
Applied, thank you.
prev parent reply other threads:[~2020-02-07 10:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 22:01 [PATCH net] hv_netvsc: Fix XDP refcnt for synthetic and VF NICs Haiyang Zhang
2020-02-07 10:34 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200207.113413.1857068725421133796.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=sashal@kernel.org \
--cc=sthemmin@microsoft.com \
--cc=vkuznets@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).