Skip to content

Commit

Permalink
Merge pull request majek#5 from lilydjwg/master
Browse files Browse the repository at this point in the history
softnet.sh: older kernels have only ten fields for /proc/net/softnet_stat
  • Loading branch information
majek committed Mar 2, 2016
2 parents d9d5a2b + cfb1b15 commit 92a21e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion how-to-receive-a-packet/softnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ cpu=0
softnet_stats_header
while read total dropped squeezed j1 j2 j3 j4 j5 collision rps flow_limit_count
do
softnet_stats_format $((cpu++)) "$total" "$dropped" "$squeezed" "$collision" "$rps" "$flow_limit_count"
# the last field does not appear on older kernels
# https://github.com/torvalds/linux/commit/99bbc70741903c063b3ccad90a3e06fc55df9245#diff-5dd540e75b320a50866267e9c52b3289R165
softnet_stats_format $((cpu++)) "$total" "$dropped" "$squeezed" "$collision" "$rps" "${flow_limit_count:-0}"
done < /proc/net/softnet_stat

0 comments on commit 92a21e5

Please sign in to comment.