VLAN即虚拟局域网,是将一个物理的LAN在逻辑上划分成多个广播域的通信技术,功能主要包括VLAN隔离、VLAN卸载。VLAN功能针对不同芯片的设计以及资源呈现给客户的能力可能不一致。
VLAN卸载功能是一种重要的硬件加速技术,它通过将VLAN相关的处理任务从CPU或软件层面转移到硬件组件上执行来提高系统性能和效率。
SP600系列网卡是基于port_vlan和func_vlan表实现VLAN卸载。
VLAN过滤开关支持配置,port_vlan过滤基于各port可配,在ES版本所有port共用一个配置,port间相互影响,vf_vlan过滤基于各func可配,在ES版本只能基于PF配置,VF配置对PF以及该PF下的其他VF有影响,NIC和RoCE开关独立配置。从PPP模块角度出发,VLAN过滤支持Ingress和Egress方向,ES版本仅Egress方向。
TX方向VLAN tag的添加有两种方式:一种是基于软件级别的tag添加;另外一种是基于port级别的tag添加,TX方向的卸载用的是基于软件级别的TAG添加,基于port级别的添加当前默认是关闭的。
协议层发出来的报文首先要基于TX卸载是否开启,需不需要软件进行添加,然后根据芯片的具体配置规则以及port是否添加,最终决定针对VLAN如何做具体处理,具体处理原则如表1所示。
Tag Accept Mode |
Tag inserted by driver? |
vPort base Tag? |
Allow driver? |
Action |
---|---|---|---|---|
accept_tag =0 accept_untag=1 |
No |
No |
yes |
Send the packet as is was |
No |
Yes |
Yes |
Tag inserted by port |
|
Yes – from descriptor |
Yes |
No |
Port VLAN Tag overrides software while keeping software priority |
|
Yes – in packet |
Yes |
No |
Drop packet |
|
Yes (VLAN ID!=0) |
No |
No |
Drop packet |
|
VLAN ID = 0 |
No |
Yes |
Send the packet as is |
|
VLAN ID = 0 |
Yes |
Yes |
Port VLAN Tag overrides software while keeping software priority. this mode is supported only if tag is inserted in the descriptor |
|
accept_tag =1 accept_untag=1 |
X |
Yes |
Unexpected setting |
Undefined(drop packet) |
X |
No |
Yes |
Send the packet as is |
|
accept_tag =1 accept_untag=0 |
X |
Yes |
Unexpected setting |
Undefined(drop packet) |
No |
No |
No |
Drop packet |
|
Yes |
No |
Yes |
Send the packet as is |
|
accept_tag =0 accept_untag=0 |
X |
X |
X |
Illegal configuration (IMP will detected) |
RX方向VLAN卸载是根据VLAN TAG接收参数配置,从接收报文中解析出tag并且写入到RX描述符中,支持的配置选项如下: