Re: [PATCH vhost 12/22] virtio_net: xsk: bind/unbind xsk

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

 



On Wed, Oct 11, 2023 at 05:27:18PM +0800, Xuan Zhuo wrote:

...

> +static int virtnet_xsk_pool_disable(struct net_device *dev, u16 qid)
> +{
> +	struct virtnet_info *vi = netdev_priv(dev);
> +	struct device *dma_dev;
> +	struct virtnet_rq *rq;
> +	struct virtnet_sq *sq;
> +	int err1, err2;
> +
> +	if (qid >= vi->curr_queue_pairs)
> +		return -EINVAL;
> +
> +	sq = &vi->sq[qid];
> +	rq = &vi->rq[qid];
> +
> +	dma_dev = virtqueue_dma_dev(rq->vq);
> +
> +	dma_unmap_single(dma_dev, sq->xsk.hdr_dma_address, vi->hdr_len, DMA_TO_DEVICE);
> +
> +	xsk_pool_dma_unmap(sq->xsk.pool, 0);

nit: the line above makes Sparse a bit unhappy:

 .../xsk.c:168:35: warning: incorrect type in argument 1 (different address spaces)
 .../xsk.c:168:35:    expected struct xsk_buff_pool *pool
 .../xsk.c:168:35:    got struct xsk_buff_pool [noderef] __rcu *pool

> +
> +	/* Sync with the XSK wakeup and with NAPI. */
> +	synchronize_net();
> +
> +	err1 = virtnet_sq_bind_xsk_pool(vi, sq, NULL);
> +	err2 = virtnet_rq_bind_xsk_pool(vi, rq, NULL);
> +
> +	return err1 | err2;
> +}

...




[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