diff options
author | Matias Elo <matias.elo@nokia.com> | 2021-06-10 09:17:25 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-06-11 12:57:00 +0300 |
commit | 7b514df6d33dec2114ae35861dc285c4a94dfa85 (patch) | |
tree | cdac3793e94d0b41d700e10e3fbe29e684b0dcd1 | |
parent | 5aeb1e9968a6a232850e0f8160b24a2a87e426b9 (diff) |
linux-dpdk: pktio: don't fail on unsupported input hash protocol
Since there is no capability for the supported input hash protocols it's
better to just print a debug message instead of fail
odp_pktin_queue_config() if an unsupported input hash protocol was
selected.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
-rw-r--r-- | platform/linux-dpdk/odp_packet_dpdk.c | 60 |
1 files changed, 24 insertions, 36 deletions
diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c index 44a2d39a3..ee72e9d10 100644 --- a/platform/linux-dpdk/odp_packet_dpdk.c +++ b/platform/linux-dpdk/odp_packet_dpdk.c @@ -355,8 +355,8 @@ static void _dpdk_print_port_mac(uint16_t port_id) eth_addr.addr_bytes[5]); } -static int check_hash_proto(pktio_entry_t *pktio_entry, - const odp_pktin_queue_param_t *p) +static void check_hash_proto(pktio_entry_t *pktio_entry, + const odp_pktin_queue_param_t *p) { struct rte_eth_dev_info dev_info; uint64_t rss_hf_capa; @@ -366,48 +366,37 @@ static int check_hash_proto(pktio_entry_t *pktio_entry, rte_eth_dev_info_get(port_id, &dev_info); rss_hf_capa = dev_info.flow_type_rss_offloads; + /* Print debug info about unsupported hash protocols. Unsupported + * protocols are later filtered out by dpdk_setup_eth_dev(). */ if (p->hash_proto.proto.ipv4 && - ((rss_hf_capa & ETH_RSS_IPV4) == 0)) { - ODP_ERR("hash_proto.ipv4 not supported\n"); - return -1; - } + ((rss_hf_capa & ETH_RSS_IPV4) == 0)) + ODP_PRINT("DPDK: hash_proto.ipv4 not supported (rss_hf_capa 0x%" PRIx64 ")\n", + rss_hf_capa); if (p->hash_proto.proto.ipv4_udp && - ((rss_hf_capa & ETH_RSS_NONFRAG_IPV4_UDP) == 0)) { - ODP_ERR("hash_proto.ipv4_udp not supported. " - "rss_hf_capa 0x%" PRIx64 "\n", rss_hf_capa); - return -1; - } + ((rss_hf_capa & ETH_RSS_NONFRAG_IPV4_UDP) == 0)) + ODP_PRINT("DPDK: hash_proto.ipv4_udp not supported (rss_hf_capa 0x%" PRIx64 ")\n", + rss_hf_capa); if (p->hash_proto.proto.ipv4_tcp && - ((rss_hf_capa & ETH_RSS_NONFRAG_IPV4_TCP) == 0)) { - ODP_ERR("hash_proto.ipv4_tcp not supported. " - "rss_hf_capa 0x%" PRIx64 "\n", rss_hf_capa); - return -1; - } + ((rss_hf_capa & ETH_RSS_NONFRAG_IPV4_TCP) == 0)) + ODP_PRINT("DPDK: hash_proto.ipv4_tcp not supported (rss_hf_capa 0x%" PRIx64 ")\n", + rss_hf_capa); if (p->hash_proto.proto.ipv6 && - ((rss_hf_capa & ETH_RSS_IPV6) == 0)) { - ODP_ERR("hash_proto.ipv6 not supported. " - "rss_hf_capa 0x%" PRIx64 "\n", rss_hf_capa); - return -1; - } + ((rss_hf_capa & ETH_RSS_IPV6) == 0)) + ODP_PRINT("DPDK: hash_proto.ipv6 not supported (rss_hf_capa 0x%" PRIx64 ")\n", + rss_hf_capa); if (p->hash_proto.proto.ipv6_udp && - ((rss_hf_capa & ETH_RSS_NONFRAG_IPV6_UDP) == 0)) { - ODP_ERR("hash_proto.ipv6_udp not supported. " - "rss_hf_capa 0x%" PRIx64 "\n", rss_hf_capa); - return -1; - } + ((rss_hf_capa & ETH_RSS_NONFRAG_IPV6_UDP) == 0)) + ODP_PRINT("DPDK: hash_proto.ipv6_udp not supported (rss_hf_capa 0x%" PRIx64 ")\n", + rss_hf_capa); if (p->hash_proto.proto.ipv6_tcp && - ((rss_hf_capa & ETH_RSS_NONFRAG_IPV6_TCP) == 0)) { - ODP_ERR("hash_proto.ipv6_tcp not supported. " - "rss_hf_capa 0x%" PRIx64 "\n", rss_hf_capa); - return -1; - } - - return 0; + ((rss_hf_capa & ETH_RSS_NONFRAG_IPV6_TCP) == 0)) + ODP_PRINT("DPDK: hash_proto.ipv6_tcp not supported (rss_hf_capa 0x%" PRIx64 ")\n", + rss_hf_capa); } static int dpdk_input_queues_config(pktio_entry_t *pktio_entry, @@ -416,9 +405,8 @@ static int dpdk_input_queues_config(pktio_entry_t *pktio_entry, odp_pktin_mode_t mode = pktio_entry->s.param.in_mode; uint8_t lockless; - if (p->hash_enable && p->num_queues > 1 && - check_hash_proto(pktio_entry, p)) - return -1; + if (p->hash_enable) + check_hash_proto(pktio_entry, p); /** * Scheduler synchronizes input queue polls. Only single thread |