Commit 902bca00dc6e3b3ff5fbb1e32e5dbb45d5f30579
1 parent
e53beacd23
Exists in
master
and in
4 other branches
firewire: net: count stats.tx_packets and stats.tx_bytes
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Showing 1 changed file with 6 additions and 3 deletions Side-by-side Diff
drivers/firewire/net.c
... | ... | @@ -906,6 +906,7 @@ |
906 | 906 | static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) |
907 | 907 | { |
908 | 908 | struct fwnet_device *dev = ptask->dev; |
909 | + struct sk_buff *skb = ptask->skb; | |
909 | 910 | unsigned long flags; |
910 | 911 | bool free; |
911 | 912 | |
912 | 913 | |
... | ... | @@ -916,8 +917,11 @@ |
916 | 917 | /* Check whether we or the networking TX soft-IRQ is last user. */ |
917 | 918 | free = (ptask->outstanding_pkts == 0 && !list_empty(&ptask->pt_link)); |
918 | 919 | |
919 | - if (ptask->outstanding_pkts == 0) | |
920 | + if (ptask->outstanding_pkts == 0) { | |
920 | 921 | list_del(&ptask->pt_link); |
922 | + dev->netdev->stats.tx_packets++; | |
923 | + dev->netdev->stats.tx_bytes += skb->len; | |
924 | + } | |
921 | 925 | |
922 | 926 | spin_unlock_irqrestore(&dev->lock, flags); |
923 | 927 | |
... | ... | @@ -926,7 +930,6 @@ |
926 | 930 | u16 fg_off; |
927 | 931 | u16 datagram_label; |
928 | 932 | u16 lf; |
929 | - struct sk_buff *skb; | |
930 | 933 | |
931 | 934 | /* Update the ptask to point to the next fragment and send it */ |
932 | 935 | lf = fwnet_get_hdr_lf(&ptask->hdr); |
... | ... | @@ -953,7 +956,7 @@ |
953 | 956 | datagram_label = fwnet_get_hdr_dgl(&ptask->hdr); |
954 | 957 | break; |
955 | 958 | } |
956 | - skb = ptask->skb; | |
959 | + | |
957 | 960 | skb_pull(skb, ptask->max_payload); |
958 | 961 | if (ptask->outstanding_pkts > 1) { |
959 | 962 | fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG, |