From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BAABFA0471 for ; Tue, 13 Aug 2019 05:24:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 522D31B952; Tue, 13 Aug 2019 05:24:45 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 34A8F1B13C for ; Tue, 13 Aug 2019 05:24:44 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id n9so44277868pgc.1 for ; Mon, 12 Aug 2019 20:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=41hWDWd9LnPfVBSuTRr+bzDVDybEwuUGVBE+65GSNNU=; b=d+kHvyn3UgUqcap76WJhhD7UI1SMUn01qjaddDLk/moGPE87b0gSBRyyqR+7sfQsav XUJZzJs9OV2Lnea0H8YMpQ0xQc1Y/193dnTnfNEtGSM2E5B5c7fFb5MSIM31k3t05hXP IUJMatNhT+zwkTdWl6lTFJC9mq79ybE3/hTlGJdJipoQ07Wdo4SlRZSOeRDcJ2hKwjy2 m73EXhoN8kRyOyBJAALXR3QU3jyM1F3T5QOrFIG442A+MohrOIBWN6yBXoOfc1mu4O5m sBOWCDBaGLEsG0sYnG1b060xM9vAIzzh9IqyiSkXH4+y4k/lzC8G73AyypYhNemgd7/+ KFxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=41hWDWd9LnPfVBSuTRr+bzDVDybEwuUGVBE+65GSNNU=; b=U9sj+bJJqu7TlDI1pmRe5SP3gm3kywnAlh32eL+E5UKlGiSXGjivpV9zqvnQbGO1N6 7KZPRzxjNqki7cXgkZGzMP4Z+BVyKQoFSTY9kMd0uvZ1Uk2ckbj+q0Os3M4KJHiIXuap 61Rbc+VrZbZuXRokV9ZQqoZUxCkwT89QDS0nnvNl9cOkkVw/kNoUTNb4W+whZP509R5k vBQdkB/tQ/xHYTNT0IGoGfkw4RVt4pzl0hOI06p5U2+pb6zcUISnzudmjytdcwyxaRBo O7CzrUJS4vlEwiKIaYbUxAnhYlAG85cnq0Ju34yAUYq8CyBUMHedXz4SY0dfttxYLyoR 8YEA== X-Gm-Message-State: APjAAAX07XSizzdlIcaVhqeOro/DqmVc6CFF2kQRromQBWffGkcW1v8k UrCCNDF9apSf5SKETJB/qhaUKA== X-Google-Smtp-Source: APXvYqzUCS9BFN4EQeQJRJ/gT6rA2RyBn0KlIeUx2DajUT2SCYBcaafx1EYiXuFVs/TybGkROhkywg== X-Received: by 2002:aa7:8a04:: with SMTP id m4mr544721pfa.65.1565666683168; Mon, 12 Aug 2019 20:24:43 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id g10sm9771013pfb.95.2019.08.12.20.24.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 20:24:43 -0700 (PDT) Date: Mon, 12 Aug 2019 20:24:36 -0700 From: Stephen Hemminger To: Haiyue Wang Cc: dev@dpdk.org Message-ID: <20190812202436.662e6ca8@hermes.lan> In-Reply-To: <1565665572-65495-2-git-send-email-haiyue.wang@intel.com> References: <1565665572-65495-1-git-send-email-haiyue.wang@intel.com> <1565665572-65495-2-git-send-email-haiyue.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang wrote: > Enhance the PMD to support retrieving trace information like > Rx/Tx burst selection etc. > > Signed-off-by: Haiyue Wang > --- > lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ > lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ > lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ > 3 files changed, 31 insertions(+) > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > index 17d183e..6098fad 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, > } > > int > +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id, > + enum rte_eth_trace type, char *buf, int sz) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + if (buf == NULL) > + return -EINVAL; > + > + dev = &rte_eth_devices[port_id]; > + > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP); > + > + return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz); What if queueid is out of bounds? The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation. Why not just keep it in the log like it is now? > int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, > struct rte_eth_txq_info *qinfo); > > +int > +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id, > + enum rte_eth_trace type, char *buf, int sz); > + You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental. Also the API would have to be in the map file as well. Docbook comments are also missing.