mlxsw: spectrum_router: Export IPv6 link local address check helper
authorArkadi Sharshevsky <arkadis@mellanox.com>
Thu, 31 Aug 2017 15:59:13 +0000 (17:59 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Aug 2017 21:42:19 +0000 (14:42 -0700)
Neighbors with link local addresses are not offloaded to the host table,
yet, the are maintained in the driver for adjacency table usage. When
dumping the IPv6 host neighbors this link local neighbors should be
ignored. This patch exports this helper for dpipe usage.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h

index 377d85cff7fab9204c4d0c4b37bb606bf4cfa6c8..1f41bcdf04ca2f6e199673356fe4dd81dff2cbc0 100644 (file)
@@ -1396,8 +1396,10 @@ mlxsw_sp_router_neigh_entry_op6(struct mlxsw_sp *mlxsw_sp,
        mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rauht), rauht_pl);
 }
 
-static bool mlxsw_sp_neigh_ipv6_ignore(struct neighbour *n)
+bool mlxsw_sp_neigh_ipv6_ignore(struct mlxsw_sp_neigh_entry *neigh_entry)
 {
+       struct neighbour *n = neigh_entry->key.n;
+
        /* Packets with a link-local destination address are trapped
         * after LPM lookup and never reach the neighbour table, so
         * there is no need to program such neighbours to the device.
@@ -1420,7 +1422,7 @@ mlxsw_sp_neigh_entry_update(struct mlxsw_sp *mlxsw_sp,
                mlxsw_sp_router_neigh_entry_op4(mlxsw_sp, neigh_entry,
                                                mlxsw_sp_rauht_op(adding));
        } else if (neigh_entry->key.n->tbl->family == AF_INET6) {
-               if (mlxsw_sp_neigh_ipv6_ignore(neigh_entry->key.n))
+               if (mlxsw_sp_neigh_ipv6_ignore(neigh_entry))
                        return;
                mlxsw_sp_router_neigh_entry_op6(mlxsw_sp, neigh_entry,
                                                mlxsw_sp_rauht_op(adding));
index fb0f971c670cb9c5084170c78a0fae3d34340957..5b68616a42343f9e4a38140f8479bf064527d88c 100644 (file)
@@ -76,5 +76,6 @@ void
 mlxsw_sp_neigh_entry_counter_update(struct mlxsw_sp *mlxsw_sp,
                                    struct mlxsw_sp_neigh_entry *neigh_entry,
                                    bool adding);
+bool mlxsw_sp_neigh_ipv6_ignore(struct mlxsw_sp_neigh_entry *neigh_entry);
 
 #endif /* _MLXSW_ROUTER_H_*/