[dpdk-dev] [PATCH]net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation
lidejun
lidejun1 at huawei.com
Wed Oct 30 03:12:16 CET 2019
Hi All:
This patch fixes a issue when DPDK 802.3ad bonding rx_machine enters EXPIRED state, but the opposite SWITCH lacp ignores distributing and collecting bit, so the SWITCH still sends packets to DPDK and all these packets are dropped.
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 007c99e..7d517e9 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -253,6 +253,13 @@ show_warnings(uint16_t slave_id)
}
static void
+update_default_selected(struct port *port)
+{
+ /* Partner admin parameters are not implemented, so mark port unselected. */
+ port->selected = UNSELECTED;
+}
+
+static void
record_default(struct port *port)
{
/* Record default parameters for partner. Partner admin parameters
@@ -377,6 +384,24 @@ rx_machine(struct bond_dev_private *internals, uint16_t slave_id,
return; /* No state change */
}
+ if (timer_is_expired(&port->current_while_timer)) {
+ if (ACTOR_STATE(port, EXPIRED)) {
+ /* update_Default_Selected */
+ update_default_selected(port);
+
+ /* recordDefault */
+ record_default(port);
+
+ /* Actor_Oper_Port_State.Expired <=== FALSE */
+ ACTOR_STATE_CLR(port, EXPIRED);
+ timer_cancel(&port->current_while_timer);
+ return;
+ }
+ if (ACTOR_STATE(port, DEFAULTED)) {
+ return;
+ }
+ }
+
/* If CURRENT state timer is not running (stopped or expired)
* transit to EXPIRED state from DISABLED or CURRENT */
if (!timer_is_running(&port->current_while_timer)) {
李德军
Cloud BU 基础服务产品部
Cloud Infrastructure Service Product Dept., Cloud BU, HUAWEI
Mobile: 18500291014
中国(China)-杭州(Hangzhou)-滨江区江虹路410号华为杭州研发中心Z6
E-mail: lidejun1 at huawei.com<mailto:lidejun1 at huawei.com>
More information about the dev
mailing list