Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: config: Add VLAN identifier as network initial configuration #59344

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

luca-fancellu
Copy link
Contributor

Add a new Kconfig parameter NET_CONFIG_MY_VLAN_ID as initial network configuration to enable users to set VLAN identifier at startup.

Add a call in net_config_init_by_iface(...) function to setup the VLAN identifier in the device if the Kconfig parameter is different from zero.

Add a new Kconfig parameter NET_CONFIG_MY_VLAN_ID as initial network
configuration to enable users to set VLAN identifier at startup.

Add a new setup_vlan(...) function to setup the VLAN identifier in
the device, the call have an effect only when NET_CONFIG_MY_VLAN_ID
is above zero.

Signed-off-by: Luca Fancellu <[email protected]>
Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have small reservations for putting VLAN setup to config lib as this allows only one VLAN tag to be set (if that is enough then all is good). That is why I originally did not put any VLAN configuration code here but instead had a samples/net/vlan that shows how the application can setup the tags itself. So this PR certainly works but has limitations.

I think the config library is starting to show its limitations as it only supports to setup one instance of a "thing" only. In the past @cfriedt suggested using dt to configure networking config options and with dt we could have a configuration setup for multiple instances of things. Someone would just need to define dt options for networking.

So +1 from me but with reservations.

@carlescufi carlescufi merged commit 38a43b0 into zephyrproject-rtos:main Jun 21, 2023
@carlescufi
Copy link
Member

I think the config library is starting to show its limitations as it only supports to setup one instance of a "thing" only. In the past @cfriedt suggested using dt to configure networking config options and with dt we could have a configuration setup for multiple instances of things. Someone would just need to define dt options for networking.

Ultimately I think this is going to be the correct solution, because DT is the only way we have to configure multi-instance devices and hardware in general.

@luca-fancellu
Copy link
Contributor Author

@jukkar @carlescufi Hi! Can you point me to the discussion about that? We are definitely interested in setting up more than one device at boot time and we can spend some time for that, I've thought before we could use DT but I was not sure until now, because you mention that.
So if you have already a design I think we can work on that feature, as long as it meets our requirements.
Also, is there a space where people can discuss these kind of things, like a chat or something? A forum?

Thanks :)

@pdgendt
Copy link
Collaborator

pdgendt commented Jun 21, 2023

There is a big reservation with using DT for describing software "metadata" rather than hardware information. See
#49431
#50441
And probably more...

@pdgendt
Copy link
Collaborator

pdgendt commented Jun 21, 2023

Also, is there a space where people can discuss these kind of things, like a chat or something? A forum?

You can join the discord chat (recommended), or use the mailing lists.

@luca-fancellu luca-fancellu deleted the vlan-net-config branch June 21, 2023 08:33
@carlescufi
Copy link
Member

Also, is there a space where people can discuss these kind of things, like a chat or something? A forum?

@luca-fancellu
https://chat.zephyrproject.org/

Then join the #networking channel

@carlescufi
Copy link
Member

There is a big reservation with using DT for describing software "metadata" rather than hardware information. See #49431 #50441 And probably more...

Thanks @pdgendt. I think we are going to have to bring this to the Architecture WG, because USB had the same problem and they ended up using DT for this.
Also see #29750

@pdgendt @rlubos @luca-fancellu @jukkar let's continue the discussion on Discord. @luca-fancellu feel free to start a thread there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants