All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [V2 RFC net-next PATCH 2/2] virtio_net: export more statistics through ethtool
Date: Fri, 8 Jun 2012 10:02:37 +0300	[thread overview]
Message-ID: <20120608070237.GA32532@redhat.com> (raw)
In-Reply-To: <4FD172FD.5070200@redhat.com>

On Fri, Jun 08, 2012 at 11:35:25AM +0800, Jason Wang wrote:
> >>>  @@ -655,7 +695,17 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
> >>>    		kfree_skb(skb);
> >>>    		return NETDEV_TX_OK;
> >>>    	}
> >>>  -	virtqueue_kick(vi->svq);
> >>>  +
> >>>  +	kick = virtqueue_kick_prepare(vi->svq);
> >>>  +	if (unlikely(kick))
> >>>  +		virtqueue_notify(vi->svq);
> >>>  +
> >>>  +	u64_stats_update_begin(&stats->syncp);
> >>>  +	if (unlikely(kick))
> >>>  +		stats->data[VIRTNET_TX_KICKS]++;
> >>>  +	stats->data[VIRTNET_TX_Q_BYTES] += skb->len;
> >>>  +	stats->data[VIRTNET_TX_Q_PACKETS]++;
> >is this statistic interesting?
> >how about decrementing when we free?
> >this way we see how many are pending..
> >
> 
> Currently we didn't have per-vq statistics but per-cpu, so the skb
> could be sent by one vcpu and freed by another.
> Pehaps another reason to use per-queue satistics.

For transmit, it could be done easily as we both send and free skbs
under a lock. I'm not sure how acceptable it is to
take a lock in get_stats but send a separate patch like this
and we'll see what others say.

-- 
MST

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev@vger.kernel.org, rusty@rustcorp.com.au,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [V2 RFC net-next PATCH 2/2] virtio_net: export more statistics through ethtool
Date: Fri, 8 Jun 2012 10:02:37 +0300	[thread overview]
Message-ID: <20120608070237.GA32532@redhat.com> (raw)
In-Reply-To: <4FD172FD.5070200@redhat.com>

On Fri, Jun 08, 2012 at 11:35:25AM +0800, Jason Wang wrote:
> >>>  @@ -655,7 +695,17 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
> >>>    		kfree_skb(skb);
> >>>    		return NETDEV_TX_OK;
> >>>    	}
> >>>  -	virtqueue_kick(vi->svq);
> >>>  +
> >>>  +	kick = virtqueue_kick_prepare(vi->svq);
> >>>  +	if (unlikely(kick))
> >>>  +		virtqueue_notify(vi->svq);
> >>>  +
> >>>  +	u64_stats_update_begin(&stats->syncp);
> >>>  +	if (unlikely(kick))
> >>>  +		stats->data[VIRTNET_TX_KICKS]++;
> >>>  +	stats->data[VIRTNET_TX_Q_BYTES] += skb->len;
> >>>  +	stats->data[VIRTNET_TX_Q_PACKETS]++;
> >is this statistic interesting?
> >how about decrementing when we free?
> >this way we see how many are pending..
> >
> 
> Currently we didn't have per-vq statistics but per-cpu, so the skb
> could be sent by one vcpu and freed by another.
> Pehaps another reason to use per-queue satistics.

For transmit, it could be done easily as we both send and free skbs
under a lock. I'm not sure how acceptable it is to
take a lock in get_stats but send a separate patch like this
and we'll see what others say.

-- 
MST

  reply	other threads:[~2012-06-08  7:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06  7:52 [V2 RFC net-next PATCH 1/2] virtio_net: convert the statistics into array Jason Wang
2012-06-06  7:52 ` [V2 RFC net-next PATCH 2/2] virtio_net: export more statistics through ethtool Jason Wang
2012-06-06  8:27   ` Michael S. Tsirkin
2012-06-06  8:27     ` Michael S. Tsirkin
2012-06-06  9:37     ` Jason Wang
2012-06-06  9:37       ` Jason Wang
2012-06-06  9:32   ` Michael S. Tsirkin
2012-06-06  9:32     ` Michael S. Tsirkin
2012-06-07 17:15   ` Ben Hutchings
2012-06-07 17:15     ` Ben Hutchings
2012-06-07 20:05     ` David Miller
2012-06-07 20:05       ` David Miller
2012-06-07 20:24       ` Ben Hutchings
2012-06-07 20:24         ` Ben Hutchings
2012-06-07 20:39         ` Rick Jones
2012-06-07 20:39           ` Rick Jones
2012-06-07 20:56           ` Ben Hutchings
2012-06-07 20:56             ` Ben Hutchings
2012-06-07 20:58             ` Ben Hutchings
2012-06-07 20:58               ` Ben Hutchings
2012-06-08  3:33             ` Jason Wang
2012-06-08  3:33               ` Jason Wang
2012-06-07 22:19   ` Michael S. Tsirkin
2012-06-07 22:19     ` Michael S. Tsirkin
2012-06-08  3:35     ` Jason Wang
2012-06-08  3:35       ` Jason Wang
2012-06-08  7:02       ` Michael S. Tsirkin [this message]
2012-06-08  7:02         ` Michael S. Tsirkin
2012-06-08  7:04       ` Michael S. Tsirkin
2012-06-08  7:04         ` Michael S. Tsirkin
2012-06-06  8:22 ` [V2 RFC net-next PATCH 1/2] virtio_net: convert the statistics into array Eric Dumazet
2012-06-06  8:22   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120608070237.GA32532@redhat.com \
    --to=mst@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.