From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Network Development <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net 2/2] packet: round up linear to header len
Date: Wed, 8 Feb 2017 08:58:51 -0800 [thread overview]
Message-ID: <20170208165851.GG30741@oracle.com> (raw)
In-Reply-To: <CAF=yD-KoijEsct9YWm5zK3F7Eas3GS+=5zks7-fZw-bgZhi-3Q@mail.gmail.com>
On (02/08/17 08:37), Willem de Bruijn wrote:
> Date: Wed, 8 Feb 2017 08:37:19 -0800
> From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
> To: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> Cc: Network Development <netdev@vger.kernel.org>, David Miller
> <davem@davemloft.net>, Eric Dumazet <eric.dumazet@gmail.com>, Dmitry
> Vyukov <dvyukov@google.com>, Willem de Bruijn <willemb@google.com>
> Subject: Re: [PATCH net 2/2] packet: round up linear to header len
>
> On Wed, Feb 8, 2017 at 7:34 AM, Sowmini Varadhan
> <sowmini.varadhan@oracle.com> wrote:
> > On (02/07/17 15:57), Willem de Bruijn wrote:
> >> @@ -2816,8 +2816,9 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
> >> err = -ENOBUFS;
> >> hlen = LL_RESERVED_SPACE(dev);
> >> tlen = dev->needed_tailroom;
> >> - skb = packet_alloc_skb(sk, hlen + tlen, hlen, len,
> >> - __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len),
> >> + linear = __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len);
> >> + linear = max(linear, min_t(int, len, dev->hard_header_len));
> >> + skb = packet_alloc_skb(sk, hlen + tlen, hlen, len, linear,
> >> msg->msg_flags & MSG_DONTWAIT, &err);
> >
:
> Do you mean the difference that it unconditionally pulls
> hard_header_len, optionally with zero padding, whereas this new
> path can check against new min_header_len and thus allows
> packets shorter than hard_header_len?
yes, maybe it doesnt matter, becaues hard_header_len >= min_header_len
at all times
--Sowmini
next prev parent reply other threads:[~2017-02-08 16:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 20:57 [PATCH net 0/2] Fixes for header length truncation Willem de Bruijn
2017-02-07 20:57 ` [PATCH net 1/2] net: introduce device min_header_len Willem de Bruijn
2017-02-07 21:20 ` Eric Dumazet
2017-02-07 21:24 ` Sowmini Varadhan
2017-02-07 20:57 ` [PATCH net 2/2] packet: round up linear to header len Willem de Bruijn
2017-02-07 21:23 ` Eric Dumazet
2017-02-08 15:34 ` Sowmini Varadhan
2017-02-08 16:37 ` Willem de Bruijn
2017-02-08 16:58 ` Sowmini Varadhan [this message]
2017-02-08 17:27 ` Willem de Bruijn
2017-02-08 18:56 ` [PATCH net 0/2] Fixes for header length truncation David Miller
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=20170208165851.GG30741@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=davem@davemloft.net \
--cc=dvyukov@google.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.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).