> -----Original Message-----
> From: dev <dev-boun...@dpdk.org> On Behalf Of Min Hu (Connor)
> 
> +     if (lcore_id >= RTE_MAX_LCORE) {
> +             RTE_LOG(ERR, GUEST_CHANNEL, "Channel(%u) is out of range
> 0...%d\n",
> +                             lcore_id, RTE_MAX_LCORE-1);
> +             return -1;
> +     }
> +

This looks good.

>       fds.fd = global_fds[lcore_id];
>       fds.events = POLLIN;
> 
<snip>

>       if (global_fds[lcore_id] < 0) {
>               RTE_LOG(ERR, GUEST_CHANNEL, "Channel is not
> connected\n");


Another suggestion if you would like to improve the code, is below,
You can move "global_fds[lcore_id]"  check to immediate after  the line  
"fds.fd = global_fds[lcore_id]; "

Reviewed-by: Reshma Pattan <reshma.pat...@intel.com>

Reply via email to