Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly do the rx-vlan-offload and tx-vlan-offload ethtool options do?

The ethtool manpage only gives a nebulous explanation:

   rxvlan on|off
          Specifies whether RX VLAN acceleration should be enabled

   txvlan on|off
          Specifies whether TX VLAN acceleration should be enabled

What exactly do the options accomplish, assuming you can enable them?

like image 271
Christian Avatar asked Dec 20 '16 23:12

Christian


1 Answers

Apparently, rxvlan and txvlan are aliases for the kernel features rx-vlan-hw-parse and tx-vlan-hw-insert respectively (see ethtool.c).

In the kernel they are translated to the netdev features NETIF_F_HW_VLAN_CTAG_RX_BIT and NETIF_F_HW_VLAN_CTAG_TX_BIT. (See net/core/ethtool.c)

To the best of my knowledge, the TX_BIT allows the NIC to add the VLAN tag during transmission without explicitly placing it in the packet. See the relevant code in the VLAN driver.

Similarly, when the RX_BIT is enabled, the NIC can strip the VLAN tag from incoming packets and let the driver place the information from the VLAN tag in the relevant skb.

like image 156
haggai_e Avatar answered Sep 17 '22 21:09

haggai_e