LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] net: hns: Avoid action name truncation
@ 2018-04-19  3:55 dann frazier
  2018-04-19 20:30 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: dann frazier @ 2018-04-19  3:55 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S. Miller
  Cc: netdev, linux-kernel, Lin Yun Sheng

When longer interface names are used, the action names exposed in
/proc/interrupts and /proc/irq/* maybe truncated. For example, when
using the predictable name algorithm in systemd on a HiSilicon D05,
I see:

  ubuntu@d05-3:~$  grep enahisic2i0-tx /proc/interrupts | sed 's/.* //'
  enahisic2i0-tx0
  enahisic2i0-tx1
  [...]
  enahisic2i0-tx8
  enahisic2i0-tx9
  enahisic2i0-tx1
  enahisic2i0-tx1
  enahisic2i0-tx1
  enahisic2i0-tx1
  enahisic2i0-tx1
  enahisic2i0-tx1

Increase the max ring name length to allow for an interface name
of IFNAMSIZE. After this change, I now see:

  $ grep enahisic2i0-tx /proc/interrupts | sed 's/.* //'
  enahisic2i0-tx0
  enahisic2i0-tx1
  enahisic2i0-tx2
  [...]
  enahisic2i0-tx8
  enahisic2i0-tx9
  enahisic2i0-tx10
  enahisic2i0-tx11
  enahisic2i0-tx12
  enahisic2i0-tx13
  enahisic2i0-tx14
  enahisic2i0-tx15

Signed-off-by: dann frazier <dann.frazier@canonical.com>
---
 drivers/net/ethernet/hisilicon/hns/hnae.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.h b/drivers/net/ethernet/hisilicon/hns/hnae.h
index 3e62692af011..fa5b30f547f6 100644
--- a/drivers/net/ethernet/hisilicon/hns/hnae.h
+++ b/drivers/net/ethernet/hisilicon/hns/hnae.h
@@ -87,7 +87,7 @@ do { \
 
 #define HNAE_AE_REGISTER 0x1
 
-#define RCB_RING_NAME_LEN 16
+#define RCB_RING_NAME_LEN (IFNAMSIZ + 4)
 
 #define HNAE_LOWEST_LATENCY_COAL_PARAM	30
 #define HNAE_LOW_LATENCY_COAL_PARAM	80
-- 
2.17.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: hns: Avoid action name truncation
  2018-04-19  3:55 [PATCH] net: hns: Avoid action name truncation dann frazier
@ 2018-04-19 20:30 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-04-19 20:30 UTC (permalink / raw)
  To: dann.frazier; +Cc: yisen.zhuang, salil.mehta, netdev, linux-kernel, linyunsheng

From: dann frazier <dann.frazier@canonical.com>
Date: Wed, 18 Apr 2018 21:55:41 -0600

> When longer interface names are used, the action names exposed in
> /proc/interrupts and /proc/irq/* maybe truncated. For example, when
> using the predictable name algorithm in systemd on a HiSilicon D05,
> I see:
> 
>   ubuntu@d05-3:~$  grep enahisic2i0-tx /proc/interrupts | sed 's/.* //'
>   enahisic2i0-tx0
>   enahisic2i0-tx1
>   [...]
>   enahisic2i0-tx8
>   enahisic2i0-tx9
>   enahisic2i0-tx1
>   enahisic2i0-tx1
>   enahisic2i0-tx1
>   enahisic2i0-tx1
>   enahisic2i0-tx1
>   enahisic2i0-tx1
> 
> Increase the max ring name length to allow for an interface name
> of IFNAMSIZE. After this change, I now see:
> 
>   $ grep enahisic2i0-tx /proc/interrupts | sed 's/.* //'
>   enahisic2i0-tx0
>   enahisic2i0-tx1
>   enahisic2i0-tx2
>   [...]
>   enahisic2i0-tx8
>   enahisic2i0-tx9
>   enahisic2i0-tx10
>   enahisic2i0-tx11
>   enahisic2i0-tx12
>   enahisic2i0-tx13
>   enahisic2i0-tx14
>   enahisic2i0-tx15
> 
> Signed-off-by: dann frazier <dann.frazier@canonical.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-19 20:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19  3:55 [PATCH] net: hns: Avoid action name truncation dann frazier
2018-04-19 20:30 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).