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 A59E8A0C41; Fri, 29 Oct 2021 18:04:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D0F6411C9; Fri, 29 Oct 2021 18:04:16 +0200 (CEST) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by mails.dpdk.org (Postfix) with ESMTP id 445424111F for ; Fri, 29 Oct 2021 18:04:15 +0200 (CEST) Received: by mail-io1-f42.google.com with SMTP id h81so4321723iof.6 for ; Fri, 29 Oct 2021 09:04:15 -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=1dTF/9zBbJT3frF7lHqXAfEKXuUadYCH3aMx8J/S5i4=; b=Sr6Qk/VYJNsSoPnKYHziXNEIVrqWpt69DDllemNkN5IhftmRX5tzgsfjfZpOartWbT 8H3AxUlQCm/jLSslPCiVqdvjYAW4Lx75HFF6AX5wMDYRakfY3CtK2FVmVW/bGsC4/qK6 v+if0d/E0P8+nNM2FAlyOpAcEQZJRgYLvI4E29KOoDqzyWoQqwPsJbWPzAM4CsF7a0Fz L9DbUUhfBxKc75h5HGlRb8EBRvZ/MhlmF/tRyOo45rlQIvNWWxfRQjA7NX1OI/9o7in4 bPcrtm5cD2xccKLsEFi1zgUlI9CX+MTLcgWr0gu1gsd9bIaCkozm8IOWjeX+lysQiX3z Pp9Q== 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=1dTF/9zBbJT3frF7lHqXAfEKXuUadYCH3aMx8J/S5i4=; b=51Kl62xVdEgQREDuxoTh/pCn+Sy1R2unUssmjf7WlQBuYONOiWC+xYxL/xPPH7UZdY /E6Qv7g9QVsSpTvJUQp6nX7tr4LmNiNdeXPd/tjZBmMeNsqqCDNE4aRJ5fxegXHYJ4Zx U81PmYEk7g7rSDUSMj1UqUZ+D/Evoag/0rOsDN8I23ENOIjUo4uCWJS78oyEEDMoKsUt Fd5JHfzapXx/KOY8jiWQBgs7BWlm8aEZoJkGi/M02f/MTkpBAmCyCunLWS3tQcuExKjQ EcZ2jFIq2c44R3G6sl74MFdPpDV6aS1fQbNf5yp69TRKaUihsKBvw11q0iK/R6qN0bIF 5Xnw== X-Gm-Message-State: AOAM530PKtQ2l48k9NdtEm8meOTm3zbBt892/fx1mGxD+77beGvomQ5g /77YWRLBVS9vWKSRbFAts7q4g/JlLIa1C1hMqdY= X-Google-Smtp-Source: ABdhPJxh89atcEXx9vv4Zb64icjQBm9Te8w7ZOFp9NrEz04QHvPJBiQOBBSRwu08ZueVUI083/xLaWRB4AillFX9AW8= X-Received: by 2002:a05:6602:3311:: with SMTP id b17mr1916677ioz.38.1635523454530; Fri, 29 Oct 2021 09:04:14 -0700 (PDT) MIME-Version: 1.0 References: <20211005074620.2224968-1-tduszynski@marvell.com> <20211022115625.1956708-1-tduszynski@marvell.com> In-Reply-To: <20211022115625.1956708-1-tduszynski@marvell.com> From: Jerin Jacob Date: Fri, 29 Oct 2021 21:33:48 +0530 Message-ID: To: Tomasz Duszynski , Ferruh Yigit Cc: dpdk-dev , Jerin Jacob , Harman Kalra , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Jakub Palider Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] common/cnxk: support BPHY telemetry 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 Fri, Oct 22, 2021 at 5:27 PM Tomasz Duszynski wrote: > > Add initial support for baseband telemetry. > > Signed-off-by: Tomasz Duszynski > --- Updated as raw/cnxk_bphy: support telemetry Added /cnxk/bphy/info telemetry endpoint. Signed-off-by: Tomasz Duszynski Acked-by: Jerin Jacob Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/for-next-net. Thanks > v2: > - make bphy telemetry available only on platforms supporting baseband > - use platform types where possible > - remove unused header > > drivers/common/cnxk/cnxk_telemetry_bphy.c | 52 +++++++++++++++++++++++ > drivers/common/cnxk/meson.build | 3 +- > drivers/common/cnxk/roc_model.h | 5 +++ > drivers/raw/cnxk_bphy/cnxk_bphy.c | 11 +++++ > drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 1 + > 5 files changed, 71 insertions(+), 1 deletion(-) > create mode 100644 drivers/common/cnxk/cnxk_telemetry_bphy.c > > diff --git a/drivers/common/cnxk/cnxk_telemetry_bphy.c b/drivers/common/cnxk/cnxk_telemetry_bphy.c > new file mode 100644 > index 0000000000..95f84888b7 > --- /dev/null > +++ b/drivers/common/cnxk/cnxk_telemetry_bphy.c > @@ -0,0 +1,52 @@ > + > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2021 Marvell. > + */ > + > +#include "cnxk_telemetry.h" > +#include "roc_api.h" > +#include "roc_priv.h" > + > +static int > +cnxk_tel_bphy(struct plt_tel_data *d) > +{ > + struct idev_cfg *idev; > + > + idev = idev_get_cfg(); > + if (!idev || !idev->bphy) > + return -ENODEV; > + > + plt_tel_data_add_dict_int(d, "sso_pf_func", roc_bphy_sso_pf_func_get()); > + plt_tel_data_add_dict_int(d, "npa_pf_func", roc_bphy_npa_pf_func_get()); > + > + return 0; > +} > + > +static int > +cnxk_bphy_tel_handle_info(const char *cmd __plt_unused, > + const char *params __plt_unused, > + struct plt_tel_data *d) > +{ > + plt_tel_data_start_dict(d); > + > + return cnxk_tel_bphy(d); > +} > + > +static int > +cnxk_bphy_telemetry_register(void) > +{ > + if (!(roc_model->flag & ROC_MODEL_CNF9K) && > + !(roc_model->flag & ROC_MODEL_CNF10K)) > + return 0; > + > + plt_telemetry_register_cmd( > + "/cnxk/bphy/info", cnxk_bphy_tel_handle_info, > + "Returns bphy information. Takes no parameters"); > + > + return 0; > +} > + > +PLT_INIT(cnxk_telemetry_bphy_init) > +{ > + roc_plt_init_cb_register(cnxk_bphy_telemetry_register); > +} > diff --git a/drivers/common/cnxk/meson.build b/drivers/common/cnxk/meson.build > index d9871a6b45..aca99b84e7 100644 > --- a/drivers/common/cnxk/meson.build > +++ b/drivers/common/cnxk/meson.build > @@ -74,7 +74,8 @@ includes += include_directories('../../../lib/ethdev') > includes += include_directories('../../../lib/meter') > > # Telemetry common code > -sources += files('cnxk_telemetry_npa.c', > +sources += files('cnxk_telemetry_bphy.c', > + 'cnxk_telemetry_npa.c', > 'cnxk_telemetry_nix.c') > > deps += ['bus_pci', 'net', 'telemetry'] > diff --git a/drivers/common/cnxk/roc_model.h b/drivers/common/cnxk/roc_model.h > index 3779a88bca..cee06779bc 100644 > --- a/drivers/common/cnxk/roc_model.h > +++ b/drivers/common/cnxk/roc_model.h > @@ -40,12 +40,17 @@ struct roc_model { > ROC_MODEL_CNF95xx_B0 | ROC_MODEL_CNF95xxMM_A0 | \ > ROC_MODEL_CNF95xxO_A0 | ROC_MODEL_CNF95xxN_A0 | ROC_MODEL_CN98xx_A0 | \ > ROC_MODEL_CNF95xxN_A1) > +#define ROC_MODEL_CNF9K \ > + (ROC_MODEL_CNF95xx_A0 | ROC_MODEL_CNF95xx_B0 | \ > + ROC_MODEL_CNF95xxMM_A0 | ROC_MODEL_CNF95xxO_A0 | \ > + ROC_MODEL_CNF95xxN_A0 | ROC_MODEL_CNF95xxN_A1) > > #define ROC_MODEL_CN106xx (ROC_MODEL_CN106xx_A0) > #define ROC_MODEL_CNF105xx (ROC_MODEL_CNF105xx_A0) > #define ROC_MODEL_CNF105xxN (ROC_MODEL_CNF105xxN_A0) > #define ROC_MODEL_CN10K \ > (ROC_MODEL_CN106xx | ROC_MODEL_CNF105xx | ROC_MODEL_CNF105xxN) > +#define ROC_MODEL_CNF10K (ROC_MODEL_CNF105xx | ROC_MODEL_CNF105xxN) > > /* Runtime variants */ > static inline uint64_t > diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c > index 6bfda71761..558ebfa85e 100644 > --- a/drivers/raw/cnxk_bphy/cnxk_bphy.c > +++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c > @@ -341,6 +341,13 @@ bphy_rawdev_probe(struct rte_pci_driver *pci_drv, > bphy_dev = (struct bphy_device *)bphy_rawdev->dev_private; > bphy_dev->mem.res0 = pci_dev->mem_resource[0]; > bphy_dev->mem.res2 = pci_dev->mem_resource[2]; > + bphy_dev->bphy.pci_dev = pci_dev; > + > + ret = roc_bphy_dev_init(&bphy_dev->bphy); > + if (ret) { > + rte_rawdev_pmd_release(bphy_rawdev); > + return ret; > + } > > return 0; > } > @@ -349,6 +356,7 @@ static int > bphy_rawdev_remove(struct rte_pci_device *pci_dev) > { > char name[RTE_RAWDEV_NAME_MAX_LEN]; > + struct bphy_device *bphy_dev; > struct rte_rawdev *rawdev; > > if (rte_eal_process_type() != RTE_PROC_PRIMARY) > @@ -366,6 +374,9 @@ bphy_rawdev_remove(struct rte_pci_device *pci_dev) > return -EINVAL; > } > > + bphy_dev = (struct bphy_device *)rawdev->dev_private; > + roc_bphy_dev_fini(&bphy_dev->bphy); > + > return rte_rawdev_pmd_release(rawdev); > } > > diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h > index f141677e2a..63d7285055 100644 > --- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h > +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h > @@ -24,6 +24,7 @@ struct bphy_irq_queue { > > struct bphy_device { > #define BPHY_QUEUE_CNT 1 > + struct roc_bphy bphy; > struct roc_bphy_irq_chip *irq_chip; > struct bphy_mem mem; > /* bphy irq interface supports single queue only */ > -- > 2.25.1 >