Lines Matching refs:pi

78 static boolean_t	phyint_repaired(struct phyint *pi);
1024 struct phyint *pi;
1033 for (pi = pg->pg_phyint; pi != NULL; pi = pi->pi_pgnext) {
1034 if (!check_pii_crtt_improved(pi->pi_v4) ||
1035 !check_pii_crtt_improved(pi->pi_v6))
1127 struct phyint *pi;
1174 pi = pii->pii_phyint;
1175 if (pi->pi_group == phyint_anongroup) {
1178 pi = pi->pi_group->pg_phyint;
1179 for (; pi != NULL; pi = pi->pi_pgnext)
1180 target_add(PHYINT_INSTANCE(pi, af), fromaddr, _B_FALSE);
1346 * Try to activate another INACTIVE interface in the same group as `pi'.
1350 phyint_activate_another(struct phyint *pi)
1355 if (pi->pi_group == phyint_anongroup)
1358 for (pi2 = pi->pi_group->pg_phyint; pi2 != NULL; pi2 = pi2->pi_pgnext) {
1359 if (pi == pi2 || !phyint_is_functioning(pi2) ||
1380 phyint_transition_to_running(struct phyint *pi)
1385 boolean_t onlining = (pi->pi_state == PI_OFFLINE);
1386 boolean_t initial = (pi->pi_state == PI_INIT);
1409 if (pi->pi_group != phyint_anongroup) {
1410 pi2 = pi->pi_group->pg_phyint;
1427 if (pi->pi_flags & IFF_STANDBY) { /* case 1 */
1435 } else if (!initial && !GROUP_FAILED(pi->pi_group)) { /* case 3 */
1438 (void) change_pif_flags(pi, set, clear);
1440 phyint_chstate(pi, PI_RUNNING);
1445 phyint_group_refresh_state(pi->pi_group);
1449 * Adjust IFF_INACTIVE on the provided `pi' to trend the group configuration
1454 phyint_standby_refresh_inactive(struct phyint *pi)
1463 if (pi->pi_group == phyint_anongroup) {
1464 (void) change_pif_flags(pi, 0, IFF_INACTIVE);
1471 if (!phyint_is_functioning(pi))
1474 for (pi2 = pi->pi_group->pg_phyint; pi2 != NULL; pi2 = pi2->pi_pgnext) {
1484 (void) change_pif_flags(pi, 0, IFF_INACTIVE);
1486 (void) change_pif_flags(pi, IFF_INACTIVE, 0);
1493 phyint_check_for_repair(struct phyint *pi)
1495 if (!phyint_repaired(pi))
1498 if (pi->pi_group == phyint_anongroup) {
1499 logerr("IP interface repair detected on %s\n", pi->pi_name);
1502 pi->pi_name, pi->pi_group->pg_name);
1510 if (pi->pi_state == PI_OFFLINE) {
1511 (void) change_pif_flags(pi, 0, IFF_FAILED);
1515 phyint_transition_to_running(pi); /* calls phyint_chstate() */
1525 struct phyint *pi = pii->pii_phyint;
1531 was_active = ((pi->pi_flags & IFF_INACTIVE) == 0);
1533 (void) change_pif_flags(pi, IFF_FAILED, IFF_INACTIVE);
1534 if (pi->pi_group == phyint_anongroup) {
1539 " %s\n", pii->pii_name, pi->pi_group->pg_name);
1547 phyint_activate_another(pi);
1553 if (pi->pi_state != PI_OFFLINE) {
1554 phyint_chstate(pi, PI_FAILED);
1555 reset_crtt_all(pi);
1560 pi2 = pi->pi_group->pg_phyint;
1594 struct phyint *pi;
1619 pi = pii->pii_phyint;
1620 if (pi->pi_state == PI_FAILED && LINK_UP(pi)) {
1621 check_time = pi->pi_whenup[pi->pi_whendx] + MSEC_PERMIN;
1625 phyint_check_for_repair(pi);
1933 process_link_state_down(struct phyint *pi)
1935 logerr("The link has gone down on %s\n", pi->pi_name);
1942 if (PROBE_CAPABLE(pi->pi_v4))
1943 clear_pii_probe_stats(pi->pi_v4);
1944 if (PROBE_CAPABLE(pi->pi_v6))
1945 clear_pii_probe_stats(pi->pi_v6);
1951 if ((pi->pi_state == PI_RUNNING) ||
1952 (pi->pi_state != PI_FAILED && !GROUP_FAILED(pi->pi_group))) {
1955 " checking for failure on %s\n", pi->pi_name);
1958 if (pi->pi_v4 != NULL)
1959 phyint_inst_check_for_failure(pi->pi_v4);
1960 else if (pi->pi_v6 != NULL)
1961 phyint_inst_check_for_failure(pi->pi_v6);
1966 process_link_state_up(struct phyint *pi)
1968 logerr("The link has come up on %s\n", pi->pi_name);
1974 if (pi->pi_v4)
1975 restart_timer(pi->pi_v4);
1976 if (pi->pi_v6)
1977 restart_timer(pi->pi_v6);
1979 phyint_check_for_repair(pi);
1981 pi->pi_whenup[pi->pi_whendx++] = getcurrenttime();
1982 if (pi->pi_whendx == LINK_UP_PERMIN)
1983 pi->pi_whendx = 0;
1992 struct phyint *pi;
1996 for (pi = phyints; pi != NULL; pi = pi->pi_next) {
1997 boolean_t old_link_state_up = LINK_UP(pi);
2005 UPDATE_LINK_STATE(pi);
2007 if (LINK_DOWN(pi)) {
2012 process_link_state_down(pi);
2018 process_link_state_up(pi);
2024 reset_crtt_all(struct phyint *pi)
2029 pii = pi->pi_v4;
2038 pii = pi->pi_v6;
2146 struct phyint *pi;
2154 pi = pii->pii_phyint;
2155 pg = pi->pi_group;
2157 if (LINK_UP(pi) && phyint_inst_probe_failure_state(pii, &pi_tff) ==
2188 if (pi2 == pi)
2191 if (LINK_DOWN(pi)) {
2524 phyint_repaired(struct phyint *pi)
2533 logdebug("phyint_repaired(%s)\n", pi->pi_name);
2535 if (LINK_DOWN(pi))
2545 if (!PROBE_ENABLED(pi->pi_v4) && !PROBE_ENABLED(pi->pi_v6)) {
2547 if ((pi->pi_whenup[pi->pi_whendx] == 0 ||
2548 (cur_time - pi->pi_whenup[pi->pi_whendx]) > MSEC_PERMIN)) {
2549 pi->pi_lfmsg_printed = 0;
2552 if (!pi->pi_lfmsg_printed) {
2555 "stabilizes\n", pi->pi_name, LINK_UP_PERMIN);
2556 pi->pi_lfmsg_printed = 1;
2562 pii = pi->pi_v4;
2572 pii = pi->pi_v6;
2589 change_pif_flags(struct phyint *pi, uint64_t set, uint64_t clear)
2597 pi->pi_name, set, clear);
2600 if (pi->pi_v4 != NULL)
2610 (void) strlcpy(lifr.lifr_name, pi->pi_name, sizeof (lifr.lifr_name));
2637 pi->pi_flags |= set;
2638 pi->pi_flags &= ~clear;
2640 if (pi->pi_v4 != NULL)
2641 pi->pi_v4->pii_flags = pi->pi_flags;
2643 if (pi->pi_v6 != NULL)
2644 pi->pi_v6->pii_flags = pi->pi_flags;