Skip to content

Commit c0c73b2

Browse files
author
Pavel Siska
committed
dpdk: move RSS configuration into port configuration
fix RSS configuration with i40e and multiple RX queues
1 parent 4546ff6 commit c0c73b2

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/plugins/input/dpdk/src/dpdkDevice.cpp

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

265256
void DpdkDevice::enablePort()

src/plugins/input/dpdk/src/dpdkDevice.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class DpdkDevice {
8484
rte_eth_conf createPortConfig();
8585
void initMemPools(uint16_t memPoolSize);
8686
void setupRxQueues(uint16_t memPoolSize);
87-
void configureRSS();
87+
rte_eth_rss_conf createRSSConfig();
8888
void enablePort();
8989
void createRteMempool(uint16_t mempoolSize);
9090
void setRxTimestampDynflag();

0 commit comments

Comments
 (0)