From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3936433D8 for ; Mon, 11 Dec 2023 11:22:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCE1C40ED2; Mon, 11 Dec 2023 11:22:29 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2057.outbound.protection.outlook.com [40.107.101.57]) by mails.dpdk.org (Postfix) with ESMTP id 874F540E0F for ; Mon, 11 Dec 2023 11:22:28 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQGK6cWniMzsjqj/U0dE51sWlcb/TxWh28AQ2iclJQWbitcp3TFM/Q3hys57M6wS+RCDbE8vZecOfUC9S87EMrL1PmoBljr23/Z43Lg9hQNgyu9K3oyydzePsXNBNwEqP8CJmy+ImT9D+D71UV2IJipErCJ+58gXWXW21AmhUveP3t+3AeP6QLsN3/aOH3in0HtIyeXwif5BWCbr3/MPSRXccb08W2FEqguO0OAnckp4ejRtBmRiXCkhkdUSNoDwsD2pt8zbjMFCWQO87VpPuDoP+rfod0xevCUhrxAqwU/qUqm6LICGS8b5dqjXqP+/oQb3FojQcGlGXhk32VvS7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+MmPyCN+N2CdGO1KHWWfKfaetJUHnEOOW9NtfjZapuU=; b=W19g5yw+MRjW5ZJMZZGmfekDUuu4u/HLET+lsIeKzNSWPUTSD5EVNyCO57GZtfc/taI+RtsnVeAFjCOiSWuxQfk8dWc1Gw9O1hXQCO/xUsgNBIiqYQe1oGCgyI2o/pb3IB5D1rOA5DX/tRGWIyQhXv2PtY7DdgxB8iT+FsixeirwEQ3IswRgNXw/a8k5UZnypq3gyTBm0W49x8WvAIJ+m4K8uXCgd3c1ea1Rk0HM6mr7mrve+WYcNvCZGvYAzuk7cZ9T4lGKH0en0OWVvviqtU29aWFFgsenm0KVxW4Duw3qaoQmZ8UecKTJnEYSLULfLzIIEpBQDztr9i+9o8n53A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+MmPyCN+N2CdGO1KHWWfKfaetJUHnEOOW9NtfjZapuU=; b=PwjK5zjDmF6Doj0EHA+2YIDCyZS95Z5iS7ySOQTJuy65XmcdWuYTghzS8/uQK0yJtax8zZ5y64OuxRTtJnLtdJNlejSk0ClMUZ3Y4fsfpE6CoIRMMyTc8fzlPI4w6Xo5EP7jXbu3BJ8sExfLfFSyxJyp/VYhcYlhHNqSP3go5NTeqtxsXHfrPN5ZVJy+piUs3MVIZslv7wZEYhtSo8gqm/g/ciTUYa9WMTBFiGicjENl+z1EGula5Qhi0moy6Cfrju9qpqxJ+gaAn2WBYSqc8D/1XFSBdkMzrqKN7LXGUjVgJCZD7aJEXzZnkps4wn/f8d9aYr+adWcp9fJw6SWnHQ== Received: from SN7PR04CA0191.namprd04.prod.outlook.com (2603:10b6:806:126::16) by IA1PR12MB8359.namprd12.prod.outlook.com (2603:10b6:208:3fc::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Mon, 11 Dec 2023 10:22:26 +0000 Received: from SA2PEPF000015C7.namprd03.prod.outlook.com (2603:10b6:806:126:cafe::9d) by SN7PR04CA0191.outlook.office365.com (2603:10b6:806:126::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 10:22:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF000015C7.mail.protection.outlook.com (10.167.241.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:22:24 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 11 Dec 2023 02:22:12 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 11 Dec 2023 02:22:10 -0800 From: Xueming Li To: Huisong Li CC: Min Hu , Stephen Hemminger , dpdk stable Subject: patch 'examples/ethtool: fix pause configuration' has been queued to stable release 22.11.4 Date: Mon, 11 Dec 2023 18:12:13 +0800 Message-ID: <20231211101226.2122-109-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211101226.2122-1-xuemingl@nvidia.com> References: <20231022142250.10324-1-xuemingl@nvidia.com> <20231211101226.2122-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015C7:EE_|IA1PR12MB8359:EE_ X-MS-Office365-Filtering-Correlation-Id: de03fd2a-d5b0-41ce-6605-08dbfa331162 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j0ByKO+oSlLV9o1ePJ9m0WHxNiiMvtqxNWo3tx0sg9B2mujpfQgKEoUpKQttutSysMWbjAvQJ97oftE9itiltBTvdlMVjA+ujsliN0JWliU/4Diw5a4DvLyzSu3yE1ofzFq/lEDy08+Yr8WajgtvSawRYhm/dBwJ1jQuzXQ/9nDep9RMMhn0DAhCdWBpZYDfG1bzfuDiw/ciH/5+X6CAOHuq1X7OPVF16w4rBLWLE2j5FKvY14OMrPPu6EUXF91RQn42n4CM0m13xb3BSq4qb8ushcEaKcqQMFX/H53c0gdwSZ1zYDBb+l1EtrHmwURHO1U4EkNbTQv0Cj3m+vRR3PpIh+4HECsPcTMF9ue561We/F4+CJtX3feFfiw3pecGF1iucp1Mg0Et+V7v1u+a9kXlbqpQZLUkn5BRRoghLPIWmO7rKKbKQVbt990/pizxOlu9BLSwLA4XRULs4Q+sGC9BHoVUAaGlFDyg3bGqz77Dy1WMdXlt/sfPvZL7l877lsH24D37udzZ6WOgfhBujX5Wp6Pm+7EVn0pYkxLbg7JxmwcPzwc4ksc3PZlVPDrUA/ejHPBG0e8BsGgQ4YRQTUsN2YW6HPkZVYa0gpLQLfyQHFAJGL7+IEHFr94JxEIpPwIM2tB8Z4C40sQp5Q9EUlBXCHo35oWtwXEBSXKobdqD2OQlq/wV7CY6iSCO77J7y2A+AytYLrz0eJAgrIb0q3YbXXZaA/eSj+td6qVbigfXXbk5RU4Z5XybME13MMUEwpWlvq5pmR8el7g8gpRd6Q== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(346002)(39860400002)(376002)(396003)(230922051799003)(64100799003)(451199024)(82310400011)(1800799012)(186009)(36840700001)(46966006)(40470700004)(55016003)(40480700001)(41300700001)(4001150100001)(40460700003)(2906002)(5660300002)(316002)(4326008)(8676002)(8936002)(6916009)(70586007)(54906003)(70206006)(7636003)(356005)(82740400003)(2616005)(36860700001)(86362001)(36756003)(47076005)(966005)(83380400001)(6286002)(478600001)(26005)(336012)(1076003)(16526019)(426003)(7696005)(53546011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:22:24.3588 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de03fd2a-d5b0-41ce-6605-08dbfa331162 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015C7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8359 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/13/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=0a742f1ec02406e36b4ef90f504450d9b59792a9 Thanks. Xueming Li --- >From 0a742f1ec02406e36b4ef90f504450d9b59792a9 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 10 Nov 2023 11:30:39 +0800 Subject: [PATCH] examples/ethtool: fix pause configuration Cc: Xueming Li [ upstream commit 29cb7cf999bd5b3cb44ec6937529b2b197e7e25f ] Currently, the pause command in ethtool to enable Rx/Tx pause has the following problem. Namely, Assume that the device supports flow control auto-negotiation to set pause parameters, which will the device that does not support flow control auto-negotiation fails to run this command. This patch supports the configuration of flow control auto-negotiation and fixes the print format and style of the pause cmd to make it more readable. Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application") Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) Acked-by: Stephen Hemminger --- examples/ethtool/ethtool-app/ethapp.c | 59 ++++++++++++++++----------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c index 4ea504ed6a..489cd4f515 100644 --- a/examples/ethtool/ethtool-app/ethapp.c +++ b/examples/ethtool/ethtool-app/ethapp.c @@ -51,6 +51,13 @@ struct pcmd_intintint_params { uint16_t rx; }; +struct pcmd_pause_params { + cmdline_fixed_string_t cmd; + uint16_t port; + cmdline_fixed_string_t mode; + cmdline_fixed_string_t autoneg; + cmdline_fixed_string_t an_status; +}; /* Parameter-less commands */ cmdline_parse_token_string_t pcmd_quit_token_cmd = @@ -118,12 +125,18 @@ cmdline_parse_token_num_t pcmd_intintint_token_rx = /* Pause commands */ cmdline_parse_token_string_t pcmd_pause_token_cmd = - TOKEN_STRING_INITIALIZER(struct pcmd_intstr_params, cmd, "pause"); + TOKEN_STRING_INITIALIZER(struct pcmd_pause_params, cmd, "pause"); cmdline_parse_token_num_t pcmd_pause_token_port = - TOKEN_NUM_INITIALIZER(struct pcmd_intstr_params, port, RTE_UINT16); -cmdline_parse_token_string_t pcmd_pause_token_opt = - TOKEN_STRING_INITIALIZER(struct pcmd_intstr_params, - opt, "all#tx#rx#none"); + TOKEN_NUM_INITIALIZER(struct pcmd_pause_params, port, RTE_UINT16); +cmdline_parse_token_string_t pcmd_pause_token_mode = + TOKEN_STRING_INITIALIZER(struct pcmd_pause_params, + mode, "full#tx#rx#none"); +cmdline_parse_token_string_t pcmd_pause_token_autoneg = + TOKEN_STRING_INITIALIZER(struct pcmd_pause_params, + autoneg, "autoneg"); +cmdline_parse_token_string_t pcmd_pause_token_an_status = + TOKEN_STRING_INITIALIZER(struct pcmd_pause_params, + an_status, "on#off"); /* VLAN commands */ cmdline_parse_token_string_t pcmd_vlan_token_cmd = @@ -350,13 +363,12 @@ pcmd_module_eeprom_callback(void *ptr_params, fclose(fp_eeprom); } - static void pcmd_pause_callback(void *ptr_params, __rte_unused struct cmdline *ctx, void *ptr_data) { - struct pcmd_intstr_params *params = ptr_params; + struct pcmd_pause_params *params = ptr_params; struct ethtool_pauseparam info; int stat; @@ -368,39 +380,38 @@ pcmd_pause_callback(void *ptr_params, stat = rte_ethtool_get_pauseparam(params->port, &info); } else { memset(&info, 0, sizeof(info)); - if (strcasecmp("all", params->opt) == 0) { + if (strcasecmp("full", params->mode) == 0) { info.tx_pause = 1; info.rx_pause = 1; - } else if (strcasecmp("tx", params->opt) == 0) { + } else if (strcasecmp("tx", params->mode) == 0) { info.tx_pause = 1; info.rx_pause = 0; - } else if (strcasecmp("rx", params->opt) == 0) { + } else if (strcasecmp("rx", params->mode) == 0) { info.tx_pause = 0; info.rx_pause = 1; } else { info.tx_pause = 0; info.rx_pause = 0; } - /* Assume auto-negotiation wanted */ - info.autoneg = 1; + + if (strcasecmp("on", params->an_status) == 0) + info.autoneg = 1; + else + info.autoneg = 0; + stat = rte_ethtool_set_pauseparam(params->port, &info); } if (stat == 0) { - if (info.rx_pause && info.tx_pause) - printf("Port %i: Tx & Rx Paused\n", params->port); - else if (info.rx_pause) - printf("Port %i: Rx Paused\n", params->port); - else if (info.tx_pause) - printf("Port %i: Tx Paused\n", params->port); - else - printf("Port %i: Tx & Rx not paused\n", params->port); + printf("Pause parameters for Port %i:\n", params->port); + printf("Rx pause: %s\n", info.rx_pause ? "on" : "off"); + printf("Tx pause: %s\n", info.tx_pause ? "on" : "off"); + printf("Autoneg: %s\n", info.autoneg ? "on" : "off"); } else if (stat == -ENOTSUP) printf("Port %i: Operation not supported\n", params->port); else printf("Port %i: Error %i\n", params->port, stat); } - static void pcmd_open_callback(__rte_unused void *ptr_params, __rte_unused struct cmdline *ctx, @@ -737,11 +748,13 @@ cmdline_parse_inst_t pcmd_pause = { .f = pcmd_pause_callback, .data = NULL, .help_str = - "pause \n Pause/unpause port", + "pause autoneg \n Pause/unpause port", .tokens = { (void *)&pcmd_pause_token_cmd, (void *)&pcmd_pause_token_port, - (void *)&pcmd_pause_token_opt, + (void *)&pcmd_pause_token_mode, + (void *)&pcmd_pause_token_autoneg, + (void *)&pcmd_pause_token_an_status, NULL }, }; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-12-11 17:56:26.586290100 +0800 +++ 0108-examples-ethtool-fix-pause-configuration.patch 2023-12-11 17:56:23.217652300 +0800 @@ -1 +1 @@ -From 29cb7cf999bd5b3cb44ec6937529b2b197e7e25f Mon Sep 17 00:00:00 2001 +From 0a742f1ec02406e36b4ef90f504450d9b59792a9 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 29cb7cf999bd5b3cb44ec6937529b2b197e7e25f ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org