diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2017-10-17 12:33:43 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2017-10-26 00:47:27 -0700 |
commit | 3c37745ec614ff048d5dce38f976804b05d307ee (patch) | |
tree | 60df9abe2901def1827f7fc166b88f4ccb98b7ae /virt | |
parent | 4ca637a20a524cd8ddbca696f12bfa92111c96e3 (diff) | |
download | linux-3c37745ec614ff048d5dce38f976804b05d307ee.tar.gz linux-3c37745ec614ff048d5dce38f976804b05d307ee.tar.bz2 linux-3c37745ec614ff048d5dce38f976804b05d307ee.zip |
net/mlx5e: Properly deal with encap flows add/del under neigh update
Currently, the encap action offload is handled in the actions parse
function and not in mlx5e_tc_add_fdb_flow() where we deal with all
the other aspects of offloading actions (vlan, modify header) and
the rule itself.
When the neigh update code (mlx5e_tc_encap_flows_add()) recreates the
encap entry and offloads the related flows, we wrongly call again into
mlx5e_tc_add_fdb_flow(), this for itself would cause us to handle
again the offloading of vlans and header re-write which puts things
in non consistent state and step on freed memory (e.g the modify
header parse buffer which is already freed).
Since on error, mlx5e_tc_add_fdb_flow() detaches and may release the
encap entry, it causes a corruption at the neigh update code which goes
over the list of flows associated with this encap entry, or double free
when the tc flow is later deleted by user-space.
When neigh update (mlx5e_tc_encap_flows_del()) unoffloads the flows related
to an encap entry which is now invalid, we do a partial repeat of the eswitch
flow removal code which is wrong too.
To fix things up we do the following:
(1) handle the encap action offload in the eswitch flow add function
mlx5e_tc_add_fdb_flow() as done for the other actions and the rule itself.
(2) modify the neigh update code (mlx5e_tc_encap_flows_add/del) to only
deal with the encap entry and rules delete/add and not with any of
the other offloaded actions.
Fixes: 232c001398ae ('net/mlx5e: Add support to neighbour update flow')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions