Show a patch.

GET /api/patches/73357/
Content-Type: application/json
Vary: Accept

    "id": 73357,
    "url": "",
    "web_url": "",
    "project": {
        "id": 1,
        "url": "",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "",
        "list_email": "",
        "web_url": "",
        "scm_url": "git://",
        "webscm_url": ""
    "msgid": "<>",
    "date": "2020-07-07T01:51:21",
    "name": "[RFC] net/bonding: change the state machine to defaulted",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2fa19d8ea45ef719b3a616602ea542f01aae38b4",
    "submitter": {
        "id": 362,
        "url": "",
        "name": "Weifeng Li",
        "email": ""
    "delegate": {
        "id": 319,
        "url": "",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": ""
    "mbox": "",
    "series": [
            "id": 10830,
            "url": "",
            "web_url": "",
            "date": "2020-07-07T01:51:21",
            "name": "[RFC] net/bonding: change the state machine to defaulted",
            "version": 1,
            "mbox": ""
    "comments": "",
    "check": "success",
    "checks": "",
    "tags": {},
    "headers": {
        "List-Archive": "<>",
        "Return-Path": "<>",
        "Content-Language": "zh-CN",
        "Accept-Language": "zh-CN, en-US",
        "Thread-Topic": "[RFC PATCH] net/bonding: change the state machine to defaulted",
        "To": "\"\" <>",
        "Thread-Index": "AQHWUPxZdw4XEnY2tECPQle2v0FLEqj7X5Kw",
        "List-Subscribe": "<>,\n <>",
        "Message-ID": "\n <>",
        "CC": "\"Huwei (Xavier)\" <>, \"\"\n <>, Songyujin <>, \"Liweifeng (DOPRA MSS)\"\n <>",
        "X-BeenThere": "",
        "x-originating-ip": "[]",
        "Received": [
            "from ( [])\n\tby (Postfix) with ESMTP id 1C5E1A00BE;\n\tTue,  7 Jul 2020 03:51:35 +0200 (CEST)",
            "from [] (localhost [])\n\tby (Postfix) with ESMTP id 1A1E71DCAE;\n\tTue,  7 Jul 2020 03:51:34 +0200 (CEST)",
            "from ( [])\n by (Postfix) with ESMTP id 5AA8B1DC93\n for <>; Tue,  7 Jul 2020 03:51:32 +0200 (CEST)",
            "from (unknown [])\n by Forcepoint Email with ESMTP id C33F4ECC141C31BE3961;\n Tue,  7 Jul 2020 09:51:30 +0800 (CST)",
            "from ( by\n ( with Microsoft SMTP Server (TLS)\n id 14.3.487.0; Tue, 7 Jul 2020 09:51:29 +0800",
            "from ([]) by\n ([]) with mapi id 14.03.0487.000;\n Tue, 7 Jul 2020 09:51:22 +0800"
        "Date": "Tue, 7 Jul 2020 01:51:21 +0000",
        "List-Id": "DPDK patches and discussions <>",
        "X-MS-TNEF-Correlator": "",
        "List-Post": "<>",
        "In-Reply-To": "<>",
        "Precedence": "list",
        "From": "\"Liyunqi (FENIX)\" <>",
        "X-MS-Has-Attach": "",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "Errors-To": "",
        "References": "<>",
        "X-Original-To": "",
        "Sender": "\"dev\" <>",
        "List-Unsubscribe": "<>,\n <>",
        "X-CFilter-Loop": "Reflected",
        "List-Help": "<>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Subject": "[dpdk-dev] [RFC PATCH] net/bonding: change the state machine to\n\tdefaulted",
        "Delivered-To": "",
        "X-Mailman-Version": "2.1.15"
    "content": "A dpdk bonding 802.3ad network as follows:\n+----------+                     +-----------+\n|dpdk lacp |slave1 <------> port1|switch lacp|\n|          |slave2 <------> port2|           |\n+----------+                     +-----------+\nIf a fiber optic go wrong about single pass during normal runing like\nthis:\nslave2 -----> port2 ok\nslave2 <----- port2 error: salve2 receive no LACPDU Some packets from switch to dpdk will choose port2 and lost.\n\nDpdk lacp state machine will transits to the expired state if no LACPDU is received before the current_while_timer expires. But if no LACPDU is received before the current_while_timer expires again, dpdk lacp state machine has no change. Port2 can not change to inactive depend on the received LACPDU.\nAccording to IEEE 802.3ad, if no lacpdu is received before the current_while_timer expires again, the state machine should transits from expired to defaulted. Port2 will change to inactive depend on the LACPDU with defaulted state.\n\nThis Patch add a state machine change from expired to defaulted when no lacpdu is received before the current_while_timer expires again according to IEEE 802.3ad:\nIf no LACPDU is received before the current_while timer expires again, the state machine transits to the DEFAULTED state. The recordDefault function overwrites the current operational parameters for the Partner with administratively configured values. This allows configuration of aggregations and individual links when no protocol partner is present, while still permitting an active partner to override default settings.\nThe update_Default_Selected function sets the Selected variable FALSE if the Link Aggregation Group has changed. Since all operational parameters are now set to locally administered values there can be no disagreement as to the Link Aggregation Group, so the Matched variable is set TRUE.\n\nThe relevant description is in the chapter 43.4.12 of the link below:\n\n\nSigned-off-by: Weifeng Li <>\n---\n drivers/net/bonding/eth_bond_8023ad_private.h |  2 ++\n drivers/net/bonding/rte_eth_bond_8023ad.c     | 21 +++++++++++++++++----\n 2 files changed, 19 insertions(+), 4 deletions(-)\n\n--\n1.8.3.1\n\n-----\nThis e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. \nAny use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons\nother than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!\n-----",
    "diff": "diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h\nindex 6e44ffd..76f8b8d 100644\n--- a/drivers/net/bonding/eth_bond_8023ad_private.h\n+++ b/drivers/net/bonding/eth_bond_8023ad_private.h\n@@ -50,6 +50,7 @@\n #define SM_FLAGS_MOVED                      0x0100\n #define SM_FLAGS_PARTNER_SHORT_TIMEOUT      0x0200\n #define SM_FLAGS_NTT                        0x0400\n+#define SM_FLAGS_EXPIRED                    0x0800\n \n #define BOND_LINK_FULL_DUPLEX_KEY           0x01\n #define BOND_LINK_SPEED_KEY_10M             0x02\n@@ -103,6 +104,7 @@ struct port {\n \n \t/** The operational Partner's port parameters */\n \tstruct port_params partner;\n+\tstruct port_params partner_admin;\n \n \t/* Additional port parameters not listed in documentation */\n \t/** State machine flags */\ndiff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c\nindex b77a37d..bfa418d 100644\n--- a/drivers/net/bonding/rte_eth_bond_8023ad.c\n+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c\n@@ -356,16 +356,28 @@\n \n \t\ttimer_set(&port->current_while_timer, timeout);\n \t\tACTOR_STATE_CLR(port, EXPIRED);\n+\t\tSM_FLAG_CLR(port, EXPIRED);\n \t\treturn; /* No state change */\n \t}\n \n \t/* If CURRENT state timer is not running (stopped or expired)\n \t * transit to EXPIRED state from DISABLED or CURRENT */\n \tif (!timer_is_running(&port->current_while_timer)) {\n-\t\tACTOR_STATE_SET(port, EXPIRED);\n-\t\tPARTNER_STATE_CLR(port, SYNCHRONIZATION);\n-\t\tPARTNER_STATE_SET(port, LACP_SHORT_TIMEOUT);\n-\t\ttimer_set(&port->current_while_timer, internals->mode4.short_timeout);\n+\t\tif (SM_FLAG(port, EXPIRED)) {\n+\t\t\tport->selected = UNSELECTED;\n+\t\t\tmemcpy(&port->partner, &port->partner_admin,\n+\t\t\t\tsizeof(struct port_params));\n+\t\t\trecord_default(port);\n+\t\t\tACTOR_STATE_CLR(port, EXPIRED);\n+\t\t\ttimer_cancel(&port->current_while_timer);\n+\t\t} else {\n+\t\t\tSM_FLAG_SET(port, EXPIRED);\n+\t\t\tACTOR_STATE_SET(port, EXPIRED);\n+\t\t\tPARTNER_STATE_CLR(port, SYNCHRONIZATION);\n+\t\t\tPARTNER_STATE_SET(port, LACP_SHORT_TIMEOUT);\n+\t\t\ttimer_set(&port->current_while_timer,\n+\t\t\t\tinternals->mode4.short_timeout);\n+\t\t}\n \t}\n }\n \n@@ -1020,6 +1032,7 @@\n \tport->actor.port_number = rte_cpu_to_be_16(slave_id + 1);\n \n \tmemcpy(&port->partner, &initial, sizeof(struct port_params));\n+\tmemcpy(&port->partner_admin, &initial, sizeof(struct port_params));\n \n \t/* default states */\n \tport->actor_state = STATE_AGGREGATION | STATE_LACP_ACTIVE | STATE_DEFAULTED;\n",
    "prefixes": [