search for: syncp

Displaying 20 results from an estimated 95 matches for "syncp".

Did you mean: sync
2012 Jun 06
2
[V2 RFC net-next PATCH 1/2] virtio_net: convert the statistics into array
...m(gso, bool, 0444); #define VIRTNET_SEND_COMMAND_SG_MAX 2 #define VIRTNET_DRIVER_VERSION "1.0.0" +enum virtnet_stats_type { + VIRTNET_TX_BYTES, + VIRTNET_TX_PACKETS, + VIRTNET_RX_BYTES, + VIRTNET_RX_PACKETS, + VIRTNET_NUM_STATS, +}; + struct virtnet_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->sy...
2012 Jun 06
2
[V2 RFC net-next PATCH 1/2] virtio_net: convert the statistics into array
...m(gso, bool, 0444); #define VIRTNET_SEND_COMMAND_SG_MAX 2 #define VIRTNET_DRIVER_VERSION "1.0.0" +enum virtnet_stats_type { + VIRTNET_TX_BYTES, + VIRTNET_TX_PACKETS, + VIRTNET_RX_BYTES, + VIRTNET_RX_PACKETS, + VIRTNET_NUM_STATS, +}; + struct virtnet_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->sy...
2012 Jun 06
9
[PATCH] virtio-net: fix a race on 32bit arches
From: Eric Dumazet <edumazet at google.com> commit 3fa2a1df909 (virtio-net: per cpu 64 bit stats (v2)) added a race on 32bit arches. We must use separate syncp for rx and tx path as they can be run at the same time on different cpus. Thus one sequence increment can be lost and readers spin forever. Signed-off-by: Eric Dumazet <edumazet at google.com> Cc: Stephen Hemminger <shemminger at vyatta.com> Cc: Michael S. Tsirkin <mst at redhat.com...
2012 Jun 06
9
[PATCH] virtio-net: fix a race on 32bit arches
From: Eric Dumazet <edumazet at google.com> commit 3fa2a1df909 (virtio-net: per cpu 64 bit stats (v2)) added a race on 32bit arches. We must use separate syncp for rx and tx path as they can be run at the same time on different cpus. Thus one sequence increment can be lost and readers spin forever. Signed-off-by: Eric Dumazet <edumazet at google.com> Cc: Stephen Hemminger <shemminger at vyatta.com> Cc: Michael S. Tsirkin <mst at redhat.com...
2011 Jun 15
3
[PATCH] virtio-net: per cpu 64 bit stats
...er at vyatta.com> --- a/drivers/net/virtio_net.c 2011-06-14 15:18:46.448596355 -0400 +++ b/drivers/net/virtio_net.c 2011-06-15 09:54:22.914426067 -0400 @@ -40,6 +40,15 @@ module_param(gso, bool, 0444); #define VIRTNET_SEND_COMMAND_SG_MAX 2 +struct virtnet_stats { + struct u64_stats_sync syncp; + u64 tx_bytes; + u64 tx_packets; + + u64 rx_bytes; + u64 rx_packets; +}; + struct virtnet_info { struct virtio_device *vdev; struct virtqueue *rvq, *svq, *cvq; @@ -56,6 +65,9 @@ struct virtnet_info { /* Host will merge rx buffers for big packets (shake it! shake it!) */ bool mergeable_rx...
2011 Jun 15
3
[PATCH] virtio-net: per cpu 64 bit stats
...er at vyatta.com> --- a/drivers/net/virtio_net.c 2011-06-14 15:18:46.448596355 -0400 +++ b/drivers/net/virtio_net.c 2011-06-15 09:54:22.914426067 -0400 @@ -40,6 +40,15 @@ module_param(gso, bool, 0444); #define VIRTNET_SEND_COMMAND_SG_MAX 2 +struct virtnet_stats { + struct u64_stats_sync syncp; + u64 tx_bytes; + u64 tx_packets; + + u64 rx_bytes; + u64 rx_packets; +}; + struct virtnet_info { struct virtio_device *vdev; struct virtqueue *rvq, *svq, *cvq; @@ -56,6 +65,9 @@ struct virtnet_info { /* Host will merge rx buffers for big packets (shake it! shake it!) */ bool mergeable_rx...
2012 Jun 05
1
[net-next RFC PATCH] virtio_net: collect satistics and export through ethtool
...END_COMMAND_SG_MAX 2 #define VIRTNET_DRIVER_VERSION "1.0.0" +#define VIRTNET_STAT_OFF(m) offsetof(struct virtnet_stats, m) +#define VIRTNET_STAT(stat, i) (*((u64 *)((char *)stat + \ + virtnet_stats_str_attr[i].stat_offset))) + struct virtnet_stats { struct u64_stats_sync syncp; u64 tx_bytes; @@ -48,8 +52,33 @@ struct virtnet_stats { u64 rx_bytes; u64 rx_packets; + + u64 tx_kick; + u64 rx_kick; + u64 tx_callbacks; + u64 rx_callbacks; + u64 tx_queued_packets; + u64 tx_queued_bytes; +}; + +static struct { + char string[ETH_GSTRING_LEN]; + int stat_offset; +} virtnet...
2012 Jun 05
1
[net-next RFC PATCH] virtio_net: collect satistics and export through ethtool
...END_COMMAND_SG_MAX 2 #define VIRTNET_DRIVER_VERSION "1.0.0" +#define VIRTNET_STAT_OFF(m) offsetof(struct virtnet_stats, m) +#define VIRTNET_STAT(stat, i) (*((u64 *)((char *)stat + \ + virtnet_stats_str_attr[i].stat_offset))) + struct virtnet_stats { struct u64_stats_sync syncp; u64 tx_bytes; @@ -48,8 +52,33 @@ struct virtnet_stats { u64 rx_bytes; u64 rx_packets; + + u64 tx_kick; + u64 rx_kick; + u64 tx_callbacks; + u64 rx_callbacks; + u64 tx_queued_packets; + u64 tx_queued_bytes; +}; + +static struct { + char string[ETH_GSTRING_LEN]; + int stat_offset; +} virtnet...
2018 Jan 17
1
[PATCH v2 net-next] virtio_net: Add ethtool stats
...ged, 141 insertions(+), 50 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 12dfc5f..626c273 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -66,16 +66,39 @@ VIRTIO_NET_F_GUEST_UFO }; -struct virtnet_stats { - struct u64_stats_sync tx_syncp; - struct u64_stats_sync rx_syncp; - u64 tx_bytes; - u64 tx_packets; - - u64 rx_bytes; - u64 rx_packets; +struct virtnet_stat_desc { + char desc[ETH_GSTRING_LEN]; + size_t offset; }; +struct virtnet_sq_stats { + struct u64_stats_sync syncp; + u64 packets; + u64 bytes; +}; + +struct virtnet_rq_st...
2020 May 06
2
[PATCH] virtio_net: fix lockdep warning on 32 bit
...b/drivers/net/virtio_net.c @@ -1243,9 +1243,11 @@ static bool try_fill_recv(struct virtnet_info *vi, struct receive_queue *rq, break; } while (rq->vq->num_free); if (virtqueue_kick_prepare(rq->vq) && virtqueue_notify(rq->vq)) { - u64_stats_update_begin(&rq->stats.syncp); + unsigned long flags; + + flags = u64_stats_update_begin_irqsave(&rq->stats.syncp); rq->stats.kicks++; - u64_stats_update_end(&rq->stats.syncp); + u64_stats_update_end_irqrestore(&rq->stats.syncp); } return !oom; -- MST
2017 Dec 20
4
[PATCH net-next] virtio_net: Add ethtool stats
...ged, 136 insertions(+), 51 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 6fb7b65..a0a7bf5 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -65,14 +65,31 @@ VIRTIO_NET_F_GUEST_UFO }; -struct virtnet_stats { - struct u64_stats_sync tx_syncp; - struct u64_stats_sync rx_syncp; - u64 tx_bytes; - u64 tx_packets; - - u64 rx_bytes; - u64 rx_packets; +struct virtnet_gstats { + char stat_string[ETH_GSTRING_LEN]; + int stat_offset; +}; + +#define VIRTNET_NETDEV_STAT(m) offsetof(struct rtnl_link_stats64, m) + +static const struct virtnet_gstats...
2017 Dec 20
4
[PATCH net-next] virtio_net: Add ethtool stats
...ged, 136 insertions(+), 51 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 6fb7b65..a0a7bf5 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -65,14 +65,31 @@ VIRTIO_NET_F_GUEST_UFO }; -struct virtnet_stats { - struct u64_stats_sync tx_syncp; - struct u64_stats_sync rx_syncp; - u64 tx_bytes; - u64 tx_packets; - - u64 rx_bytes; - u64 rx_packets; +struct virtnet_gstats { + char stat_string[ETH_GSTRING_LEN]; + int stat_offset; +}; + +#define VIRTNET_NETDEV_STAT(m) offsetof(struct rtnl_link_stats64, m) + +static const struct virtnet_gstats...
2018 Jul 31
8
[PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters
..., { struct virtnet_info *vi = rq->vq->vdev->priv; struct virtnet_rx_stats stats = {}; - struct send_queue *sq; unsigned int len; void *buf; int i; @@ -1351,12 +1326,6 @@ static int virtnet_receive(struct receive_queue *rq, int budget, } u64_stats_update_end(&rq->stats.syncp); - sq = virtnet_xdp_sq(vi); - u64_stats_update_begin(&sq->stats.syncp); - sq->stats.xdp_tx += stats.tx.xdp_tx; - sq->stats.xdp_tx_drops += stats.tx.xdp_tx_drops; - u64_stats_update_end(&sq->stats.syncp); - return stats.rx.packets; } -- 2.7.4
2018 Jul 31
8
[PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters
..., { struct virtnet_info *vi = rq->vq->vdev->priv; struct virtnet_rx_stats stats = {}; - struct send_queue *sq; unsigned int len; void *buf; int i; @@ -1351,12 +1326,6 @@ static int virtnet_receive(struct receive_queue *rq, int budget, } u64_stats_update_end(&rq->stats.syncp); - sq = virtnet_xdp_sq(vi); - u64_stats_update_begin(&sq->stats.syncp); - sq->stats.xdp_tx += stats.tx.xdp_tx; - sq->stats.xdp_tx_drops += stats.tx.xdp_tx_drops; - u64_stats_update_end(&sq->stats.syncp); - return stats.rx.packets; } -- 2.7.4
2018 Jul 31
2
[PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats
...irtio_net.c > index 72d3f68..14f661c 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -87,7 +87,8 @@ struct virtnet_sq_stats { > u64 kicks; > }; > > -struct virtnet_rq_stat_items { > +struct virtnet_rq_stats { > + struct u64_stats_sync syncp; > u64 packets; > u64 bytes; > u64 drops; > @@ -98,17 +99,8 @@ struct virtnet_rq_stat_items { > u64 kicks; > }; > > -struct virtnet_rq_stats { > - struct u64_stats_sync syncp; > - struct virtnet_rq_stat_items items; > -}; I'm not thinking removing sq...
2018 Jul 31
2
[PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats
...irtio_net.c > index 72d3f68..14f661c 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -87,7 +87,8 @@ struct virtnet_sq_stats { > u64 kicks; > }; > > -struct virtnet_rq_stat_items { > +struct virtnet_rq_stats { > + struct u64_stats_sync syncp; > u64 packets; > u64 bytes; > u64 drops; > @@ -98,17 +99,8 @@ struct virtnet_rq_stat_items { > u64 kicks; > }; > > -struct virtnet_rq_stats { > - struct u64_stats_sync syncp; > - struct virtnet_rq_stat_items items; > -}; I'm not thinking removing sq...
2018 Jul 31
0
[PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats
...f --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 72d3f68..14f661c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -87,7 +87,8 @@ struct virtnet_sq_stats { u64 kicks; }; -struct virtnet_rq_stat_items { +struct virtnet_rq_stats { + struct u64_stats_sync syncp; u64 packets; u64 bytes; u64 drops; @@ -98,17 +99,8 @@ struct virtnet_rq_stat_items { u64 kicks; }; -struct virtnet_rq_stats { - struct u64_stats_sync syncp; - struct virtnet_rq_stat_items items; -}; - -struct virtnet_rx_stats { - struct virtnet_rq_stat_items rx; -}; - #define VIRTNET_S...
2019 Nov 22
2
[PATCH net-next v2] drivers: net: virtio_net: Implement a dev_watchdog handler
...bytes, rdrops; + u64 tpackets, tbytes, terrors, rpackets, rbytes, rdrops; struct receive_queue *rq = &vi->rq[i]; struct send_queue *sq = &vi->sq[i]; @@ -1729,6 +1734,7 @@ static void virtnet_stats(struct net_device *dev, start = u64_stats_fetch_begin_irq(&sq->stats.syncp); tpackets = sq->stats.packets; tbytes = sq->stats.bytes; + terrors = sq->stats.tx_timeouts; } while (u64_stats_fetch_retry_irq(&sq->stats.syncp, start)); do { @@ -1743,6 +1749,7 @@ static void virtnet_stats(struct net_device *dev, tot->rx_bytes += rbyte...
2019 Nov 22
2
[PATCH net-next v2] drivers: net: virtio_net: Implement a dev_watchdog handler
...bytes, rdrops; + u64 tpackets, tbytes, terrors, rpackets, rbytes, rdrops; struct receive_queue *rq = &vi->rq[i]; struct send_queue *sq = &vi->sq[i]; @@ -1729,6 +1734,7 @@ static void virtnet_stats(struct net_device *dev, start = u64_stats_fetch_begin_irq(&sq->stats.syncp); tpackets = sq->stats.packets; tbytes = sq->stats.bytes; + terrors = sq->stats.tx_timeouts; } while (u64_stats_fetch_retry_irq(&sq->stats.syncp, start)); do { @@ -1743,6 +1749,7 @@ static void virtnet_stats(struct net_device *dev, tot->rx_bytes += rbyte...
2019 Oct 06
7
[PATCH RFC net-next 0/2] drivers: net: virtio_net: Implement
From: Julio Faracco <jcfaracco at gmail.com> Driver virtio_net is not handling error events for TX provided by dev_watchdog. This event is reached when transmission queue is having problems to transmit packets. To enable it, driver should have .ndo_tx_timeout implemented. This serie has two commits: In the past, we implemented a function to recover driver state when this kind of event