From: lidejun <lidejun1@huawei.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: Shiweixian <shiweixian@huawei.com>,
"liucheng (J)" <liucheng11@huawei.com>,
"chenhaifeng (A)" <chenhaifeng6@huawei.com>,
houdisheng <houdisheng@huawei.com>
Subject: [dpdk-dev] [PATCH]net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation
Date: Wed, 30 Oct 2019 02:12:16 +0000 [thread overview]
Message-ID: <A69E93D1CF6DFA4BA33FB8D8DAFFFD19037B345D@dggemm512-mbs.china.huawei.com> (raw)
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>
next reply other threads:[~2019-10-30 2:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 2:12 lidejun [this message]
2019-11-11 16:51 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A69E93D1CF6DFA4BA33FB8D8DAFFFD19037B345D@dggemm512-mbs.china.huawei.com \
--to=lidejun1@huawei.com \
--cc=chenhaifeng6@huawei.com \
--cc=dev@dpdk.org \
--cc=houdisheng@huawei.com \
--cc=liucheng11@huawei.com \
--cc=shiweixian@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).