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 70E27A0C4C; Tue, 21 Sep 2021 13:28:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 328B640683; Tue, 21 Sep 2021 13:28:21 +0200 (CEST) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by mails.dpdk.org (Postfix) with ESMTP id 909EC4003C for ; Tue, 21 Sep 2021 13:28:19 +0200 (CEST) Received: by mail-io1-f50.google.com with SMTP id m11so26459231ioo.6 for ; Tue, 21 Sep 2021 04:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=McoCGd8L0uOztMG4M/RgwlwKNdbtuAnVrxV+FmK1Ul4=; b=VCRn29UeGSC62Kz1U6AmeW39jW6M1UVl52+k/5ZW8Rt0mJisKXv87LP9L9a287ldJY Q5RuivHr2038X7BR1QwHgpsEZygrxLJPXGr9dd2K81+ka617R/6nZ5VJo14Z977ZdR3J PKiW6uGOfTiTeFRCya5fGJWPi1zEZ0yPXJv6+oXE7fWDsDbV1g4vXQli7lMzSdF+odoO RMFMvU6PE2QfzVfvOBT6mbY8GDgjW2l/nC7/1Rxp89JWkiWxR9YEvX7c5oMyu3YC9lWk YHScJTjJNwYY2qFscpj/4gcyAHtQ0F+RdmktJbE5LX8aOJsH6R4fFQCSR+fJWyokjK6e sVOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=McoCGd8L0uOztMG4M/RgwlwKNdbtuAnVrxV+FmK1Ul4=; b=5DuzJjboEE7bcZEMA2tdIniUrgIWbn70ItNVRxDY8tIBhb5mSt3Br+BrsTUPav86F1 LKmsDABYfHC7d9kDF+W/6R43lkPoRvjlDxt4A+65AA+OmFPxLFG4qoZ4DpQkKotw5ldD zmT0806x/MY/5ByF6AFjbFYHTUDbJKiWtTXyo4ln7JBy0av/mt7+M+3lQod4AB5IThaZ GdXDS6zPsvuHU3qCwiGu955/D7+Yl++sUl633fTm1Sb5Wse0YypTacZwh08r5IePwLYh y224mm3pbDOENHwsEnOXGO4/KZ+8tS9IhQATPHesxL/vNrzyWUxHrKpEqnS8Xv8jNOBo ut1w== X-Gm-Message-State: AOAM532xQJIN1n6foF0d3eGC/rgx11brJi7Jllf07RvYQvXoYhwdWtU+ epAXH5q6RNjj7YuyAK9Q5NjSvJM71ZFOWhhCvI8= X-Google-Smtp-Source: ABdhPJwRQDvV70ZGnQV9/ODM/ynRbcvOdqHppMS3f8YyYvd8lHGeJtYn57D5e6SMdsVF2X8sWH/q4dFjhkygDADUuXw= X-Received: by 2002:a6b:6b08:: with SMTP id g8mr4840692ioc.199.1632223698869; Tue, 21 Sep 2021 04:28:18 -0700 (PDT) MIME-Version: 1.0 References: <2eaeef2ece0ff3a5a3fc9323f15a47be617a73a4.1632219073.git.gmuthukrishn@marvell.com> In-Reply-To: <2eaeef2ece0ff3a5a3fc9323f15a47be617a73a4.1632219073.git.gmuthukrishn@marvell.com> From: Jerin Jacob Date: Tue, 21 Sep 2021 16:57:52 +0530 Message-ID: To: Gowrishankar Muthukrishnan Cc: dpdk-dev , "Richardson, Bruce" , Ciara Power , Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Ashwin Sekhar Thalakalath Kottilveetil , Pavan Nikhilesh , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Olivier Matz Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [v8, 4/4] net/cnxk: add telemetry endpoing to ethdev 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 Sender: "dev" On Tue, Sep 21, 2021 at 4:23 PM Gowrishankar Muthukrishnan wrote: > > Add telemetry endpoint to ethdev. > > Signed-off-by: Gowrishankar Muthukrishnan > --- > drivers/net/cnxk/cnxk_ethdev_telemetry.c | 129 +++++++++++++++++++++++ > drivers/net/cnxk/meson.build | 1 + > 2 files changed, 130 insertions(+) > create mode 100644 drivers/net/cnxk/cnxk_ethdev_telemetry.c > > diff --git a/drivers/net/cnxk/cnxk_ethdev_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_telemetry.c > new file mode 100644 > index 0000000000..de8c468670 > --- /dev/null > +++ b/drivers/net/cnxk/cnxk_ethdev_telemetry.c > @@ -0,0 +1,129 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2021 Marvell International Ltd. > + */ > + > +#include > + > +#include "cnxk_ethdev.h" > + > +/* Macro to count no of words in eth_info_s size */ > +#define ETH_INFO_SZ \ > + (RTE_ALIGN_CEIL(sizeof(struct eth_info_s), sizeof(uint64_t)) / \ > + sizeof(uint64_t)) > +#define MACADDR_LEN 18 > + > +static int > +ethdev_tel_handle_info(const char *cmd __rte_unused, > + const char *params __rte_unused, struct rte_tel_data *d) > +{ > + struct rte_eth_dev *eth_dev; > + struct rte_tel_data *i_data; > + struct cnxk_eth_dev *dev; > + union eth_info_u { > + struct eth_info_s { > + /** PF/VF information */ > + uint16_t pf_func; > + /** No of rx queues */ > + uint16_t rx_queues; > + /** No of tx queues */ > + uint16_t tx_queues; > + /** Port ID */ > + uint16_t port_id; > + /** MAC entries */ > + char mac_addr[MACADDR_LEN]; > + uint8_t max_mac_entries; > + bool dmac_filter_ena; > + uint8_t dmac_filter_count; > + uint16_t flags; > + uint8_t ptype_disable; > + bool scalar_ena; > + bool ptp_ena; > + /* Offload capabilities */ > + uint64_t rx_offload_capa; > + uint64_t tx_offload_capa; > + uint32_t speed_capa; > + /* Configured offloads */ > + uint64_t rx_offloads; > + uint64_t tx_offloads; > + /* Platform specific offload flags */ > + uint16_t rx_offload_flags; > + uint16_t tx_offload_flags; > + /* ETHDEV RSS HF bitmask */ > + uint64_t ethdev_rss_hf; + Ethdev, , mempool and telemetry maintainers All of the above data except[1] is generic data that can be derived from ethdev APIs or ethdev data from lib/ethdev itself, IMO, We should avoid duplicating this in driver and make useful for other driver/application by adding generic endpoint in ethdev. Same comment for "[2/4] mempool/cnxk: add telemetry end points" for mempool subsystem. Thoughts from Maintainers? [1] uint8_t ptype_disable; bool scalar_ena; bool ptp_ena; uint16_t flags;