@@ -57,7 +57,6 @@ DpdkDevice::DpdkDevice(
5757 configurePort ();
5858 initMemPools (memPoolSize);
5959 setupRxQueues (memPoolSize);
60- configureRSS ();
6160 enablePort ();
6261}
6362
@@ -154,7 +153,9 @@ rte_eth_conf DpdkDevice::createPortConfig()
154153
155154 if (m_supportedRSS) {
156155 portConfig.rxmode .mq_mode = RTE_ETH_MQ_RX_RSS;
156+ portConfig.rx_adv_conf .rss_conf = createRSSConfig ();
157157 } else {
158+ std::cerr << " Skipped RSS hash setting for port " << m_portID << " ." << std::endl;
158159 portConfig.rxmode .mq_mode = RTE_ETH_MQ_RX_NONE;
159160 }
160161
@@ -220,12 +221,9 @@ void DpdkDevice::setupRxQueues(uint16_t memPoolSize)
220221 << " set up. Size of each queue: " << rxQueueSize << std::endl;
221222}
222223
223- void DpdkDevice::configureRSS ()
224+ rte_eth_rss_conf DpdkDevice::createRSSConfig ()
224225{
225- if (!m_supportedRSS) {
226- std::cerr << " Skipped RSS hash setting for port " << m_portID << " ." << std::endl;
227- return ;
228- }
226+ struct rte_eth_rss_conf rssConfig = {};
229227
230228 rte_eth_dev_info rteDevInfo;
231229 if (rte_eth_dev_info_get (m_portID, &rteDevInfo)) {
@@ -249,17 +247,10 @@ void DpdkDevice::configureRSS()
249247 << std::endl;
250248 }
251249
252- struct rte_eth_rss_conf rssConfig = {};
253250 rssConfig.rss_key = m_hashKey.data ();
254251 rssConfig.rss_key_len = rssHashKeySize;
255252 rssConfig.rss_hf = rssOffloads;
256-
257- int ret = rte_eth_dev_rss_hash_update (m_portID, &rssConfig);
258- if (ret < 0 ) {
259- std::cerr << " Setting RSS {" << rssOffloads << " } for port " << m_portID
260- << " failed. Errno:" << ret << std::endl;
261- throw PluginError (" DpdkDevice::configureRSS() has failed." );
262- }
253+ return rssConfig;
263254}
264255
265256void DpdkDevice::enablePort ()
0 commit comments