From patchwork Wed Oct 30 02:12:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: lidejun X-Patchwork-Id: 62185 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA590A00BE; Wed, 30 Oct 2019 03:12:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 388791BEAE; Wed, 30 Oct 2019 03:12:30 +0100 (CET) Received: from huawei.com (szxga02-in.huawei.com [45.249.212.188]) by dpdk.org (Postfix) with ESMTP id 2A0E31BE89 for ; Wed, 30 Oct 2019 03:12:27 +0100 (CET) Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id 17FB558DC20FE3ADFFA5 for ; Wed, 30 Oct 2019 10:12:26 +0800 (CST) Received: from DGGEMM512-MBS.china.huawei.com ([169.254.4.14]) by DGGEMM405-HUB.china.huawei.com ([10.3.20.213]) with mapi id 14.03.0439.000; Wed, 30 Oct 2019 10:12:17 +0800 From: lidejun To: "dev@dpdk.org" CC: Shiweixian , "liucheng (J)" , "chenhaifeng (A)" , houdisheng Thread-Topic: [PATCH]net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation Thread-Index: AdWOxTnZxfW8Cy59R9WreUcvCAL8NQ== Date: Wed, 30 Oct 2019 02:12:16 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.98.154] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH]net/bonding: add DEFAULTED state in rx_machine in 802.3ad bonding implementation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 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,