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 465E6A0524; Wed, 2 Jun 2021 14:59:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1ED44069F; Wed, 2 Jun 2021 14:59:37 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 8A0D340689 for ; Wed, 2 Jun 2021 14:59:35 +0200 (CEST) IronPort-SDR: uhGme9kG0cJBA/JCjv60HzWiC8pzsPuKvgtx+BUwCOdAPP6E8VWj5o+EbkCpnSfb76p6q3NIid Br5p2SUosb1Q== X-IronPort-AV: E=McAfee;i="6200,9189,10002"; a="203592023" X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="203592023" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 05:59:34 -0700 IronPort-SDR: vldbLQlPSxIu8D6etkW/e/EkO9uLcyq5NEpPZWvBWhAkFk3wHcQPWyjSMHDZ1UDz9EXJTdZpeM 5UjerDCZWBew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="479699458" Received: from irsmsx606.ger.corp.intel.com ([163.33.146.139]) by orsmga001.jf.intel.com with ESMTP; 02 Jun 2021 05:59:33 -0700 Received: from irsmsx604.ger.corp.intel.com (163.33.146.137) by IRSMSX606.ger.corp.intel.com (163.33.146.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 2 Jun 2021 13:59:33 +0100 Received: from irsmsx604.ger.corp.intel.com ([163.33.146.137]) by IRSMSX604.ger.corp.intel.com ([163.33.146.137]) with mapi id 15.01.2242.008; Wed, 2 Jun 2021 13:59:33 +0100 From: "Loftus, Ciara" To: "Burakov, Anatoly" , "dev@dpdk.org" , "Zhang, Qi Z" CC: "Hunt, David" Thread-Topic: [PATCH v1 2/7] net/af_xdp: add power monitor support Thread-Index: AQHXVt2/TINC0dYnD0WLVbQBqyIDU6sAsCow Date: Wed, 2 Jun 2021 12:59:33 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.184.70.1] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1 2/7] net/af_xdp: add power monitor support 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" > Subject: [PATCH v1 2/7] net/af_xdp: add power monitor support >=20 > Implement support for .get_monitor_addr in AF_XDP driver. >=20 > Signed-off-by: Anatoly Burakov Thanks Anatoly. LGTM. Acked-by: Ciara Loftus > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) >=20 > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c > b/drivers/net/af_xdp/rte_eth_af_xdp.c > index eb5660a3dc..dfbf74ea53 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include >=20 > #include "compat.h" >=20 > @@ -788,6 +789,29 @@ eth_dev_configure(struct rte_eth_dev *dev) > return 0; > } >=20 > +static int > +eth_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond > *pmc) > +{ > + struct pkt_rx_queue *rxq =3D rx_queue; > + unsigned int *prod =3D rxq->rx.producer; > + const uint32_t cur_val =3D rxq->rx.cached_prod; /* use cached value */ > + > + /* watch for changes in producer ring */ > + pmc->addr =3D (void*)prod; > + > + /* store current value */ > + pmc->val =3D cur_val; > + pmc->mask =3D (uint32_t)~0; /* mask entire uint32_t value */ > + > + /* AF_XDP producer ring index is 32-bit */ > + pmc->size =3D sizeof(uint32_t); > + > + /* this requires an inverted check */ > + pmc->invert =3D 1; > + > + return 0; > +} > + > static int > eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > { > @@ -1448,6 +1472,7 @@ static const struct eth_dev_ops ops =3D { > .link_update =3D eth_link_update, > .stats_get =3D eth_stats_get, > .stats_reset =3D eth_stats_reset, > + .get_monitor_addr =3D eth_get_monitor_addr > }; >=20 > /** parse busy_budget argument */ > -- > 2.25.1