diff options
author | Murali Karicheri <m-karicheri2@ti.com> | 2019-04-15 11:36:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-15 20:22:02 -0400 |
commit | ee2c46f353901a41513ca0776d6bb6e6fd39cb98 (patch) | |
tree | 49b3133409c2ba5b9c02b5a9e451d8d8aa63ab12 /net/hsr/hsr_forward.c | |
parent | 3271273388fb14a4e8c582a8c7eaf5ef958291b1 (diff) |
net: hsr: add tx stats for master interface
Add tx stats to hsr interface. Without this
ifconfig for hsr interface doesn't show tx packet stats.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr/hsr_forward.c')
-rw-r--r-- | net/hsr/hsr_forward.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 0cac992192d0..ddd9605bad04 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c | |||
@@ -359,6 +359,13 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port) | |||
359 | goto out_drop; | 359 | goto out_drop; |
360 | hsr_register_frame_in(frame.node_src, port, frame.sequence_nr); | 360 | hsr_register_frame_in(frame.node_src, port, frame.sequence_nr); |
361 | hsr_forward_do(&frame); | 361 | hsr_forward_do(&frame); |
362 | /* Gets called for ingress frames as well as egress from master port. | ||
363 | * So check and increment stats for master port only here. | ||
364 | */ | ||
365 | if (port->type == HSR_PT_MASTER) { | ||
366 | port->dev->stats.tx_packets++; | ||
367 | port->dev->stats.tx_bytes += skb->len; | ||
368 | } | ||
362 | 369 | ||
363 | if (frame.skb_hsr) | 370 | if (frame.skb_hsr) |
364 | kfree_skb(frame.skb_hsr); | 371 | kfree_skb(frame.skb_hsr); |