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

rework termination mac handling #396

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Conversation

KanjiMonster
Copy link
Contributor

@KanjiMonster KanjiMonster commented Oct 27, 2022

Rework termination mac handling by tying termination mac entries to
interfaces:

  • create entries on interface creation
  • remove them on interface deletion

with the values of

  • port_id, vid 0 for the base port/bond interface (specific port, any vlan)
  • port_id, vid for vlan interfaces on top of those (specific port, specific vlan)
  • port_id 0, vid 0 for the base bridge interface (any port, any vlan)
  • port_id 0, vid for vlan interface on top of bridge (any port, specific vlan)

Since these combinations are unique, we can just add/remove the entries
without the need of having refcounts.

Advantages:

  • simplication of code
  • ip addresses assigned to lo will just work

Disadvantages:

  • higher use of termination mac flows, which are limited (0.5k to 1k),
    so only (256 - ports) to (512 - ports) number of vlan/bridge/bond
    interfaces are supported
  • (this is a lie though, since both termination mac entries for an
    interface share the same underlying resource)

Open Questions:

  • Do other parts need termination mac entries, or the underlying
    resources?

Signed-off-by: Jonas Gorski jonas.gorski@bisdn.de

KanjiMonster and others added 12 commits October 14, 2022 10:02
These now work stable, so we don't need to mark them as experimental
anymore.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
KNET interfaces on switch work stable, and offer more throughput and
lower latency, and avoid the issue of traffic to/from controller
overloading the OpenFlow connection.

So switch to them as default.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Add a new function to control wether packets should be marked as
switching offloaded in hardware.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Add a new flag mark_fwd_offload to enable marking switched packets as
offloaded, and default to true.

This flag, when set on packets, will tell the kernel that the packet was
already forwarded/flooded in hardware, and will prevent packet
duplication.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Implement ::set_offloaded for knet_manager by setting the appropriate
flag via /proc.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
mark packets as offloaded when using KNET
Just get the port id once, and check it as needed. Makes the code
slightly less complex.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Add support for setting the port config. For now only support setting a
port up or down by sending an appropriate port_mod message.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
OF-DPA requires the correct (internal) MAC address set for all port_mod
messages, so we need to store it when we first create the port
interfaces.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Propagate port admin config of ports to the switch so they follow the port
admin config in linux.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Any newly created interface will start as being down, so we should make
sure that the configuration in the switch reflects that.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
@KanjiMonster KanjiMonster marked this pull request as draft October 27, 2022 09:01
@KanjiMonster KanjiMonster changed the title Jogo termmac rework rework termination mac handling Oct 27, 2022
cnetlink: propagate admin port config
Rework termination mac handling by tying termination mac entries to
interfaces:

* create entries on interface creation
* remove them on interface deletion

with the values of
* port_id, vid 0 for the base port/bond interface (any vid)
* port_id, vid for vlan interfaces on top of those
* port_id 0, vid 0 for the base bridge interface (any port, any vid)
* port_id 0, vid for vlan interface on top of bridge

Since these combinations are unique, we can just add/remove the entries
without the need of having refcounts.

Advantages:
* simplication of code
* ip addresses assigned to lo will just work

Disadvantages:
* higher use of termination mac flows, which are limited (0.5k to 1k),
  so only (256 - ports) to (512 - ports) number of vlan/bridge/bond
  interfaces are supported
* (this is a lie though, since both termination mac entries for an
  interface share the same underlying resource)

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Base automatically changed from baseboxd-2.0 to main March 17, 2023 16:09
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.

None yet

3 participants