History

nfp: flower: configure tunnel neighbour on cmsg rx

nfp_tun_write_neigh() function will configure a tunnel neighbour when calling nfp_tun_neigh_event_handler() or nfp_flower_cmsg_process_one_rx() (with no tunnel neighbour type) from firmware. When configuring IP on physical port as a tunnel endpoint, no operation will be performed after receiving the cmsg mentioned above. Therefore, add a progress to configure tunnel neighbour in this case. v2: Correct format of fixes tag.

Tianyu Yuan committed 4 years ago

Commit 656bd031 parent 3d8c51b1 file · +13 −5Browse files

Unified · Split

drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c+13−5
@@ -447,7 +447,8 @@ void nfp_tun_unlink_and_update_nn_entries(struct nfp_app *app, · 446 unmodified lines
447447
448448 static void
449449 nfp_tun_write_neigh(struct net_device *netdev, struct nfp_app *app,
450− void *flow, struct neighbour *neigh, bool is_ipv6)
450+ void *flow, struct neighbour *neigh, bool is_ipv6,
451+ bool override)
451452 {
452453 bool neigh_invalid = !(neigh->nud_state & NUD_VALID) || neigh->dead;
453454 size_t neigh_size = is_ipv6 ? sizeof(struct nfp_tun_neigh_v6) :
@@ -546,6 +547,13 @@ nfp_tun_write_neigh(struct net_device *netdev, struct nfp_app *app, · 92 unmodified lines
546547 if (nn_entry->flow)
547548 list_del(&nn_entry->list_head);
548549 kfree(nn_entry);
550+ } else if (nn_entry && !neigh_invalid && override) {
551+ mtype = is_ipv6 ? NFP_FLOWER_CMSG_TYPE_TUN_NEIGH_V6 :
552+ NFP_FLOWER_CMSG_TYPE_TUN_NEIGH;
553+ nfp_tun_link_predt_entries(app, nn_entry);
554+ nfp_flower_xmit_tun_conf(app, mtype, neigh_size,
555+ nn_entry->payload,
556+ GFP_ATOMIC);
549557 }
550558
551559 spin_unlock_bh(&priv->predt_lock);
@@ -610,7 +618,7 @@ nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event, · 58 unmodified lines
610618
611619 dst_release(dst);
612620 }
613− nfp_tun_write_neigh(n->dev, app, &flow6, n, true);
621+ nfp_tun_write_neigh(n->dev, app, &flow6, n, true, false);
614622 #else
615623 return NOTIFY_DONE;
616624 #endif /* CONFIG_IPV6 */
@@ -633,7 +641,7 @@ nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event, · 16 unmodified lines
633641
634642 ip_rt_put(rt);
635643 }
636− nfp_tun_write_neigh(n->dev, app, &flow4, n, false);
644+ nfp_tun_write_neigh(n->dev, app, &flow4, n, false, false);
637645 }
638646 #else
639647 return NOTIFY_DONE;
@@ -676,7 +684,7 @@ void nfp_tunnel_request_route_v4(struct nfp_app *app, struct sk_buff *skb) · 36 unmodified lines
676684 ip_rt_put(rt);
677685 if (!n)
678686 goto fail_rcu_unlock;
679− nfp_tun_write_neigh(n->dev, app, &flow, n, false);
687+ nfp_tun_write_neigh(n->dev, app, &flow, n, false, true);
680688 neigh_release(n);
681689 rcu_read_unlock();
682690 return;
@@ -718,7 +726,7 @@ void nfp_tunnel_request_route_v6(struct nfp_app *app, struct sk_buff *skb) · 35 unmodified lines
718726 if (!n)
719727 goto fail_rcu_unlock;
720728
721− nfp_tun_write_neigh(n->dev, app, &flow, n, true);
729+ nfp_tun_write_neigh(n->dev, app, &flow, n, true, true);
722730 neigh_release(n);
723731 rcu_read_unlock();
724732 return;