if_infiniband: Support BPF write for broadcast frames #1591
+52
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is predominantly focused at being able to support DHCP for IPoIB network interfaces utilizing the if_infiniband.c driver.
To do this, DHCP clients and servers require the ability to transmit link-layer broadcasts on the IB interfaces using BPF. In the current driver implementation, this isn't possible as frames transmitted via BPF become mangled (whether using IB or Ethernet headers).
This change updates the if_infiniband driver to be capable of accepting link-layer broadcast requests via BPF using Ethernet formatted frames as this honors the DLT_EN10MB type the driver uses to bind to BPF. Only Broadcast frames can reliably be interpreted using the Ethernet header format so unicast and multicast frames are rejected if passed in using the Ethernet header format. This is, however, sufficient to support the primary DHCP use case this commit aims to address. The ability to support unicast, broadcast or multicast frames should not be impacted if native infiniband header support is added to BPF at a later date.