[dpdk-dev] [PATCH v8 09/10] eal: replace rte_panic instances in init sequence

Burakov, Anatoly anatoly.burakov at intel.com
Wed Apr 25 15:53:07 CEST 2018


On 25-Apr-18 2:45 PM, Arnon Warshavsky wrote:
> Change some local functions return type from void to int.
> This change does not break ABI as the functions are internal.
> Panic thrown from threads was not handled in this patch
> 
> Signed-off-by: Arnon Warshavsky <arnon at qwilt.com>
> ---

<...>

>   	retval = fcntl(mem_cfg_fd, F_SETLK, &wr_lock);
>   	if (retval < 0){
>   		close(mem_cfg_fd);
> -		rte_exit(EXIT_FAILURE, "Cannot create lock on '%s'. Is another primary "
> -				"process running?\n", pathname);
> +		mem_cfg_fd = -1;
> +		RTE_LOG(CRIT, EAL, "%s(): Cannot create lock on '%s'. Is another primary process running?\n",
> +				__func__, pathname);
> +		return -1;
>   	}
>   
>   	rte_mem_cfg_addr = mmap(NULL, sizeof(*rte_config.mem_config),
>   				PROT_READ | PROT_WRITE, MAP_SHARED, mem_cfg_fd, 0);
>   
>   	if (rte_mem_cfg_addr == MAP_FAILED){
> -		rte_panic("Cannot mmap memory for rte_config\n");
> +		RTE_LOG(CRIT, EAL, "%s(): Cannot mmap memory for rte_config\n",
> +				__func__);
> +		return -1;

Still missing mem_cfg_fd close() and set to -1 here.

Once this is fixed,

Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

And please keep my ack this time :)

-- 
Thanks,
Anatoly


More information about the dev mailing list