DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH]net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation
@ 2019-10-30  2:12 lidejun
  2019-11-11 16:51 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: lidejun @ 2019-10-30  2:12 UTC (permalink / raw)
  To: dev; +Cc: Shiweixian, liucheng (J), chenhaifeng (A), houdisheng

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH]net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation
  2019-10-30  2:12 [dpdk-dev] [PATCH]net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation lidejun
@ 2019-11-11 16:51 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2019-11-11 16:51 UTC (permalink / raw)
  To: lidejun, dev
  Cc: Shiweixian, liucheng (J), chenhaifeng (A),
	houdisheng, Chas Williams, Declan Doherty, Nicolau, Radu

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>
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-11 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30  2:12 [dpdk-dev] [PATCH]net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation lidejun
2019-11-11 16:51 ` Ferruh Yigit

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).