* vlan tagging problem
@ 2017-04-11 19:36 carl h
2017-04-11 20:49 ` Greg Rose
2017-04-12 9:45 ` Michal Kubecek
0 siblings, 2 replies; 3+ messages in thread
From: carl h @ 2017-04-11 19:36 UTC (permalink / raw)
To: netdev
Hi
Hope this is right place to ask this. Looking for help regarding vlan
tagging done by the 8021q driver.
I tried to manually configure a vlan on my target device. I use these
2 vlan config commands, then I ping an IP address and sniff the
packets to look for the vlan tag in the messages.
vconfig add esw0
ifconfig esw0.10 10.93.1.2 netmask 255.255.255.0
Despite my attempts, tagging does not occur in any outgoing packets.
However when I tried the exact same method and commands on my Ubuntu
workstation vlan tagging did work without problems.
Target: mips32, Linux 2.6.39, 802.1Q driver version 1.8
I have looked at the source for the 8021q.ko driver and I keep running
into a dead end trying to figure out where the 4 bytes of vlan data
gets added to the IP header. There are 2 key functions where vlan
information is deciphered and added to a structure that contains vlan
info, but the information never gets added to the header for some
reason.
vlan_dev_hard_header()
vlan_dev_hard_start_xmit()
It is clear in the code where vlan information in receive packets gets
removed, but not so clear in the transmit direction where this is
supposed to happen.
Could someone explain to me what I'm missing, and where and how vlan
info gets added to the header for outgoing packets?
thx
/carl
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: vlan tagging problem
2017-04-11 19:36 vlan tagging problem carl h
@ 2017-04-11 20:49 ` Greg Rose
2017-04-12 9:45 ` Michal Kubecek
1 sibling, 0 replies; 3+ messages in thread
From: Greg Rose @ 2017-04-11 20:49 UTC (permalink / raw)
To: carl h; +Cc: netdev
On Tue, 2017-04-11 at 15:36 -0400, carl h wrote:
> Hi
>
> Hope this is right place to ask this. Looking for help regarding vlan
> tagging done by the 8021q driver.
>
> I tried to manually configure a vlan on my target device. I use these
> 2 vlan config commands, then I ping an IP address and sniff the
> packets to look for the vlan tag in the messages.
>
> vconfig add esw0
> ifconfig esw0.10 10.93.1.2 netmask 255.255.255.0
>
> Despite my attempts, tagging does not occur in any outgoing packets.
> However when I tried the exact same method and commands on my Ubuntu
> workstation vlan tagging did work without problems.
>
> Target: mips32, Linux 2.6.39, 802.1Q driver version 1.8
>
> I have looked at the source for the 8021q.ko driver and I keep running
> into a dead end trying to figure out where the 4 bytes of vlan data
> gets added to the IP header. There are 2 key functions where vlan
> information is deciphered and added to a structure that contains vlan
> info, but the information never gets added to the header for some
> reason.
>
> vlan_dev_hard_header()
> vlan_dev_hard_start_xmit()
>
> It is clear in the code where vlan information in receive packets gets
> removed, but not so clear in the transmit direction where this is
> supposed to happen.
>
> Could someone explain to me what I'm missing, and where and how vlan
> info gets added to the header for outgoing packets?
>
> thx
> /carl
The Ethernet HW probably inserts the VLAN tag for you as an 'offload'.
Run 'ethtool -k <interface>' and check the offloads. You can change the
offload settings with 'ethtool -K..'.
- Greg Rose
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: vlan tagging problem
2017-04-11 19:36 vlan tagging problem carl h
2017-04-11 20:49 ` Greg Rose
@ 2017-04-12 9:45 ` Michal Kubecek
1 sibling, 0 replies; 3+ messages in thread
From: Michal Kubecek @ 2017-04-12 9:45 UTC (permalink / raw)
To: netdev; +Cc: carl h
On Tue, Apr 11, 2017 at 03:36:50PM -0400, carl h wrote:
>
> I tried to manually configure a vlan on my target device. I use these
> 2 vlan config commands, then I ping an IP address and sniff the
> packets to look for the vlan tag in the messages.
>
> vconfig add esw0
> ifconfig esw0.10 10.93.1.2 netmask 255.255.255.0
I would rather suggest
ip link add esw0.10 link esw0 type vlan id 10
ip addr add 10.93.1.2/24 brd + dev esw0.10
ip link set esw0.10 up
> Despite my attempts, tagging does not occur in any outgoing packets.
How do you check? If with tcpdump, on which interface?
> However when I tried the exact same method and commands on my Ubuntu
> workstation vlan tagging did work without problems.
>
> Target: mips32, Linux 2.6.39, 802.1Q driver version 1.8
With older versions of libpcap, tcpdump wouldn't show VLAN tags if vlan
information was passed in metadata rather than as a tag in packet itself
(which is usually the case when outgoing/incoming device supports
hardware vlan tagging/stripping). Make sure this is not your case.
Michal Kubecek
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-12 9:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-11 19:36 vlan tagging problem carl h
2017-04-11 20:49 ` Greg Rose
2017-04-12 9:45 ` Michal Kubecek
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).