ethtool 手册页只给出了模糊的解释:
rxvlan on|off
Specifies whether RX VLAN acceleration should be enabled
txvlan on|off
Specifies whether TX VLAN acceleration should be enabled
假设您可以启用它们,这些选项究竟完成了什么?
ethtool 手册页只给出了模糊的解释:
rxvlan on|off
Specifies whether RX VLAN acceleration should be enabled
txvlan on|off
Specifies whether TX VLAN acceleration should be enabled
假设您可以启用它们,这些选项究竟完成了什么?
显然,rxvlan
和txvlan
分别是内核特性rx-vlan-hw-parse
和的别名tx-vlan-hw-insert
(参见 参考资料ethtool.c
)。
在内核中,它们被转换为 netdev 特性NETIF_F_HW_VLAN_CTAG_RX_BIT
和NETIF_F_HW_VLAN_CTAG_TX_BIT
. (见net/core/ethtool.c
)
据我所知,TX_BIT 允许 NIC 在传输过程中添加 VLAN 标记,而无需明确将其放入数据包中。参见VLAN 驱动程序中的相关代码。
类似地,当启用 RX_BIT 时,NIC 可以从传入的数据包中剥离 VLAN 标记,并让驱动程序将来自 VLAN 标记的信息放在相关的 skb 中。