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 A7A7A41CB1; Thu, 16 Feb 2023 13:06:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8467C42BC9; Thu, 16 Feb 2023 13:06:47 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2079.outbound.protection.outlook.com [40.107.244.79]) by mails.dpdk.org (Postfix) with ESMTP id 734B440EE3 for ; Thu, 16 Feb 2023 13:06:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A4LRQ4ncd5/DwnZtz1e+mSABV8ilW232vSzzuHxPS56Ttw21QLK5YnJmuzMSJX6XQ1qbKIN7Vdma0JQ2zpNp27bAgjIfBE0PaynpWlonMmooP7UoZRkm8g9cWhXDEoMqRsOEl55YyzoyA4QlXy2CW1qYUerbgi3esB1jD3EGpE01OnfGPfcCXZm26SjJ5nntBTkmE9rMyyiOJzA2LpYJsQQ/v4UdM0pKBLyR3/BBQAFsHVrHAJlEGZqVnw/aoncg9ACqvQ0pesK6gzFW0XT5wWjV5F+3RCfGwFXmuxPVGVsmLrwcVvlr9xYJarjU730XBlAD6w7dmHP7SnYz4KvsdQ== 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=U8hmZUYaNWu2sZPmx4LptnbdxB1dTFt2dY3xCl8grCQ=; b=eAwdA2kK2sSMAvYwRqm3BhYIYy4qOiVSfu6MYQuLndHUC7ehfkLTsiTZlDIlDpkTsroHRmMxpG38oSiTn+b1tW86mNKaevqyXbFSjMF13zLtmTX0suK9uzjU20ViQSJLpFqChlVuFsby+Dxzc3d5RyFdj9pWEq+fsplppIBUof51Q4j3NUjFPW30xoZl5Bj3JXYRcHm4E35Pl2FBYPkBVFnBSesy66vhN54UWI7D5Re6/mkwtC3rY68eFDLJkXX3fHm5DQ0pkb7qJjYD7ErF4ORyiD30zVuGUB6ETEl1fG7r72n9HDIw5YAt3r4W3gSfhgnrXMASTasivyF9a1yAjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U8hmZUYaNWu2sZPmx4LptnbdxB1dTFt2dY3xCl8grCQ=; b=k9FfVPjGnxDTjFtVTGjxvV7qGAfizPmjucHzpOCwt1KBrp9WYEuJvcaHxj6EbJ7/N3Wirj0HUBb2XGIORSn8VjyOOzAxt/te5rBPFnDpuPvPvcjC9cSDXtINr6Uo5s+wzM9BKi2oqW51l/52phC2D23QXVmZFSEUgkqloZVOqhk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by BN9PR12MB5355.namprd12.prod.outlook.com (2603:10b6:408:104::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13; Thu, 16 Feb 2023 12:06:43 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%7]) with mapi id 15.20.6111.013; Thu, 16 Feb 2023 12:06:43 +0000 Message-ID: <6921c549-c980-8911-cebf-2c7ab7872f02@amd.com> Date: Thu, 16 Feb 2023 12:06:36 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Content-Language: en-US To: fengchengwen , Dongdong Liu , thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, ciara.power@intel.com, kevin.laatz@intel.com, bruce.richardson@intel.com References: <20221219090723.29356-1-fengchengwen@huawei.com> <20230209023203.35269-1-fengchengwen@huawei.com> <20230209023203.35269-3-fengchengwen@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH v5 2/2] ethdev: support xstats reset telemetry command In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0206.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:318::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BN9PR12MB5355:EE_ X-MS-Office365-Filtering-Correlation-Id: 83cda724-a3ea-4931-eda2-08db101644a7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R9oZWOKEYr0lNlIMX6VRDYhG3lkpJmUakP2P6jMthruQME+pL74l5zgUbaS8h78LSWQxedhE0Bl79F2ZyIplA92esgeaUpbWA5OjoQEImJDMLTUy/Lov3xS/m1wOXRYwEMCWWXIJ/TbsAGamHjSU2PCp5vv7WttIvX41mTEjJ5kKSwp1QejA8PMkQLE2S2q/tUOATO1kbaV39XM5N6E2NJfPTV66wGkpysbiyLy9dihs07Bm+Vx/9n9qLpyaUrEKi4RMd4F2/UCvZraG6PKjwRGfmVeYChS5PIwWWcubzjjAjJP0BhClwIDRAQaTx8LUw1HUVehHqj5xjGk0RJJeCrZ/Qyp1ttR/HUvXfILwi+VPz30q9LYjuRFDcrUF7BzVQCiejKzY/xlentJIRNGzj4gqUsgc8glmnJCfmGRwdl7Jnd+q5OyNX7AdzKs9e1nCDUbgHxE8UXRR9e1tBSpyyly88Uq/Rx36kOk/FVGGqm7Y7wUA+QQUCa3BrkGMv2oX/VRtt5LXNLTcSuJZLA3Wm6Wc+WNKZjOWnipjCP63LGckFHVPSrRRfVN000armngl7rVAo/2NLaTiENpottzFxbb321Ye5F9R6i0jb7/2ONbQOxHCDu+U3EXdybRw8diEdiZT82Ywo0zZMKea1QENiiyJx6d/PbWX0yxo3vYUm8h5Hkc0YDJk2cUXIQ7PCyGE1hiD4O7RvHICADxD1xsXdyl5hU3c4mcegSDu3k+V2zI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(346002)(376002)(39860400002)(366004)(396003)(451199018)(5660300002)(44832011)(36756003)(316002)(86362001)(6486002)(478600001)(6666004)(2616005)(53546011)(6506007)(26005)(186003)(6512007)(4326008)(66476007)(66556008)(8676002)(66946007)(31696002)(8936002)(41300700001)(83380400001)(110136005)(38100700002)(2906002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VGR1d2hTazdpZk1Ybi9QQjg3bVRQaFFyZXN1VjJidlNGQml1RElBRk5Ebmpi?= =?utf-8?B?ZzNra2wxYmpHTmVoTEh2U3RGUy9CVEwrd2FuZkY4QjVlblV3clZpNlF1eGEz?= =?utf-8?B?bHdLMDcrUVl3aldvdm9pdUNBRmNEK1lOVnpHaUliZnc4WGNPSTk0dmxoVnlr?= =?utf-8?B?UFR2aXVxeXcyYnFwLzc5MkpUOWVUbmFzWnVSYldMakFGd0hBK21PT0F1djFr?= =?utf-8?B?YVJ0aDNES09ZaElheDk1TVZVUERq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lkcFpIV2kv?= =?utf-8?B?TTVMZEppNkd3ZVgzUkNFRGV0alRjZmVRekRFNldYN24weFljNituMk9xdzh6?= =?utf-8?Q?8XlDh5A18bzQEep6b5QLhU9Ln?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83cda724-a3ea-4931-eda2-08db101644a7 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2023 12:06:43.2580 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A6jEIgnf3oIwc+O8RULuhWUFD1fFhMUVzE18Rfb76bXlK2XbsmmGb5FsKgzcwStB X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5355 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2/16/2023 11:53 AM, fengchengwen wrote: > On 2023/2/15 11:19, Dongdong Liu wrote: >> Hi Chengwen >> >> On 2023/2/9 10:32, Chengwen Feng wrote: >>> The xstats reset is useful for debugging, so add it to the ethdev >>> telemetry command lists. >>> >>> Signed-off-by: Chengwen Feng >> This patch looks good, so >> Reviewed-by: Dongdong Liu >> >> A minior question >> Do we need to support stats reset ? > > Stats is contained by xstats, and future direction I think is xstats. > So I think we don't need support stats reset. > I have similar question with Dongdong, readonly values are safe for telemetry, but modifying data can be more tricky since we don't have locking in ethdev APIs, this can cause concurrency issues. Overall do we want telemetry go that way and become something that alters ethdev data/config? > Thanks. > >> >> Thanks, >> Dongdong >>> --- >>>  lib/ethdev/rte_ethdev.c | 31 +++++++++++++++++++++++++++++++ >>>  1 file changed, 31 insertions(+) >>> >>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c >>> index d25db35f7f..e85c98f307 100644 >>> --- a/lib/ethdev/rte_ethdev.c >>> +++ b/lib/ethdev/rte_ethdev.c >>> @@ -5915,6 +5915,35 @@ eth_dev_handle_port_xstats(const char *cmd __rte_unused, >>>      return 0; >>>  } >>> >>> +static int >>> +eth_dev_handle_port_xstats_reset(const char *cmd __rte_unused, >>> +        const char *params, >>> +        struct rte_tel_data *d) >>> +{ >>> +    int port_id, ret; >>> +    char *end_param; >>> + >>> +    if (params == NULL || strlen(params) == 0 || !isdigit(*params)) >>> +        return -1; >>> + >>> +    port_id = strtoul(params, &end_param, 0); >>> +    if (*end_param != '\0') >>> +        RTE_ETHDEV_LOG(NOTICE, >>> +            "Extra parameters passed to ethdev telemetry command, ignoring\n"); >>> +    if (!rte_eth_dev_is_valid_port(port_id)) >>> +        return -1; >>> + >>> +    ret = rte_eth_xstats_reset(port_id); >>> +    if (ret == 0) { >>> +        rte_tel_data_string(d, "success"); >>> +        RTE_ETHDEV_LOG(NOTICE, "Port %d reset xstats success\n", port_id); >>> +    } else { >>> +        RTE_ETHDEV_LOG(ERR, "Port %d reset xstats failed! ret: %d\n", port_id, ret); >>> +    } >>> + >>> +    return ret; >>> +} >>> + >>>  #ifndef RTE_EXEC_ENV_WINDOWS >>>  static int >>>  eth_dev_handle_port_dump_priv(const char *cmd __rte_unused, >>> @@ -6329,6 +6358,8 @@ RTE_INIT(ethdev_init_telemetry) >>>              "Returns the common stats for a port. Parameters: int port_id"); >>>      rte_telemetry_register_cmd("/ethdev/xstats", eth_dev_handle_port_xstats, >>>              "Returns the extended stats for a port. Parameters: int port_id"); >>> +    rte_telemetry_register_cmd("/ethdev/xstats_reset", eth_dev_handle_port_xstats_reset, >>> +            "Reset the extended stats for a port. Parameters: int port_id"); >>>  #ifndef RTE_EXEC_ENV_WINDOWS >>>      rte_telemetry_register_cmd("/ethdev/dump_priv", eth_dev_handle_port_dump_priv, >>>              "Returns dump private information for a port. Parameters: int port_id"); >>> >> .