Lines Matching defs:portp

226 lacp_port_select(aggr_port_t *portp)
228 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
230 if (!lacp_sel_ports_add(portp))
232 portp->lp_lacp.sm.selected = AGGR_SELECTED;
240 lacp_port_unselect(aggr_port_t *portp)
242 aggr_grp_t *grp = portp->lp_grp;
246 lacp_sel_ports_del(portp);
247 portp->lp_lacp.sm.selected = AGGR_UNSELECTED;
267 aggr_lacp_init_port(aggr_port_t *portp)
269 aggr_grp_t *aggrp = portp->lp_grp;
270 aggr_lacp_port_t *pl = &portp->lp_lacp;
273 ASSERT(MAC_PERIM_HELD(portp->lp_mh));
276 pl->ActorPortNumber = portp->lp_portid;
278 "ActorPortNumber = 0x%x\n", portp->lp_linkid,
289 portp->lp_linkid, pl->ActorAdminPortKey, pl->ActorOperPortKey));
324 lacp_port_unselect(portp);
349 portp, 0, &p0, TS_RUN, minclsyspri);
360 aggr_grp_port_hold(portp);
370 lacp_reset_port(aggr_port_t *portp)
372 aggr_lacp_port_t *pl = &portp->lp_lacp;
374 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
399 lacp_port_unselect(portp);
440 start_periodic_timer(aggr_port_t *portp)
442 aggr_lacp_port_t *pl = &portp->lp_lacp;
444 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
448 pl->periodic_timer.id = timeout(periodic_timer_pop, portp,
449 drv_usectohz(1000000 * portp->lp_lacp.periodic_timer.val));
455 stop_periodic_timer(aggr_port_t *portp)
457 aggr_lacp_port_t *pl = &portp->lp_lacp;
460 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
482 aggr_port_t *portp = data;
483 aggr_lacp_port_t *pl = &portp->lp_lacp;
498 periodic_timer_pop_handler(aggr_port_t *portp)
500 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
502 portp->lp_lacp_stats.LACPDUsTx = 0;
505 portp->lp_lacp.time = gethrtime();
506 portp->lp_lacp.NTT = B_TRUE;
507 lacp_xmit_sm(portp);
514 if (portp->lp_lacp.PartnerOperPortState.bit.timeout) {
515 portp->lp_lacp.periodic_timer.val = FAST_PERIODIC_TIME;
516 portp->lp_lacp.sm.periodic_state = LACP_FAST_PERIODIC;
518 portp->lp_lacp.periodic_timer.val = SLOW_PERIODIC_TIME;
519 portp->lp_lacp.sm.periodic_state = LACP_SLOW_PERIODIC;
522 lacp_periodic_sm(portp);
534 lacp_periodic_sm(aggr_port_t *portp)
536 lacp_periodic_state_t oldstate = portp->lp_lacp.sm.periodic_state;
537 aggr_lacp_port_t *pl = &portp->lp_lacp;
539 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
544 stop_periodic_timer(portp);
548 "%s--->%s\n", portp->lp_linkid,
560 stop_periodic_timer(portp);
564 portp->lp_linkid, lacp_periodic_str[oldstate],
586 stop_periodic_timer(portp);
587 periodic_timer_pop_handler(portp);
591 start_periodic_timer(portp);
599 lacp_xmit_sm(aggr_port_t *portp)
601 aggr_lacp_port_t *pl = &portp->lp_lacp;
606 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
609 if (!pl->sm.lacp_on || !pl->NTT || !portp->lp_started)
627 if (portp->lp_lacp_stats.LACPDUsTx >= 3) {
636 portp->lp_lacp_stats.LACPDUsTx = 0;
651 fill_lacp_ether(portp, (struct ether_header *)mp->b_rptr);
652 fill_lacp_pdu(portp,
656 mp = mac_hwring_send_priv(portp->lp_mch, portp->lp_tx_rings[0], mp);
661 portp->lp_lacp_stats.LACPDUsTx++;
678 fill_lacp_pdu(aggr_port_t *portp, lacp_t *lacp)
680 aggr_lacp_port_t *pl = &portp->lp_lacp;
681 aggr_grp_t *aggrp = portp->lp_grp;
685 mac_perim_enter_by_mh(portp->lp_mh, &pmph);
743 lacp_mux_sm(aggr_port_t *portp)
745 aggr_grp_t *aggrp = portp->lp_grp;
747 aggr_lacp_port_t *pl = &portp->lp_lacp;
761 portp->lp_linkid));
824 portp->lp_linkid, lacp_mux_str[oldstate],
834 portp->lp_linkid));
841 aggr_set_coll_dist(portp, B_FALSE);
848 start_wait_while_timer(portp);
856 portp->lp_linkid));
863 aggr_set_coll_dist(portp, B_FALSE);
882 portp->lp_linkid));
887 aggr_set_coll_dist(portp, B_TRUE);
900 lacp_xmit_sm(portp);
906 receive_marker_pdu(aggr_port_t *portp, mblk_t *mp)
910 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
913 portp->lp_linkid));
916 if (!portp->lp_lacp.sm.lacp_on)
925 portp->lp_linkid, markerp->version, MARKER_VERSION));
933 portp->lp_linkid, markerp->tlv_marker));
939 " MARKER TLV = %d \n", portp->lp_linkid,
946 " MARKER length = %d \n", portp->lp_linkid,
951 if (markerp->requestor_port != portp->lp_lacp.PartnerOperPortNum) {
954 portp->lp_linkid, markerp->requestor_port,
955 portp->lp_lacp.PartnerOperPortNum));
960 &portp->lp_lacp.PartnerOperSystem) != 0) {
963 portp->lp_linkid));
976 fill_lacp_ether(portp, (struct ether_header *)mp->b_rptr);
1101 lacp_misconfig_check(aggr_port_t *portp)
1103 aggr_grp_t *grp = portp->lp_grp;
1132 portp->lp_lacp.sm.selected = AGGR_UNSELECTED;
1136 "port %d\n", grp->lg_linkid, portp->lp_linkid,
1137 mac_str, portp->lp_lacp.PartnerOperKey,
1151 lacp_sel_ports_del(aggr_port_t *portp)
1160 if (portp->lp_linkid == cport->sp_linkid)
1181 lacp_sel_ports_add(aggr_port_t *portp)
1192 if (portp->lp_linkid == cport->sp_linkid) {
1194 portp->lp_lacp.PartnerOperKey);
1196 &portp->lp_lacp.PartnerOperSystem) == 0);
1210 new_port->sp_grp_linkid = portp->lp_grp->lg_linkid;
1211 bcopy(&portp->lp_lacp.PartnerOperSystem,
1213 new_port->sp_partner_key = portp->lp_lacp.PartnerOperKey;
1214 new_port->sp_linkid = portp->lp_linkid;
1229 * - portp - instance this applies to.
1239 lacp_selection_logic(aggr_port_t *portp)
1242 aggr_grp_t *aggrp = portp->lp_grp;
1245 aggr_lacp_port_t *pl = &portp->lp_lacp;
1251 lacp_port_unselect(portp);
1253 lacp_mux_sm(portp);
1258 (portp->lp_state != AGGR_PORT_STATE_ATTACHED)) {
1262 "lp_state=%d)\n", portp->lp_linkid, pl->sm.selected,
1264 portp->lp_state));
1266 lacp_port_unselect(portp);
1268 lacp_mux_sm(portp);
1277 portp->lp_linkid, pl->sm.selected, AGGR_UNSELECTED));
1279 lacp_port_unselect(portp);
1280 lacp_mux_sm(portp);
1352 portp->lp_linkid);
1354 lacp_port_unselect(portp);
1355 lacp_mux_sm(portp);
1364 if (lacp_misconfig_check(portp)) {
1365 lacp_mux_sm(portp);
1388 if (tpp == portp)
1405 lacp_port_unselect(portp);
1409 "MAC or key (%d)\n", portp->lp_linkid, pl->PartnerOperKey,
1412 lacp_mux_sm(portp);
1419 "selected %d-->%d\n", portp->lp_linkid,
1421 if (!lacp_port_select(portp))
1423 lacp_mux_sm(portp);
1464 "aggr.ready already set\n", portp->lp_linkid));
1465 lacp_mux_sm(portp);
1468 portp->lp_linkid, aggrp->aggr.ready, B_TRUE));
1484 aggr_port_t *portp = data;
1485 aggr_lacp_port_t *pl = &portp->lp_lacp;
1498 wait_while_timer_pop_handler(aggr_port_t *portp)
1500 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1503 portp->lp_linkid));
1504 portp->lp_lacp.sm.ready_n = B_TRUE;
1506 lacp_selection_logic(portp);
1510 start_wait_while_timer(aggr_port_t *portp)
1512 aggr_lacp_port_t *pl = &portp->lp_lacp;
1514 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1519 timeout(wait_while_timer_pop, portp,
1521 portp->lp_lacp.wait_while_timer.val));
1528 stop_wait_while_timer(aggr_port_t *portp)
1530 aggr_lacp_port_t *pl = &portp->lp_lacp;
1533 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1553 aggr_lacp_port_attached(aggr_port_t *portp)
1555 aggr_grp_t *grp = portp->lp_grp;
1556 aggr_lacp_port_t *pl = &portp->lp_lacp;
1559 ASSERT(MAC_PERIM_HELD(portp->lp_mh));
1560 ASSERT(portp->lp_state == AGGR_PORT_STATE_ATTACHED);
1563 portp->lp_linkid));
1565 portp->lp_lacp.sm.port_enabled = B_TRUE; /* link on */
1574 lacp_receive_sm(portp, NULL);
1575 lacp_mux_sm(portp);
1578 aggr_lacp_mcast_on(portp);
1581 lacp_selection_logic(portp);
1589 aggr_lacp_port_detached(aggr_port_t *portp)
1591 aggr_grp_t *grp = portp->lp_grp;
1594 ASSERT(MAC_PERIM_HELD(portp->lp_mh));
1597 portp->lp_linkid));
1599 portp->lp_lacp.sm.port_enabled = B_FALSE;
1604 portp->lp_lacp.sm.lacp_enabled = B_FALSE;
1605 lacp_selection_logic(portp);
1606 lacp_mux_sm(portp);
1607 lacp_periodic_sm(portp);
1612 stop_periodic_timer(portp);
1613 stop_current_while_timer(portp);
1614 stop_wait_while_timer(portp);
1617 aggr_lacp_mcast_off(portp);
1618 aggr_set_coll_dist(portp, B_FALSE);
1625 lacp_on(aggr_port_t *portp)
1627 aggr_lacp_port_t *pl = &portp->lp_lacp;
1630 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1632 mac_perim_enter_by_mh(portp->lp_mh, &mph);
1639 lacp_reset_port(portp);
1642 AGGR_LACP_DBG(("lacp_on:(%d): \n", portp->lp_linkid));
1644 if (portp->lp_state == AGGR_PORT_STATE_ATTACHED) {
1650 lacp_receive_sm(portp, NULL);
1651 lacp_mux_sm(portp);
1653 if (portp->lp_state == AGGR_PORT_STATE_ATTACHED) {
1655 aggr_lacp_mcast_on(portp);
1658 lacp_selection_logic(portp);
1666 lacp_off(aggr_port_t *portp)
1668 aggr_lacp_port_t *pl = &portp->lp_lacp;
1671 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1672 mac_perim_enter_by_mh(portp->lp_mh, &mph);
1676 AGGR_LACP_DBG(("lacp_off:(%d): \n", portp->lp_linkid));
1678 if (portp->lp_state == AGGR_PORT_STATE_ATTACHED) {
1682 stop_periodic_timer(portp);
1683 stop_current_while_timer(portp);
1684 stop_wait_while_timer(portp);
1687 aggr_lacp_mcast_off(portp);
1694 lacp_mux_sm(portp);
1695 lacp_periodic_sm(portp);
1696 lacp_selection_logic(portp);
1699 aggr_set_coll_dist(portp, B_FALSE);
1701 lacp_reset_port(portp);
1707 valid_lacp_pdu(aggr_port_t *portp, lacp_t *lacp)
1722 " Terminator Length = %d \n", portp->lp_linkid,
1732 start_current_while_timer(aggr_port_t *portp, uint_t time)
1734 aggr_lacp_port_t *pl = &portp->lp_lacp;
1736 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1748 timeout(current_while_timer_pop, portp,
1750 (clock_t)portp->lp_lacp.current_while_timer.val));
1757 stop_current_while_timer(aggr_port_t *portp)
1759 aggr_lacp_port_t *pl = &portp->lp_lacp;
1762 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1778 aggr_port_t *portp = (aggr_port_t *)data;
1779 aggr_lacp_port_t *pl = &portp->lp_lacp;
1788 current_while_timer_pop_handler(aggr_port_t *portp)
1790 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1793 "pop id=%p\n", portp->lp_linkid,
1794 portp->lp_lacp.current_while_timer.id));
1796 lacp_receive_sm(portp, NULL);
1805 record_Default(aggr_port_t *portp)
1807 aggr_lacp_port_t *pl = &portp->lp_lacp;
1809 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1824 record_PDU(aggr_port_t *portp, lacp_t *lacp)
1826 aggr_grp_t *aggrp = portp->lp_grp;
1827 aggr_lacp_port_t *pl = &portp->lp_lacp;
1878 "%d -->%d\n", portp->lp_linkid, save_sync,
1893 update_selected(aggr_port_t *portp, lacp_t *lacp)
1895 aggr_lacp_port_t *pl = &portp->lp_lacp;
1897 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1910 "selected %d-->%d\n", portp->lp_linkid, pl->sm.selected,
1913 lacp_port_unselect(portp);
1927 update_default_selected(aggr_port_t *portp)
1929 aggr_lacp_port_t *pl = &portp->lp_lacp;
1931 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
1942 "selected %d-->%d\n", portp->lp_linkid,
1945 lacp_port_unselect(portp);
1956 update_NTT(aggr_port_t *portp, lacp_t *lacp)
1958 aggr_grp_t *aggrp = portp->lp_grp;
1959 aggr_lacp_port_t *pl = &portp->lp_lacp;
1981 portp->lp_linkid, pl->NTT, B_TRUE));
1991 * - portp - instance this applies to.
2001 lacp_receive_sm(aggr_port_t *portp, lacp_t *lacp)
2004 aggr_lacp_port_t *pl = &portp->lp_lacp;
2007 ASSERT(MAC_PERIM_HELD(portp->lp_grp->lg_mh));
2038 portp->lp_linkid, lacp_receive_str[oldstate],
2044 lacp_port_unselect(portp);
2045 record_Default(portp);
2050 lacp_receive_sm(portp, NULL);
2059 stop_current_while_timer(portp);
2063 lacp_receive_sm(portp, lacp);
2090 start_current_while_timer(portp, SHORT_TIMEOUT_TIME);
2091 lacp_periodic_sm(portp);
2099 lacp_port_unselect(portp);
2100 record_Default(portp);
2109 update_default_selected(portp);
2110 record_Default(portp); /* overwrite Partner Oper val */
2114 lacp_selection_logic(portp);
2115 lacp_mux_sm(portp);
2127 portp->lp_linkid));
2134 if (!valid_lacp_pdu(portp, lacp)) {
2137 portp->lp_linkid));
2142 selected_updated = update_selected(portp, lacp);
2143 update_NTT(portp, lacp);
2144 sync_updated = record_PDU(portp, lacp);
2149 lacp_selection_logic(portp);
2150 lacp_mux_sm(portp);
2152 lacp_mux_sm(portp);
2168 lacp_periodic_sm(portp);
2171 stop_current_while_timer(portp);
2174 lacp_xmit_sm(portp);
2175 start_current_while_timer(portp, 0);
2182 aggr_set_coll_dist(aggr_port_t *portp, boolean_t enable)
2187 portp->lp_linkid, enable ? "ENABLED" : "DISABLED"));
2189 mac_perim_enter_by_mh(portp->lp_mh, &mph);
2194 portp->lp_collector_enabled = B_FALSE;
2195 aggr_send_port_disable(portp);
2203 if (!portp->lp_lacp.sm.lacp_on || (portp->lp_lacp.sm.lacp_on &&
2204 (portp->lp_lacp.sm.mux_state == LACP_COLLECTING_DISTRIBUTING))) {
2206 portp->lp_collector_enabled = B_TRUE;
2207 aggr_send_port_enable(portp);
2221 aggr_lacp_rx_enqueue(aggr_port_t *portp, mblk_t *dmp)
2223 aggr_grp_t *grp = portp->lp_grp;
2237 portp->lp_linkid, lacp->subtype));
2266 AGGR_PORT_REFHOLD(portp);
2267 dmp->b_prev = (mblk_t *)portp;
2275 aggr_port_t *portp = (aggr_port_t *)dmp->b_prev;
2281 mac_perim_enter_by_mh(portp->lp_grp->lg_mh, &mph);
2282 if (portp->lp_closing)
2289 portp->lp_linkid));
2291 if (!portp->lp_lacp.sm.lacp_on) {
2294 lacp_receive_sm(portp, lacp);
2299 portp->lp_linkid));
2301 if (receive_marker_pdu(portp, dmp) != 0)
2305 dmp = mac_hwring_send_priv(portp->lp_mch,
2306 portp->lp_tx_rings[0], dmp);
2310 AGGR_PORT_REFRELE(portp);
2316 AGGR_PORT_REFRELE(portp);