netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: Eric Garver <e@erig.me>
Cc: netdev@vger.kernel.org, pravin shelar <pshelar@ovn.org>
Subject: Re: [PATCH net-next 1/2] openvswitch: remove nonreachable code in vlan parsing
Date: Wed, 5 Oct 2016 14:53:49 +0200	[thread overview]
Message-ID: <20161005145349.51509e00@griffin> (raw)
In-Reply-To: <20161005000618.GN25403@egarver>

On Tue, 4 Oct 2016 20:06:18 -0400, Eric Garver wrote:
> This code is also called for packets passed back down from userspace
> (after the flow key miss and upcall). So it does happen that we have a
> skb without skb->vlan_tci set.

That sucks. The vlan handling should be really consistent, Jiri Pirko
and others put great effort to unify it in the stack, we should make
use of that effort.

I'll respin this patchset and add a patch to make the vlan handling
consistent.

> See the chain:
> ovs_packet_cmd_execute()
>   ovs_flow_key_extract_userspace()
>     key_extract()
>       parse_vlan()
> 
> > Moreover, the likely() statement around skb_vlan_tag_present is bogus. This
> > code is called whenever flow key is being extracted from the packet. The
> > packet may be as likely vlan tagged as not.
> 
> I guess the unlikely scenario is the one I mention above.

But it's wrong. It's also called via

ovs_vport_receive()
  ovs_flow_key_extract()
    key_extract()
      parse_vlan()

and in that path, both cases (vlan vs. non-vlan) are equally possible.

 Jiri

  reply	other threads:[~2016-10-05 12:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 12:30 [PATCH net-next 0/2] openvswitch: vlan fixes Jiri Benc
2016-10-04 12:30 ` [PATCH net-next 1/2] openvswitch: remove nonreachable code in vlan parsing Jiri Benc
2016-10-05  0:06   ` Eric Garver
2016-10-05 12:53     ` Jiri Benc [this message]
2016-10-04 12:30 ` [PATCH net-next 2/2] openvswitch: fix vlan subtraction from packet length Jiri Benc

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=20161005145349.51509e00@griffin \
    --to=jbenc@redhat.com \
    --cc=e@erig.me \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.org \
    /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).