diff mbox series

[v2] net-sysfs: add a newline when printing 'tx_timeout' by sysfs

Message ID 1595314977-57991-1-git-send-email-wangxiongfeng2@huawei.com
State Accepted
Delegated to: David Miller
Headers show
Series [v2] net-sysfs: add a newline when printing 'tx_timeout' by sysfs | expand

Commit Message

Xiongfeng Wang July 21, 2020, 7:02 a.m. UTC
When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to
add a newline for easy reading.

root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
0root@syzkaller:~#

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
---
 net/core/net-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller July 21, 2020, 10:36 p.m. UTC | #1
From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Date: Tue, 21 Jul 2020 15:02:57 +0800

> When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to
> add a newline for easy reading.
> 
> root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
> 0root@syzkaller:~#
> 
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>

Applied, thank you.
Stephen Hemminger July 22, 2020, 3:27 p.m. UTC | #2
On Tue, 21 Jul 2020 15:36:32 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> Date: Tue, 21 Jul 2020 15:02:57 +0800
> 
> > When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to
> > add a newline for easy reading.
> > 
> > root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
> > 0root@syzkaller:~#
> > 
> > Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>  
> 
> Applied, thank you.

Could you add


Fixes: ccf5ff69fbbd ("net: new counter for tx_timeout errors in sysfs")
Cc: david.decotigny@google.com
David Miller July 22, 2020, 8:23 p.m. UTC | #3
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 22 Jul 2020 08:27:41 -0700

> On Tue, 21 Jul 2020 15:36:32 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
> 
>> From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
>> Date: Tue, 21 Jul 2020 15:02:57 +0800
>> 
>> > When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to
>> > add a newline for easy reading.
>> > 
>> > root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
>> > 0root@syzkaller:~#
>> > 
>> > Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>  
>> 
>> Applied, thank you.
> 
> Could you add

Stephen, of all people you should know by now that all of my commits
are %100 immutable.  So commit log changes cannot be made after I've
applied the patch, ever.
Joe Perches July 22, 2020, 8:46 p.m. UTC | #4
On Wed, 2020-07-22 at 13:23 -0700, David Miller wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Wed, 22 Jul 2020 08:27:41 -0700
> 
> > On Tue, 21 Jul 2020 15:36:32 -0700 (PDT)
> > David Miller <davem@davemloft.net> wrote:
> > 
> >> From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> >> Date: Tue, 21 Jul 2020 15:02:57 +0800
> >> 
> >> > When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to
> >> > add a newline for easy reading.
> >> > 
> >> > root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
> >> > 0root@syzkaller:~#
> >> > 
> >> > Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>  
> >> 
> >> Applied, thank you.
> > 
> > Could you add
> 
> Stephen, of all people you should know by now that all of my commits
> are %100 immutable.  So commit log changes cannot be made after I've
> applied the patch, ever.

Maybe it's time to use git notes?
Stephen Hemminger July 22, 2020, 9:27 p.m. UTC | #5
On Wed, 22 Jul 2020 13:23:11 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Wed, 22 Jul 2020 08:27:41 -0700
> 
> > On Tue, 21 Jul 2020 15:36:32 -0700 (PDT)
> > David Miller <davem@davemloft.net> wrote:
> >   
> >> From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> >> Date: Tue, 21 Jul 2020 15:02:57 +0800
> >>   
> >> > When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to
> >> > add a newline for easy reading.
> >> > 
> >> > root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
> >> > 0root@syzkaller:~#
> >> > 
> >> > Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>    
> >> 
> >> Applied, thank you.  
> > 
> > Could you add  
> 
> Stephen, of all people you should know by now that all of my commits
> are %100 immutable.  So commit log changes cannot be made after I've
> applied the patch, ever.

Will you send it to stable tree?
It could be added then.
diff mbox series

Patch

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index e353b82..7bd6440 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1108,7 +1108,7 @@  static ssize_t tx_timeout_show(struct netdev_queue *queue, char *buf)
 	trans_timeout = queue->trans_timeout;
 	spin_unlock_irq(&queue->_xmit_lock);
 
-	return sprintf(buf, "%lu", trans_timeout);
+	return sprintf(buf, fmt_ulong, trans_timeout);
 }
 
 static unsigned int get_netdev_queue_index(struct netdev_queue *queue)