netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Holger Eitzenberger <holger@eitzenberger.org>
To: Jay Vosburgh <fubar@us.ibm.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [patch 3/9] bonding: use port_params in __record_pdu()
Date: Wed, 17 Dec 2008 22:28:30 +0100	[thread overview]
Message-ID: <20081217213009.859308351@jonathan.eitzenberger.org> (raw)
In-Reply-To: 20081217212827.080073908@jonathan.eitzenberger.org

[-- Attachment #1: bonding-3ad-__record_pdu-use-partner.diff --]
[-- Type: text/plain, Size: 1973 bytes --]

It helps in maintaining the various partner information values from
the LACPDU.  It also removes the pointless comment at the top.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>

Index: bonding-2.6/drivers/net/bonding/bond_3ad.c
===================================================================
--- bonding-2.6.orig/drivers/net/bonding/bond_3ad.c
+++ bonding-2.6/drivers/net/bonding/bond_3ad.c
@@ -483,24 +483,25 @@ static u16 __ad_timer_to_ticks(u16 timer
  */
 static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
 {
-	// validate lacpdu and port
 	if (lacpdu && port) {
+		struct port_params *partner = &port->partner_oper;
+
 		// record the new parameter values for the partner operational
-		port->partner_oper.port_number = ntohs(lacpdu->actor_port);
-		port->partner_oper.port_priority = ntohs(lacpdu->actor_port_priority);
-		port->partner_oper.system = lacpdu->actor_system;
-		port->partner_oper.system_priority = ntohs(lacpdu->actor_system_priority);
-		port->partner_oper.key = ntohs(lacpdu->actor_key);
-		port->partner_oper.port_state = lacpdu->actor_state;
+		partner->port_number = ntohs(lacpdu->actor_port);
+		partner->port_priority = ntohs(lacpdu->actor_port_priority);
+		partner->system = lacpdu->actor_system;
+		partner->system_priority = ntohs(lacpdu->actor_system_priority);
+		partner->key = ntohs(lacpdu->actor_key);
+		partner->port_state = lacpdu->actor_state;
 
 		// set actor_oper_port_state.defaulted to FALSE
 		port->actor_oper_port_state &= ~AD_STATE_DEFAULTED;
 
 		// set the partner sync. to on if the partner is sync. and the port is matched
 		if ((port->sm_vars & AD_PORT_MATCHED) && (lacpdu->actor_state & AD_STATE_SYNCHRONIZATION)) {
-			port->partner_oper.port_state |= AD_STATE_SYNCHRONIZATION;
+			partner->port_state |= AD_STATE_SYNCHRONIZATION;
 		} else {
-			port->partner_oper.port_state &= ~AD_STATE_SYNCHRONIZATION;
+			partner->port_state &= ~AD_STATE_SYNCHRONIZATION;
 		}
 	}
 }

-- 

  parent reply	other threads:[~2008-12-17 21:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 21:28 [patch 0/9] [RFC] bonding updates for net-next-2.6 Holger Eitzenberger
2008-12-17 21:28 ` [patch 1/9] bonding: improve elaborate port_state assignment Holger Eitzenberger
2008-12-17 21:28 ` [patch 2/9] bonding: introduce and use port_params structure Holger Eitzenberger
2008-12-17 21:28 ` Holger Eitzenberger [this message]
2008-12-17 21:28 ` [patch 4/9] bonding: use plain memcpy in __record_default() Holger Eitzenberger
2008-12-17 21:28 ` [patch 5/9] bonding: init port_params from template Holger Eitzenberger
2008-12-17 21:28 ` [patch 6/9] bonding: remove various function declarations Holger Eitzenberger
2008-12-17 21:28 ` [patch 7/9] bonding: use port_params in __update_selected() Holger Eitzenberger
2008-12-17 21:28 ` [patch 8/9] bonding: use port_params in __update_default_selected() Holger Eitzenberger
2008-12-17 21:28 ` [patch 9/9] bonding: use port_params in __update_lacpdu_from_port Holger Eitzenberger
2008-12-18  3:14 ` [patch 0/9] [RFC] bonding updates for net-next-2.6 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081217213009.859308351@jonathan.eitzenberger.org \
    --to=holger@eitzenberger.org \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).