get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28025,
    "url": "https://patches.dpdk.org/api/patches/28025/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1503713853-13217-1-git-send-email-xie.rongqiang@zte.com.cn/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1503713853-13217-1-git-send-email-xie.rongqiang@zte.com.cn>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1503713853-13217-1-git-send-email-xie.rongqiang@zte.com.cn",
    "date": "2017-08-26T02:17:33",
    "name": "[dpdk-dev,v3] app/testpmd:add bond type description",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8e800bba38f7726b962e1d2885e1a417166b710e",
    "submitter": {
        "id": 770,
        "url": "https://patches.dpdk.org/api/people/770/?format=api",
        "name": "Xie RongQiang",
        "email": "xie.rongqiang@zte.com.cn"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1503713853-13217-1-git-send-email-xie.rongqiang@zte.com.cn/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/28025/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/28025/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id CAD697D2A;\n\tSat, 26 Aug 2017 04:18:23 +0200 (CEST)",
            "from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172])\n\tby dpdk.org (Postfix) with ESMTP id 49BF77D1E\n\tfor <dev@dpdk.org>; Sat, 26 Aug 2017 04:18:20 +0200 (CEST)",
            "from unknown (HELO mse01.zte.com.cn) (10.30.3.20)\n\tby localhost with (AES256-SHA encrypted) SMTP;\n\t26 Aug 2017 02:13:46 -0000",
            "from notes_smtp.zte.com.cn ([10.30.1.239])\n\tby mse01.zte.com.cn with ESMTP id v7Q2IDAO030523;\n\tSat, 26 Aug 2017 10:18:13 +0800 (GMT-8)\n\t(envelope-from xie.rongqiang@zte.com.cn)",
            "from localhost.localdomain.localdomain ([10.43.166.171])\n\tby szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6)\n\twith ESMTP id 2017082610181883-841356 ;\n\tSat, 26 Aug 2017 10:18:18 +0800 "
        ],
        "X-scanvirus": "By SEG_CYREN AntiVirus Engine",
        "X-scanresult": "CLEAN",
        "X-MAILFROM": "<xie.rongqiang@zte.com.cn>",
        "X-RCPTTO": "<dev@dpdk.org>",
        "X-FROMIP": "10.30.3.20",
        "X-SEG-Scaned": "1",
        "X-Received": "unknown,10.30.3.20,20170826101346",
        "From": "Rongqiang XIE <xie.rongqiang@zte.com.cn>",
        "To": "declan.doherty@intel.com, thomas@monjalon.net, jingjing.wu@intel.com",
        "Cc": "dev@dpdk.org, Rongqiang XIE <xie.rongqiang@zte.com.cn>",
        "Date": "Sat, 26 Aug 2017 10:17:33 +0800",
        "Message-Id": "<1503713853-13217-1-git-send-email-xie.rongqiang@zte.com.cn>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "X-MIMETrack": "Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release\n\t8.5.3FP6|November 21, 2013) at 2017-08-26 10:18:18,\n\tSerialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17,\n\t2016) at\n\t2017-08-26 10:17:53, Serialize complete at 2017-08-26 10:17:53",
        "X-MAIL": "mse01.zte.com.cn v7Q2IDAO030523",
        "X-HQIP": "127.0.0.1",
        "Subject": "[dpdk-dev] [PATCH v3] app/testpmd:add bond type description",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "In function cmd_show_bonding_config_parsed() used number represent\nthe bond type,in order more detailed,add bond type description\notherwise we may confused about the number type.\nAnd also,the primary port just use in mode active backup and tlb,\nso,when the mode is active backup or tlb show the primary port info\nmay be more appropriate.\n\nSigned-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>\n---\n app/test-pmd/cmdline.c                       | 28 ++++++++++++-------\n drivers/net/bonding/rte_eth_bond.h           | 15 +++++++++++\n drivers/net/bonding/rte_eth_bond_api.c       | 40 ++++++++++++++++++++++++++++\n drivers/net/bonding/rte_eth_bond_version.map |  1 +\n 4 files changed, 74 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex cd8c358..038cb3d 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -4593,6 +4593,7 @@ static void cmd_show_bonding_config_parsed(void *parsed_result,\n {\n \tstruct cmd_show_bonding_config_result *res = parsed_result;\n \tint bonding_mode, agg_mode;\n+\tchar bonding_str[BONDING_MODE_STRING_LEN];\n \tuint8_t slaves[RTE_MAX_ETHPORTS];\n \tint num_slaves, num_active_slaves;\n \tint primary_id;\n@@ -4600,13 +4601,17 @@ static void cmd_show_bonding_config_parsed(void *parsed_result,\n \tportid_t port_id = res->port_id;\n \n \t/* Display the bonding mode.*/\n+\tif (!rte_eth_bond_mode_string_get(port_id, bonding_str)) {\n+\t\tprintf(\"\\tFailed to get bonding mode string for port = %d\\n\", port_id);\n+\t\treturn;\n+\t} else\n+\t\tprintf(\"\\tBonding mode: %s\\n\", bonding_str);\n+\n \tbonding_mode = rte_eth_bond_mode_get(port_id);\n \tif (bonding_mode < 0) {\n \t\tprintf(\"\\tFailed to get bonding mode for port = %d\\n\", port_id);\n \t\treturn;\n-\t} else\n-\t\tprintf(\"\\tBonding mode: %d\\n\", bonding_mode);\n-\n+\t}\n \tif (bonding_mode == BONDING_MODE_BALANCE) {\n \t\tint balance_xmit_policy;\n \n@@ -4685,13 +4690,16 @@ static void cmd_show_bonding_config_parsed(void *parsed_result,\n \t\tprintf(\"\\tActive Slaves: []\\n\");\n \n \t}\n-\n-\tprimary_id = rte_eth_bond_primary_get(port_id);\n-\tif (primary_id < 0) {\n-\t\tprintf(\"\\tFailed to get primary slave for port = %d\\n\", port_id);\n-\t\treturn;\n-\t} else\n-\t\tprintf(\"\\tPrimary: [%d]\\n\", primary_id);\n+\tif (bonding_mode == BONDING_MODE_ACTIVE_BACKUP ||\n+\t\tbonding_mode == BONDING_MODE_TLB){\n+\t\tprimary_id = rte_eth_bond_primary_get(port_id);\n+\t\tif (primary_id < 0) {\n+\t\t\tprintf(\"\\tFailed to get primary slave for port = %d\\n\", port_id);\n+\t\t\treturn;\n+\t\t} else\n+\t\t\tprintf(\"\\tPrimary: [%d]\\n\", primary_id);\n+\t}\n+\treturn;\n \n }\n \ndiff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h\nindex 8efbf07..c25293a 100644\n--- a/drivers/net/bonding/rte_eth_bond.h\n+++ b/drivers/net/bonding/rte_eth_bond.h\n@@ -117,6 +117,9 @@\n #define BALANCE_XMIT_POLICY_LAYER34\t\t(2)\n /**< Layer 3+4 (IP Addresses + UDP Ports) transmit load balancing */\n \n+/* Max length size for bond mode string */\n+#define BONDING_MODE_STRING_LEN      (30)\n+\n /**\n  * Create a bonded rte_eth_dev device\n  *\n@@ -189,6 +192,18 @@\n rte_eth_bond_mode_get(uint8_t bonded_port_id);\n \n /**\n+ * Get link bonding mode string of bonded device\n+ *\n+ * @param bonded_port_id\tPort ID of bonded device.\n+ *\n+ * @param mode          mode string\n+ * @return\n+ *\tlink bonding mode on success, negative value otherwise\n+ */\n+int\n+rte_eth_bond_mode_string_get(uint8_t bonded_port_id, char *mode);\n+\n+/**\n  * Set slave rte_eth_dev as primary slave of bonded device\n  *\n  * @param bonded_port_id\tPort ID of bonded device.\ndiff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c\nindex de1d9e0..c55b90f 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -510,6 +510,46 @@\n }\n \n int\n+rte_eth_bond_mode_string_get(uint8_t bonded_port_id, char *mode)\n+{\n+\tstruct bond_dev_private *internals;\n+\n+\tif (valid_bonded_port_id(bonded_port_id) != 0)\n+\t\treturn -1;\n+\n+\tinternals = rte_eth_devices[bonded_port_id].data->dev_private;\n+\n+\tswitch (internals->mode) {\n+\tcase BONDING_MODE_ROUND_ROBIN:\n+\t\t\tmemcpy(mode, \"round-robin\", BONDING_MODE_STRING_LEN);\n+\t\t\tbreak;\n+\tcase BONDING_MODE_ACTIVE_BACKUP:\n+\t\t\tmemcpy(mode, \"active-backup\", BONDING_MODE_STRING_LEN);\n+\t\t\tbreak;\n+\tcase BONDING_MODE_BALANCE:\n+\t\t\tmemcpy(mode, \"link-aggregation\", BONDING_MODE_STRING_LEN);\n+\t\t\tbreak;\n+\tcase BONDING_MODE_BROADCAST:\n+\t\t\tmemcpy(mode, \"broadcast\", BONDING_MODE_STRING_LEN);\n+\t\t\tbreak;\n+\tcase BONDING_MODE_8023AD:\n+\t\t\tmemcpy(mode, \"link-aggregation-802.3ad\", BONDING_MODE_STRING_LEN);\n+\t\t\tbreak;\n+\tcase BONDING_MODE_TLB:\n+\t\t\tmemcpy(mode, \"transmit-load-balancing\", BONDING_MODE_STRING_LEN);\n+\t\t\tbreak;\n+\tcase BONDING_MODE_ALB:\n+\t\t\tmemcpy(mode, \"adaptive-load-balancing\", BONDING_MODE_STRING_LEN);\n+\t\t\tbreak;\n+\tdefault:\n+\t\t\tmemcpy(mode, \"unknown-mode\", BONDING_MODE_STRING_LEN);\n+\t\t\tbreak;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id)\n {\n \tstruct bond_dev_private *internals;\ndiff --git a/drivers/net/bonding/rte_eth_bond_version.map b/drivers/net/bonding/rte_eth_bond_version.map\nindex 0f4e847..c08f60e 100644\n--- a/drivers/net/bonding/rte_eth_bond_version.map\n+++ b/drivers/net/bonding/rte_eth_bond_version.map\n@@ -53,6 +53,7 @@ DPDK_17.08 {\n         rte_eth_bond_8023ad_agg_selection_set;\n         rte_eth_bond_8023ad_conf_get;\n         rte_eth_bond_8023ad_setup;\n+        rte_eth_bond_mode_string_get;\n \n \n } DPDK_16.07;\n",
    "prefixes": [
        "dpdk-dev",
        "v3"
    ]
}