我正在将几个KVM连接到一个被路由到1 1Gbit物理网络的虚拟网络。路由器使用netfilter/iptable来过滤真实网络和虚拟网络之间的通信量。对于虚拟网络交换机,我使用SR和PCI-通。与使用Linux相比,该设置允许更高的吞吐量(受PCIe带宽的限制),并具有较低的CPU开销( Toshiaki Makita 2014年年在日本LinuxCon的演讲的推荐值:PP22-23)。
我已经为每个VM和KVM主机分配了一个来自英特尔I350 NIC端口的VF。(每个I350端口都有最多的7个VFs,因此6个VM+主机是这个虚拟网络的最大大小)。除了一个令人讨厌的怪癖外,此设置正在正常工作:I 350‘S嵌入式交换机只在我将相关的I350物理端口与物理补丁电缆连接到物理外部交换机(所有其他端口都为空)时才能工作。当外部交换机打开时,虚拟网络正常工作;但是当外部交换机关闭时,PF链路状态会改变为“无载波”,并且虚拟网络不再传递数据包。
有没有人知道如何让I 350‘S嵌入式交换机在物理端口上没有活动链接的情况下工作呢?
VM主机运行Debian 10 (Buster),如果这很重要的话。
感谢您所能提供的任何光!
进一步说明:
更新:
ip link set dev eth1 vf 0 trust on
的操作确实有效,因此语法正确,驱动程序也能工作。我很好奇igb驱动程序或I350硬件是否阻止将vf链接状态设置为enable
。以i40e_main.c为例,struct net_device_ops i40e_netdev_ops
包含.ndo_set_vf_link_state = i40e_ndo_set_vf_link_state、.ndo_set_vf_spoofchk = i40e_ndo_set_vf_spoofchk、.ndo_set_vf_trust = i40e_ndo_set_vf_trust,而在国标_main.c struct net_device_ops igb_netdev_op
中有.ndo_set_vf_spoofchk = igb_ndo_set_vf_spoofchk,.ndo_set_vf_trust = igb_ndo_set_vf_trust,但缺少.ndo_set_vf_link_state
。因此,看起来igb
不支持将VF链接状态设置为已启用。I350硬件是否能够支持这一特性是另一个问题。这种启用嵌入式交换机的标准方式似乎不适用于I350。也许还有别的办法?7.3.3.5交换下列规则的TX数据包适用于回送通信:
- Loopback is disabled when the network link is disconnected.
Whereas the [Intel 710 datasheet](https://cdrdv2.intel.com/v1/dl/getContent/332464?wapkw=xl710+datasheet) reads quite differently: Table 1-7. Internal Switching Features Internal switching operates independently of the state of the LAN ports (also when LAN ports are down). It's increasingly looking like the answer to my question is: Yes, an I350 does need an external switch attached in order to switch VM-VM traffic. I'd love for someone to prove me wrong!
发布于 2019-10-01 18:19:43
虽然我不确定这在I350网卡上是否有效,但我认为答案是在ip链接手册页:
vf NUM specify a Virtual Function device to be configured. The associated PF device
must be specified using the dev parameter.
[--cut--]
state auto|enable|disable - set the virtual link state as seen by
the specified VF. Setting to auto means a reflection of the PF link state,
enable lets the VF to communicate with other VFs on this host even
if the PF link state is down, disable causes the HW to drop any packets
sent by the VF.
将VF state
设置为enable
应该强制所有VFs向上运行,而不管链路状态如何,并且允许在它们之间切换,即使没有电缆。
https://serverfault.com/questions/985533
复制相似问题