From: Ethan Jackson Date: Mon, 18 Apr 2011 19:48:59 +0000 (-0700) Subject: lacp: Remove LACP_[FAST|SLOW]_TIME_RX macros. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=808f401eb60cfc335251d641658d525c5266f27e;p=openvswitch lacp: Remove LACP_[FAST|SLOW]_TIME_RX macros. The receive rate for a LACP packets is simply 3 times the transmission rate. It doesn't make sense to maintain separate macros for these values especially since future patches will allow arbitrary transmission rates. --- diff --git a/lib/lacp.c b/lib/lacp.c index 7a7ca6ef..38ce595a 100644 --- a/lib/lacp.c +++ b/lib/lacp.c @@ -209,9 +209,8 @@ lacp_process_pdu(struct lacp *lacp, const void *slave_, struct slave *slave = slave_lookup(lacp, slave_); slave->status = LACP_CURRENT; - timer_set_duration(&slave->rx, (lacp->fast - ? LACP_FAST_TIME_RX - : LACP_SLOW_TIME_RX)); + timer_set_duration(&slave->rx, LACP_RX_MULTIPLIER * + (lacp->fast ? LACP_FAST_TIME_TX : LACP_SLOW_TIME_TX)); slave->ntt_actor = pdu->partner; @@ -491,7 +490,7 @@ slave_set_expired(struct slave *slave) slave->status = LACP_EXPIRED; slave->partner.state |= LACP_STATE_TIME; slave->partner.state &= ~LACP_STATE_SYNC; - timer_set_duration(&slave->rx, LACP_FAST_TIME_RX); + timer_set_duration(&slave->rx, LACP_RX_MULTIPLIER * LACP_FAST_TIME_TX); } static void diff --git a/lib/lacp.h b/lib/lacp.h index 8371fece..dc2bede4 100644 --- a/lib/lacp.h +++ b/lib/lacp.h @@ -33,8 +33,7 @@ #define LACP_FAST_TIME_TX 1000 /* Fast transmission rate. */ #define LACP_SLOW_TIME_TX 30000 /* Slow transmission rate. */ -#define LACP_FAST_TIME_RX (LACP_FAST_TIME_TX * 3) /* Fast receive rate. */ -#define LACP_SLOW_TIME_RX (LACP_SLOW_TIME_TX * 3) /* Slow receive rate. */ +#define LACP_RX_MULTIPLIER 3 /* Multiply by TX rate to get RX rate. */ #define LACP_INFO_LEN 15 struct lacp_info {