netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Tobias Klauser <tklauser@distanz.ch>,
	Network Development <netdev@vger.kernel.org>
Subject: Re: [PATCH net v3 3/5] packet: only allow extra vlan len on ethernet devices
Date: Thu, 12 Nov 2015 00:07:42 +0100	[thread overview]
Message-ID: <5643CA3E.50703@iogearbox.net> (raw)
In-Reply-To: <CA+FuTSeg9tyi+yd+2LuuzPcHs=H4NkPQXqEb+yrR9tQOKqim3A@mail.gmail.com>

On 11/11/2015 11:55 PM, Willem de Bruijn wrote:
> On Wed, Nov 11, 2015 at 5:25 PM, Daniel Borkmann <daniel@iogearbox.net> wrote:
...
>> +       if (!gso_type && (len > dev->mtu + reserve + extra_len) &&
>> +           !packet_extra_vlan_len_allowed(dev, skb)) {
>> +               err = -EMSGSIZE;
>> +               goto out_free;
>
> This nicely reuses the same code in three locations.
>
> If you end up having to send a v4, it would be nice to also fold the
> repeated len check into the shared code. Variable reserve here is
> just dev->hard_header_len. No need to spin a patch just for that
> cleanup, though.

Noted, I was also thinking for net-next to move the tpacket_snd() check
into tpacket_fill_skb(), that would save us to do the likely(tp_len >= 0)
check there. Can take care of both when net-next opens, I feared there
would be critics that it's not ending up minimal enough otherwise. ;)

Thanks,
Daniel

  reply	other threads:[~2015-11-11 23:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 22:25 [PATCH net v3 0/5] packet fixes Daniel Borkmann
2015-11-11 22:25 ` [PATCH net v3 1/5] packet: do skb_probe_transport_header when we actually have data Daniel Borkmann
2015-11-11 22:25 ` [PATCH net v3 2/5] packet: always probe for transport header Daniel Borkmann
2015-11-11 22:25 ` [PATCH net v3 3/5] packet: only allow extra vlan len on ethernet devices Daniel Borkmann
2015-11-11 22:55   ` Willem de Bruijn
2015-11-11 23:07     ` Daniel Borkmann [this message]
2015-11-11 23:11       ` Willem de Bruijn
2015-11-11 22:25 ` [PATCH net v3 4/5] packet: infer protocol from ethernet header if unset Daniel Borkmann
2015-11-11 23:10   ` Willem de Bruijn
2015-11-11 22:25 ` [PATCH net v3 5/5] packet: fix tpacket_snd max frame len Daniel Borkmann
2015-11-11 22:56   ` Willem de Bruijn
2015-11-15 23:01 ` [PATCH net v3 0/5] packet fixes 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=5643CA3E.50703@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=tklauser@distanz.ch \
    --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).