Skip to content

Commit b45f64d

Browse files
jpirkodavem330
authored andcommitted
mlxsw: spectrum_router: Use FIB notifications instead of switchdev calls
Until now, in order to offload a FIB entry to HW we use switchdev op. However that has limits. Mainly in case we need to make the HW aware of all route prefixes configured in kernel. HW needs to know those in order to properly trap appropriate packets and pass the to kernel to do the forwarding. Abort mechanism is now handled within the mlxsw driver. Signed-off-by: Jiri Pirko <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c985018 commit b45f64d

File tree

3 files changed

+260
-195
lines changed

3 files changed

+260
-195
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include <linux/list.h>
4646
#include <linux/dcbnl.h>
4747
#include <linux/in6.h>
48-
#include <net/switchdev.h>
48+
#include <linux/notifier.h>
4949

5050
#include "port.h"
5151
#include "core.h"
@@ -257,6 +257,7 @@ struct mlxsw_sp_router {
257257
#define MLXSW_SP_UNRESOLVED_NH_PROBE_INTERVAL 5000 /* ms */
258258
struct list_head nexthop_group_list;
259259
struct list_head nexthop_neighs_list;
260+
bool aborted;
260261
};
261262

262263
struct mlxsw_sp {
@@ -296,6 +297,7 @@ struct mlxsw_sp {
296297
struct mlxsw_sp_span_entry *entries;
297298
int entries_count;
298299
} span;
300+
struct notifier_block fib_nb;
299301
};
300302

301303
static inline struct mlxsw_sp_upper *
@@ -584,11 +586,6 @@ static inline void mlxsw_sp_port_dcb_fini(struct mlxsw_sp_port *mlxsw_sp_port)
584586

585587
int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp);
586588
void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp);
587-
int mlxsw_sp_router_fib4_add(struct mlxsw_sp_port *mlxsw_sp_port,
588-
const struct switchdev_obj_ipv4_fib *fib4,
589-
struct switchdev_trans *trans);
590-
int mlxsw_sp_router_fib4_del(struct mlxsw_sp_port *mlxsw_sp_port,
591-
const struct switchdev_obj_ipv4_fib *fib4);
592589
int mlxsw_sp_router_neigh_construct(struct net_device *dev,
593590
struct neighbour *n);
594591
void mlxsw_sp_router_neigh_destroy(struct net_device *dev,

0 commit comments

Comments
 (0)