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.
Unified · Split
| @@ -447,7 +447,8 @@ void nfp_tun_unlink_and_update_nn_entries(struct nfp_app *app, · 446 unmodified lines | ||
| 447 | 447 | |
| 448 | 448 | static void |
| 449 | 449 | 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) | |
| 451 | 452 | { |
| 452 | 453 | bool neigh_invalid = !(neigh->nud_state & NUD_VALID) || neigh->dead; |
| 453 | 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 | 547 | if (nn_entry->flow) |
| 547 | 548 | list_del(&nn_entry->list_head); |
| 548 | 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 | 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 | 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 | 622 | #else |
| 615 | 623 | return NOTIFY_DONE; |
| 616 | 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 | 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 | 646 | #else |
| 639 | 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 | 684 | ip_rt_put(rt); |
| 677 | 685 | if (!n) |
| 678 | 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 | 688 | neigh_release(n); |
| 681 | 689 | rcu_read_unlock(); |
| 682 | 690 | return; |
| @@ -718,7 +726,7 @@ void nfp_tunnel_request_route_v6(struct nfp_app *app, struct sk_buff *skb) · 35 unmodified lines | ||
| 718 | 726 | if (!n) |
| 719 | 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 | 730 | neigh_release(n); |
| 723 | 731 | rcu_read_unlock(); |
| 724 | 732 | return; |