Lines Matching defs:ill

296 	ill_t *ill;
311 if (grp->gr_v4 != NULL && (ill = grp->gr_v4->ig_cast_ill) != NULL) {
312 (void) strlcpy(lifgr->gi_m4ifname, ill->ill_name, LIFNAMSIZ);
313 (void) strlcpy(lifgr->gi_bcifname, ill->ill_name, LIFNAMSIZ);
316 if (grp->gr_v6 != NULL && (ill = grp->gr_v6->ig_cast_ill) != NULL)
317 (void) strlcpy(lifgr->gi_m6ifname, ill->ill_name, LIFNAMSIZ);
433 * Check whether `ill' is suitable for inclusion into `grp', and return an
439 ipmp_grp_vet_ill(ipmp_grp_t *grp, ill_t *ill)
443 ASSERT(IAM_WRITER_ILL(ill));
457 if (ill->ill_ipif_up_count + ill->ill_ipif_dup_count > 0)
465 if (ill_appaddr_cnt(ill) != 0)
472 if (ill_ptpaddr_cnt(ill) != 0)
476 * An ill must support multicast to be allowed into a group.
478 if (!(ill->ill_flags & ILLF_MULTICAST))
482 * An ill must strictly be using ARP and/or ND for address
485 if (ill->ill_flags & (ILLF_NONUD | ILLF_NOARP))
489 * An ill cannot also be using usesrc groups. (Although usesrc uses
493 if (IS_USESRC_ILL(ill) || IS_USESRC_CLI_ILL(ill))
499 if (grp->gr_nif > 0 && grp->gr_mactype != ill->ill_mactype)
536 * Create a new illgrp on IPMP meta-interface `ill'.
539 ipmp_illgrp_create(ill_t *ill)
541 uint_t mtu = ill->ill_isv6 ? IPV6_MIN_MTU : IP_MIN_MTU;
544 ASSERT(IAM_WRITER_ILL(ill));
545 ASSERT(IS_IPMP(ill));
546 ASSERT(ill->ill_grp == NULL);
557 illg->ig_ipmp_ill = ill;
558 ill->ill_grp = illg;
596 * bind it to an underlying ill, while keeping an even address distribution.
597 * If the bind is successful, return a pointer to the bound ill.
626 * bound, unbind it from the underlying ill while keeping an even address
648 * Return the active ill with the greatest number of data addresses in `illg'.
653 ill_t *ill, *bestill = NULL;
657 ill = list_head(&illg->ig_actif);
658 for (; ill != NULL; ill = list_next(&illg->ig_actif, ill)) {
660 ill->ill_bound_cnt > bestill->ill_bound_cnt) {
661 bestill = ill;
668 * Return the active ill with the fewest number of data addresses in `illg'.
673 ill_t *ill, *bestill = NULL;
677 ill = list_head(&illg->ig_actif);
678 for (; ill != NULL; ill = list_next(&illg->ig_actif, ill)) {
680 ill->ill_bound_cnt < bestill->ill_bound_cnt) {
681 if (ill->ill_bound_cnt == 0)
682 return (ill); /* can't get better */
683 bestill = ill;
700 * Return a pointer to the next available underlying ill in `illg', or NULL if
706 ill_t *ill;
712 if ((ill = illg->ig_next_ill) != NULL) {
713 illg->ig_next_ill = list_next(&illg->ig_actif, ill);
719 return (ill);
723 * Return a held pointer to the next available underlying ill in `illg', or
729 ill_t *ill;
735 ill = illg->ig_next_ill;
736 illg->ig_next_ill = list_next(&illg->ig_actif, ill);
740 if (ill_check_and_refhold(ill)) {
742 return (ill);
751 * Return a held pointer to the nominated multicast ill in `illg', or NULL if
771 * Set the nominated cast ill on `illg' to `castill'. If `castill' is NULL,
784 * Disable old nominated ill (if any).
815 * Enable new nominated ill (if any).
920 ill_t *ill, *ipmp_ill = illg->ig_ipmp_ill;
929 ill = list_head(&illg->ig_actif);
932 if (ill == NULL || ipmp_ill->ill_ipif_up_count == 0) {
937 ASSERT(paddrlen == ill->ill_phys_addr_length);
945 if (bcmp(ill->ill_phys_addr, entp->ia_lladdr,
948 bcopy(ill->ill_phys_addr, entp->ia_lladdr, paddrlen);
961 nce_update(ncec, ND_UNCHANGED, ill->ill_phys_addr);
966 if ((ill = list_next(&illg->ig_actif, ill)) == NULL)
967 ill = list_head(&illg->ig_actif);
978 ill_t *ill;
984 ill = list_head(&illg->ig_if);
985 for (; ill != NULL; ill = list_next(&illg->ig_if, ill)) {
986 if (ill->ill_phys_addr_length == paddrlen &&
987 bcmp(ill->ill_phys_addr, physaddr, paddrlen) == 0)
988 return (ill);
994 * Asynchronously update the MTU for an IPMP ill by injecting a DL_NOTIFY_IND.
1000 ill_t *ill = illg->ig_ipmp_ill;
1003 ASSERT(illg->ig_mtu == 0 || IAM_WRITER_ILL(ill));
1011 put(ill->ill_rq, mp);
1017 * ill MTU if necessary.
1022 ill_t *ill;
1031 * for each ill as we iterate through the list. Any changes to the
1035 ill = list_head(&illg->ig_if);
1036 for (; ill != NULL; ill = list_next(&illg->ig_if, ill)) {
1037 mutex_enter(&ill->ill_lock);
1038 if (mtu == 0 || ill->ill_mtu < mtu)
1039 mtu = ill->ill_mtu;
1040 if (mc_mtu == 0 || ill->ill_mc_mtu < mc_mtu)
1041 mc_mtu = ill->ill_mc_mtu;
1042 mutex_exit(&ill->ill_lock);
1099 * Place `ill' into `illg', and rebalance the data addresses on `illg'
1101 * ill as necessary to account for `ill' (e.g., MTU).
1104 ipmp_ill_join_illgrp(ill_t *ill, ipmp_illgrp_t *illg)
1108 ip_stack_t *ipst = ill->ill_ipst;
1111 ASSERT(!IS_IPMP(ill) && ill->ill_phyint->phyint_grp != NULL);
1112 ASSERT(IAM_WRITER_ILL(ill));
1113 ASSERT(ill->ill_grp == NULL);
1118 * Account for `ill' joining the illgrp.
1121 if (ill->ill_isv6)
1122 ill->ill_phyint->phyint_grp->gr_nv6++;
1124 ill->ill_phyint->phyint_grp->gr_nv4++;
1130 mutex_enter(&ill->ill_lock);
1132 ill->ill_flags |= ILLF_ROUTER;
1134 ill->ill_flags &= ~ILLF_ROUTER;
1135 mutex_exit(&ill->ill_lock);
1138 * Blow away all multicast memberships that currently exist on `ill'.
1140 * that `ill' no longer exists (e.g., due to ipmp_ill_rtsaddrmsg()).
1144 mutex_enter(&ill->ill_mcast_serializer);
1145 ill->ill_grp_pending = 1;
1146 mutex_exit(&ill->ill_mcast_serializer);
1147 update_conn_ill(ill, ill->ill_ipst);
1148 if (ill->ill_isv6) {
1149 reset_mrt_ill(ill);
1151 ipif = ill->ill_ipif;
1156 ip_purge_allmulti(ill);
1159 * Borrow the first ill's ill_phys_addr_length value for the illgrp's
1162 * the IPMP ill's MTU and CoS marking, if necessary.
1172 ipmp_ill->ill_phys_addr_length = ill->ill_phys_addr_length;
1173 ipmp_ill->ill_nd_lla_len = ill->ill_phys_addr_length;
1174 ipmp_ill->ill_type = ill->ill_type;
1176 if (ill->ill_flags & ILLF_COS_ENABLED) {
1181 ipmp_illgrp_set_mtu(illg, ill->ill_mtu, ill->ill_mc_mtu);
1184 ill->ill_phys_addr_length);
1185 ASSERT(ipmp_ill->ill_type == ill->ill_type);
1187 if (!(ill->ill_flags & ILLF_COS_ENABLED)) {
1192 if (illg->ig_mtu > ill->ill_mtu ||
1193 illg->ig_mc_mtu > ill->ill_mc_mtu) {
1194 ipmp_illgrp_set_mtu(illg, ill->ill_mtu,
1195 ill->ill_mc_mtu);
1200 list_insert_tail(&illg->ig_if, ill);
1201 ill->ill_grp = illg;
1204 mutex_enter(&ill->ill_mcast_serializer);
1205 ill->ill_grp_pending = 0;
1206 mutex_exit(&ill->ill_mcast_serializer);
1209 * Hide the IREs on `ill' so that we don't accidentally find them when
1212 ire_walk_ill(MATCH_IRE_ILL, 0, ipmp_ill_ire_mark_testhidden, ill, ill);
1214 ipmp_ill_refresh_active(ill);
1218 * Remove `ill' from its illgrp, and rebalance the data addresses in that
1220 * IPMP ill as necessary now that `ill' is removed (e.g., MTU).
1223 ipmp_ill_leave_illgrp(ill_t *ill)
1228 ipmp_illgrp_t *illg = ill->ill_grp;
1231 ASSERT(IS_UNDER_IPMP(ill));
1232 ASSERT(IAM_WRITER_ILL(ill));
1238 * Cancel IPMP-specific ill timeouts.
1240 (void) untimeout(ill->ill_refresh_tid);
1243 * Expose any previously-hidden IREs on `ill'.
1245 ire_walk_ill(MATCH_IRE_ILL, 0, ipmp_ill_ire_clear_testhidden, ill, ill);
1248 * Ensure the multicast state for each ipif on `ill' is down so that
1249 * our ipif_multicast_up() (once `ill' leaves the group) will rejoin
1252 for (ipif = ill->ill_ipif; ipif != NULL; ipif = ipif->ipif_next)
1257 * Account for `ill' leaving the illgrp.
1260 if (ill->ill_isv6)
1261 ill->ill_phyint->phyint_grp->gr_nv6--;
1263 ill->ill_phyint->phyint_grp->gr_nv4--;
1267 * Pull `ill' out of the interface lists.
1269 if (list_link_active(&ill->ill_actnode))
1270 ipmp_ill_deactivate(ill);
1272 list_remove(&illg->ig_if, ill);
1273 ill->ill_grp = NULL;
1280 for (ipif = ill->ill_ipif; ipif != NULL; ipif = ipif->ipif_next)
1306 * If `ill' didn't support CoS, see if it can now be enabled.
1308 if (!(ill->ill_flags & ILLF_COS_ENABLED)) {
1311 ill = list_head(&illg->ig_if);
1313 if (!(ill->ill_flags & ILLF_COS_ENABLED))
1315 } while ((ill = list_next(&illg->ig_if, ill)) != NULL);
1317 if (ill == NULL) {
1327 * Check if `ill' should be active, and activate or deactivate if need be.
1331 ipmp_ill_try_refresh_active(ill_t *ill)
1335 ASSERT(IAM_WRITER_ILL(ill));
1336 ASSERT(IS_UNDER_IPMP(ill));
1338 if (ipmp_ill_is_active(ill)) {
1339 if (!list_link_active(&ill->ill_actnode))
1340 refreshed = ipmp_ill_activate(ill);
1342 if (list_link_active(&ill->ill_actnode))
1343 ipmp_ill_deactivate(ill);
1350 * Check if `ill' should be active, and activate or deactivate if need be.
1354 ipmp_ill_refresh_active(ill_t *ill)
1356 if (!ipmp_ill_try_refresh_active(ill))
1357 ipmp_ill_refresh_active_timer_start(ill);
1361 * Retry ipmp_ill_try_refresh_active() on the ill named by `ill_arg'.
1366 ill_t *ill = ill_arg;
1372 * running, but that's harmless). If the ill is going away, bail.
1374 mutex_enter(&ill->ill_lock);
1375 ill->ill_refresh_tid = 0;
1376 if (ill->ill_state_flags & ILL_CONDEMNED) {
1377 mutex_exit(&ill->ill_lock);
1380 mutex_exit(&ill->ill_lock);
1382 if (ipsq_try_enter(NULL, ill, NULL, NULL, NULL, NEW_OP, B_FALSE)) {
1383 refreshed = ipmp_ill_try_refresh_active(ill);
1384 ipsq_exit(ill->ill_phyint->phyint_ipsq);
1391 ipmp_ill_refresh_active_timer_start(ill);
1395 * Retry an ipmp_ill_try_refresh_active() on the ill named by `arg'.
1398 ipmp_ill_refresh_active_timer_start(ill_t *ill)
1400 mutex_enter(&ill->ill_lock);
1403 * If the ill is going away or a refresh is already scheduled, bail.
1405 if (ill->ill_refresh_tid != 0 ||
1406 (ill->ill_state_flags & ILL_CONDEMNED)) {
1407 mutex_exit(&ill->ill_lock);
1411 ill->ill_refresh_tid = timeout(ipmp_ill_refresh_active_timer, ill,
1414 mutex_exit(&ill->ill_lock);
1418 * Activate `ill' so it will be used to send and receive data traffic. Return
1419 * B_FALSE if `ill' cannot be activated. Note that we allocate any messages
1420 * needed to deactivate `ill' here as well so that deactivation cannot fail.
1423 ipmp_ill_activate(ill_t *ill)
1427 ipmp_grp_t *grp = ill->ill_phyint->phyint_grp;
1428 ipmp_illgrp_t *illg = ill->ill_grp;
1432 ASSERT(IAM_WRITER_ILL(ill));
1433 ASSERT(IS_UNDER_IPMP(ill));
1448 * Now that we have an active ill, nominate it for multicast
1453 ipmp_illgrp_set_cast(illg, ill);
1456 * This is the first active ill in the illgrp -- add 'em all.
1463 ipmp_ill_bind_ipif(ill, ipif, Res_act_initial);
1466 * Redistribute the addresses by moving them from the ill with
1467 * the most addresses until the ill being activated is at the
1473 if (ill->ill_bound_cnt + 1 >= maxill->ill_bound_cnt)
1476 ipmp_ill_bind_ipif(ill, ipif, Res_act_rebind);
1484 list_insert_tail(&illg->ig_actif, ill);
1486 illg->ig_next_ill = ill;
1490 * Refresh static/proxy ARP entries to use `ill', if need be.
1492 if (!ill->ill_isv6)
1511 * Deactivate `ill' so it will not be used to send or receive data traffic.
1514 ipmp_ill_deactivate(ill_t *ill)
1519 ipmp_grp_t *grp = ill->ill_phyint->phyint_grp;
1520 ipmp_illgrp_t *illg = ill->ill_grp;
1523 ASSERT(IAM_WRITER_ILL(ill));
1524 ASSERT(IS_UNDER_IPMP(ill));
1532 list_remove(&illg->ig_actif, ill);
1538 * If the ill that's being deactivated had been nominated for
1541 if (ill == illg->ig_cast_ill)
1545 * Delete all nce_t entries using this ill, so that the next attempt
1548 nce_flush(ill, B_TRUE);
1551 * Unbind all of the ipifs bound to this ill, and save 'em in a list;
1552 * we'll rebind them after we tell the resolver the ill is no longer
1554 * accidentally rebind to the ill we're trying to remove if multiple
1558 while ((ipif = ipmp_ill_unbind_ipif(ill, NULL, B_TRUE)) != NULL) {
1563 if (!ill->ill_isv6) {
1565 * Refresh static/proxy ARP entries that had been using `ill'.
1571 * Rebind each ipif from the deactivated ill to the active ill with
1584 * Remove any IRE_IF_CLONEs for this ill since they might have an
1585 * ire_nce_cache/nce_common which refers to another ill in the group.
1587 ire_walk_ill(MATCH_IRE_TYPE, IRE_IF_CLONE, ill_downi_if_clone, ill,
1588 ill);
1604 * Send the routing socket messages needed to make `ill' "appear" (RTM_ADD)
1608 ipmp_ill_rtsaddrmsg(ill_t *ill, int cmd)
1612 ASSERT(IAM_WRITER_ILL(ill));
1616 * If `ill' is truly down, there are no messages to generate since:
1627 if (ill->ill_ipif_up_count == 0)
1631 ip_rts_xifmsg(ill->ill_ipif, IPIF_UP, 0, RTSQ_NORMAL);
1633 for (ipif = ill->ill_ipif; ipif != NULL; ipif = ipif->ipif_next)
1638 ip_rts_xifmsg(ill->ill_ipif, 0, IPIF_UP, RTSQ_NORMAL);
1642 * Bind the address named by `ipif' to the underlying ill named by `ill'.
1645 * `ipif', or just a rebind to another ill.
1648 ipmp_ill_bind_ipif(ill_t *ill, ipif_t *ipif, enum ip_resolver_action act)
1651 ip_stack_t *ipst = ill->ill_ipst;
1653 ASSERT(IAM_WRITER_ILL(ill) && IAM_WRITER_IPIF(ipif));
1654 ASSERT(IS_UNDER_IPMP(ill) && IS_IPMP(ipif->ipif_ill));
1659 ipif->ipif_bound_next = ill->ill_bound_ipif;
1660 ill->ill_bound_ipif = ipif;
1661 ill->ill_bound_cnt++;
1663 ipif->ipif_bound_ill = ill;
1671 if (ill->ill_isv6) {
1681 * associated ill is not up, we should never be here with
1691 * Unbind the address named by `ipif' from the underlying ill named by `ill'.
1692 * If `ipif' is NULL, then an arbitrary ipif on `ill' is unbound and returned.
1693 * If no ipifs are bound to `ill', NULL is returned. If `notifyres' is
1697 ipmp_ill_unbind_ipif(ill_t *ill, ipif_t *ipif, boolean_t notifyres)
1700 ip_stack_t *ipst = ill->ill_ipst;
1702 ASSERT(IAM_WRITER_ILL(ill));
1703 ASSERT(IS_UNDER_IPMP(ill));
1709 if ((ipif = ill->ill_bound_ipif) == NULL) {
1710 ASSERT(ill->ill_bound_cnt == 0);
1717 ASSERT(ipif->ipif_bound_ill == ill);
1718 ASSERT(ill->ill_bound_cnt > 0);
1726 ill->ill_bound_cnt--;
1728 if (ill->ill_bound_ipif == ipif) {
1729 ill->ill_bound_ipif = ipif->ipif_bound_next;
1731 previpif = ill->ill_bound_ipif;
1743 if (ill->ill_isv6)
1754 * Check if `ill' is active. Caller must hold ill_lock and phyint_lock if
1756 * to determine whether an ill should be considered active, other consumers
1757 * may race and learn about an ill that should be deactivated/activated before
1763 ipmp_ill_is_active(ill_t *ill)
1765 phyint_t *phyi = ill->ill_phyint;
1767 ASSERT(IS_UNDER_IPMP(ill));
1768 ASSERT(IAM_WRITER_ILL(ill) ||
1769 (MUTEX_HELD(&ill->ill_lock) && MUTEX_HELD(&phyi->phyint_lock)));
1777 return (!(ill->ill_ipif_up_count == 0 ||
1788 ill_t *ill = (ill_t *)ill_arg;
1790 ASSERT(IAM_WRITER_ILL(ill));
1791 ASSERT(!IS_IPMP(ill));
1793 if (ire->ire_ill != ill)
1809 ill_t *ill = (ill_t *)ill_arg;
1811 ASSERT(IAM_WRITER_ILL(ill));
1812 ASSERT(!IS_IPMP(ill));
1814 if (ire->ire_ill == ill) {
1821 * Return a held pointer to the IPMP ill for underlying interface `ill', or
1823 * underlying ill rather than an ipmp_illgrp_t because an underlying ill's
1828 ipmp_ill_hold_ipmp_ill(ill_t *ill)
1830 ip_stack_t *ipst = ill->ill_ipst;
1833 ASSERT(!IS_IPMP(ill));
1836 illg = ill->ill_grp;
1842 * Assume `ill' was removed from the illgrp in the meantime.
1844 rw_exit(&ill->ill_ipst->ips_ipmp_lock);
1849 * Return a held pointer to the appropriate underlying ill for sending the
1851 * underlying ill rather than an ipmp_illgrp_t because an underlying ill's
1856 ipmp_ill_hold_xmit_ill(ill_t *ill, boolean_t is_unicast)
1859 ip_stack_t *ipst = ill->ill_ipst;
1862 if (ill->ill_grp == NULL) {
1864 * The ill was taken out of the group, so just send on it.
1867 ill_refhold(ill);
1868 return (ill);
1871 xmit_ill = ipmp_illgrp_hold_next_ill(ill->ill_grp);
1873 xmit_ill = ipmp_illgrp_hold_cast_ill(ill->ill_grp);
1880 * Return the interface index for the IPMP ill tied to underlying interface
1881 * `ill', or zero if one doesn't exist. Caller need not be inside the IPSQ.
1884 ipmp_ill_get_ipmp_ifindex(const ill_t *ill)
1887 ip_stack_t *ipst = ill->ill_ipst;
1890 ASSERT(!IS_IPMP(ill));
1893 if ((grp = ill->ill_phyint->phyint_grp) != NULL)
1905 ill_t *ill;
1918 ill = phyi->phyint_illv4;
1919 ipmp_ill_rtsaddrmsg(ill, RTM_DELETE);
1923 ill = phyi->phyint_illv6;
1924 ipmp_ill_rtsaddrmsg(ill, RTM_DELETE);
1936 grp->gr_mactype = ill->ill_mactype;
1938 ASSERT(grp->gr_mactype == ill->ill_mactype);
2081 * Return a held pointer to the underlying ill bound to `ipif', or NULL if one
2103 * Return a pointer to the underlying ill bound to `ipif', or NULL if one
2154 * is a test address on underlying interface `ill'. Caller need not be inside
2158 ipmp_packet_is_probe(mblk_t *mp, ill_t *ill)
2165 if (!IS_UNDER_IPMP(ill))
2168 if (ill->ill_isv6) {
2170 ipif_lookup_testaddr_v6(ill, &ip6h->ip6_src, NULL))
2174 ipif_lookup_testaddr_v4(ill, &ipha->ipha_src, NULL))
2200 ill_t *ill;
2214 ill = list_head(&illg->ig_if);
2215 for (; ill != NULL; ill = list_next(&illg->ig_if, ill))
2216 nce_fastpath_list_delete(ill, ncec, &dead);
2234 ill_t *ill;
2255 ill = list_head(&illg->ig_actif);
2256 for (; ill != NULL; ill = list_next(&illg->ig_actif, ill)) {
2257 mutex_enter(&ill->ill_lock);
2258 nce = list_head(&ill->ill_nce);
2260 nce_next = list_next(&ill->ill_nce, nce);
2268 mutex_exit(&ill->ill_lock);