From: "Govindarajulu Varadarajan (gvaradar)" <gvaradar@cisco.com>
To: "davem@davemloft.net" <davem@davemloft.net>
Cc: "Christian Benvenuti (benve)" <benve@cisco.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net] net: handle 802.1P vlan 0 packets properly
Date: Mon, 10 Jun 2019 23:09:58 +0000 [thread overview]
Message-ID: <441e5d91c8dd70d533dc6ed7ae0f4a9777360874.camel@cisco.com> (raw)
In-Reply-To: <20190610.142810.138225058759413106.davem@davemloft.net>
On Mon, 2019-06-10 at 14:28 -0700, David Miller wrote:
> From: Govindarajulu Varadarajan <gvaradar@cisco.com>
> Date: Mon, 10 Jun 2019 07:27:02 -0700
>
> > When stack receives pkt: [802.1P vlan 0][802.1AD vlan 100][IPv4],
> > vlan_do_receive() returns false if it does not find vlan_dev. Later
> > __netif_receive_skb_core() fails to find packet type handler for
> > skb->protocol 801.1AD and drops the packet.
> >
> > 801.1P header with vlan id 0 should be handled as untagged packets.
> > This patch fixes it by checking if vlan_id is 0 and processes next vlan
> > header.
> >
> > Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
>
> Under Linux we absolutely do not decapsulate the VLAN protocol unless
> a VLAN device is configured on that interface.
Can you clarify on if 802.1P header (with vlan id 0) not supported with inner
802.1Q or 802.1AD header?
We already decapsulate vlan 0 header (802.1P) for all other inner protocols if
vlan 0 device is not present.
For example: pkt - [802.1P vlan 0][IPv4]
In __netif_receive_skb_core():
if (vlan_do_receive(&skb))
goto another_round;
vlan_do_receive() returns false since it did not find VLAN 0 device.
Later, we decapsulate vlan 0 header (802.1P) here:
if (unlikely(skb_vlan_tag_present(skb))) {
if (skb_vlan_tag_get_id(skb)) //False, because vlan id is 0
skb->pkt_type = PACKET_OTHERHOST;
/* Note: we might in the future use prio bits
* and set skb->priority like in vlan_do_receive()
* For the time being, just ignore Priority Code Point
*/
__vlan_hwaccel_clear_tag(skb);
}
Then we deliver packet to packet type handler (IPv4) here:
/* deliver only exact match when indicated */
if (likely(!deliver_exact)) {
deliver_ptype_list_skb(skb, &pt_prev, orig_dev, type,
&ptype_base[ntohs(type) &
PTYPE_HASH_MASK]);
}
deliver_ptype_list_skb(skb, &pt_prev, orig_dev, type,
&orig_dev->ptype_specific);
This does not work if skb->protocol (inner) is 802.1Q or 802.1AD. Since they do
not have packet type handler, pkt is dropped.
Default configuration of our hardware is to priority tag all packets. IMO 802.1P
header with (vlan id 0) should be treated as priority tagged packets, and not as
a vlan tagged packet.
Alternative is, enic driver not setting skb->vlan_tci if vlan_id is 0. IMO driver
should forward pkt as it sees on wire. And stack should handle the headers
properly.
Is there any other way to solve the problem?
prev parent reply other threads:[~2019-06-10 23:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 14:27 [PATCH net] net: handle 802.1P vlan 0 packets properly Govindarajulu Varadarajan
2019-06-10 21:28 ` David Miller
2019-06-10 23:08 ` Stephen Suryaputra
2019-06-11 0:35 ` Christian Benvenuti (benve)
2019-06-11 1:20 ` David Miller
2019-06-10 23:09 ` Govindarajulu Varadarajan (gvaradar) [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=441e5d91c8dd70d533dc6ed7ae0f4a9777360874.camel@cisco.com \
--to=gvaradar@cisco.com \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.