diff mbox series

net: hns: Avoid action name truncation

Message ID 20180419035541.6318-1-dann.frazier@canonical.com
State Accepted
Commit f4ea89110df237da6fbcaab76af431e85f07d904
Headers show
Series net: hns: Avoid action name truncation | expand

Commit Message

dann frazier April 19, 2018, 3:55 a.m. UTC
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(-)

-- 
2.17.0

Comments

David Miller April 19, 2018, 8:30 p.m. UTC | #1
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.
diff mbox series

Patch

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