From: Jason Wang <jasowang@redhat.com>
To: "Nikita V. Shirokov" <tehnerd@tehnerd.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
"Michael S. Tsirkin" <mst@redhat.com>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH bpf-next] bpf: fix virtio-net's length calc for XDP_PASS
Date: Mon, 23 Apr 2018 14:33:08 +0800 [thread overview]
Message-ID: <eced76a9-5480-8180-7e5a-84a62d0fdc8b@redhat.com> (raw)
In-Reply-To: <20180423041648.2285-1-tehnerd@tehnerd.com>
On 2018年04月23日 12:16, Nikita V. Shirokov wrote:
> In commit 6870de435b90 ("bpf: make virtio compatible w/
> bpf_xdp_adjust_tail") i didn't account for vi->hdr_len during new
> packet's length calculation after bpf_prog_run in receive_mergeable.
> because of this all packets, if they were passed to the kernel,
> were truncated by 12 bytes.
>
> Fixes:6870de435b90 ("bpf: make virtio compatible w/ bpf_xdp_adjust_tail")
> Reported-by: David Ahern <dsahern@gmail.com>
>
> Signed-off-by: Nikita V. Shirokov <tehnerd@tehnerd.com>
> ---
>
> Notes:
> unfortunately it looks like that xdp_tx is still broken because
> fix by Jason (introduced in "XDP_TX for virtio_net not working in recent kernel?
> " thread) haven't landed yet)
>
> drivers/net/virtio_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 779a4f798522..08ac2cc986aa 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -761,7 +761,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
> /* recalculate len if xdp.data or xdp.data_end were
> * adjusted
> */
> - len = xdp.data_end - xdp.data;
> + len = xdp.data_end - xdp.data + vi->hdr_len;
> /* We can only create skb based on xdp_page. */
> if (unlikely(xdp_page != page)) {
> rcu_read_unlock();
Acked-by: Jason Wang <jasowang@redhat.com>
next prev parent reply other threads:[~2018-04-23 6:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-23 4:16 [PATCH bpf-next] bpf: fix virtio-net's length calc for XDP_PASS Nikita V. Shirokov
2018-04-23 6:33 ` Jason Wang [this message]
2018-04-23 9:30 ` Daniel Borkmann
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=eced76a9-5480-8180-7e5a-84a62d0fdc8b@redhat.com \
--to=jasowang@redhat.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=dsahern@gmail.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=tehnerd@tehnerd.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