epair: add VLAN_HWTAGGING
Add capability VLAN_HWTAGGING to the epair interface and enable it by default. When sending a packet over a VLAN interface that uses an epair interface, the flag M_VLANTAG and the ether_vtag (which contains the VLAN ID and/or PCP) are set in the mbuf to inform the hardware that the VLAN header has to be added. The sending epair end does not need to actually add a VLAN header. It can just pass the mbuf with this setting to the other epair end, which receives the packet. The receiving epair end can just pass the mbuf with this setting to the upper layer. Due to this setting, the upper layer believes that there was a VLAN header that has been removed by the interface. If the packet later leaves the host, the outgoing physical interface can add the VLAN header in hardware if it supports VLAN_HWTAGGING. If not, the implementation of Ethernet or bridge adds the VLAN header in software. Reviewed by: zlei, tuexen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52465
This commit is contained in:
committed by
Michael Tuexen
parent
33596d9255
commit
574d46b25a
+19
-1
@@ -25,7 +25,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd September 4, 2025
|
||||
.Dd January 30, 2026
|
||||
.Dt EPAIR 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -113,6 +113,7 @@ The
|
||||
.Nm
|
||||
has RXCSUM and RXCSUM6 enabled because it may receive a packet where the
|
||||
checksum has already been validated by a physical interface.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
supports TXCSUM and TXCSUM6 for TCP and UDP, but only by forwarding the order
|
||||
@@ -131,6 +132,23 @@ enables/disables it on the other end).
|
||||
In case one end is in a bridge and the bridge disabled TXCSUM or TXCSUM6,
|
||||
this avoids a sender to send packets with checksum offloading into the
|
||||
bridge by using the other end.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
supports VLAN_HWTAGGING without actually adding a VLAN tag.
|
||||
The sending
|
||||
.Nm
|
||||
end just forwards the offloading information to the other end.
|
||||
The receiving
|
||||
.Nm
|
||||
end leaves the offloading information set to pretend that there was a VLAN tag
|
||||
in the Ethernet header, which has been removed already.
|
||||
To avoid a situation where the receiving
|
||||
.Nm
|
||||
end has VLAN_HWTAGGING disabled, this capability is synchronized between the
|
||||
.Nm
|
||||
interface pair (i.e., enabling/disabling the capability on one end
|
||||
enables/disables it on the other end).
|
||||
.Sh SEE ALSO
|
||||
.Xr ioctl 2 ,
|
||||
.Xr altq 4 ,
|
||||
|
||||
Reference in New Issue
Block a user