aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/net_dropmonitor.py
diff options
context:
space:
mode:
authorXie He <[email protected]>2020-10-31 11:10:40 -0700
committerJakub Kicinski <[email protected]>2020-11-03 15:19:09 -0800
commit14b20704a18062249903a7a930e27c4452bc56bc (patch)
treeca741585909aef15fb4cce98f29e6e9750ed4916 /tools/perf/scripts/python/net_dropmonitor.py
parent583d5333ed7dcdc0c7a3f8ec8b818b7ae4a59e8e (diff)
net: hdlc_fr: Change the use of "dev" in fr_rx to make the code cleaner
The eth_type_trans function is called when we receive frames carrying Ethernet frames. This function expects a non-NULL pointer as an argument, and assigns it directly to skb->dev. However, the code handling other types of frames first assigns the pointer to "dev", and then at the end checks whether the value is NULL, and if it is not NULL, assigns it to skb->dev. The two flows are different. Mixing them in this function makes the code messy. It's better that we convert the second flow to align with how eth_type_trans does things. So this patch changes the code to: first make sure the pointer is not NULL, then assign it directly to skb->dev. "dev" is no longer needed until the end where we use it to update stats. Cc: Krzysztof Halasa <[email protected]> Cc: Willem de Bruijn <[email protected]> Signed-off-by: Xie He <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions