本文介绍了CPU访问是否与网卡不对称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在一台计算机上有2个CPU时,它们是否可以对称访问网卡(PCI)?

When we have 2 CPU on a machine, do they have symmetric access to network cards (PCI)?

本质上,对于数据包处理代码而言,每秒从网卡处理14M数据包,这与它在哪个CPU上运行无关吗?

Essentially, for a packet processing code, processing 14M packet per second from a network card, does that matter on which CPU it runs?

推荐答案

不确定您是否仍需要答案,但是无论如何我都会发布答案,以防其他人可能需要它.而且我假设您是在询问硬件拓扑,而不是OS irq关联性问题.

Not sure if you still need an answer, but I will post an answer anyway in case someone else might need it. And I assume you are asking about hardware topology rather than OS irq affinity problems.

  1. 来自Jerry的评论并非100%正确.虽然NUMA是SMP,但是从不同NUMA节点访问内存和PCIe资源并不对称.与主从AMP架构相对,它是对称的,与资源访问无关.
  2. NIC通常通过PCIe链接连接到CPU(我假设您是在谈论以太网/IP,而不是像InfiniBand这样的HPC互连). PCIe从CPU链接根.例如,英特尔®至强®处理器E5-2699 v4具有30个PCIe v3.0链接,而英特尔X520 QDA-1 10Gbe需要4或8个PCIe v3.0通道才能连接到CPU.
  3. 当PCIe链接直接进入两个CPU时,NIC不能同时连接到两个CPU.它取决于母板配置,哪个PCIe物理插槽连接到哪个CPU插槽,并且由于硬接线而无法轻松切换. PCIe拓扑信息应该在数据表中,或者印在PCIe插槽旁边的主板上(例如CPU1_PCIE8,CPU2_PCIE4).
  1. Comment from Jerry is not 100% correct. While NUMA is SMP, but access to memory and PCIe resources from different NUMA nodes are not symmetric. It's symmetric as opposed to the master-slave AMP architecture, not about resource access.
  2. NIC are typically attached to CPU via PCIe link (I assume you are talking about Ethernet/IP stuff, not some HPC interconnect like InfiniBand). PCIe links root from CPU. For example, Intel® Xeon® Processor E5-2699 v4 has 30 PCIe v3.0 links and Intel X520 QDA-1 10Gbe needs 4 or 8 PCIe v3.0 lanes to connect to the CPU.
  3. A NIC can't be connected to two CPUs at the same time as PCIe link goes directly into the CPU. It depends on the motherboards configuration which PCIe physical slot connects to which CPU socket and it can't be easily switched since it's hardwired. The PCIe topology information should be in the datasheet, or printed on the motherboard next to the PCIe slot (e.g. CPU1_PCIE8, CPU2_PCIE4).

https://www.asus.com/us/Commercial -服务器-工作站/ESC4000_G3S/规格/

http://www.intel. com/content/www/us/en/embedded/products/grantley/specifications.html

  1. 在同一NUMA域中访问NIC比在整个NUMA域中访问NIC更快.可以找到一些性能编号供您参考 http://docplayer.net/5271505-网络功能-虚拟化-虚拟化-bras-with-linux-and-intel-architecture.html .图12-16.
  1. Accessing NIC in the same NUMA domain is faster than across NUMA domain. Some performance number for your reference could be found http://docplayer.net/5271505-Network-function-virtualization-virtualized-bras-with-linux-and-intel-architecture.html. Figure 12-16.

总而言之,请始终在同一NUMA节点内使用具有NIC的内核,以获取最佳性能.

In summary, always use cores with NIC within the same NUMA node if possible to gain best performance.

这篇关于CPU访问是否与网卡不对称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:57
查看更多