net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation
diff mbox series

Message ID A69E93D1CF6DFA4BA33FB8D8DAFFFD19037B345D@dggemm512-mbs.china.huawei.com
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail apply issues

Commit Message

lidejun Oct. 30, 2019, 2:12 a.m. UTC
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.

          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@huawei.com<mailto:lidejun1@huawei.com>

Comments

Ferruh Yigit Nov. 11, 2019, 4:51 p.m. UTC | #1
On 10/30/2019 2:12 AM, lidejun wrote:
> 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.

Hi lidejun,

Thanks for the patch, but we need a commit with description and the sign-off
from the author. Can you please check the contribution guide, and send a new
version according:
https://doc.dpdk.org/guides/contributing/patches.html

Meanwhile cc'ed the bonding maintainer [1] and related folks for the review.
Please add at least the maintainer to the cc for your next version.

Thanks,
ferruh

[1]
Chas Williams <chas3@att.com>
http://lxr.dpdk.org/dpdk/v19.08/source/MAINTAINERS#L507


> 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@huawei.com<mailto:lidejun1@huawei.com>
>

Patch
diff mbox series

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,