lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 22 Jan 2019 00:20:09 +0200
From:   Or Gerlitz <gerlitz.or@...il.com>
To:     Tonghao Zhang <xiangxia.m.yue@...il.com>
Cc:     Saeed Mahameed <saeedm@...lanox.com>,
        Linux Netdev List <netdev@...r.kernel.org>,
        Hadar Hen Zion <hadarh@...lanox.com>
Subject: Re: [PATCH net-next v2 1/2] net/mlx5e: Update hw flows when encap
 source mac changed

On Mon, Jan 21, 2019 at 1:20 PM <xiangxia.m.yue@...il.com> wrote:
>
> From: Tonghao Zhang <xiangxia.m.yue@...il.com>
>
> When we offload tc filters to hardware, hardware flows can
> be updated when mac of encap destination ip is changed.
> But we ignore one case, that the mac of local encap ip can
> be changed too, so we should also update them.
>
> To fix it, add route_dev in mlx5e_encap_entry struct to save
> the local encap netdevice, and when mac changed, kernel will
> flush all the neighbour on the netdevice and send NETEVENT_NEIGH_UPDATE
> event. The mlx5 driver will delete the flows and add them when neighbour
> available again.
>
> Fixes: 232c001398ae ("net/mlx5e: Add support to neighbour update flow")
> Cc: Hadar Hen Zion <hadarh@...lanox.com>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@...il.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 1 +
>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.c    | 4 ++++
>  drivers/net/ethernet/mellanox/mlx5/core/en_rep.h    | 1 +
>  3 files changed, 6 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
> index 046948e..156b2b3 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
> @@ -256,6 +256,7 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,

please address the ipv6 tunnel path as well

>         e->m_neigh.family = n->ops->family;
>         memcpy(&e->m_neigh.dst_ip, n->primary_key, n->tbl->key_len);
>         e->out_dev = out_dev;
> +       e->route_dev = route_dev;



>
>         /* It's important to add the neigh to the hash table before checking
>          * the neigh validity state. So if we'll get a notification, in case the
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> index 96cc0c6..c4b9073 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
> @@ -594,6 +594,10 @@ static void mlx5e_rep_update_flows(struct mlx5e_priv *priv,
>         if (neigh_connected && !(e->flags & MLX5_ENCAP_ENTRY_VALID)) {
>                 ether_addr_copy(e->h_dest, ha);
>                 ether_addr_copy(eth->h_dest, ha);
> +               /* Update the encap source mac, in case that we delete
> +                * the flows when encap source mac changed.
> +                */
> +               ether_addr_copy(eth->h_source, e->route_dev->dev_addr);

there's must be some other location in the code which currently sets
the source mac. I need to look deeper but I suspect it has to be removed
and only the one you added should stay

Powered by blists - more mailing lists