Skip to content

fix dev_info.hash_key_size is 0 init_port_start failed #873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions lib/ff_dpdk_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,27 +656,29 @@ init_port_start(void)
rte_memcpy(pconf->mac,
addr.addr_bytes, RTE_ETHER_ADDR_LEN);

/* Set RSS mode */
uint64_t default_rss_hf = RTE_ETH_RSS_PROTO_MASK;
port_conf.rxmode.mq_mode = RTE_ETH_MQ_RX_RSS;
port_conf.rx_adv_conf.rss_conf.rss_hf = default_rss_hf;
if (dev_info.hash_key_size == 52) {
rsskey = default_rsskey_52bytes;
rsskey_len = 52;
}
if (ff_global_cfg.dpdk.symmetric_rss) {
printf("Use symmetric Receive-side Scaling(RSS) key\n");
rsskey = symmetric_rsskey;
}
port_conf.rx_adv_conf.rss_conf.rss_key = rsskey;
port_conf.rx_adv_conf.rss_conf.rss_key_len = rsskey_len;
port_conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads;
if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
RTE_ETH_RSS_PROTO_MASK) {
printf("Port %u modified RSS hash function based on hardware support,"
"requested:%#"PRIx64" configured:%#"PRIx64"\n",
port_id, default_rss_hf,
port_conf.rx_adv_conf.rss_conf.rss_hf);
if (dev_info.hash_key_size > 0) {
/* Set RSS mode */
uint64_t default_rss_hf = RTE_ETH_RSS_PROTO_MASK;
port_conf.rxmode.mq_mode = RTE_ETH_MQ_RX_RSS;
port_conf.rx_adv_conf.rss_conf.rss_hf = default_rss_hf;
if (dev_info.hash_key_size == 52) {
rsskey = default_rsskey_52bytes;
rsskey_len = 52;
}
if (ff_global_cfg.dpdk.symmetric_rss) {
printf("Use symmetric Receive-side Scaling(RSS) key\n");
rsskey = symmetric_rsskey;
}
port_conf.rx_adv_conf.rss_conf.rss_key = rsskey;
port_conf.rx_adv_conf.rss_conf.rss_key_len = rsskey_len;
port_conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads;
if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
RTE_ETH_RSS_PROTO_MASK) {
printf("Port %u modified RSS hash function based on hardware support,"
"requested:%#"PRIx64" configured:%#"PRIx64"\n",
port_id, default_rss_hf,
port_conf.rx_adv_conf.rss_conf.rss_hf);
}
}

if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) {
Expand Down