Lines Matching defs:pl

153 	aggr_lacp_port_t	*pl = &port->lp_lacp;
159 CALLB_CPR_INIT(&cprinfo, &pl->lacp_timer_lock, callb_generic_cpr,
162 mutex_enter(&pl->lacp_timer_lock);
166 if ((lacp_timer_bits = pl->lacp_timer_bits) == 0) {
168 cv_wait(&pl->lacp_timer_cv, &pl->lacp_timer_lock);
169 CALLB_CPR_SAFE_END(&cprinfo, &pl->lacp_timer_lock);
172 pl->lacp_timer_bits = 0;
178 pl->periodic_timer.id = 0;
180 pl->wait_while_timer.id = 0;
182 pl->current_while_timer.id = 0;
184 mutex_exit(&pl->lacp_timer_lock);
189 mutex_enter(&pl->lacp_timer_lock);
201 mutex_enter(&pl->lacp_timer_lock);
202 if (pl->lacp_timer_bits & LACP_THREAD_EXIT)
206 pl->lacp_timer_bits = 0;
207 pl->lacp_timer_thread = NULL;
208 cv_broadcast(&pl->lacp_timer_cv);
270 aggr_lacp_port_t *pl = &portp->lp_lacp;
276 pl->ActorPortNumber = portp->lp_portid;
279 pl->ActorPortNumber));
281 pl->ActorPortPriority = (uint16_t)lacp_port_priority;
282 pl->ActorPortAggrId = 0; /* aggregator id - not used */
283 pl->NTT = B_FALSE; /* need to transmit */
285 pl->ActorAdminPortKey = aggrp->lg_key;
286 pl->ActorOperPortKey = pl->ActorAdminPortKey;
289 portp->lp_linkid, pl->ActorAdminPortKey, pl->ActorOperPortKey));
292 pl->ActorAdminPortState.bit.activity = B_FALSE;
293 pl->ActorAdminPortState.bit.timeout = B_TRUE;
294 pl->ActorAdminPortState.bit.aggregation = B_TRUE;
295 pl->ActorAdminPortState.bit.sync = B_FALSE;
296 pl->ActorAdminPortState.bit.collecting = B_FALSE;
297 pl->ActorAdminPortState.bit.distributing = B_FALSE;
298 pl->ActorAdminPortState.bit.defaulted = B_FALSE;
299 pl->ActorAdminPortState.bit.expired = B_FALSE;
300 pl->ActorOperPortState = pl->ActorAdminPortState;
307 pl->PartnerAdminPortState.bit.timeout =
308 pl->PartnerOperPortState.bit.timeout = B_TRUE;
310 pl->PartnerCollectorMaxDelay = 0; /* tens of microseconds */
315 pl->sm.lacp_on = B_FALSE; /* LACP Off default */
316 pl->sm.begin = B_TRUE; /* Prevents transmissions */
317 pl->sm.lacp_enabled = B_FALSE;
318 pl->sm.port_enabled = B_FALSE; /* Link Down */
319 pl->sm.actor_churn = B_FALSE;
320 pl->sm.partner_churn = B_FALSE;
321 pl->sm.ready_n = B_FALSE;
322 pl->sm.port_moved = B_FALSE;
326 pl->sm.periodic_state = LACP_NO_PERIODIC;
327 pl->sm.receive_state = LACP_INITIALIZE;
328 pl->sm.mux_state = LACP_DETACHED;
329 pl->sm.churn_state = LACP_NO_ACTOR_CHURN;
334 pl->current_while_timer.id = 0;
335 pl->current_while_timer.val = SHORT_TIMEOUT_TIME;
337 pl->periodic_timer.id = 0;
338 pl->periodic_timer.val = FAST_PERIODIC_TIME;
340 pl->wait_while_timer.id = 0;
341 pl->wait_while_timer.val = AGGREGATE_WAIT_TIME;
343 pl->lacp_timer_bits = 0;
345 mutex_init(&pl->lacp_timer_lock, NULL, MUTEX_DRIVER, NULL);
346 cv_init(&pl->lacp_timer_cv, NULL, CV_DRIVER, NULL);
348 pl->lacp_timer_thread = thread_create(NULL, 0, aggr_port_timer_thread,
372 aggr_lacp_port_t *pl = &portp->lp_lacp;
376 pl->NTT = B_FALSE; /* need to transmit */
379 pl->ActorOperPortState.bit.timeout =
380 pl->ActorAdminPortState.bit.timeout;
382 pl->ActorOperPortState.bit.sync = B_FALSE;
383 pl->ActorOperPortState.bit.collecting = B_FALSE;
384 pl->ActorOperPortState.bit.distributing = B_FALSE;
385 pl->ActorOperPortState.bit.defaulted = B_TRUE;
386 pl->ActorOperPortState.bit.expired = B_FALSE;
388 pl->PartnerOperPortState.bit.timeout = B_TRUE; /* fast t/o */
389 pl->PartnerCollectorMaxDelay = 0; /* tens of microseconds */
394 pl->sm.begin = B_TRUE; /* Prevents transmissions */
395 pl->sm.actor_churn = B_FALSE;
396 pl->sm.partner_churn = B_FALSE;
397 pl->sm.ready_n = B_FALSE;
401 pl->sm.periodic_state = LACP_NO_PERIODIC;
402 pl->sm.receive_state = LACP_INITIALIZE;
403 pl->sm.mux_state = LACP_DETACHED;
404 pl->sm.churn_state = LACP_NO_ACTOR_CHURN;
409 pl->current_while_timer.val = SHORT_TIMEOUT_TIME;
410 pl->periodic_timer.val = FAST_PERIODIC_TIME;
442 aggr_lacp_port_t *pl = &portp->lp_lacp;
446 mutex_enter(&pl->lacp_timer_lock);
447 if (pl->periodic_timer.id == 0) {
448 pl->periodic_timer.id = timeout(periodic_timer_pop, portp,
451 mutex_exit(&pl->lacp_timer_lock);
457 aggr_lacp_port_t *pl = &portp->lp_lacp;
462 mutex_enter(&pl->lacp_timer_lock);
463 if ((id = pl->periodic_timer.id) != 0) {
464 pl->lacp_timer_bits &= ~LACP_PERIODIC_TIMEOUT;
465 pl->periodic_timer.id = 0;
467 mutex_exit(&pl->lacp_timer_lock);
483 aggr_lacp_port_t *pl = &portp->lp_lacp;
485 mutex_enter(&pl->lacp_timer_lock);
486 pl->lacp_timer_bits |= LACP_PERIODIC_TIMEOUT;
487 cv_broadcast(&pl->lacp_timer_cv);
488 mutex_exit(&pl->lacp_timer_lock);
537 aggr_lacp_port_t *pl = &portp->lp_lacp;
542 if (!pl->sm.lacp_on) {
545 pl->sm.periodic_state = LACP_NO_PERIODIC;
546 pl->NTT = B_FALSE;
550 lacp_periodic_str[pl->sm.periodic_state]));
554 if (pl->sm.begin || !pl->sm.lacp_enabled ||
555 !pl->sm.port_enabled ||
556 !pl->ActorOperPortState.bit.activity &&
557 !pl->PartnerOperPortState.bit.activity) {
561 pl->sm.periodic_state = LACP_NO_PERIODIC;
562 pl->NTT = B_FALSE;
565 lacp_periodic_str[pl->sm.periodic_state]));
574 if (pl->sm.periodic_state == LACP_NO_PERIODIC) {
575 pl->periodic_timer.val = FAST_PERIODIC_TIME;
576 pl->sm.periodic_state = LACP_FAST_PERIODIC;
577 } else if ((pl->sm.periodic_state == LACP_SLOW_PERIODIC) &&
578 pl->PartnerOperPortState.bit.timeout) {
601 aggr_lacp_port_t *pl = &portp->lp_lacp;
609 if (!pl->sm.lacp_on || !pl->NTT || !portp->lp_started)
616 if ((pl->sm.periodic_state == LACP_NO_PERIODIC) ||
617 !pl->sm.lacp_enabled || pl->sm.begin) {
618 pl->NTT = B_FALSE;
634 elapsed = now - pl->time;
637 pl->time = now;
660 pl->NTT = B_FALSE;
680 aggr_lacp_port_t *pl = &portp->lp_lacp;
699 lacp->actor_info.key = htons(pl->ActorOperPortKey);
700 lacp->actor_info.port_priority = htons(pl->ActorPortPriority);
701 lacp->actor_info.port = htons(pl->ActorPortNumber);
702 lacp->actor_info.state.state = pl->ActorOperPortState.state;
710 htons(pl->PartnerOperSysPriority);
711 lacp->partner_info.system_id = pl->PartnerOperSystem;
712 lacp->partner_info.key = htons(pl->PartnerOperKey);
714 htons(pl->PartnerOperPortPriority);
715 lacp->partner_info.port = htons(pl->PartnerOperPortNum);
716 lacp->partner_info.state.state = pl->PartnerOperPortState.state;
747 aggr_lacp_port_t *pl = &portp->lp_lacp;
748 lacp_mux_state_t oldstate = pl->sm.mux_state;
753 if (!pl->sm.lacp_on) {
754 pl->sm.mux_state = LACP_DETACHED;
755 pl->ActorOperPortState.bit.sync = B_FALSE;
757 if (pl->ActorOperPortState.bit.collecting ||
758 pl->ActorOperPortState.bit.distributing) {
764 pl->ActorOperPortState.bit.collecting =
765 pl->ActorOperPortState.bit.distributing = B_FALSE;
769 if (pl->sm.begin || !pl->sm.lacp_enabled)
770 pl->sm.mux_state = LACP_DETACHED;
774 switch (pl->sm.mux_state) {
776 if (pl->sm.begin) {
780 if ((pl->sm.selected == AGGR_SELECTED) ||
781 (pl->sm.selected == AGGR_STANDBY)) {
782 pl->sm.mux_state = LACP_WAITING;
788 if (pl->sm.selected == AGGR_UNSELECTED) {
789 pl->sm.mux_state = LACP_DETACHED;
793 if ((pl->sm.selected == AGGR_SELECTED) && aggrp->aggr.ready) {
794 pl->sm.mux_state = LACP_ATTACHED;
800 if ((pl->sm.selected == AGGR_UNSELECTED) ||
801 (pl->sm.selected == AGGR_STANDBY)) {
802 pl->sm.mux_state = LACP_DETACHED;
806 if ((pl->sm.selected == AGGR_SELECTED) &&
807 pl->PartnerOperPortState.bit.sync) {
808 pl->sm.mux_state = LACP_COLLECTING_DISTRIBUTING;
814 if ((pl->sm.selected == AGGR_UNSELECTED) ||
815 (pl->sm.selected == AGGR_STANDBY) ||
816 !pl->PartnerOperPortState.bit.sync) {
817 pl->sm.mux_state = LACP_ATTACHED;
825 lacp_mux_str[pl->sm.mux_state]));
828 switch (pl->sm.mux_state) {
830 if (pl->ActorOperPortState.bit.collecting ||
831 pl->ActorOperPortState.bit.distributing) {
837 pl->ActorOperPortState.bit.sync =
838 pl->ActorOperPortState.bit.collecting = B_FALSE;
843 pl->ActorOperPortState.bit.distributing = B_FALSE;
852 if (pl->ActorOperPortState.bit.collecting ||
853 pl->ActorOperPortState.bit.distributing) {
859 pl->ActorOperPortState.bit.sync = B_TRUE;
860 pl->ActorOperPortState.bit.collecting = B_FALSE;
865 pl->ActorOperPortState.bit.distributing = B_FALSE;
867 if (pl->PartnerOperPortState.bit.sync) {
878 if (!pl->ActorOperPortState.bit.collecting &&
879 !pl->ActorOperPortState.bit.distributing) {
884 pl->ActorOperPortState.bit.distributing = B_TRUE;
889 pl->ActorOperPortState.bit.collecting = B_TRUE;
899 pl->NTT = B_TRUE;
1245 aggr_lacp_port_t *pl = &portp->lp_lacp;
1250 if (!pl->sm.lacp_on) {
1257 if (pl->sm.begin || !pl->sm.lacp_enabled ||
1262 "lp_state=%d)\n", portp->lp_linkid, pl->sm.selected,
1263 AGGR_UNSELECTED, pl->sm.begin, pl->sm.lacp_enabled,
1275 if (!pl->sm.lacp_enabled) {
1277 portp->lp_linkid, pl->sm.selected, AGGR_UNSELECTED));
1289 if (ether_cmp(&pl->PartnerOperSystem, &etherzeroaddr) == 0 ||
1290 (pl->PartnerOperKey == 0)) {
1319 if (ether_cmp(&pl->PartnerOperSystem,
1321 (pl->PartnerOperKey != aggrp->aggr.PartnerOperAggrKey)) {
1330 pl->PartnerOperSystem;
1332 pl->PartnerOperKey;
1349 if (ether_cmp(&pl->PartnerOperSystem,
1378 aggrp->aggr.PartnerSystem = pl->PartnerOperSystem;
1379 aggrp->aggr.PartnerOperAggrKey = pl->PartnerOperKey;
1397 } else if (ether_cmp(&pl->PartnerOperSystem,
1399 (pl->PartnerOperKey != aggrp->aggr.PartnerOperAggrKey)) {
1409 "MAC or key (%d)\n", portp->lp_linkid, pl->PartnerOperKey,
1417 if (pl->sm.selected != AGGR_SELECTED) {
1420 pl->sm.selected, AGGR_SELECTED));
1485 aggr_lacp_port_t *pl = &portp->lp_lacp;
1487 mutex_enter(&pl->lacp_timer_lock);
1488 pl->lacp_timer_bits |= LACP_WAIT_WHILE_TIMEOUT;
1489 cv_broadcast(&pl->lacp_timer_cv);
1490 mutex_exit(&pl->lacp_timer_lock);
1512 aggr_lacp_port_t *pl = &portp->lp_lacp;
1516 mutex_enter(&pl->lacp_timer_lock);
1517 if (pl->wait_while_timer.id == 0) {
1518 pl->wait_while_timer.id =
1523 mutex_exit(&pl->lacp_timer_lock);
1530 aggr_lacp_port_t *pl = &portp->lp_lacp;
1535 mutex_enter(&pl->lacp_timer_lock);
1536 if ((id = pl->wait_while_timer.id) != 0) {
1537 pl->lacp_timer_bits &= ~LACP_WAIT_WHILE_TIMEOUT;
1538 pl->wait_while_timer.id = 0;
1540 mutex_exit(&pl->lacp_timer_lock);
1556 aggr_lacp_port_t *pl = &portp->lp_lacp;
1570 pl->sm.lacp_enabled = B_TRUE;
1571 pl->ActorOperPortState.bit.aggregation = B_TRUE;
1572 pl->sm.begin = B_TRUE;
1627 aggr_lacp_port_t *pl = &portp->lp_lacp;
1640 pl->sm.lacp_on = B_TRUE;
1645 pl->sm.port_enabled = B_TRUE;
1646 pl->sm.lacp_enabled = B_TRUE;
1647 pl->ActorOperPortState.bit.aggregation = B_TRUE;
1668 aggr_lacp_port_t *pl = &portp->lp_lacp;
1674 pl->sm.lacp_on = B_FALSE;
1689 pl->sm.port_enabled = B_FALSE;
1690 pl->sm.lacp_enabled = B_FALSE;
1691 pl->ActorOperPortState.bit.aggregation = B_FALSE;
1734 aggr_lacp_port_t *pl = &portp->lp_lacp;
1738 mutex_enter(&pl->lacp_timer_lock);
1739 if (pl->current_while_timer.id == 0) {
1741 pl->current_while_timer.val = time;
1742 else if (pl->ActorOperPortState.bit.timeout)
1743 pl->current_while_timer.val = SHORT_TIMEOUT_TIME;
1745 pl->current_while_timer.val = LONG_TIMEOUT_TIME;
1747 pl->current_while_timer.id =
1752 mutex_exit(&pl->lacp_timer_lock);
1759 aggr_lacp_port_t *pl = &portp->lp_lacp;
1764 mutex_enter(&pl->lacp_timer_lock);
1765 if ((id = pl->current_while_timer.id) != 0) {
1766 pl->lacp_timer_bits &= ~LACP_CURRENT_WHILE_TIMEOUT;
1767 pl->current_while_timer.id = 0;
1769 mutex_exit(&pl->lacp_timer_lock);
1779 aggr_lacp_port_t *pl = &portp->lp_lacp;
1781 mutex_enter(&pl->lacp_timer_lock);
1782 pl->lacp_timer_bits |= LACP_CURRENT_WHILE_TIMEOUT;
1783 cv_broadcast(&pl->lacp_timer_cv);
1784 mutex_exit(&pl->lacp_timer_lock);
1807 aggr_lacp_port_t *pl = &portp->lp_lacp;
1811 pl->PartnerOperPortNum = pl->PartnerAdminPortNum;
1812 pl->PartnerOperPortPriority = pl->PartnerAdminPortPriority;
1813 pl->PartnerOperSystem = pl->PartnerAdminSystem;
1814 pl->PartnerOperSysPriority = pl->PartnerAdminSysPriority;
1815 pl->PartnerOperKey = pl->PartnerAdminKey;
1816 pl->PartnerOperPortState.state = pl->PartnerAdminPortState.state;
1818 pl->ActorOperPortState.bit.defaulted = B_TRUE;
1827 aggr_lacp_port_t *pl = &portp->lp_lacp;
1835 pl->PartnerOperPortNum = ntohs(lacp->actor_info.port);
1836 pl->PartnerOperPortPriority =
1838 pl->PartnerOperSystem = lacp->actor_info.system_id;
1839 pl->PartnerOperSysPriority =
1841 pl->PartnerOperKey = ntohs(lacp->actor_info.key);
1844 save_sync = pl->PartnerOperPortState.bit.sync;
1845 pl->PartnerOperPortState.state = lacp->actor_info.state.state;
1848 pl->ActorOperPortState.bit.defaulted = B_FALSE;
1858 if (((ntohs(lacp->partner_info.port) == pl->ActorPortNumber) &&
1860 pl->ActorPortPriority) &&
1865 (ntohs(lacp->partner_info.key) == pl->ActorOperPortKey) &&
1867 pl->ActorOperPortState.bit.aggregation)) ||
1870 pl->PartnerOperPortState.bit.sync =
1873 pl->PartnerOperPortState.bit.sync = B_FALSE;
1876 if (save_sync != pl->PartnerOperPortState.bit.sync) {
1879 pl->PartnerOperPortState.bit.sync));
1895 aggr_lacp_port_t *pl = &portp->lp_lacp;
1899 if ((pl->PartnerOperPortNum != ntohs(lacp->actor_info.port)) ||
1900 (pl->PartnerOperPortPriority !=
1902 (ether_cmp(&pl->PartnerOperSystem,
1904 (pl->PartnerOperSysPriority !=
1906 (pl->PartnerOperKey != ntohs(lacp->actor_info.key)) ||
1907 (pl->PartnerOperPortState.bit.aggregation !=
1910 "selected %d-->%d\n", portp->lp_linkid, pl->sm.selected,
1929 aggr_lacp_port_t *pl = &portp->lp_lacp;
1933 if ((pl->PartnerAdminPortNum != pl->PartnerOperPortNum) ||
1934 (pl->PartnerOperPortPriority != pl->PartnerAdminPortPriority) ||
1935 (ether_cmp(&pl->PartnerOperSystem, &pl->PartnerAdminSystem) != 0) ||
1936 (pl->PartnerOperSysPriority != pl->PartnerAdminSysPriority) ||
1937 (pl->PartnerOperKey != pl->PartnerAdminKey) ||
1938 (pl->PartnerOperPortState.bit.aggregation !=
1939 pl->PartnerAdminPortState.bit.aggregation)) {
1943 pl->sm.selected, AGGR_UNSELECTED));
1959 aggr_lacp_port_t *pl = &portp->lp_lacp;
1963 if ((pl->ActorPortNumber != ntohs(lacp->partner_info.port)) ||
1964 (pl->ActorPortPriority !=
1970 (pl->ActorOperPortKey != ntohs(lacp->partner_info.key)) ||
1971 (pl->ActorOperPortState.bit.activity !=
1973 (pl->ActorOperPortState.bit.timeout !=
1975 (pl->ActorOperPortState.bit.sync !=
1977 (pl->ActorOperPortState.bit.aggregation !=
1981 portp->lp_linkid, pl->NTT, B_TRUE));
1983 pl->NTT = B_TRUE;
2004 aggr_lacp_port_t *pl = &portp->lp_lacp;
2005 lacp_receive_state_t oldstate = pl->sm.receive_state;
2010 if (!pl->sm.lacp_on)
2014 if (pl->sm.begin || pl->sm.port_moved) {
2015 pl->sm.receive_state = LACP_INITIALIZE;
2016 } else if (!pl->sm.port_enabled) { /* DL_NOTE_LINK_DOWN */
2017 pl->sm.receive_state = LACP_PORT_DISABLED;
2018 } else if (!pl->sm.lacp_enabled) { /* DL_NOTE_AGGR_UNAVAIL */
2019 pl->sm.receive_state =
2020 (pl->sm.receive_state == LACP_PORT_DISABLED) ?
2023 if ((pl->sm.receive_state == LACP_EXPIRED) ||
2024 (pl->sm.receive_state == LACP_DEFAULTED)) {
2025 pl->sm.receive_state = LACP_CURRENT;
2027 } else if ((pl->sm.receive_state == LACP_CURRENT) &&
2028 (pl->current_while_timer.id == 0)) {
2029 pl->sm.receive_state = LACP_EXPIRED;
2030 } else if ((pl->sm.receive_state == LACP_EXPIRED) &&
2031 (pl->current_while_timer.id == 0)) {
2032 pl->sm.receive_state = LACP_DEFAULTED;
2036 (pl->sm.receive_state == LACP_CURRENT)))) {
2039 lacp_receive_str[pl->sm.receive_state]));
2042 switch (pl->sm.receive_state) {
2046 pl->ActorOperPortState.bit.expired = B_FALSE;
2047 pl->sm.port_moved = B_FALSE;
2048 pl->sm.receive_state = LACP_PORT_DISABLED;
2049 pl->sm.begin = B_FALSE;
2054 pl->PartnerOperPortState.bit.sync = B_FALSE;
2061 if (pl->sm.port_enabled && !pl->sm.lacp_enabled) {
2062 pl->sm.receive_state = LACP_DISABLED;
2066 } else if (pl->sm.port_enabled && pl->sm.lacp_enabled) {
2067 pl->sm.receive_state = LACP_EXPIRED;
2086 pl->PartnerOperPortState.bit.sync = B_FALSE;
2087 pl->PartnerOperPortState.bit.timeout = B_TRUE;
2089 pl->ActorOperPortState.bit.expired = B_TRUE;
2101 pl->PartnerOperPortState.bit.aggregation = B_FALSE;
2102 pl->ActorOperPortState.bit.expired = B_FALSE;
2111 pl->ActorOperPortState.bit.expired = B_FALSE;
2112 pl->PartnerOperPortState.bit.sync = B_TRUE;
2141 save_activity = pl->PartnerOperPortState.bit.activity;
2146 pl->ActorOperPortState.bit.expired = B_FALSE;
2162 if ((pl->PartnerOperPortState.bit.timeout &&
2163 (pl->periodic_timer.val != FAST_PERIODIC_TIME)) ||
2164 (!pl->PartnerOperPortState.bit.timeout &&
2165 (pl->periodic_timer.val != SLOW_PERIODIC_TIME)) ||
2166 (pl->PartnerOperPortState.bit.activity !=
2173 if (pl->NTT)