Lines Matching defs:lacpdu
96 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port);
418 * __choose_matched - update a port's matched variable from a received lacpdu
419 * @lacpdu: the lacpdu we've received
423 * newly received lacpdu. Parameter values for the partner carried in the
440 static void __choose_matched(struct lacpdu *lacpdu, struct port *port)
446 if (((ntohs(lacpdu->partner_port) == port->actor_port_number) &&
447 (ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) &&
448 MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(port->actor_system)) &&
449 (ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) &&
450 (ntohs(lacpdu->partner_key) == port->actor_oper_port_key) &&
451 ((lacpdu->partner_state & LACP_STATE_AGGREGATION) == (port->actor_oper_port_state & LACP_STATE_AGGREGATION))) ||
452 ((lacpdu->actor_state & LACP_STATE_AGGREGATION) == 0)
461 * __record_pdu - record parameters from a received lacpdu
462 * @lacpdu: the lacpdu we've received
465 * Record the parameter values for the Actor carried in a received lacpdu as
469 static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
471 if (lacpdu && port) {
474 __choose_matched(lacpdu, port);
478 partner->port_number = ntohs(lacpdu->actor_port);
479 partner->port_priority = ntohs(lacpdu->actor_port_priority);
480 partner->system = lacpdu->actor_system;
481 partner->system_priority = ntohs(lacpdu->actor_system_priority);
482 partner->key = ntohs(lacpdu->actor_key);
483 partner->port_state = lacpdu->actor_state;
492 (lacpdu->actor_state & LACP_STATE_SYNCHRONIZATION)) {
525 * __update_selected - update a port's Selected variable from a received lacpdu
526 * @lacpdu: the lacpdu we've received
530 * newly received lacpdu. The parameter values for the Actor carried in the
537 static void __update_selected(struct lacpdu *lacpdu, struct port *port)
539 if (lacpdu && port) {
545 if (ntohs(lacpdu->actor_port) != partner->port_number ||
546 ntohs(lacpdu->actor_port_priority) != partner->port_priority ||
547 !MAC_ADDRESS_EQUAL(&lacpdu->actor_system, &partner->system) ||
548 ntohs(lacpdu->actor_system_priority) != partner->system_priority ||
549 ntohs(lacpdu->actor_key) != partner->key ||
550 (lacpdu->actor_state & LACP_STATE_AGGREGATION) != (partner->port_state & LACP_STATE_AGGREGATION)) {
590 * __update_ntt - update a port's ntt variable from a received lacpdu
591 * @lacpdu: the lacpdu we've received
595 * received lacpdu. The parameter values for the partner carried in the
601 static void __update_ntt(struct lacpdu *lacpdu, struct port *port)
603 /* validate lacpdu and port */
604 if (lacpdu && port) {
608 if ((ntohs(lacpdu->partner_port) != port->actor_port_number) ||
609 (ntohs(lacpdu->partner_port_priority) != port->actor_port_priority) ||
610 !MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(port->actor_system)) ||
611 (ntohs(lacpdu->partner_system_priority) != port->actor_system_priority) ||
612 (ntohs(lacpdu->partner_key) != port->actor_oper_port_key) ||
613 ((lacpdu->partner_state & LACP_STATE_LACP_ACTIVITY) != (port->actor_oper_port_state & LACP_STATE_LACP_ACTIVITY)) ||
614 ((lacpdu->partner_state & LACP_STATE_LACP_TIMEOUT) != (port->actor_oper_port_state & LACP_STATE_LACP_TIMEOUT)) ||
615 ((lacpdu->partner_state & LACP_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & LACP_STATE_SYNCHRONIZATION)) ||
616 ((lacpdu->partner_state & LACP_STATE_AGGREGATION) != (port->actor_oper_port_state & LACP_STATE_AGGREGATION))
764 * __update_lacpdu_from_port - update a port's lacpdu fields
769 struct lacpdu *lacpdu = &port->lacpdu;
773 * lacpdu->subtype initialized
774 * lacpdu->version_number initialized
775 * lacpdu->tlv_type_actor_info initialized
776 * lacpdu->actor_information_length initialized
779 lacpdu->actor_system_priority = htons(port->actor_system_priority);
780 lacpdu->actor_system = port->actor_system;
781 lacpdu->actor_key = htons(port->actor_oper_port_key);
782 lacpdu->actor_port_priority = htons(port->actor_port_priority);
783 lacpdu->actor_port = htons(port->actor_port_number);
784 lacpdu->actor_state = port->actor_oper_port_state;
786 "update lacpdu: actor port state %x\n",
789 /* lacpdu->reserved_3_1 initialized
790 * lacpdu->tlv_type_partner_info initialized
791 * lacpdu->partner_information_length initialized
794 lacpdu->partner_system_priority = htons(partner->system_priority);
795 lacpdu->partner_system = partner->system;
796 lacpdu->partner_key = htons(partner->key);
797 lacpdu->partner_port_priority = htons(partner->port_priority);
798 lacpdu->partner_port = htons(partner->port_number);
799 lacpdu->partner_state = partner->port_state;
801 /* lacpdu->reserved_3_2 initialized
802 * lacpdu->tlv_type_collector_info initialized
803 * lacpdu->collector_information_length initialized
815 * ad_lacpdu_send - send out a lacpdu packet on a given port
850 lacpdu_header->lacpdu = port->lacpdu;
1065 * @lacpdu: the lacpdu we've received
1068 * If lacpdu arrived, stop previous timer (if exists) and set the next state as
1072 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
1081 if (lacpdu) {
1094 /* check if new lacpdu arrived */
1095 else if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) ||
1117 /* if no lacpdu arrived and no timer is on */
1135 /* check if the State machine was changed or new lacpdu arrived */
1136 if ((port->sm_rx_state != last_state) || (lacpdu)) {
1187 if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system),
1193 __update_selected(lacpdu, port);
1194 __update_ntt(lacpdu, port);
1195 __record_pdu(lacpdu, port);
1281 * Turn ntt flag on priodically to perform periodic transmission of lacpdu's.
1373 * and after every lacpdu receive (if selected is off).
1827 static const struct lacpdu lacpdu = {
1875 memcpy(&port->lacpdu, &lacpdu, sizeof(lacpdu));
2043 * lacpdu's are sent in one second)
2376 * @lacpdu: received lacpdu
2383 static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
2398 switch (lacpdu->subtype) {
2406 ad_rx_machine(lacpdu, port);
2414 marker = (struct bond_marker *)lacpdu;
2665 struct lacpdu *lacpdu, _lacpdu;
2673 lacpdu = skb_header_pointer(skb, 0, sizeof(_lacpdu), &_lacpdu);
2674 if (!lacpdu) {
2680 return bond_3ad_rx_indication(lacpdu, slave);