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 98074A0032; Thu, 1 Sep 2022 16:44:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 872C940C35; Thu, 1 Sep 2022 16:44:08 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id D0B0340695 for ; Thu, 1 Sep 2022 16:44:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662043447; x=1693579447; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=gBoKsFuEOgc9tkmwtjZCcyDYc0RzwhBSHaAVJREzxVs=; b=h6niPw9LaPrnwjwCaqifNwq/jBA2IKP8bgIZcczWtibH0ONxLIspFNXs w8Y9egEQWdrChUMNAYooLP48wU0+2Zyr2h67GaIe9Ec9WdTzD9LV6Uifs /HSWNzPB2DIkm7xEqmnugWD4oQ7ncrwWDSLA1GZvOeq32lsVQ7EsKfmOC 9aQnQXbMBYgPyc4kgieC7vfk3MNXovYbyiTJ4A3eBoHQApL27wo5lcOtg NQZU9dyzrN50QZ1wfOz1c1M7SLJiHuC3bT5E4q+tBwLKMeSFP3b9IiEKM dUJZqc7md9gFZz38GT4CUC6EoiQ5jEe+NwHGWULxV1DgiY4NHGTKV9Gg+ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="382027695" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="382027695" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 07:44:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="563486145" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 01 Sep 2022 07:44:05 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 1 Sep 2022 07:44:05 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 1 Sep 2022 07:44:05 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 1 Sep 2022 07:44:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I78lv71pf4iEDSylizrgPGygsyn3hWWDv1AOKomtcanq1yQSNuBDlLmI0Fty/dsLRreR6GO/zJEgb4MsvZT3xmvGgddbcLZK10fjROnt/aydpU5RQXwCwUGrBA2Pc84wmS8TJLupLCHvIQmxT3J2h/WcuTVq+2uJgM3kAe5UW01QKnUIGZIEn4bDgFBueeIwbAjACjoFHtdlqSOizqdoXaAhuDV/zqeYqwJ3RnbJ55vCHjcBC3XQwnJEVs7DVCi7fr8QH3AqUXLrQsw76NvWsgkSjxvi1gdnpcbyntfsVn5vMN5MgjaNkC2KaeJaPjiuHMp9XsMEmc33gGeOterbtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NJFUdoEK5AhKfyrnNkuUKqrx5T2UYGeDzoKobS7xv88=; b=jXlTGBDZd3Fcnf2XDRdzrghXeXsDvzogSG+O8rXGWvfiYeir4R24k+NL+Y6rk6xzwByXuK25JLIg8RkQF7X9F/tlY3xehzHexRsF9lq4KpgHovaOPVlzkCHb+0O3bZ6qYM5d6mfY2erAGGIsxX9BFf1JcUr4L54GFB6VyijANMo/JZB8hjmFGJc457GDEBw7WMP7Qe+veUi83/y+1TkbQiCqZM16313uKF2K6EhBxcsJwyXA4ExTxbnciQxNduacHV9MVWpXFzo4SCoj3e5V+A27AnIG3XkyOpdUyWGOSSeL9k9hAbJq4TUXVDDewZWajrwBjMkD9S3Mr9E3y4OwfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by SA1PR11MB6685.namprd11.prod.outlook.com (2603:10b6:806:258::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.16; Thu, 1 Sep 2022 14:44:01 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2%6]) with mapi id 15.20.5566.021; Thu, 1 Sep 2022 14:44:00 +0000 Date: Thu, 1 Sep 2022 15:43:53 +0100 From: Bruce Richardson To: Herakliusz Lipiec CC: , , Subject: Re: [PATCH] net/ring: add umonitor callback Message-ID: References: <20220803142845.2221915-1-herakliusz.lipiec@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220803142845.2221915-1-herakliusz.lipiec@intel.com> X-ClientProxiedBy: DBBPR09CA0016.eurprd09.prod.outlook.com (2603:10a6:10:c0::28) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65bee384-6547-4c5d-3f85-08da8c28686b X-MS-TrafficTypeDiagnostic: SA1PR11MB6685:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qznnFA0EmGh2TLnUlayirpjDSfNre/0ObJBVYg6JCtfS+myQIw9MiC6cjgczLsZgJmB8QBwlefEelKH/idf2I5dqAfY9oIoU4A+G+3xVkhs2Rj6vd5yV9YIq2AAyteQflT+UK3+P56er95V/RmLXQ2FF+eaUmGWOo+ux75lBcI7tgl05J6vhTe54HjkRWwhTsaOgqOQigtBjX3jxXUCU9XznJX0h9PDSETSPzAaNBUA8sUZPAs2G+hsyC3r4v3LVSpYmg+k30miB1NwSyIvvwLGPmZx4rxzQr8lAfZeGX+mxEE0ywlVAli+Eb1nKGNWEVTldwf7fkJ94uIqSFtAQXlqecFQ2E3NMDkCBzYOUAmUH2UMQNZGQ8BrxvVPH9tHM9ysHj+iNuCAX4pPjUB0iOvkWYFIZnzR2fcmgduJCBjnMoABUb6h8Qv1NHgA2gaPebhQWAuDT/yNNYCqBCRVYsHtyKf2khMW/AoPuRMDtrmlGKLH5ZG/QFhuVG1INGyiJX54YMOUEuVAcWZOQh18BWV+MO0C4oa0UqJbSQiy4HGGw/4pPsvJFbDC8K0m6Nejk93b2Sdm/7XJblpI81FMIjV/St4JVh1XwoPdOi4i2MNTs6RphGlEqbEuvaxpFe4i8RM+yk8VOLagmIsey3A8WB53MefzrtRrRBYQ04/gD0ARFgnIfnUO0JK0XzWMoFONq X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(396003)(39860400002)(346002)(136003)(376002)(8936002)(66946007)(6486002)(44832011)(66556008)(478600001)(66476007)(8676002)(316002)(6636002)(38100700002)(82960400001)(86362001)(107886003)(83380400001)(6506007)(6862004)(186003)(6512007)(5660300002)(2906002)(6666004)(41300700001)(26005)(4326008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jUoWw9yviM/zH1b9uFKqAHQ60pdaEgr088IxlTZdY8GWtwvzw70G6JqiaoIH?= =?us-ascii?Q?JunmZripZcBK4Z7WyS9qz1vBomWaTt1+nFf3mpWsQcNt8oKyTYrHLysXdN/7?= =?us-ascii?Q?7a6dDe0v4wPSHmMg5+QAGP6Gtu0riBsuTQpRGdFuV6mD1db8P+HTVbCyqzj9?= =?us-ascii?Q?2wBsQ6htlzxXhZnRYCRzIFlpBUQHwdf0Kx1V8ms6VLrp7k5WGr32XqWy04vB?= =?us-ascii?Q?4BwRfGu/aMtebHc1gjDnYoRzFUFekSO/7Mex6hjJs+XFSJ0FOoe8B3aHPQ4J?= =?us-ascii?Q?R1FWuVe4gFGh7jj4GZCF85bn9BIiD/UWNPUS3J+FZZYrcEnInwlpBKOxn0Vg?= =?us-ascii?Q?zMKp7ncKscbp6/M7JX9MtoBnzVG59Ov/DU0ysejtRsdKUcxprs3vNoO02QuX?= =?us-ascii?Q?49Pfn01g3zr329saS79dVt7bdZ8YkOyRzx+xeiOxDkk5yOql9dsO2jp9l08S?= =?us-ascii?Q?wBKPqP14Gz+UThbRWjRHwBJDJZEQJ8wmUA3+l0jrwZ+0nJ64eaHOhSJDbFr3?= =?us-ascii?Q?QIY09cWSo9rBp4KF3uY6Ox+G5otdzdtWzfnIYz3gWYeIdbLf42xqnWu6B6Oe?= =?us-ascii?Q?wQAuBynWtyt0bjkzTdRP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us-ascii?Q?00V3LMlT10PuDQPjqRfjAnTck1cybezkz1Vyh7KpoNAYffHE4A5DShFcWcS7?= =?us-ascii?Q?YwGbO6LbTTv/nFErWpai/qPD2TR598IgE06RZ4/tKI7SXynIIPW8ruszn4al?= =?us-ascii?Q?tQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 65bee384-6547-4c5d-3f85-08da8c28686b X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 14:44:00.7285 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y0cH9PnJGi0xwTdWi+rwBB0jRXuAg2KpLF5JV89gl9SxBWqQ5hFh4ih5cGPloyr2UmoidJh914t9YnDhI3jcNvFvFOmGK7b85Qgk5SNad/o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6685 X-OriginatorOrg: 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 Wed, Aug 03, 2022 at 03:28:45PM +0100, Herakliusz Lipiec wrote: > Currently ring pmd does not support ``rte_power_monitor`` api. > This patch adds support by adding umonitor callback that is called > whenever we enter sleep state and need to check if it is time to wake > up. > > Signed-off-by: Herakliusz Lipiec > --- Code looks ok to me, but I think the commit log and title needs to remove references to umonitor. The generic API in DPDK is just called "monitor". With such rewording. Acked-by: Bruce Richardson > drivers/net/ring/rte_eth_ring.c | 23 +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) > > diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c > index cfb81da5fe..1bb6b196cb 100644 > --- a/drivers/net/ring/rte_eth_ring.c > +++ b/drivers/net/ring/rte_eth_ring.c > @@ -284,6 +284,28 @@ eth_dev_close(struct rte_eth_dev *dev) > return ret; > } > > +static int ring_monitor_callback(const uint64_t value, > + const uint64_t arg[RTE_POWER_MONITOR_OPAQUE_SZ]) > +{ > + /* Check if the head pointer has changed */ > + return value != arg[0]; > +} > + > +static int > +eth_get_monitor_addr(void* rx_queue, struct rte_power_monitor_cond *pmc) > +{ > + struct rte_ring *rng = ((struct ring_queue*) rx_queue)->rng; > + > + /* Monitor ring head since if head moves > + * there are packets to transmit > + * */ > + pmc->addr = &rng->prod.head; > + pmc->size = sizeof(rng->prod.head); > + pmc->opaque[0] = rng->prod.head; > + pmc->fn = ring_monitor_callback; > + return 0; > +} > + > static const struct eth_dev_ops ops = { > .dev_close = eth_dev_close, > .dev_start = eth_dev_start, > @@ -303,6 +325,7 @@ static const struct eth_dev_ops ops = { > .promiscuous_disable = eth_promiscuous_disable, > .allmulticast_enable = eth_allmulticast_enable, > .allmulticast_disable = eth_allmulticast_disable, > + .get_monitor_addr = eth_get_monitor_addr, > }; > > static int > -- > 2.36.1 >