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
447 447
448static void448static void
449nfp_tun_write_neigh(struct net_device *netdev, struct nfp_app *app,449nfp_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)
451{452{
452 bool neigh_invalid = !(neigh->nud_state & NUD_VALID) || neigh->dead;453 bool neigh_invalid = !(neigh->nud_state & NUD_VALID) || neigh->dead;
453 size_t neigh_size = is_ipv6 ? sizeof(struct nfp_tun_neigh_v6) :454 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
546 if (nn_entry->flow)547 if (nn_entry->flow)
547 list_del(&nn_entry->list_head);548 list_del(&nn_entry->list_head);
548 kfree(nn_entry);549 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);
549 }557 }
550 558
551 spin_unlock_bh(&priv->predt_lock);559 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
610 618
611 dst_release(dst);619 dst_release(dst);
612 }620 }
613 nfp_tun_write_neigh(n->dev, app, &flow6, n, true);621 nfp_tun_write_neigh(n->dev, app, &flow6, n, true, false);
614#else622#else
615 return NOTIFY_DONE;623 return NOTIFY_DONE;
616#endif /* CONFIG_IPV6 */624#endif /* CONFIG_IPV6 */
@@ -633,7 +641,7 @@ nfp_tun_neigh_event_handler(struct notifier_block *nb, unsigned long event, · 16 unmodified lines
633 641
634 ip_rt_put(rt);642 ip_rt_put(rt);
635 }643 }
636 nfp_tun_write_neigh(n->dev, app, &flow4, n, false);644 nfp_tun_write_neigh(n->dev, app, &flow4, n, false, false);
637 }645 }
638#else646#else
639 return NOTIFY_DONE;647 return NOTIFY_DONE;
@@ -676,7 +684,7 @@ void nfp_tunnel_request_route_v4(struct nfp_app *app, struct sk_buff *skb) · 36 unmodified lines
676 ip_rt_put(rt);684 ip_rt_put(rt);
677 if (!n)685 if (!n)
678 goto fail_rcu_unlock;686 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);
680 neigh_release(n);688 neigh_release(n);
681 rcu_read_unlock();689 rcu_read_unlock();
682 return;690 return;
@@ -718,7 +726,7 @@ void nfp_tunnel_request_route_v6(struct nfp_app *app, struct sk_buff *skb) · 35 unmodified lines
718 if (!n)726 if (!n)
719 goto fail_rcu_unlock;727 goto fail_rcu_unlock;
720 728
721 nfp_tun_write_neigh(n->dev, app, &flow, n, true);729 nfp_tun_write_neigh(n->dev, app, &flow, n, true, true);
722 neigh_release(n);730 neigh_release(n);
723 rcu_read_unlock();731 rcu_read_unlock();
724 return;732 return;