diff --git a/ecosystem/ffmpeg_plugin/kahawai_common.c b/ecosystem/ffmpeg_plugin/kahawai_common.c index f23ab796a..b6b9dd193 100644 --- a/ecosystem/ffmpeg_plugin/kahawai_common.c +++ b/ecosystem/ffmpeg_plugin/kahawai_common.c @@ -39,15 +39,19 @@ mtl_handle kahawai_init(char* port, char* local_addr, int enc_session_cnt, param.num_ports = 1; snprintf(param.port[MTL_PORT_P], MTL_PORT_MAX_LEN, "%s", port); + param.pmd[MTL_PORT_P] = mtl_pmd_by_port_name(param.port[MTL_PORT_P]); - if (NULL == local_addr) { - av_log(NULL, AV_LOG_ERROR, "Invalid local IP address\n"); - return NULL; - } else if (sscanf(local_addr, "%hhu.%hhu.%hhu.%hhu", ¶m.sip_addr[MTL_PORT_P][0], - ¶m.sip_addr[MTL_PORT_P][1], ¶m.sip_addr[MTL_PORT_P][2], - ¶m.sip_addr[MTL_PORT_P][3]) != MTL_IP_ADDR_LEN) { - av_log(NULL, AV_LOG_ERROR, "Failed to parse local IP address: %s\n", local_addr); - return NULL; + if (param.pmd[MTL_PORT_P] == MTL_PMD_DPDK_USER) { + /* check ip for dpdk based pmd */ + if (NULL == local_addr) { + av_log(NULL, AV_LOG_ERROR, "Invalid local IP address\n"); + return NULL; + } else if (sscanf(local_addr, "%hhu.%hhu.%hhu.%hhu", ¶m.sip_addr[MTL_PORT_P][0], + ¶m.sip_addr[MTL_PORT_P][1], ¶m.sip_addr[MTL_PORT_P][2], + ¶m.sip_addr[MTL_PORT_P][3]) != MTL_IP_ADDR_LEN) { + av_log(NULL, AV_LOG_ERROR, "Failed to parse local IP address: %s\n", local_addr); + return NULL; + } } if (enc_session_cnt > 0) { diff --git a/include/mtl_api.h b/include/mtl_api.h index 8c8efbbe6..83cb0e18c 100644 --- a/include/mtl_api.h +++ b/include/mtl_api.h @@ -472,7 +472,8 @@ struct mtl_init_params { * Static(default) or DHCP(please make sure you have a DHCP server inside LAN) */ enum mtl_net_proto net_proto[MTL_PORT_MAX]; - /** Mandatory. dpdk user pmd(default) or af_xdp */ + /** Mandatory. dpdk user pmd(default) or af_xdp. Use mtl_pmd_by_port_name helper to get + * PMD type */ enum mtl_pmd_type pmd[MTL_PORT_MAX]; /** * Mandatory. Max NIC tx queues requested the lib to support. diff --git a/lib/src/mt_socket.c b/lib/src/mt_socket.c index f49200817..b6cb16b71 100644 --- a/lib/src/mt_socket.c +++ b/lib/src/mt_socket.c @@ -180,6 +180,10 @@ int mt_socket_get_numa(const char* if_name) { fclose(file); dbg("%s, numa_node %d for %s\n", __func__, numa_node, if_name); + if (SOCKET_ID_ANY == numa_node) { + numa_node = 0; + info("%s, direct soc_id from SOCKET_ID_ANY to 0 for %s\n", __func__, if_name); + } return numa_node; }