[PATCH v1] net/iavf: fix race condition for multi-cores

Stephen Hemminger stephen at networkplumber.org
Thu May 19 05:13:04 CEST 2022


On Thu, 19 May 2022 09:19:59 +0800
Wenjun Wu <wenjun1.wu at intel.com> wrote:

>  	if (dev->data->dev_conf.rxmode.offloads &
> -	    RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
> -		if (iavf_get_phc_time(adapter)) {
> -			PMD_DRV_LOG(ERR, "get physical time failed");
> -			goto err_mac;
> -		}
> -		adapter->hw_time_update = rte_get_timer_cycles() / (rte_get_timer_hz() / 1000);
> -	}
> +	    RTE_ETH_RX_OFFLOAD_TIMESTAMP)
> +		rte_spinlock_init(&vf->phc_time_aq_lock);

Be safe just always init the spin_lock. It is just a simple assignment.


More information about the dev mailing list