]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_trap: Push Ethernet header before reporting trap
authorIdo Schimmel <idosch@mellanox.com>
Thu, 17 Oct 2019 07:11:03 +0000 (10:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Oct 2019 17:15:09 +0000 (10:15 -0700)
commitde26054cd2eb093043eed99a61d6fe0b660cd5cf
tree568db4733b51da56748ed3613cdda7201decaafe
parentf7b0445d9e4daf3da2080ac6ac0df6110c6f59fa
mlxsw: spectrum_trap: Push Ethernet header before reporting trap

devlink maintains packets and bytes statistics for each trap. Since
eth_type_trans() was called to set the skb's protocol, the data pointer
no longer points to the start of the packet and the bytes accounting is
off by 14 bytes.

Fix this by pushing the skb's data pointer to the start of the packet.

Fixes: f313c87b4f4e ("mlxsw: spectrum: Add devlink-trap support")
Reported-by: Alex Kushnarov <alexanderk@mellanox.com>
Tested-by: Alex Kushnarov <alexanderk@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c