Re: [PATCH v3 net-next] virtio-net: support XDP_TX when not more queues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 28 Feb 2021 16:22:47 +0800 Xuan Zhuo wrote:
> +static void virtnet_put_xdp_sq(struct virtnet_info *vi, struct send_queue *sq)
> +{
> +	struct netdev_queue *txq;
> +	unsigned int qp;
> +
> +	if (vi->curr_queue_pairs <= nr_cpu_ids) {
> +		qp = sq - vi->sq;
> +		txq = netdev_get_tx_queue(vi->dev, qp);
> +		__netif_tx_unlock(txq);
> +	}
> +}

Could we potentially avoid sparse warnings on this patch by adding the
right annotations?

I've seen this pattern used in a few places:

void maybe_take_some_lock() 
	__acquires(lock)
{
	if (condition) {
		lock(lock); /* really take the lock */
	} else {
		/* tell sparse we took the lock, but don't really take it */
		__acquire(lock);
	}
}




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux