Skip to content

Conversation

@KanjiMonster
Copy link
Contributor

Linux will flood/forward any packets it sees on a bridge by default. This can lead to packet duplication if the packet was already forwarded/flooded by the ASIC. This can be avoided by marking packets as forwarding being offloaded, so tell KNET to mark any received packets as such.

To allow disabling it in case of unexpected side effects, add a flag for controlling the behavior.

The implementation is kept as generic as possible, in case we ever implement it for TAP interfaces as well.

Signed-off-by: Jonas Gorski [email protected]

@KanjiMonster KanjiMonster marked this pull request as draft October 14, 2022 13:56
Add a new function to control wether packets should be marked as
switching offloaded in hardware.

Signed-off-by: Jonas Gorski <[email protected]>
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 <[email protected]>
Implement ::set_offloaded for knet_manager by setting the appropriate
flag via /proc.

Signed-off-by: Jonas Gorski <[email protected]>
@KanjiMonster KanjiMonster force-pushed the jogo_knet_mark_as_offloaded branch from 214f5ce to 5ad9fd3 Compare October 20, 2022 08:07
@KanjiMonster KanjiMonster marked this pull request as ready for review October 20, 2022 08:08
@jklare jklare requested a review from rubensfig October 20, 2022 10:02
Copy link
Contributor

@rubensfig rubensfig left a comment

Choose a reason for hiding this comment

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

LGTM

@rubensfig rubensfig merged commit 9343775 into baseboxd-2.0 Oct 25, 2022
@rubensfig rubensfig deleted the jogo_knet_mark_as_offloaded branch October 25, 2022 07:45
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.

3 participants