Skip to content

Commit ee2c46f

Browse files
Murali Karicheridavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3271273 commit ee2c46f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/hsr/hsr_forward.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,13 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port)
359359
goto out_drop;
360360
hsr_register_frame_in(frame.node_src, port, frame.sequence_nr);
361361
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+
}
362369

363370
if (frame.skb_hsr)
364371
kfree_skb(frame.skb_hsr);

0 commit comments

Comments
 (0)