return -ENOMEM;
atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_tx);
+ atomic64_inc(&BOND_AD_INFO(slave->bond).stats.lacpdu_tx);
skb->dev = slave->dev;
skb_reset_mac_header(skb);
switch (marker->tlv_type) {
case AD_MARKER_INFORMATION_SUBTYPE:
atomic64_inc(&SLAVE_AD_INFO(slave)->stats.marker_tx);
+ atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_tx);
break;
case AD_MARKER_RESPONSE_SUBTYPE:
atomic64_inc(&SLAVE_AD_INFO(slave)->stats.marker_resp_tx);
+ atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_resp_tx);
break;
}
*/
last_state = port->sm_rx_state;
- if (lacpdu)
+ if (lacpdu) {
atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.lacpdu_rx);
-
+ atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.lacpdu_rx);
+ }
/* check if state machine should change state */
/* first, check if port was reinitialized */
struct bond_marker marker;
atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.marker_rx);
+ atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_rx);
/* copy the received marker data to the response marker */
memcpy(&marker, marker_info, sizeof(struct bond_marker));
struct port *port)
{
atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.marker_resp_rx);
+ atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_resp_rx);
/* DO NOTHING, SINCE WE DECIDED NOT TO IMPLEMENT THIS FEATURE FOR NOW */
}
*/
static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
{
+ struct bonding *bond = slave->bond;
int ret = RX_HANDLER_ANOTHER;
struct bond_marker *marker;
struct port *port;
port->actor_port_number);
stat = &SLAVE_AD_INFO(slave)->stats.marker_unknown_rx;
atomic64_inc(stat);
+ stat = &BOND_AD_INFO(bond).stats.marker_unknown_rx;
+ atomic64_inc(stat);
}
break;
default:
atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_unknown_rx);
+ atomic64_inc(&BOND_AD_INFO(bond).stats.lacpdu_unknown_rx);
}
return ret;
lacpdu = skb_header_pointer(skb, 0, sizeof(_lacpdu), &_lacpdu);
if (!lacpdu) {
atomic64_inc(&SLAVE_AD_INFO(slave)->stats.lacpdu_illegal_rx);
+ atomic64_inc(&BOND_AD_INFO(bond).stats.lacpdu_illegal_rx);
return RX_HANDLER_ANOTHER;
}
spin_unlock_bh(&bond->mode_lock);
}
-void bond_3ad_stats_add(struct slave *slave, struct bond_3ad_stats *stats)
-{
- struct bond_3ad_stats *rstats = &SLAVE_AD_INFO(slave)->stats;
- u64 stat;
-
- atomic64_add(atomic64_read(&rstats->lacpdu_rx), &stats->lacpdu_rx);
- atomic64_add(atomic64_read(&rstats->lacpdu_tx), &stats->lacpdu_tx);
-
- stat = atomic64_read(&rstats->lacpdu_unknown_rx);
- atomic64_add(stat, &stats->lacpdu_unknown_rx);
- stat = atomic64_read(&rstats->lacpdu_illegal_rx);
- atomic64_add(stat, &stats->lacpdu_illegal_rx);
-
- atomic64_add(atomic64_read(&rstats->marker_rx), &stats->marker_rx);
- atomic64_add(atomic64_read(&rstats->marker_tx), &stats->marker_tx);
-
- stat = atomic64_read(&rstats->marker_resp_rx);
- atomic64_add(stat, &stats->marker_resp_rx);
- stat = atomic64_read(&rstats->marker_resp_tx);
- atomic64_add(stat, &stats->marker_resp_tx);
- stat = atomic64_read(&rstats->marker_unknown_rx);
- atomic64_add(stat, &stats->marker_unknown_rx);
-}
-
size_t bond_3ad_stats_size(void)
{
return nla_total_size_64bit(sizeof(u64)) + /* BOND_3AD_STAT_LACPDU_RX */
if (!nest)
return -EMSGSIZE;
if (BOND_MODE(bond) == BOND_MODE_8023AD) {
- struct bond_3ad_stats stats;
- struct list_head *iter;
-
- memset(&stats, 0, sizeof(stats));
- if (slave) {
- bond_3ad_stats_add(slave, &stats);
- } else {
- bond_for_each_slave(bond, slave, iter)
- bond_3ad_stats_add(slave, &stats);
- }
+ struct bond_3ad_stats *stats;
+
+ if (slave)
+ stats = &SLAVE_AD_INFO(slave)->stats;
+ else
+ stats = &BOND_AD_INFO(bond).stats;
nest2 = nla_nest_start(skb, BOND_XSTATS_3AD);
if (!nest2) {
return -EMSGSIZE;
}
- if (bond_3ad_stats_fill(skb, &stats)) {
+ if (bond_3ad_stats_fill(skb, stats)) {
nla_nest_cancel(skb, nest2);
nla_nest_end(skb, nest);
return -EMSGSIZE;
struct ad_bond_info {
struct ad_system system; /* 802.3ad system structure */
+ struct bond_3ad_stats stats;
u32 agg_select_timer; /* Timer to select aggregator after all adapter's hand shakes */
u16 aggregator_identifier;
};
int bond_3ad_set_carrier(struct bonding *bond);
void bond_3ad_update_lacp_rate(struct bonding *bond);
void bond_3ad_update_ad_actor_settings(struct bonding *bond);
-void bond_3ad_stats_add(struct slave *slave, struct bond_3ad_stats *stats);
int bond_3ad_stats_fill(struct sk_buff *skb, struct bond_3ad_stats *stats);
size_t bond_3ad_stats_size(void);
#endif /* _NET_BOND_3AD_H */