Show a patch.

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

    "id": 73372,
    "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-07T14:38:17",
    "name": "[v2] 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": 10836,
            "url": "",
            "web_url": "",
            "date": "2020-07-07T14:38:17",
            "name": "[v2] net/bonding: change the state machine to defaulted",
            "version": 2,
            "mbox": ""
    "comments": "",
    "check": "warning",
    "checks": "",
    "tags": {},
    "headers": {
        "List-Archive": "<>",
        "Return-Path": "<>",
        "X-Mailer": "git-send-email 2.9.5",
        "To": "<>",
        "List-Subscribe": "<>,\n <>",
        "Message-ID": "<>",
        "CC": "<>, <>, <>,\n <>",
        "X-BeenThere": "",
        "Received": [
            "from ( [])\n\tby (Postfix) with ESMTP id EF45DA00BE;\n\tTue,  7 Jul 2020 08:46:24 +0200 (CEST)",
            "from [] (localhost [])\n\tby (Postfix) with ESMTP id D6D631DA16;\n\tTue,  7 Jul 2020 08:46:23 +0200 (CEST)",
            "from ( [])\n by (Postfix) with ESMTP id 61F611B13C\n for <>; Tue,  7 Jul 2020 08:46:22 +0200 (CEST)",
            "from (unknown [])\n by Forcepoint Email with ESMTP id 519E74FD2F18E852B611;\n Tue,  7 Jul 2020 14:46:21 +0800 (CST)",
            "from Euler.localdomain ( by\n ( with Microsoft SMTP Server id\n 14.3.487.0; Tue, 7 Jul 2020 14:46:11 +0800"
        "Subject": "[dpdk-dev] [PATCH v2] net/bonding: change the state machine to\n\tdefaulted",
        "List-Unsubscribe": "<>,\n <>",
        "List-Id": "DPDK patches and discussions <>",
        "List-Post": "<>",
        "Date": "Tue, 7 Jul 2020 14:38:17 +0000",
        "Precedence": "list",
        "From": "Weifeng Li <>",
        "MIME-Version": "1.0",
        "X-Original-To": "",
        "Sender": "\"dev\" <>",
        "Errors-To": "",
        "X-CFilter-Loop": "Reflected",
        "List-Help": "<>",
        "Content-Type": "text/plain",
        "Delivered-To": "",
        "X-Originating-IP": "[]",
        "X-Mailman-Version": "2.1.15"
    "content": "From: Weifeng Li <>\n\nA 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 running like\nthis:\nslave2 -----> port2 ok\nslave2 <----- port2 error: salve2 receive no LACPDU Some packets from\n\t\t\t   switch to dpdk will choose port2 and lost.\n\nDPDK lacp state machine will transits to the expired state if no LACPDU\nis received before the current_while_timer expires. But if no LACPDU is\nreceived before the current_while_timer expires again, DPDK lacp state\nmachine has no change. Port2 can not change to inactive depend on the\nreceived LACPDU.\nAccording to IEEE 802.3ad, if no lacpdu is received before the\ncurrent_while_timer expires again, the state machine should transits from\nexpired to defaulted. Port2 will change to inactive depend on the LACPDU\nwith defaulted state.\n\nThis patch adds a state machine change from expired to defaulted when no\nlacpdu is received before the current_while_timer expires again according\nto IEEE 802.3ad:\nIf no LACPDU is received before the current_while timer expires again,\nthe state machine transits to the DEFAULTED state. The record Default\nfunction overwrites the current operational parameters for the Partner\nwith administratively configured values. This allows configuration of\naggregations and individual links when no protocol partner is present,\nwhile still permitting an active partner to override default settings.\nThe update_Default_Selected function sets the Selected variable FALSE\nif the Link Aggregation Group has changed. Since all operational parameters\nare now set to locally administered values there can be no disagreement as\nto 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---\nv1 -> v2: adjust the formate of commit log\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(-)",
    "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 @@ rx_machine(struct bond_dev_private *internals, uint16_t slave_id,\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 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,\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": [