diff mbox series

[net-next,v6,6/8] virtio_net: rename stat tx_timeout to timeout

Message ID 20240423113141.1752-7-xuanzhuo@linux.alibaba.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series virtio-net: support device stats | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/apply fail Patch does not apply to net-next-0

Commit Message

Xuan Zhuo April 23, 2024, 11:31 a.m. UTC
Now, we have this:

    tx_queue_0_tx_timeouts

This is used to record the tx schedule timeout.
But this has two "tx". I think the below is enough.

    tx_queue_0_timeouts

So I rename this field.

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
---
 drivers/net/virtio_net.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jason Wang April 24, 2024, 3:55 a.m. UTC | #1
On Tue, Apr 23, 2024 at 7:32 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
>
> Now, we have this:
>
>     tx_queue_0_tx_timeouts
>
> This is used to record the tx schedule timeout.
> But this has two "tx". I think the below is enough.
>
>     tx_queue_0_timeouts
>
> So I rename this field.
>
> Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
> ---
>  drivers/net/virtio_net.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 8a4d22f5f5b1..51ce2308f4f5 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -87,7 +87,7 @@ struct virtnet_sq_stats {
>         u64_stats_t xdp_tx;
>         u64_stats_t xdp_tx_drops;
>         u64_stats_t kicks;
> -       u64_stats_t tx_timeouts;
> +       u64_stats_t timeouts;
>  };
>
>  struct virtnet_rq_stats {
> @@ -111,7 +111,7 @@ static const struct virtnet_stat_desc virtnet_sq_stats_desc[] = {
>         VIRTNET_SQ_STAT("xdp_tx",       xdp_tx),
>         VIRTNET_SQ_STAT("xdp_tx_drops", xdp_tx_drops),
>         VIRTNET_SQ_STAT("kicks",        kicks),
> -       VIRTNET_SQ_STAT("tx_timeouts",  tx_timeouts),
> +       VIRTNET_SQ_STAT("timeouts",     timeouts),

Not sure if it is too late to do this as it is noticeable by the userspace.

Thanks

>  };
>
>  static const struct virtnet_stat_desc virtnet_rq_stats_desc[] = {
> @@ -2691,7 +2691,7 @@ static void virtnet_stats(struct net_device *dev,
>                         start = u64_stats_fetch_begin(&sq->stats.syncp);
>                         tpackets = u64_stats_read(&sq->stats.packets);
>                         tbytes   = u64_stats_read(&sq->stats.bytes);
> -                       terrors  = u64_stats_read(&sq->stats.tx_timeouts);
> +                       terrors  = u64_stats_read(&sq->stats.timeouts);
>                 } while (u64_stats_fetch_retry(&sq->stats.syncp, start));
>
>                 do {
> @@ -4639,7 +4639,7 @@ static void virtnet_tx_timeout(struct net_device *dev, unsigned int txqueue)
>         struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue);
>
>         u64_stats_update_begin(&sq->stats.syncp);
> -       u64_stats_inc(&sq->stats.tx_timeouts);
> +       u64_stats_inc(&sq->stats.timeouts);
>         u64_stats_update_end(&sq->stats.syncp);
>
>         netdev_err(dev, "TX timeout on queue: %u, sq: %s, vq: 0x%x, name: %s, %u usecs ago\n",
> --
> 2.32.0.3.g01195cf9f
>
Xuan Zhuo April 24, 2024, 8:23 a.m. UTC | #2
On Wed, 24 Apr 2024 11:55:24 +0800, Jason Wang <jasowang@redhat.com> wrote:
> On Tue, Apr 23, 2024 at 7:32 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> >
> > Now, we have this:
> >
> >     tx_queue_0_tx_timeouts
> >
> > This is used to record the tx schedule timeout.
> > But this has two "tx". I think the below is enough.
> >
> >     tx_queue_0_timeouts
> >
> > So I rename this field.
> >
> > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > Reviewed-by: Jiri Pirko <jiri@nvidia.com>
> > ---
> >  drivers/net/virtio_net.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index 8a4d22f5f5b1..51ce2308f4f5 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -87,7 +87,7 @@ struct virtnet_sq_stats {
> >         u64_stats_t xdp_tx;
> >         u64_stats_t xdp_tx_drops;
> >         u64_stats_t kicks;
> > -       u64_stats_t tx_timeouts;
> > +       u64_stats_t timeouts;
> >  };
> >
> >  struct virtnet_rq_stats {
> > @@ -111,7 +111,7 @@ static const struct virtnet_stat_desc virtnet_sq_stats_desc[] = {
> >         VIRTNET_SQ_STAT("xdp_tx",       xdp_tx),
> >         VIRTNET_SQ_STAT("xdp_tx_drops", xdp_tx_drops),
> >         VIRTNET_SQ_STAT("kicks",        kicks),
> > -       VIRTNET_SQ_STAT("tx_timeouts",  tx_timeouts),
> > +       VIRTNET_SQ_STAT("timeouts",     timeouts),
>
> Not sure if it is too late to do this as it is noticeable by the userspace.

OK. I remove this in next version.

Thanks.


>
> Thanks
>
> >  };
> >
> >  static const struct virtnet_stat_desc virtnet_rq_stats_desc[] = {
> > @@ -2691,7 +2691,7 @@ static void virtnet_stats(struct net_device *dev,
> >                         start = u64_stats_fetch_begin(&sq->stats.syncp);
> >                         tpackets = u64_stats_read(&sq->stats.packets);
> >                         tbytes   = u64_stats_read(&sq->stats.bytes);
> > -                       terrors  = u64_stats_read(&sq->stats.tx_timeouts);
> > +                       terrors  = u64_stats_read(&sq->stats.timeouts);
> >                 } while (u64_stats_fetch_retry(&sq->stats.syncp, start));
> >
> >                 do {
> > @@ -4639,7 +4639,7 @@ static void virtnet_tx_timeout(struct net_device *dev, unsigned int txqueue)
> >         struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue);
> >
> >         u64_stats_update_begin(&sq->stats.syncp);
> > -       u64_stats_inc(&sq->stats.tx_timeouts);
> > +       u64_stats_inc(&sq->stats.timeouts);
> >         u64_stats_update_end(&sq->stats.syncp);
> >
> >         netdev_err(dev, "TX timeout on queue: %u, sq: %s, vq: 0x%x, name: %s, %u usecs ago\n",
> > --
> > 2.32.0.3.g01195cf9f
> >
>
diff mbox series

Patch

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 8a4d22f5f5b1..51ce2308f4f5 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -87,7 +87,7 @@  struct virtnet_sq_stats {
 	u64_stats_t xdp_tx;
 	u64_stats_t xdp_tx_drops;
 	u64_stats_t kicks;
-	u64_stats_t tx_timeouts;
+	u64_stats_t timeouts;
 };
 
 struct virtnet_rq_stats {
@@ -111,7 +111,7 @@  static const struct virtnet_stat_desc virtnet_sq_stats_desc[] = {
 	VIRTNET_SQ_STAT("xdp_tx",       xdp_tx),
 	VIRTNET_SQ_STAT("xdp_tx_drops", xdp_tx_drops),
 	VIRTNET_SQ_STAT("kicks",        kicks),
-	VIRTNET_SQ_STAT("tx_timeouts",  tx_timeouts),
+	VIRTNET_SQ_STAT("timeouts",     timeouts),
 };
 
 static const struct virtnet_stat_desc virtnet_rq_stats_desc[] = {
@@ -2691,7 +2691,7 @@  static void virtnet_stats(struct net_device *dev,
 			start = u64_stats_fetch_begin(&sq->stats.syncp);
 			tpackets = u64_stats_read(&sq->stats.packets);
 			tbytes   = u64_stats_read(&sq->stats.bytes);
-			terrors  = u64_stats_read(&sq->stats.tx_timeouts);
+			terrors  = u64_stats_read(&sq->stats.timeouts);
 		} while (u64_stats_fetch_retry(&sq->stats.syncp, start));
 
 		do {
@@ -4639,7 +4639,7 @@  static void virtnet_tx_timeout(struct net_device *dev, unsigned int txqueue)
 	struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue);
 
 	u64_stats_update_begin(&sq->stats.syncp);
-	u64_stats_inc(&sq->stats.tx_timeouts);
+	u64_stats_inc(&sq->stats.timeouts);
 	u64_stats_update_end(&sq->stats.syncp);
 
 	netdev_err(dev, "TX timeout on queue: %u, sq: %s, vq: 0x%x, name: %s, %u usecs ago\n",