[PATCH v2 38/45] bus/vmbus: use rte stdatomic API

Long Li longli at microsoft.com
Fri Mar 22 20:34:46 CET 2024


>  static inline void
>  vmbus_set_monitor(const struct vmbus_channel *channel, uint32_t monitor_id)
> {
> -	uint32_t *monitor_addr, monitor_mask;
> +	RTE_ATOMIC(uint32_t) *monitor_addr, monitor_mask;

Does this mean monitor_mask will also change to RTE_ATOMIC(uint32_t)? 

Seems not necessary.

>  	unsigned int trigger_index;
> 
>  	trigger_index = monitor_id / HV_MON_TRIG_LEN;
>  	monitor_mask = 1u << (monitor_id % HV_MON_TRIG_LEN);
> 
> -	monitor_addr = &channel->monitor_page->trigs[trigger_index].pending;
> +	monitor_addr =
> +	    (uint32_t __rte_atomic
> +*)&channel->monitor_page->trigs[trigger_index].pending;
>  	vmbus_sync_set_bit(monitor_addr, monitor_mask);  }
> 
> --
> 1.8.3.1



More information about the dev mailing list