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

Add VLAN (802.1q) tag support for all datawidths of LiteethMAC #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jersey99
Copy link
Collaborator

A working ping and UDP on both HW and sim on verilator tun/tap over 2 VLAN tags and IPs.
See bench/sim_xgmii_vlan.py

Currently adding a VLAN tag sets up a new port on a newly added MACVLANCrossbar, with a new IP in that virtual network. This can be modded in the future upon necessity and add more IP addresses within the network.

common.py: Add vlan header related things
core/init.py: Adds a separate instantiator for VLANs LiteEthVLANUDPIPCore
core/{arp/ip}.py: Facilitate the necessary VLAN related modifications
mac/common.py: Update the get_port method of the crossbar to support a fancier dispatcher
liteeth/packet.py: VLAN header is 4 bytes, this is smaller than 8 byte dw of xgmii, so necessary changes to handle packet headers that are less than datawidth are in here. Note that header_words == 0 codepath is basically independent from the previous code, and the new packet.py is backwards compatible.

jersey99 added 2 commits May 24, 2023 13:56
A working ping and UDP on both HW and sim on verilator tun/tap over 2 VLAN tags and IPs.
See bench/sim_xgmii_vlan.py

Currently adding a VLAN tag sets up a new port on a newly added MACVLANCrossbar, with a new IP in that virtual network. This can be modded in the future upon necessity and add more IP addresses within the network.

common.py: Add vlan header related things
core/__init__.py: Adds a separate instantiator for VLANs LiteEthVLANUDPIPCore
core/{arp/ip}.py: Facilitate the necessary VLAN related modifications
mac/common.py: Update the get_port method of the crossbar to support a fancier dispatcher
liteeth/packet.py: VLAN header is 4 bytes, this is smaller than 8 byte dw of xgmii, so necessary changes to handle packet headers that are less than datawidth are in here. Note that header_words == 0 codepath is basically independent from the previous code, and the new packet.py is backwards compatible.
@jersey99 jersey99 requested a review from enjoy-digital May 24, 2023 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant