Lines Matching refs:port
43 struct net_bridge_port *port);
45 struct net_bridge_port *port,
53 struct net_bridge_port *port,
291 br_mdb_notify(br->dev, p->port, &pg->addr, RTM_DELMDB, in br_multicast_del_pg()
308 struct net_bridge *br = pg->port->br; in br_multicast_port_group_expired()
592 struct net_bridge *br, struct net_bridge_port *port, in br_multicast_get_group() argument
616 port ? port->dev->name : br->dev->name); in br_multicast_get_group()
627 port ? port->dev->name : br->dev->name); in br_multicast_get_group()
640 port ? port->dev->name : br->dev->name); in br_multicast_get_group()
649 port ? port->dev->name : br->dev->name, in br_multicast_get_group()
715 struct net_bridge_port *port, in br_multicast_new_port_group() argument
728 p->port = port; in br_multicast_new_port_group()
731 hlist_add_head(&p->mglist, &port->mglist); in br_multicast_new_port_group()
744 struct net_bridge_port *port, in br_port_group_equal() argument
747 if (p->port != port) in br_port_group_equal()
750 if (!(port->flags & BR_MULTICAST_TO_UNICAST)) in br_port_group_equal()
757 struct net_bridge_port *port, in br_multicast_add_group() argument
769 (port && port->state == BR_STATE_DISABLED)) in br_multicast_add_group()
772 mp = br_multicast_new_group(br, port, group); in br_multicast_add_group()
777 if (!port) { in br_multicast_add_group()
786 if (br_port_group_equal(p, port, src)) in br_multicast_add_group()
788 if ((unsigned long)p->port < (unsigned long)port) in br_multicast_add_group()
792 p = br_multicast_new_port_group(port, group, *pp, 0, src); in br_multicast_add_group()
796 br_mdb_notify(br->dev, port, group, RTM_NEWMDB, 0); in br_multicast_add_group()
809 struct net_bridge_port *port, in br_ip4_multicast_add_group() argument
823 return br_multicast_add_group(br, port, &br_group, src); in br_ip4_multicast_add_group()
828 struct net_bridge_port *port, in br_ip6_multicast_add_group() argument
842 return br_multicast_add_group(br, port, &br_group, src); in br_ip6_multicast_add_group()
848 struct net_bridge_port *port = (void *)data; in br_multicast_router_expired() local
849 struct net_bridge *br = port->br; in br_multicast_router_expired()
852 if (port->multicast_router == MDB_RTR_TYPE_DISABLED || in br_multicast_router_expired()
853 port->multicast_router == MDB_RTR_TYPE_PERM || in br_multicast_router_expired()
854 timer_pending(&port->multicast_router_timer)) in br_multicast_router_expired()
857 __del_port_router(port); in br_multicast_router_expired()
908 struct net_bridge_port *port, in __br_multicast_send_query() argument
918 if (port) { in __br_multicast_send_query()
919 skb->dev = port->dev; in __br_multicast_send_query()
920 br_multicast_count(br, port, skb, igmp_type, in __br_multicast_send_query()
923 dev_net(port->dev), NULL, skb, NULL, skb->dev, in __br_multicast_send_query()
927 br_multicast_count(br, port, skb, igmp_type, in __br_multicast_send_query()
934 struct net_bridge_port *port, in br_multicast_send_query() argument
947 if (port ? (own_query == &port->ip4_own_query) : in br_multicast_send_query()
961 __br_multicast_send_query(br, port, &br_group); in br_multicast_send_query()
971 br_multicast_port_query_expired(struct net_bridge_port *port, in br_multicast_port_query_expired() argument
974 struct net_bridge *br = port->br; in br_multicast_port_query_expired()
977 if (port->state == BR_STATE_DISABLED || in br_multicast_port_query_expired()
978 port->state == BR_STATE_BLOCKING) in br_multicast_port_query_expired()
984 br_multicast_send_query(port->br, port, query); in br_multicast_port_query_expired()
992 struct net_bridge_port *port = (void *)data; in br_ip4_multicast_port_query_expired() local
994 br_multicast_port_query_expired(port, &port->ip4_own_query); in br_ip4_multicast_port_query_expired()
1000 struct net_bridge_port *port = (void *)data; in br_ip6_multicast_port_query_expired() local
1002 br_multicast_port_query_expired(port, &port->ip6_own_query); in br_ip6_multicast_port_query_expired()
1018 int br_multicast_add_port(struct net_bridge_port *port) in br_multicast_add_port() argument
1020 port->multicast_router = MDB_RTR_TYPE_TEMP_QUERY; in br_multicast_add_port()
1022 setup_timer(&port->multicast_router_timer, br_multicast_router_expired, in br_multicast_add_port()
1023 (unsigned long)port); in br_multicast_add_port()
1024 setup_timer(&port->ip4_own_query.timer, in br_multicast_add_port()
1025 br_ip4_multicast_port_query_expired, (unsigned long)port); in br_multicast_add_port()
1027 setup_timer(&port->ip6_own_query.timer, in br_multicast_add_port()
1028 br_ip6_multicast_port_query_expired, (unsigned long)port); in br_multicast_add_port()
1030 br_mc_disabled_update(port->dev, port->br->multicast_disabled); in br_multicast_add_port()
1032 port->mcast_stats = netdev_alloc_pcpu_stats(struct bridge_mcast_stats); in br_multicast_add_port()
1033 if (!port->mcast_stats) in br_multicast_add_port()
1039 void br_multicast_del_port(struct net_bridge_port *port) in br_multicast_del_port() argument
1041 struct net_bridge *br = port->br; in br_multicast_del_port()
1047 hlist_for_each_entry_safe(pg, n, &port->mglist, mglist) in br_multicast_del_port()
1050 del_timer_sync(&port->multicast_router_timer); in br_multicast_del_port()
1051 free_percpu(port->mcast_stats); in br_multicast_del_port()
1063 static void __br_multicast_enable_port(struct net_bridge_port *port) in __br_multicast_enable_port() argument
1065 struct net_bridge *br = port->br; in __br_multicast_enable_port()
1070 br_multicast_enable(&port->ip4_own_query); in __br_multicast_enable_port()
1072 br_multicast_enable(&port->ip6_own_query); in __br_multicast_enable_port()
1074 if (port->multicast_router == MDB_RTR_TYPE_PERM && in __br_multicast_enable_port()
1075 hlist_unhashed(&port->rlist)) in __br_multicast_enable_port()
1076 br_multicast_add_router(br, port); in __br_multicast_enable_port()
1079 void br_multicast_enable_port(struct net_bridge_port *port) in br_multicast_enable_port() argument
1081 struct net_bridge *br = port->br; in br_multicast_enable_port()
1084 __br_multicast_enable_port(port); in br_multicast_enable_port()
1088 void br_multicast_disable_port(struct net_bridge_port *port) in br_multicast_disable_port() argument
1090 struct net_bridge *br = port->br; in br_multicast_disable_port()
1095 hlist_for_each_entry_safe(pg, n, &port->mglist, mglist) in br_multicast_disable_port()
1099 __del_port_router(port); in br_multicast_disable_port()
1101 del_timer(&port->multicast_router_timer); in br_multicast_disable_port()
1102 del_timer(&port->ip4_own_query.timer); in br_multicast_disable_port()
1104 del_timer(&port->ip6_own_query.timer); in br_multicast_disable_port()
1110 struct net_bridge_port *port, in br_ip4_multicast_igmp3_report() argument
1161 br_ip4_multicast_leave_group(br, port, group, vid, src); in br_ip4_multicast_igmp3_report()
1163 err = br_ip4_multicast_add_group(br, port, group, vid, in br_ip4_multicast_igmp3_report()
1175 struct net_bridge_port *port, in br_ip6_multicast_mld2_report() argument
1234 br_ip6_multicast_leave_group(br, port, &grec->grec_mca, in br_ip6_multicast_mld2_report()
1237 err = br_ip6_multicast_add_group(br, port, in br_ip6_multicast_mld2_report()
1250 struct net_bridge_port *port, in br_ip4_multicast_select_querier() argument
1269 rcu_assign_pointer(br->ip4_querier.port, port); in br_ip4_multicast_select_querier()
1276 struct net_bridge_port *port, in br_ip6_multicast_select_querier() argument
1292 rcu_assign_pointer(br->ip6_querier.port, port); in br_ip6_multicast_select_querier()
1299 struct net_bridge_port *port, in br_multicast_select_querier() argument
1304 return br_ip4_multicast_select_querier(br, port, saddr->u.ip4); in br_multicast_select_querier()
1307 return br_ip6_multicast_select_querier(br, port, &saddr->u.ip6); in br_multicast_select_querier()
1344 struct net_bridge_port *port) in br_multicast_add_router() argument
1349 if (!hlist_unhashed(&port->rlist)) in br_multicast_add_router()
1353 if ((unsigned long) port >= (unsigned long) p) in br_multicast_add_router()
1359 hlist_add_behind_rcu(&port->rlist, slot); in br_multicast_add_router()
1361 hlist_add_head_rcu(&port->rlist, &br->router_list); in br_multicast_add_router()
1362 br_rtr_notify(br->dev, port, RTM_NEWMDB); in br_multicast_add_router()
1363 br_port_mc_router_state_change(port, true); in br_multicast_add_router()
1367 struct net_bridge_port *port) in br_multicast_mark_router() argument
1371 if (!port) { in br_multicast_mark_router()
1378 if (port->multicast_router == MDB_RTR_TYPE_DISABLED || in br_multicast_mark_router()
1379 port->multicast_router == MDB_RTR_TYPE_PERM) in br_multicast_mark_router()
1382 br_multicast_add_router(br, port); in br_multicast_mark_router()
1384 mod_timer(&port->multicast_router_timer, in br_multicast_mark_router()
1389 struct net_bridge_port *port, in br_multicast_query_received() argument
1394 if (!br_multicast_select_querier(br, port, saddr)) in br_multicast_query_received()
1398 br_multicast_mark_router(br, port); in br_multicast_query_received()
1402 struct net_bridge_port *port, in br_ip4_multicast_query() argument
1421 (port && port->state == BR_STATE_DISABLED)) in br_ip4_multicast_query()
1448 br_multicast_query_received(br, port, &br->ip4_other_query, in br_ip4_multicast_query()
1481 struct net_bridge_port *port, in br_ip6_multicast_query() argument
1500 (port && port->state == BR_STATE_DISABLED)) in br_ip6_multicast_query()
1530 br_multicast_query_received(br, port, &br->ip6_other_query, in br_ip6_multicast_query()
1565 struct net_bridge_port *port, in br_multicast_leave_group() argument
1579 (port && port->state == BR_STATE_DISABLED)) in br_multicast_leave_group()
1587 if (port && (port->flags & BR_MULTICAST_FAST_LEAVE)) { in br_multicast_leave_group()
1593 if (!br_port_group_equal(p, port, src)) in br_multicast_leave_group()
1603 br_mdb_notify(br->dev, port, group, RTM_DELMDB, in br_multicast_leave_group()
1617 __br_multicast_send_query(br, port, &mp->addr); in br_multicast_leave_group()
1627 if (!br_port_group_equal(p, port, src)) in br_multicast_leave_group()
1645 if (!port) { in br_multicast_leave_group()
1659 if (p->port != port) in br_multicast_leave_group()
1676 struct net_bridge_port *port, in br_ip4_multicast_leave_group() argument
1687 own_query = port ? &port->ip4_own_query : &br->ip4_own_query; in br_ip4_multicast_leave_group()
1693 br_multicast_leave_group(br, port, &br_group, &br->ip4_other_query, in br_ip4_multicast_leave_group()
1699 struct net_bridge_port *port, in br_ip6_multicast_leave_group() argument
1710 own_query = port ? &port->ip6_own_query : &br->ip6_own_query; in br_ip6_multicast_leave_group()
1716 br_multicast_leave_group(br, port, &br_group, &br->ip6_other_query, in br_ip6_multicast_leave_group()
1755 struct net_bridge_port *port, in br_multicast_pim() argument
1766 br_multicast_mark_router(br, port); in br_multicast_pim()
1770 struct net_bridge_port *port, in br_multicast_ipv4_rcv() argument
1786 br_multicast_pim(br, port, skb); in br_multicast_ipv4_rcv()
1790 br_multicast_err_count(br, port, skb->protocol); in br_multicast_ipv4_rcv()
1802 err = br_ip4_multicast_add_group(br, port, ih->group, vid, src); in br_multicast_ipv4_rcv()
1805 err = br_ip4_multicast_igmp3_report(br, port, skb_trimmed, vid); in br_multicast_ipv4_rcv()
1808 err = br_ip4_multicast_query(br, port, skb_trimmed, vid); in br_multicast_ipv4_rcv()
1811 br_ip4_multicast_leave_group(br, port, ih->group, vid, src); in br_multicast_ipv4_rcv()
1818 br_multicast_count(br, port, skb, BR_INPUT_SKB_CB(skb)->igmp, in br_multicast_ipv4_rcv()
1826 struct net_bridge_port *port, in br_multicast_ipv6_rcv() argument
1842 br_multicast_err_count(br, port, skb->protocol); in br_multicast_ipv6_rcv()
1853 err = br_ip6_multicast_add_group(br, port, &mld->mld_mca, vid, in br_multicast_ipv6_rcv()
1857 err = br_ip6_multicast_mld2_report(br, port, skb_trimmed, vid); in br_multicast_ipv6_rcv()
1860 err = br_ip6_multicast_query(br, port, skb_trimmed, vid); in br_multicast_ipv6_rcv()
1864 br_ip6_multicast_leave_group(br, port, &mld->mld_mca, vid, src); in br_multicast_ipv6_rcv()
1871 br_multicast_count(br, port, skb, BR_INPUT_SKB_CB(skb)->igmp, in br_multicast_ipv6_rcv()
1878 int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port, in br_multicast_rcv() argument
1891 ret = br_multicast_ipv4_rcv(br, port, skb, vid); in br_multicast_rcv()
1895 ret = br_multicast_ipv6_rcv(br, port, skb, vid); in br_multicast_rcv()
1911 RCU_INIT_POINTER(querier->port, NULL); in br_multicast_query_expired()
1951 br->ip4_querier.port = NULL; in br_multicast_init()
1956 br->ip6_querier.port = NULL; in br_multicast_init()
2125 struct net_bridge_port *port; in br_multicast_start_querier() local
2130 list_for_each_entry_rcu(port, &br->port_list, list) { in br_multicast_start_querier()
2131 if (port->state == BR_STATE_DISABLED || in br_multicast_start_querier()
2132 port->state == BR_STATE_BLOCKING) in br_multicast_start_querier()
2136 br_multicast_enable(&port->ip4_own_query); in br_multicast_start_querier()
2139 br_multicast_enable(&port->ip6_own_query); in br_multicast_start_querier()
2148 struct net_bridge_port *port; in br_multicast_toggle() local
2179 list_for_each_entry(port, &br->port_list, list) in br_multicast_toggle()
2180 __br_multicast_enable_port(port); in br_multicast_toggle()
2328 struct net_bridge_port *port; in br_multicast_list_adjacent() local
2337 port = br_port_get_rcu(dev); in br_multicast_list_adjacent()
2338 if (!port || !port->br) in br_multicast_list_adjacent()
2341 br = port->br; in br_multicast_list_adjacent()
2343 list_for_each_entry_rcu(port, &br->port_list, list) { in br_multicast_list_adjacent()
2344 if (!port->dev || port->dev == dev) in br_multicast_list_adjacent()
2347 hlist_for_each_entry_rcu(group, &port->mglist, mglist) { in br_multicast_list_adjacent()
2376 struct net_bridge_port *port; in br_multicast_has_querier_anywhere() local
2384 port = br_port_get_rcu(dev); in br_multicast_has_querier_anywhere()
2385 if (!port || !port->br) in br_multicast_has_querier_anywhere()
2388 br = port->br; in br_multicast_has_querier_anywhere()
2413 struct net_bridge_port *port; in br_multicast_has_querier_adjacent() local
2420 port = br_port_get_rcu(dev); in br_multicast_has_querier_adjacent()
2421 if (!port || !port->br) in br_multicast_has_querier_adjacent()
2424 br = port->br; in br_multicast_has_querier_adjacent()
2429 rcu_dereference(br->ip4_querier.port) == port) in br_multicast_has_querier_adjacent()
2435 rcu_dereference(br->ip6_querier.port) == port) in br_multicast_has_querier_adjacent()