Show a patch.

GET /api/patches/73372/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 73372,
    "url": "https://patches.dpdk.org/api/patches/73372/",
    "web_url": "https://patches.dpdk.org/patch/73372/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<20200707143817.6680-1-liyunqi@huawei.com>",
    "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": "https://patches.dpdk.org/api/people/362/",
        "name": "Weifeng Li",
        "email": "liyunqi@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/73372/mbox/",
    "series": [
        {
            "id": 10836,
            "url": "https://patches.dpdk.org/api/series/10836/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10836",
            "date": "2020-07-07T14:38:17",
            "name": "[v2] net/bonding: change the state machine to defaulted",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10836/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73372/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/73372/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Mailer": "git-send-email 2.9.5",
        "To": "<dev@dpdk.org>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Message-ID": "<20200707143817.6680-1-liyunqi@huawei.com>",
        "CC": "<liweifeng2@huawei.com>, <songyujin@huawei.com>, <chas3@att.com>,\n <xavier.huwei@huawei.com>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id EF45DA00BE;\n\tTue,  7 Jul 2020 08:46:24 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D6D631DA16;\n\tTue,  7 Jul 2020 08:46:23 +0200 (CEST)",
            "from huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by dpdk.org (Postfix) with ESMTP id 61F611B13C\n for <dev@dpdk.org>; Tue,  7 Jul 2020 08:46:22 +0200 (CEST)",
            "from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58])\n by Forcepoint Email with ESMTP id 519E74FD2F18E852B611;\n Tue,  7 Jul 2020 14:46:21 +0800 (CST)",
            "from Euler.localdomain (10.175.129.171) by\n DGGEMS401-HUB.china.huawei.com (10.3.19.201) 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": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Date": "Tue, 7 Jul 2020 14:38:17 +0000",
        "Precedence": "list",
        "From": "Weifeng Li <liyunqi@huawei.com>",
        "MIME-Version": "1.0",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-CFilter-Loop": "Reflected",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Content-Type": "text/plain",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "X-Originating-IP": "[10.175.129.171]",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "From: Weifeng Li <liweifeng2@huawei.com>\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:\nhttps://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=850426\n\nSigned-off-by: Weifeng Li <liweifeng2@huawei.com>\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": [
        "v2"
    ]
}