Commit b7a59557 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: fib_notifier: propagate extack down to the notifier block callback



Since errors are propagated all the way up to the caller, propagate
possible extack of the caller all the way down to the notifier block
callback.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3f9e5c11
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ int mlx5_lag_mp_init(struct mlx5_lag *ldev)

	mp->fib_nb.notifier_call = mlx5_lag_fib_event;
	err = register_fib_notifier(&init_net, &mp->fib_nb,
				    mlx5_lag_fib_event_flush);
				    mlx5_lag_fib_event_flush, NULL);
	if (err)
		mp->fib_nb.notifier_call = NULL;

+1 −1
Original line number Diff line number Diff line
@@ -8135,7 +8135,7 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp)

	mlxsw_sp->router->fib_nb.notifier_call = mlxsw_sp_router_fib_event;
	err = register_fib_notifier(&init_net, &mlxsw_sp->router->fib_nb,
				    mlxsw_sp_router_fib_dump_flush);
				    mlxsw_sp_router_fib_dump_flush, NULL);
	if (err)
		goto err_register_fib_notifier;

+1 −1
Original line number Diff line number Diff line
@@ -2991,7 +2991,7 @@ static int rocker_probe(struct pci_dev *pdev, const struct pci_device_id *id)
	 * the device, so no need to pass a callback.
	 */
	rocker->fib_nb.notifier_call = rocker_router_fib_event;
	err = register_fib_notifier(&init_net, &rocker->fib_nb, NULL);
	err = register_fib_notifier(&init_net, &rocker->fib_nb, NULL, NULL);
	if (err)
		goto err_register_fib_notifier;

+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ struct nsim_fib_data *nsim_fib_create(struct devlink *devlink)

	data->fib_nb.notifier_call = nsim_fib_event_nb;
	err = register_fib_notifier(&init_net, &data->fib_nb,
				    nsim_fib_dump_inconsistent);
				    nsim_fib_dump_inconsistent, NULL);
	if (err) {
		pr_err("Failed to register fib notifier\n");
		goto err_out;
+12 −6
Original line number Diff line number Diff line
@@ -50,11 +50,13 @@ static inline int mr_call_vif_notifier(struct notifier_block *nb,
				       unsigned short family,
				       enum fib_event_type event_type,
				       struct vif_device *vif,
				       unsigned short vif_index, u32 tb_id)
				       unsigned short vif_index, u32 tb_id,
				       struct netlink_ext_ack *extack)
{
	struct vif_entry_notifier_info info = {
		.info = {
			.family = family,
			.extack = extack,
		},
		.dev = vif->dev,
		.vif_index = vif_index,
@@ -172,11 +174,13 @@ struct mfc_entry_notifier_info {
static inline int mr_call_mfc_notifier(struct notifier_block *nb,
				       unsigned short family,
				       enum fib_event_type event_type,
				       struct mr_mfc *mfc, u32 tb_id)
				       struct mr_mfc *mfc, u32 tb_id,
				       struct netlink_ext_ack *extack)
{
	struct mfc_entry_notifier_info info = {
		.info = {
			.family = family,
			.extack = extack,
		},
		.mfc = mfc,
		.tb_id = tb_id
@@ -295,10 +299,11 @@ int mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb,

int mr_dump(struct net *net, struct notifier_block *nb, unsigned short family,
	    int (*rules_dump)(struct net *net,
			      struct notifier_block *nb),
			      struct notifier_block *nb,
			      struct netlink_ext_ack *extack),
	    struct mr_table *(*mr_iter)(struct net *net,
					struct mr_table *mrt),
	    rwlock_t *mrt_lock);
	    rwlock_t *mrt_lock, struct netlink_ext_ack *extack);
#else
static inline void vif_device_init(struct vif_device *v,
				   struct net_device *dev,
@@ -349,10 +354,11 @@ mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb,
static inline int mr_dump(struct net *net, struct notifier_block *nb,
			  unsigned short family,
			  int (*rules_dump)(struct net *net,
					    struct notifier_block *nb),
					    struct notifier_block *nb,
					    struct netlink_ext_ack *extack),
			  struct mr_table *(*mr_iter)(struct net *net,
						      struct mr_table *mrt),
			  rwlock_t *mrt_lock)
			  rwlock_t *mrt_lock, struct netlink_ext_ack *extack)
{
	return -EINVAL;
}
Loading