Lines Matching defs:lacpdu

100 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port);
437 * __choose_matched - update a port's matched variable from a received lacpdu
438 * @lacpdu: the lacpdu we've received
442 * newly received lacpdu. Parameter values for the partner carried in the
459 static void __choose_matched(struct lacpdu *lacpdu, struct port *port)
465 if (((ntohs(lacpdu->partner_port) == port->actor_port_number) &&
466 (ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) &&
467 MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(port->actor_system)) &&
468 (ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) &&
469 (ntohs(lacpdu->partner_key) == port->actor_oper_port_key) &&
470 ((lacpdu->partner_state & LACP_STATE_AGGREGATION) == (port->actor_oper_port_state & LACP_STATE_AGGREGATION))) ||
471 ((lacpdu->actor_state & LACP_STATE_AGGREGATION) == 0)
480 * __record_pdu - record parameters from a received lacpdu
481 * @lacpdu: the lacpdu we've received
484 * Record the parameter values for the Actor carried in a received lacpdu as
488 static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
490 if (lacpdu && port) {
493 __choose_matched(lacpdu, port);
497 partner->port_number = ntohs(lacpdu->actor_port);
498 partner->port_priority = ntohs(lacpdu->actor_port_priority);
499 partner->system = lacpdu->actor_system;
500 partner->system_priority = ntohs(lacpdu->actor_system_priority);
501 partner->key = ntohs(lacpdu->actor_key);
502 partner->port_state = lacpdu->actor_state;
511 (lacpdu->actor_state & LACP_STATE_SYNCHRONIZATION)) {
544 * __update_selected - update a port's Selected variable from a received lacpdu
545 * @lacpdu: the lacpdu we've received
549 * newly received lacpdu. The parameter values for the Actor carried in the
556 static void __update_selected(struct lacpdu *lacpdu, struct port *port)
558 if (lacpdu && port) {
564 if (ntohs(lacpdu->actor_port) != partner->port_number ||
565 ntohs(lacpdu->actor_port_priority) != partner->port_priority ||
566 !MAC_ADDRESS_EQUAL(&lacpdu->actor_system, &partner->system) ||
567 ntohs(lacpdu->actor_system_priority) != partner->system_priority ||
568 ntohs(lacpdu->actor_key) != partner->key ||
569 (lacpdu->actor_state & LACP_STATE_AGGREGATION) != (partner->port_state & LACP_STATE_AGGREGATION)) {
609 * __update_ntt - update a port's ntt variable from a received lacpdu
610 * @lacpdu: the lacpdu we've received
614 * received lacpdu. The parameter values for the partner carried in the
620 static void __update_ntt(struct lacpdu *lacpdu, struct port *port)
622 /* validate lacpdu and port */
623 if (lacpdu && port) {
627 if ((ntohs(lacpdu->partner_port) != port->actor_port_number) ||
628 (ntohs(lacpdu->partner_port_priority) != port->actor_port_priority) ||
629 !MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(port->actor_system)) ||
630 (ntohs(lacpdu->partner_system_priority) != port->actor_system_priority) ||
631 (ntohs(lacpdu->partner_key) != port->actor_oper_port_key) ||
632 ((lacpdu->partner_state & LACP_STATE_LACP_ACTIVITY) != (port->actor_oper_port_state & LACP_STATE_LACP_ACTIVITY)) ||
633 ((lacpdu->partner_state & LACP_STATE_LACP_TIMEOUT) != (port->actor_oper_port_state & LACP_STATE_LACP_TIMEOUT)) ||
634 ((lacpdu->partner_state & LACP_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & LACP_STATE_SYNCHRONIZATION)) ||
635 ((lacpdu->partner_state & LACP_STATE_AGGREGATION) != (port->actor_oper_port_state & LACP_STATE_AGGREGATION))
792 * __update_lacpdu_from_port - update a port's lacpdu fields
797 struct lacpdu *lacpdu = &port->lacpdu;
801 * lacpdu->subtype initialized
802 * lacpdu->version_number initialized
803 * lacpdu->tlv_type_actor_info initialized
804 * lacpdu->actor_information_length initialized
807 lacpdu->actor_system_priority = htons(port->actor_system_priority);
808 lacpdu->actor_system = port->actor_system;
809 lacpdu->actor_key = htons(port->actor_oper_port_key);
810 lacpdu->actor_port_priority = htons(port->actor_port_priority);
811 lacpdu->actor_port = htons(port->actor_port_number);
812 lacpdu->actor_state = port->actor_oper_port_state;
814 "update lacpdu: actor port state %x\n",
817 /* lacpdu->reserved_3_1 initialized
818 * lacpdu->tlv_type_partner_info initialized
819 * lacpdu->partner_information_length initialized
822 lacpdu->partner_system_priority = htons(partner->system_priority);
823 lacpdu->partner_system = partner->system;
824 lacpdu->partner_key = htons(partner->key);
825 lacpdu->partner_port_priority = htons(partner->port_priority);
826 lacpdu->partner_port = htons(partner->port_number);
827 lacpdu->partner_state = partner->port_state;
829 /* lacpdu->reserved_3_2 initialized
830 * lacpdu->tlv_type_collector_info initialized
831 * lacpdu->collector_information_length initialized
843 * ad_lacpdu_send - send out a lacpdu packet on a given port
878 lacpdu_header->lacpdu = port->lacpdu;
1093 * @lacpdu: the lacpdu we've received
1096 * If lacpdu arrived, stop previous timer (if exists) and set the next state as
1100 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
1109 if (lacpdu) {
1122 /* check if new lacpdu arrived */
1123 else if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) ||
1145 /* if no lacpdu arrived and no timer is on */
1163 /* check if the State machine was changed or new lacpdu arrived */
1164 if ((port->sm_rx_state != last_state) || (lacpdu)) {
1215 if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system),
1221 __update_selected(lacpdu, port);
1222 __update_ntt(lacpdu, port);
1223 __record_pdu(lacpdu, port);
1310 * Turn ntt flag on priodically to perform periodic transmission of lacpdu's.
1402 * and after every lacpdu receive (if selected is off).
1857 static const struct lacpdu lacpdu = {
1905 memcpy(&port->lacpdu, &lacpdu, sizeof(lacpdu));
2067 * lacpdu's are sent in one second)
2400 * @lacpdu: received lacpdu
2407 static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
2422 switch (lacpdu->subtype) {
2430 ad_rx_machine(lacpdu, port);
2438 marker = (struct bond_marker *)lacpdu;
2689 struct lacpdu *lacpdu, _lacpdu;
2697 lacpdu = skb_header_pointer(skb, 0, sizeof(_lacpdu), &_lacpdu);
2698 if (!lacpdu) {
2704 return bond_3ad_rx_indication(lacpdu, slave);