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 48ADBA0507; Fri, 1 Apr 2022 12:50:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39D6D42911; Fri, 1 Apr 2022 12:50:30 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id F01F64067E for ; Fri, 1 Apr 2022 12:50:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648810228; x=1680346228; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=H6SnR4tdis3bV7xmyK8j4VX6F79bzGJBQLGbUURlpNE=; b=MOTD8sKCP4299k1jU77l2svX73J3fCDSyxvTius+JYz9dMpUo8K7GSXo 2NYC5e+lAaMH84uFq6EgCNItNGwkOoa8HI8gUC42wbyRZEJzaFAGHBbGV zAmnUtiq6EP4c7A6jzRQ2CZ0WfBrsfmmUF4lVRyob63lbq2zx0gWMTzuR lcwH1S65TQBRO5k/76c81KwvScbXWMPTaJT9QoCxizBjUxZbcMp8xoinh m6FQTKiV7a1hk10TcVj+B20md11BaUGnp7uO0GSQ++FppHE1ToUZL6mc7 699L6iF+1vaN0rtsksmZsoijvAdeTGherh3jDnndzyA+rliz+iCo42woj w==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="320792074" X-IronPort-AV: E=Sophos;i="5.90,227,1643702400"; d="scan'208";a="320792074" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 03:50:27 -0700 X-IronPort-AV: E=Sophos;i="5.90,227,1643702400"; d="scan'208";a="522730871" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.20.202]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 01 Apr 2022 03:50:25 -0700 Date: Fri, 1 Apr 2022 11:50:22 +0100 From: Bruce Richardson To: Sean Morrissey Cc: Chengwen Feng , Kevin Laatz , dev@dpdk.org, Sunil Pai G Subject: Re: [PATCH v3] dmadev: add telemetry support Message-ID: References: <20220331183946.2203233-1-sean.morrissey@intel.com> <20220401102402.2249057-1-sean.morrissey@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220401102402.2249057-1-sean.morrissey@intel.com> 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 Fri, Apr 01, 2022 at 10:24:02AM +0000, Sean Morrissey wrote: > Telemetry commands are now registered through the dmadev library > for the gathering of DSA stats. The corresponding callback > functions for listing dmadevs and providing info and stats for a > specific dmadev are implemented in the dmadev library. > > An example usage can be seen below: > > Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2 > {"version": "DPDK 22.03.0-rc2", "pid": 2956551, "max_output_len": 16384} > Connected to application: "dpdk-dma" > --> / > {"/": ["/", "/dmadev/info", "/dmadev/list", "/dmadev/stats", ...]} > --> /dmadev/list > {"/dmadev/list": [0, 1]} > --> /dmadev/info,0 > {"/dmadev/info": {"name": "0000:00:01.0", "nb_vchans": 1, "numa_node": 0, > "max_vchans": 1, "max_desc": 4096, "min_desc": 32, "max_sges": 0, > "capabilities": {"fill": 1, "sva": 0, "silent": 0, ...}}} > --> /dmadev/stats,0,0 > {"/dmadev/stats": {"submitted": 0, "completed": 0, "errors": 0}} > > Signed-off-by: Sean Morrissey > Tested-by: Sunil Pai G Reviewed-by: Bruce Richardson One comment inline below, which I'd like feedback from others on. > --- > V3: > * update docs with correct examples > * code cleanup and added comments > + > +#define ADD_CAPA(c, s) rte_tel_data_add_dict_int(dma_caps, #c, !!(dev_capa & RTE_DMA_CAPA_ ## s)) > + > +static int > +dmadev_handle_dev_info(const char *cmd __rte_unused, > + const char *params, struct rte_tel_data *d) > +{ > + struct rte_dma_info dma_info; > + struct rte_tel_data *dma_caps; > + dma_caps = rte_tel_data_alloc(); > + if (!dma_caps) > + return -ENOMEM; > + > + rte_tel_data_start_dict(dma_caps); > + ADD_CAPA(fill, OPS_FILL); > + ADD_CAPA(sva, SVA); > + ADD_CAPA(silent, SILENT); > + ADD_CAPA(copy, OPS_COPY); > + ADD_CAPA(mem2mem, MEM_TO_MEM); I'm not 100% sure about this approach of having slightly different names compared to the flags, just to have things in lower-case. Looking to have some more input here - I'd tend to have the capabilities in upper case to avoid duplicating parameters, but I'm not massively concerned either way. > + ADD_CAPA(mem2dev, MEM_TO_DEV); > + ADD_CAPA(dev2mem, DEV_TO_MEM); > + ADD_CAPA(dev2dev, DEV_TO_DEV); > + ADD_CAPA(copy_sg, OPS_COPY_SG); > + ADD_CAPA(handles_errors, HANDLES_ERRORS); > + rte_tel_data_add_dict_container(d, "capabilities", dma_caps, 0); > + > + return 0; > +}