In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about the network card multi-queue technology and RSS functions of the sample analysis content. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Multi-queue network card is a technology, which is originally used to solve the problem of network IO QoS (quality of service). Later, with the continuous improvement of the bandwidth of network IO, single-core CPU can not fully meet the needs of network card. Through the support of multi-queue network card driver, each queue is bound to different cores through interruption to meet the needs of network card.
1. Hardware implementation of multi-queue network card
Figure 1.1 is a hardware logic diagram of Intel 82575 with four hardware queues. When a message is received, a stream will always receive the same queue through the SIP, Sport, DIP, DPort quadruple of the hash packet header. The interrupt bound to the queue is also triggered.
Figure 1.182575 hardware logic diagram
two。 What is RSS?
RSS (Receive Side Scaling) is a network card driver technology that can efficiently distribute received messages among multiple CPU in a multiprocessor system.
The network card parses the received message to obtain the IP address, protocol and port five-tuple information.
Through the configured HASH function, the network card calculates the Hash value according to the five-tuple information, or it can be calculated according to the two, three or four tuples.
Take the lower bits of the HASH value (this specific network card may be different) as the index of RETA (redirection table)
Distribute to the corresponding CPU according to the values stored in RETA
The following figure describes the complete process flow:
Programs based on RSS technology can distribute data streams among multiple CPU through hardware, and can achieve dynamic load balancing by modifying RETA.
3. Configure RSS in DPDK
DPDK supports setting static hash values and configuring RETA. However, RSS in DPDK is port-based and distributes messages according to the receiving queue of the port. For example, if we configure three receive queues on a port and turn on RSS, this is what it looks like:
{0,1,2,0,1,2,0.}
Applications running on different CPU receive messages from different receiving queues, thus achieving the effect of message distribution.
In DPDK, enable the RSS function by setting the mq_mode field in rte_eth_conf, rx_mode.mq_mode = ETH_MQ_RX_RSS.
When the RSS function is enabled, the hash value calculated by RSS will be stored in the rte_pktmbuf corresponding to the message, which can be accessed through pktmbuf.hash.rss. This value can be directly used in subsequent message processing without recalculating the hash value, such as fast forwarding, identifying message flow, and so on.
RETA is run-time configurable, so that applications can dynamically change the receiving queue corresponding to CPU, thus dynamically adjusting message distribution. It is configured specifically through the drivers of the PMD module, such as ixgbe_dev_rss_reta_update and ixgbe_dev_rss_reta_query.
Thank you for reading! On the "network card multi-queue technology and RSS function example analysis" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.