search for: u64_stats_update_begin

Displaying 20 results from an estimated 149 matches for "u64_stats_update_begin".

2014 Oct 15
2
[RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()
From: Of Michael S. Tsirkin > On Wed, Oct 15, 2014 at 03:25:27PM +0800, Jason Wang wrote: > > Accumulate the sent packets and sent bytes in local variables and perform a > > single u64_stats_update_begin/end() after. > > > > Cc: Rusty Russell <rusty at rustcorp.com.au> > > Cc: Michael S. Tsirkin <mst at redhat.com> > > Signed-off-by: Jason Wang <jasowang at redhat.com> > > Not sure how much it's worth but since Eric suggested it ... Probably dep...
2014 Oct 15
2
[RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()
From: Of Michael S. Tsirkin > On Wed, Oct 15, 2014 at 03:25:27PM +0800, Jason Wang wrote: > > Accumulate the sent packets and sent bytes in local variables and perform a > > single u64_stats_update_begin/end() after. > > > > Cc: Rusty Russell <rusty at rustcorp.com.au> > > Cc: Michael S. Tsirkin <mst at redhat.com> > > Signed-off-by: Jason Wang <jasowang at redhat.com> > > Not sure how much it's worth but since Eric suggested it ... Probably dep...
2014 Oct 15
1
[RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()
Accumulate the sent packets and sent bytes in local variables and perform a single u64_stats_update_begin/end() after. Cc: Rusty Russell <rusty at rustcorp.com.au> Cc: Michael S. Tsirkin <mst at redhat.com> Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/vi...
2014 Oct 15
1
[RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()
Accumulate the sent packets and sent bytes in local variables and perform a single u64_stats_update_begin/end() after. Cc: Rusty Russell <rusty at rustcorp.com.au> Cc: Michael S. Tsirkin <mst at redhat.com> Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/vi...
2014 Oct 15
1
[RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()
...; On Wed, Oct 15, 2014 at 09:49:01AM +0000, David Laight wrote: > > From: Of Michael S. Tsirkin > > > On Wed, Oct 15, 2014 at 03:25:27PM +0800, Jason Wang wrote: > > > > Accumulate the sent packets and sent bytes in local variables and perform a > > > > single u64_stats_update_begin/end() after. > > > > > > > > Cc: Rusty Russell <rusty at rustcorp.com.au> > > > > Cc: Michael S. Tsirkin <mst at redhat.com> > > > > Signed-off-by: Jason Wang <jasowang at redhat.com> > > > > > > Not sure how much i...
2014 Oct 15
1
[RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()
...; On Wed, Oct 15, 2014 at 09:49:01AM +0000, David Laight wrote: > > From: Of Michael S. Tsirkin > > > On Wed, Oct 15, 2014 at 03:25:27PM +0800, Jason Wang wrote: > > > > Accumulate the sent packets and sent bytes in local variables and perform a > > > > single u64_stats_update_begin/end() after. > > > > > > > > Cc: Rusty Russell <rusty at rustcorp.com.au> > > > > Cc: Michael S. Tsirkin <mst at redhat.com> > > > > Signed-off-by: Jason Wang <jasowang at redhat.com> > > > > > > Not sure how much i...
2011 Jun 15
3
[PATCH] virtio-net: per cpu 64 bit stats
...pu_ptr(vi->stats); struct sk_buff *skb; struct page *page; struct skb_vnet_hdr *hdr; @@ -265,8 +278,11 @@ static void receive_buf(struct net_devic hdr = skb_vnet_hdr(skb); skb->truesize += skb->data_len; - dev->stats.rx_bytes += skb->len; - dev->stats.rx_packets++; + + u64_stats_update_begin(&stats->syncp); + stats->rx_bytes += skb->len; + stats->rx_packets++; + u64_stats_update_begin(&stats->syncp); if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { pr_debug("Needs csum!\n"); @@ -515,11 +531,16 @@ static unsigned int free_old_xmit_skbs(s...
2011 Jun 15
3
[PATCH] virtio-net: per cpu 64 bit stats
...pu_ptr(vi->stats); struct sk_buff *skb; struct page *page; struct skb_vnet_hdr *hdr; @@ -265,8 +278,11 @@ static void receive_buf(struct net_devic hdr = skb_vnet_hdr(skb); skb->truesize += skb->data_len; - dev->stats.rx_bytes += skb->len; - dev->stats.rx_packets++; + + u64_stats_update_begin(&stats->syncp); + stats->rx_bytes += skb->len; + stats->rx_packets++; + u64_stats_update_begin(&stats->syncp); if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { pr_debug("Needs csum!\n"); @@ -515,11 +531,16 @@ static unsigned int free_old_xmit_skbs(s...
2012 Jun 06
2
[V2 RFC net-next PATCH 1/2] virtio_net: convert the statistics into array
...et_stats { struct u64_stats_sync syncp; - u64 tx_bytes; - u64 tx_packets; - - u64 rx_bytes; - u64 rx_packets; + u64 data[VIRTNET_NUM_STATS]; }; struct virtnet_info { @@ -301,8 +305,8 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len) hdr = skb_vnet_hdr(skb); u64_stats_update_begin(&stats->syncp); - stats->rx_bytes += skb->len; - stats->rx_packets++; + stats->data[VIRTNET_RX_BYTES] += skb->len; + stats->data[VIRTNET_RX_PACKETS]++; u64_stats_update_end(&stats->syncp); if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { @@ -566,8 +57...
2012 Jun 06
2
[V2 RFC net-next PATCH 1/2] virtio_net: convert the statistics into array
...et_stats { struct u64_stats_sync syncp; - u64 tx_bytes; - u64 tx_packets; - - u64 rx_bytes; - u64 rx_packets; + u64 data[VIRTNET_NUM_STATS]; }; struct virtnet_info { @@ -301,8 +305,8 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len) hdr = skb_vnet_hdr(skb); u64_stats_update_begin(&stats->syncp); - stats->rx_bytes += skb->len; - stats->rx_packets++; + stats->data[VIRTNET_RX_BYTES] += skb->len; + stats->data[VIRTNET_RX_PACKETS]++; u64_stats_update_end(&stats->syncp); if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { @@ -566,8 +57...
2017 Feb 17
0
[PATCH net-next] virtio-net: batch stats updating
We already have counters for sent/recv packets and sent/recv bytes. Doing a batched update to reduce the number of u64_stats_update_begin/end(). Take care not to bother with stats update when called speculatively. Cc: Willem de Bruijn <willemb at google.com> Signed-off-by: Jason Wang <jasowang at redhat.com> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/net/virtio_net.c | 47 ++++++++++++++++++...
2017 Feb 17
0
[PATCH net-next] virtio-net: batch stats updating
We already have counters for sent/recv packets and sent/recv bytes. Doing a batched update to reduce the number of u64_stats_update_begin/end(). Take care not to bother with stats update when called speculatively. Cc: Willem de Bruijn <willemb at google.com> Signed-off-by: Jason Wang <jasowang at redhat.com> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/net/virtio_net.c | 47 ++++++++++++++++++...
2014 Oct 15
0
[RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()
On Wed, Oct 15, 2014 at 09:49:01AM +0000, David Laight wrote: > From: Of Michael S. Tsirkin > > On Wed, Oct 15, 2014 at 03:25:27PM +0800, Jason Wang wrote: > > > Accumulate the sent packets and sent bytes in local variables and perform a > > > single u64_stats_update_begin/end() after. > > > > > > Cc: Rusty Russell <rusty at rustcorp.com.au> > > > Cc: Michael S. Tsirkin <mst at redhat.com> > > > Signed-off-by: Jason Wang <jasowang at redhat.com> > > > > Not sure how much it's worth but since Eric...
2012 Jun 05
1
[net-next RFC PATCH] virtio_net: collect satistics and export through ethtool
...; struct virtqueue *rvq, *svq, *cvq; @@ -142,6 +171,11 @@ static struct page *get_a_page(struct virtnet_info *vi, gfp_t gfp_mask) static void skb_xmit_done(struct virtqueue *svq) { struct virtnet_info *vi = svq->vdev->priv; + struct virtnet_stats *stats = this_cpu_ptr(vi->stats); + + u64_stats_update_begin(&stats->syncp); + stats->tx_callbacks++; + u64_stats_update_end(&stats->syncp); /* Suppress further interrupts. */ virtqueue_disable_cb(svq); @@ -461,6 +495,7 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) { int err; bool oom; + struct virtnet_stats *st...
2012 Jun 05
1
[net-next RFC PATCH] virtio_net: collect satistics and export through ethtool
...; struct virtqueue *rvq, *svq, *cvq; @@ -142,6 +171,11 @@ static struct page *get_a_page(struct virtnet_info *vi, gfp_t gfp_mask) static void skb_xmit_done(struct virtqueue *svq) { struct virtnet_info *vi = svq->vdev->priv; + struct virtnet_stats *stats = this_cpu_ptr(vi->stats); + + u64_stats_update_begin(&stats->syncp); + stats->tx_callbacks++; + u64_stats_update_end(&stats->syncp); /* Suppress further interrupts. */ virtqueue_disable_cb(svq); @@ -461,6 +495,7 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) { int err; bool oom; + struct virtnet_stats *st...
2018 Dec 06
7
[PATCH RFC 1/2] virtio-net: bql support
...bool use_napi) > { > struct sk_buff *skb; > unsigned int len; > @@ -1347,6 +1348,9 @@ static void free_old_xmit_skbs(struct send_queue *sq) > if (!packets) > return; > > + if (use_napi) > + netdev_tx_completed_queue(txq, packets, bytes); > + > u64_stats_update_begin(&sq->stats.syncp); > sq->stats.bytes += bytes; > sq->stats.packets += packets; > @@ -1364,7 +1368,7 @@ static void virtnet_poll_cleantx(struct receive_queue *rq) > return; > > if (__netif_tx_trylock(txq)) { > - free_old_xmit_skbs(sq); > + free_...
2018 Dec 06
7
[PATCH RFC 1/2] virtio-net: bql support
...bool use_napi) > { > struct sk_buff *skb; > unsigned int len; > @@ -1347,6 +1348,9 @@ static void free_old_xmit_skbs(struct send_queue *sq) > if (!packets) > return; > > + if (use_napi) > + netdev_tx_completed_queue(txq, packets, bytes); > + > u64_stats_update_begin(&sq->stats.syncp); > sq->stats.bytes += bytes; > sq->stats.packets += packets; > @@ -1364,7 +1368,7 @@ static void virtnet_poll_cleantx(struct receive_queue *rq) > return; > > if (__netif_tx_trylock(txq)) { > - free_old_xmit_skbs(sq); > + free_...
2012 Jun 06
9
[PATCH] virtio-net: fix a race on 32bit arches
..." struct virtnet_stats { - struct u64_stats_sync syncp; + struct u64_stats_sync tx_syncp; + struct u64_stats_sync rx_syncp; u64 tx_bytes; u64 tx_packets; @@ -300,10 +301,10 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len) hdr = skb_vnet_hdr(skb); - u64_stats_update_begin(&stats->syncp); + u64_stats_update_begin(&stats->rx_syncp); stats->rx_bytes += skb->len; stats->rx_packets++; - u64_stats_update_end(&stats->syncp); + u64_stats_update_end(&stats->rx_syncp); if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { p...
2012 Jun 06
9
[PATCH] virtio-net: fix a race on 32bit arches
..." struct virtnet_stats { - struct u64_stats_sync syncp; + struct u64_stats_sync tx_syncp; + struct u64_stats_sync rx_syncp; u64 tx_bytes; u64 tx_packets; @@ -300,10 +301,10 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len) hdr = skb_vnet_hdr(skb); - u64_stats_update_begin(&stats->syncp); + u64_stats_update_begin(&stats->rx_syncp); stats->rx_bytes += skb->len; stats->rx_packets++; - u64_stats_update_end(&stats->syncp); + u64_stats_update_end(&stats->rx_syncp); if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { p...
2014 Oct 15
15
[RFC PATCH net-next 0/6] Always use tx interrupt for virtio-net
According to David, proper accounting and queueing (at all levels, not just TCP sockets) is more important than trying to skim a bunch of cycles by avoiding TX interrupts. Having an event to free the SKB is absolutely essential for the stack to operate correctly. This series tries to enable tx interrupt for virtio-net. The idea is simple: enable tx interrupt and schedule a tx napi to free old