From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E5FD5A04DD;
	Wed, 28 Oct 2020 17:47:44 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 7151D5947;
	Wed, 28 Oct 2020 17:47:43 +0100 (CET)
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 7D87754AE
 for <dev@dpdk.org>; Wed, 28 Oct 2020 17:47:41 +0100 (CET)
IronPort-SDR: de7iVza5NUXiJb5FeoTSBtR9PhR5G6uPB3EdRJkGYP4cQFo6DzQqkZ3rWBx1FW0ApRQpdIsRM9
 BSo6lH6cXBSg==
X-IronPort-AV: E=McAfee;i="6000,8403,9788"; a="168391465"
X-IronPort-AV: E=Sophos;i="5.77,427,1596524400"; d="scan'208";a="168391465"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga006.jf.intel.com ([10.7.209.51])
 by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 28 Oct 2020 09:47:40 -0700
IronPort-SDR: vqzplNhYKPmB9rHf2Mr9mnUGT5e70fpSx5HArRx516naWnQc09BUZuqZ8ql/SfPmK75MXB479o
 wPkmxYJAQVXg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.77,427,1596524400"; d="scan'208";a="323398916"
Received: from irvmail001.ir.intel.com ([163.33.26.43])
 by orsmga006.jf.intel.com with ESMTP; 28 Oct 2020 09:47:36 -0700
Received: from sivswdev09.ir.intel.com (sivswdev09.ir.intel.com
 [10.237.217.48])
 by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id
 09SGlarH029643; Wed, 28 Oct 2020 16:47:36 GMT
Received: from sivswdev09.ir.intel.com (localhost [127.0.0.1])
 by sivswdev09.ir.intel.com with ESMTP id 09SGlZAH019279;
 Wed, 28 Oct 2020 16:47:35 GMT
Received: (from lma25@localhost)
 by sivswdev09.ir.intel.com with LOCAL id 09SGlZaa019264;
 Wed, 28 Oct 2020 16:47:35 GMT
Date: Wed, 28 Oct 2020 16:47:35 +0000
From: "Liang, Ma" <liang.j.ma@intel.com>
To: Jerin Jacob <jerinjacobk@gmail.com>
Cc: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
 Thomas Monjalon <thomas@monjalon.net>, dpdk-dev <dev@dpdk.org>,
 "Ruifeng Wang (Arm Technology China)" <ruifeng.wang@arm.com>,
 "Wang, Haiyue" <haiyue.wang@intel.com>,
 "Richardson, Bruce" <bruce.richardson@intel.com>,
 "Hunt, David" <david.hunt@intel.com>, Neil Horman <nhorman@tuxdriver.com>,
 "McDaniel, Timothy" <timothy.mcdaniel@intel.com>,
 "Eads, Gage" <gage.eads@intel.com>, Marcin Wojtas <mw@semihalf.com>,
 Guy Tzalik <gtzalik@amazon.com>,
 Ajit Khaparde <ajit.khaparde@broadcom.com>,
 Harman Kalra <hkalra@marvell.com>, John Daley <johndale@cisco.com>,
 "Wei Hu (Xavier" <xavier.huwei@huawei.com>,
 Ziyang Xuan <xuanziyang2@huawei.com>,
 "matan@nvidia.com" <matan@nvidia.com>, Yong Wang <yongwang@vmware.com>,
 "david.marchand@redhat.com" <david.marchand@redhat.com>
Message-ID: <20201028164735.GG29706@sivswdev09.ir.intel.com>
References: <1603494392-7181-1-git-send-email-liang.j.ma@intel.com>
 <20201028133507.GC29706@sivswdev09.ir.intel.com>
 <CALBAE1MoE+XjkLPCEO8bipT1qaXUu42w6eR4DmnuvKchav_1kg@mail.gmail.com>
 <2373759.1G5EZAqFcn@thomas>
 <BYAPR11MB3301D9ABFD81E4BA580D4A7C9A170@BYAPR11MB3301.namprd11.prod.outlook.com>
 <CALBAE1MU1CFxvn+MhyDErXpuwUetaFYDPbU=m9BLfGkpLsNtRw@mail.gmail.com>
 <BYAPR11MB3301130E5D754E4DEC78F02F9A170@BYAPR11MB3301.namprd11.prod.outlook.com>
 <CALBAE1Pkqj49guSovbTZKWr1qY0Jw3UXmBPF=x9fNkK4b_ArYw@mail.gmail.com>
 <BYAPR11MB33010CC7B047E7F79E04F0639A170@BYAPR11MB3301.namprd11.prod.outlook.com>
 <CALBAE1ODGKUf9pX=qfAWV6WfdhBG3vmdhw8UDQNc2Oq8=ozkTw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CALBAE1ODGKUf9pX=qfAWV6WfdhBG3vmdhw8UDQNc2Oq8=ozkTw@mail.gmail.com>
Subject: Re: [dpdk-dev] [PATCH v10 0/9] Add PMD power mgmt
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On 28 Oct 21:27, Jerin Jacob wrote:
> On Wed, Oct 28, 2020 at 9:19 PM Ananyev, Konstantin
> <konstantin.ananyev@intel.com> wrote:
> > > > > > > 28/10/2020 14:49, Jerin Jacob:
> > > > > > > > On Wed, Oct 28, 2020 at 7:05 PM Liang, Ma <liang.j.ma@intel.com> wrote:
> > > > > > > > >
> > > > > > > > > Hi Thomas,
> > > > > > > > >   I think I addressed all of the questions in relation to V9. I don't think I can solve the issue of a generic API on my own. From the
> > > > > > > Community Call last week Jerin also said that a generic was investigated but that a single solution wasn't feasible.
> > > > > > > >
> > > > > > > > I think, From the architecture point of view, the specific
> > > > > > > > functionally of UMONITOR may not be abstracted.
> > > > > > > > But from the ethdev callback point of view, Can it be abstracted in
> > > > > > > > such a way that packet notification available through
> > > > > > > > checking interrupt status register or ring descriptor location, etc by
> > > > > > > > the driver. Use that callback as a notification mechanism rather
> > > > > > > > than defining a memory-based scheme that UMONITOR expects? or similar
> > > > > > > > thoughts on abstraction.
> > > > > >
> > > > > > I think there is probably some sort of misunderstanding.
> > > > > > This API is not about providing acync notification when next packet arrives.
> > > > > > This is about to putting core to sleep till some event (or timeout) happens.
> > > > > > From my perspective the closest analogy: cond_timedwait().
> > > > > > So we need PMD to tell us what will be the address of the condition variable
> > > > > > we should sleep on.
> > > > > >
> > > > > > > I agree with Jerin.
> > > > > > > The ethdev API is the blocking problem.
> > > > > > > First problem: it is not well explained in doxygen.
> > > > > > > Second problem: it is probably not generic enough (if we understand it well)
> > > > > >
> > > > > > It is an address to sleep(/wakeup) on, plus expected value.
> > > > > > Honestly, I can't think-up of anything even more generic then that.
> > > > > > If you guys have something particular in mind - please share.
> > > > >
> > > > > Current PMD callback:
> > > > > typedef int (*eth_get_wake_addr_t)(void *rxq, volatile void
> > > > > **tail_desc_addr, + uint64_t *expected, uint64_t *mask, uint8_t
> > > > > *data_sz);
> > > > >
> > > > > Can we make it as
> > > > > typedef void (*core_sleep_t)(void *rxq)
> > > > >
> > > > > if we do such abstraction and "move the polling on memory by HW/CPU"
> > > > > to the driver using a helper function then
> > > > > I can think of abstracting in some way in all PMDs.
> > > >
> > > > Ok I see, thanks for explanation.
> > > > From my perspective main disadvantage of such approach -
> > > > it can't be extended easily.
> > > > If/when will have an ability for core to sleep/wake-up on multiple events
> > > > (multiple addresses) will have to either rework that API again.
> > >
> > > I think, we can enumerate the policies and pass the associated
> > > structures as input to the driver.
> >
> > What I am trying to say: with that API we will not be able to wait
> > for events from multiple devices (HW queues).
> > I.E. something like that:
> >
> > get_wake_addr(port=X, ..., &addr[0], ...);
> > get_wake_addr(port=Y,..., &addr[1],...);
> > wait_on_multi(addr, 2);
> >
> > wouldn't be possible.
> 
> I see. But the current implementation dictates the only queue bound to
> a core. Right?
Current implementation only support 1:1 queue/core mapping is because of 
the limitation of umwait/umonitor which can not work with multiple address
range. However, for other scheme like PASUE/Freq Scale have no such limitation. 
The proposed API itself doesn't limit the 1:1 queue/core mapping. 
> 
> 
> >
> > >
> > >
> > > >
> > > > >
> > > > > Note: core_sleep_t can take some more arguments such as enumerated
> > > > > policy if something more needs to be pushed to the driver.
> > > > >
> > > > > Thoughts?
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > > This API is experimental and other vendor support can be added as needed. If there are any other open issue let me know?
> > > > > > >
> > > > > > > Being experimental is not an excuse to throw something
> > > > > > > which is not satisfying.
> > > > > > >
> > > > > > >
> > > > > >