* How does vlan driver pass vlan info to the h/w ethernet driver
@ 2017-04-28 13:46 carl h
2017-05-01 14:20 ` carl h
0 siblings, 1 reply; 9+ messages in thread
From: carl h @ 2017-04-28 13:46 UTC (permalink / raw)
To: netdev
Desperately need info on this.
I'm trying to implement vlans on a target programmatically.
But first I wanted to set up vlans manually to help get a better
understanding of vlan setup. So I setup a vlan manually on my
development system (ubuntu) using the vconfig/ifconfig command
combination, but using the same command combination on the intended
target doesn't work.
Both systems use the same 8021q driver so the method of informing the
lower level Ethernet driver of the vlan info should be the same (I
would think). After looking at the vlan driver source it appears that
it collects the vlan info and adds the info the sk_buff structure
which is eventually passed to the ethernet driver, but it's not
obvious where the vlan magic is suppose to happen (ethernet driver or
8021q driver).
I looked at the source for the target system’s ethernet driver and it
supports an ioctl method of setting up a vlan. But this does not seem
like the conventional way that Linux sets up a vlan in the ethernet
driver.
By what mechanism does the vlan driver (8021q.ko) tell the Ethernet
hardware about a vlan?
Is it a special api call to the ethernet driver to set up a vlan in
hardware, or should the vlan driver be adding the vlan tags to the
packet?
Any info on vlan implementation would also be helpful too.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How does vlan driver pass vlan info to the h/w ethernet driver
2017-04-28 13:46 How does vlan driver pass vlan info to the h/w ethernet driver carl h
@ 2017-05-01 14:20 ` carl h
2017-05-01 14:37 ` Andrew Lunn
0 siblings, 1 reply; 9+ messages in thread
From: carl h @ 2017-05-01 14:20 UTC (permalink / raw)
To: netdev
I can't seem to get any response to this.
If there is a better place to get help for this question please let me know.
Note: I have already posted the same question in Linux&Users and
StackOverflow without luck either.
On Fri, Apr 28, 2017 at 9:46 AM, carl h <heyen2000@gmail.com> wrote:
> Desperately need info on this.
>
> I'm trying to implement vlans on a target programmatically.
>
> But first I wanted to set up vlans manually to help get a better
> understanding of vlan setup. So I setup a vlan manually on my
> development system (ubuntu) using the vconfig/ifconfig command
> combination, but using the same command combination on the intended
> target doesn't work.
>
> Both systems use the same 8021q driver so the method of informing the
> lower level Ethernet driver of the vlan info should be the same (I
> would think). After looking at the vlan driver source it appears that
> it collects the vlan info and adds the info the sk_buff structure
> which is eventually passed to the ethernet driver, but it's not
> obvious where the vlan magic is suppose to happen (ethernet driver or
> 8021q driver).
>
> I looked at the source for the target system’s ethernet driver and it
> supports an ioctl method of setting up a vlan. But this does not seem
> like the conventional way that Linux sets up a vlan in the ethernet
> driver.
>
> By what mechanism does the vlan driver (8021q.ko) tell the Ethernet
> hardware about a vlan?
>
> Is it a special api call to the ethernet driver to set up a vlan in
> hardware, or should the vlan driver be adding the vlan tags to the
> packet?
>
> Any info on vlan implementation would also be helpful too.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How does vlan driver pass vlan info to the h/w ethernet driver
2017-05-01 14:20 ` carl h
@ 2017-05-01 14:37 ` Andrew Lunn
2017-05-01 14:52 ` carl h
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2017-05-01 14:37 UTC (permalink / raw)
To: carl h; +Cc: netdev
> > By what mechanism does the vlan driver (8021q.ko) tell the Ethernet
> > hardware about a vlan?
Why would the Ethernet hardware need to know?
An Ethernet Switch might need to know. If so, then switchdev would be
used, include/net/switchdev.h
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How does vlan driver pass vlan info to the h/w ethernet driver
2017-05-01 14:37 ` Andrew Lunn
@ 2017-05-01 14:52 ` carl h
2017-05-01 14:57 ` David Miller
2017-05-01 15:02 ` Andrew Lunn
0 siblings, 2 replies; 9+ messages in thread
From: carl h @ 2017-05-01 14:52 UTC (permalink / raw)
To: Andrew Lunn; +Cc: netdev
The Ethernet hardware *is* a 2 port switch in a phone which does support
vlan tag insertion in the switch and driver. The driver is third party which
I'm trying to get working with vlans.
But i can't see how the vlan info propagates down to the switch driver.
On Mon, May 1, 2017 at 10:37 AM, Andrew Lunn <andrew@lunn.ch> wrote:
>> > By what mechanism does the vlan driver (8021q.ko) tell the Ethernet
>> > hardware about a vlan?
>
> Why would the Ethernet hardware need to know?
>
> An Ethernet Switch might need to know. If so, then switchdev would be
> used, include/net/switchdev.h
>
> Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How does vlan driver pass vlan info to the h/w ethernet driver
2017-05-01 14:52 ` carl h
@ 2017-05-01 14:57 ` David Miller
2017-05-01 18:26 ` carl h
2017-05-01 15:02 ` Andrew Lunn
1 sibling, 1 reply; 9+ messages in thread
From: David Miller @ 2017-05-01 14:57 UTC (permalink / raw)
To: heyen2000; +Cc: andrew, netdev
From: carl h <heyen2000@gmail.com>
Date: Mon, 1 May 2017 10:52:17 -0400
> But i can't see how the vlan info propagates down to the switch driver.
Which "VLAN info" are you talking about?
The VLANs configured onto the device itself or the per-packet VLAN
info.
Per-device VLAN configuration is communicated to the netdev driver
via netdev_ops->ndo_vlan_{add,kill}_vid().
Per-packet VLAN information is stored in skb->vlan_{proto,tci}.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How does vlan driver pass vlan info to the h/w ethernet driver
2017-05-01 14:52 ` carl h
2017-05-01 14:57 ` David Miller
@ 2017-05-01 15:02 ` Andrew Lunn
1 sibling, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2017-05-01 15:02 UTC (permalink / raw)
To: carl h; +Cc: netdev
On Mon, May 01, 2017 at 10:52:17AM -0400, carl h wrote:
> The Ethernet hardware *is* a 2 port switch in a phone which does support
> vlan tag insertion in the switch and driver. The driver is third party which
> I'm trying to get working with vlans.
> But i can't see how the vlan info propagates down to the switch driver.
How are you adding the vlan?
bridge vlan add dev port0 vid 42 self
That should call __vlan_add(), which calls __vlan_vid_add() which uses
switchdev to push the VLAN down into the hardware.
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How does vlan driver pass vlan info to the h/w ethernet driver
2017-05-01 14:57 ` David Miller
@ 2017-05-01 18:26 ` carl h
2017-05-01 19:29 ` Andrew Lunn
0 siblings, 1 reply; 9+ messages in thread
From: carl h @ 2017-05-01 18:26 UTC (permalink / raw)
To: David Miller; +Cc: Andrew Lunn, netdev
It appears that the switchdev driver model was introduced after 2.6.39
which is the
kernel version that I'm using unfortunately.
So considering this, and the fact that the switch hardware I'm using has support
for vlan tag insertion, how would it have been accomplished for my version
of the kernel?
Also is it possible to get the vlan driver to insert the vlan tags for
each packet? If so
how can that be accomplished?
Thanks
/carl
On Mon, May 1, 2017 at 10:57 AM, David Miller <davem@davemloft.net> wrote:
> From: carl h <heyen2000@gmail.com>
> Date: Mon, 1 May 2017 10:52:17 -0400
>
>> But i can't see how the vlan info propagates down to the switch driver.
>
> Which "VLAN info" are you talking about?
>
> The VLANs configured onto the device itself or the per-packet VLAN
> info.
>
> Per-device VLAN configuration is communicated to the netdev driver
> via netdev_ops->ndo_vlan_{add,kill}_vid().
>
> Per-packet VLAN information is stored in skb->vlan_{proto,tci}.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How does vlan driver pass vlan info to the h/w ethernet driver
2017-05-01 18:26 ` carl h
@ 2017-05-01 19:29 ` Andrew Lunn
2017-05-01 19:35 ` carl h
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2017-05-01 19:29 UTC (permalink / raw)
To: carl h; +Cc: David Miller, netdev
On Mon, May 01, 2017 at 02:26:52PM -0400, carl h wrote:
> It appears that the switchdev driver model was introduced after 2.6.39
> which is the
> kernel version that I'm using unfortunately.
We cannot help you much is you are using an ancient kernel. Please
upgrade.
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How does vlan driver pass vlan info to the h/w ethernet driver
2017-05-01 19:29 ` Andrew Lunn
@ 2017-05-01 19:35 ` carl h
0 siblings, 0 replies; 9+ messages in thread
From: carl h @ 2017-05-01 19:35 UTC (permalink / raw)
To: Andrew Lunn; +Cc: David Miller, netdev
I was afraid you were going to say that.
Thanks anyways Andrew.
On Mon, May 1, 2017 at 3:29 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> On Mon, May 01, 2017 at 02:26:52PM -0400, carl h wrote:
>> It appears that the switchdev driver model was introduced after 2.6.39
>> which is the
>> kernel version that I'm using unfortunately.
>
> We cannot help you much is you are using an ancient kernel. Please
> upgrade.
>
> Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-05-01 19:35 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-28 13:46 How does vlan driver pass vlan info to the h/w ethernet driver carl h
2017-05-01 14:20 ` carl h
2017-05-01 14:37 ` Andrew Lunn
2017-05-01 14:52 ` carl h
2017-05-01 14:57 ` David Miller
2017-05-01 18:26 ` carl h
2017-05-01 19:29 ` Andrew Lunn
2017-05-01 19:35 ` carl h
2017-05-01 15:02 ` Andrew Lunn
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).