linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the vhost tree with the net-next tree
@ 2016-06-16  4:19 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2016-06-16  4:19 UTC (permalink / raw)
  To: Michael S. Tsirkin, David Miller, netdev; +Cc: linux-next, linux-kernel

Hi Michael,

Today's linux-next merge of the vhost tree got a conflict in:

  tools/virtio/ringtest/Makefile

between commit:

  9fb6bc5b4a78 ("ptr_ring: ring test")

from the net-next tree and commit:

  139ab4d4e68b ("tools/virtio: add noring tool")

from the vhost tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/virtio/ringtest/Makefile
index 50e086c6a7b6,6173adae9f08..000000000000
--- a/tools/virtio/ringtest/Makefile
+++ b/tools/virtio/ringtest/Makefile
@@@ -1,6 -1,6 +1,6 @@@
  all:
  
- all: ring virtio_ring_0_9 virtio_ring_poll virtio_ring_inorder ptr_ring
 -all: ring virtio_ring_0_9 virtio_ring_poll virtio_ring_inorder noring
++all: ring virtio_ring_0_9 virtio_ring_poll virtio_ring_inorder ptr_ring noring
  
  CFLAGS += -Wall
  CFLAGS += -pthread -O2 -ggdb
@@@ -16,13 -15,13 +16,15 @@@ ring: ring.o main.
  virtio_ring_0_9: virtio_ring_0_9.o main.o
  virtio_ring_poll: virtio_ring_poll.o main.o
  virtio_ring_inorder: virtio_ring_inorder.o main.o
 +ptr_ring: ptr_ring.o main.o
+ noring: noring.o main.o
  clean:
  	-rm main.o
  	-rm ring.o ring
  	-rm virtio_ring_0_9.o virtio_ring_0_9
  	-rm virtio_ring_poll.o virtio_ring_poll
  	-rm virtio_ring_inorder.o virtio_ring_inorder
 +	-rm ptr_ring.o ptr_ring
+ 	-rm noring.o noring
  
  .PHONY: all clean

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the vhost tree with the net-next tree
@ 2019-04-03  4:22 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2019-04-03  4:22 UTC (permalink / raw)
  To: Michael S. Tsirkin, David Miller, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Florian Westphal

[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]

Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

  drivers/net/virtio_net.c

between commit:

  6b16f9ee89b8 ("net: move skb->xmit_more hint to softnet data")

from the net-next tree and commit:

  916faccfe56d ("virtio-net: bql support")

from the vhost tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/virtio_net.c
index ba246fc475ae,955b3e76eb8d..000000000000
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@@ -1568,13 -1571,15 +1572,15 @@@ static netdev_tx_t start_xmit(struct sk
  	struct send_queue *sq = &vi->sq[qnum];
  	int err;
  	struct netdev_queue *txq = netdev_get_tx_queue(dev, qnum);
- 	bool kick = !netdev_xmit_more();
 -	bool more = skb->xmit_more;
++	bool more = netdev_xmit_more();
  	bool use_napi = sq->napi.weight;
+ 	unsigned int bytes = skb->len;
+ 	bool kick;
  
  	/* Free up any pending old buffers before queueing new ones. */
- 	free_old_xmit_skbs(sq, false);
+ 	free_old_xmit_skbs(sq, txq, false);
  
- 	if (use_napi && kick)
+ 	if (use_napi && !more)
  		virtqueue_enable_cb_delayed(sq->vq);
  
  	/* timestamp packet in software */

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the vhost tree with the net-next tree
@ 2013-04-29  7:29 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2013-04-29  7:29 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: linux-next, linux-kernel, Jason Wang, David Miller, netdev, Asias He

[-- Attachment #1: Type: text/plain, Size: 5412 bytes --]

Hi Michael,

Today's linux-next merge of the vhost tree got a conflict in
drivers/vhost/net.c between commit 70181d51209c ("vhost_net: remove tx
polling state") from the net-next tree and commits 11569c7119a6 ("vhost:
Allow device specific fields per vq"), 15a51679a0a1 ("vhost: Move
vhost-net zerocopy support fields to net.c") and 0cc4c2bd142b ("vhost:
move per-vq net specific fields out to net") from the vhost tree.

I fixed it up (I think - see below - there is probably a better way) and
can carry the fix as necessary (no action is required).

diff --cc drivers/vhost/net.c
index 87c216c,661d9be..0000000
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@@ -64,10 -64,46 +64,36 @@@ enum 
  	VHOST_NET_VQ_MAX = 2,
  };
  
 -enum vhost_net_poll_state {
 -	VHOST_NET_POLL_DISABLED = 0,
 -	VHOST_NET_POLL_STARTED = 1,
 -	VHOST_NET_POLL_STOPPED = 2,
 -};
 -
+ struct vhost_ubuf_ref {
+ 	struct kref kref;
+ 	wait_queue_head_t wait;
+ 	struct vhost_virtqueue *vq;
+ };
+ 
+ struct vhost_net_virtqueue {
+ 	struct vhost_virtqueue vq;
+ 	/* hdr is used to store the virtio header.
+ 	 * Since each iovec has >= 1 byte length, we never need more than
+ 	 * header length entries to store the header. */
+ 	struct iovec hdr[sizeof(struct virtio_net_hdr_mrg_rxbuf)];
+ 	size_t vhost_hlen;
+ 	size_t sock_hlen;
+ 	/* vhost zerocopy support fields below: */
+ 	/* last used idx for outstanding DMA zerocopy buffers */
+ 	int upend_idx;
+ 	/* first used idx for DMA done zerocopy buffers */
+ 	int done_idx;
+ 	/* an array of userspace buffers info */
+ 	struct ubuf_info *ubuf_info;
+ 	/* Reference counting for outstanding ubufs.
+ 	 * Protected by vq mutex. Writers must also take device mutex. */
+ 	struct vhost_ubuf_ref *ubufs;
+ };
+ 
  struct vhost_net {
  	struct vhost_dev dev;
- 	struct vhost_virtqueue vqs[VHOST_NET_VQ_MAX];
+ 	struct vhost_net_virtqueue vqs[VHOST_NET_VQ_MAX];
  	struct vhost_poll poll[VHOST_NET_VQ_MAX];
 -	/* Tells us whether we are polling a socket for TX.
 -	 * We only do this when socket buffer fills up.
 -	 * Protected by tx vq lock. */
 -	enum vhost_net_poll_state tx_poll_state;
  	/* Number of TX recently submitted.
  	 * Protected by tx vq lock. */
  	unsigned tx_packets;
@@@ -224,8 -369,18 +337,8 @@@ static void handle_tx(struct vhost_net 
  	mutex_lock(&vq->mutex);
  	vhost_disable_notify(&net->dev, vq);
  
- 	hdr_size = vq->vhost_hlen;
- 	zcopy = vq->ubufs;
 -	if (wmem < sock->sk->sk_sndbuf / 2)
 -		tx_poll_stop(net);
+ 	hdr_size = nvq->vhost_hlen;
+ 	zcopy = nvq->ubufs;
  
  	for (;;) {
  		/* Release DMAs done buffers first */
@@@ -246,11 -401,21 +359,12 @@@
  			/* If more outstanding DMAs, queue the work.
  			 * Handle upend_idx wrap around
  			 */
- 			num_pends = likely(vq->upend_idx >= vq->done_idx) ?
- 				    (vq->upend_idx - vq->done_idx) :
- 				    (vq->upend_idx + UIO_MAXIOV - vq->done_idx);
+ 			num_pends = likely(nvq->upend_idx >= nvq->done_idx) ?
+ 				    (nvq->upend_idx - nvq->done_idx) :
+ 				    (nvq->upend_idx + UIO_MAXIOV -
+ 				     nvq->done_idx);
 -			if (unlikely(num_pends > VHOST_MAX_PEND)) {
 -				tx_poll_start(net, sock);
 -				set_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
 +			if (unlikely(num_pends > VHOST_MAX_PEND))
  				break;
 -			}
  			if (unlikely(vhost_enable_notify(&net->dev, vq))) {
  				vhost_disable_notify(&net->dev, vq);
  				continue;
@@@ -309,10 -474,12 +423,10 @@@
  			if (zcopy_used) {
  				if (ubufs)
  					vhost_ubuf_put(ubufs);
- 				vq->upend_idx = ((unsigned)vq->upend_idx - 1) %
- 					UIO_MAXIOV;
+ 				nvq->upend_idx = ((unsigned)nvq->upend_idx - 1)
+ 					% UIO_MAXIOV;
  			}
  			vhost_discard_vq_desc(vq, 1);
 -			if (err == -EAGAIN || err == -ENOBUFS)
 -				tx_poll_start(net, sock);
  			break;
  		}
  		if (err != len)
@@@ -584,24 -770,32 +716,31 @@@ static int vhost_net_open(struct inode 
  static void vhost_net_disable_vq(struct vhost_net *n,
  				 struct vhost_virtqueue *vq)
  {
- 	struct vhost_poll *poll = n->poll + (vq - n->vqs);
++	struct vhost_net_virtqueue *vnq;
++	struct vhost_poll *poll;
++
  	if (!vq->private_data)
  		return;
 -	if (vq == &n->vqs[VHOST_NET_VQ_TX].vq) {
 -		tx_poll_stop(n);
 -		n->tx_poll_state = VHOST_NET_POLL_DISABLED;
 -	} else
 -		vhost_poll_stop(n->poll + VHOST_NET_VQ_RX);
++	vnq = container_of(vq, struct vhost_net_virtqueue, vq);
++	poll = n->poll + (vnq - n->vqs);
 +	vhost_poll_stop(poll);
  }
  
  static int vhost_net_enable_vq(struct vhost_net *n,
  				struct vhost_virtqueue *vq)
  {
- 	struct vhost_poll *poll = n->poll + (vq - n->vqs);
++	struct vhost_net_virtqueue *vnq;
++	struct vhost_poll *poll;
  	struct socket *sock;
 -	int ret;
  
  	sock = rcu_dereference_protected(vq->private_data,
  					 lockdep_is_held(&vq->mutex));
  	if (!sock)
  		return 0;
 -	if (vq == &n->vqs[VHOST_NET_VQ_TX].vq) {
 -		n->tx_poll_state = VHOST_NET_POLL_STOPPED;
 -		ret = tx_poll_start(n, sock);
 -	} else
 -		ret = vhost_poll_start(n->poll + VHOST_NET_VQ_RX, sock->file);
++	vnq = container_of(vq, struct vhost_net_virtqueue, vq);
++	poll = n->poll + (vnq - n->vqs);
  
 -	return ret;
 +	return vhost_poll_start(poll, sock->file);
  }
  
  static struct socket *vhost_net_stop_vq(struct vhost_net *n,

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the vhost tree with the net-next tree
  2012-04-19  5:35 Stephen Rothwell
@ 2012-04-19  5:40 ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2012-04-19  5:40 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, Jason Wang, David Miller, netdev

On Thu, Apr 19, 2012 at 03:35:47PM +1000, Stephen Rothwell wrote:
> Hi Michael,
> 
> Today's linux-next merge of the vhost tree got a conflict in
> drivers/net/virtio_net.c between commit 586d17c5a01b ("virtio-net: send
> gratuitous packets when needed") from the net-next tree and commit
> 66fdfb7bc203 ("virtio-net: remove useless disable on freeze") from the
> vhost tree.
> 
> Just context changes.  I fixed it up (I think - see below) and can carry
> the fix as necessary.

The fix looks right, thanks a lot.

> -- 
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
> 
> diff --cc drivers/net/virtio_net.c
> index fa58c78,3e4767f..0000000
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@@ -1224,16 -1183,6 +1224,11 @@@ static int virtnet_freeze(struct virtio
>   {
>   	struct virtnet_info *vi = vdev->priv;
>   
>  +	/* Prevent config work handler from accessing the device */
>  +	mutex_lock(&vi->config_lock);
>  +	vi->config_enable = false;
>  +	mutex_unlock(&vi->config_lock);
>  +
> - 	virtqueue_disable_cb(vi->rvq);
> - 	virtqueue_disable_cb(vi->svq);
> - 	if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ))
> - 		virtqueue_disable_cb(vi->cvq);
> - 
>   	netif_device_detach(vi->dev);
>   	cancel_delayed_work_sync(&vi->refill);
>   



^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the vhost tree with the net-next tree
@ 2012-04-19  5:35 Stephen Rothwell
  2012-04-19  5:40 ` Michael S. Tsirkin
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2012-04-19  5:35 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: linux-next, linux-kernel, Jason Wang, David Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

Hi Michael,

Today's linux-next merge of the vhost tree got a conflict in
drivers/net/virtio_net.c between commit 586d17c5a01b ("virtio-net: send
gratuitous packets when needed") from the net-next tree and commit
66fdfb7bc203 ("virtio-net: remove useless disable on freeze") from the
vhost tree.

Just context changes.  I fixed it up (I think - see below) and can carry
the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/net/virtio_net.c
index fa58c78,3e4767f..0000000
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@@ -1224,16 -1183,6 +1224,11 @@@ static int virtnet_freeze(struct virtio
  {
  	struct virtnet_info *vi = vdev->priv;
  
 +	/* Prevent config work handler from accessing the device */
 +	mutex_lock(&vi->config_lock);
 +	vi->config_enable = false;
 +	mutex_unlock(&vi->config_lock);
 +
- 	virtqueue_disable_cb(vi->rvq);
- 	virtqueue_disable_cb(vi->svq);
- 	if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ))
- 		virtqueue_disable_cb(vi->cvq);
- 
  	netif_device_detach(vi->dev);
  	cancel_delayed_work_sync(&vi->refill);
  

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-03  4:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-16  4:19 linux-next: manual merge of the vhost tree with the net-next tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2019-04-03  4:22 Stephen Rothwell
2013-04-29  7:29 Stephen Rothwell
2012-04-19  5:35 Stephen Rothwell
2012-04-19  5:40 ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).