On 4/25/2023 5:09 AM, Jerin Jacob wrote: > On Mon, Apr 24, 2023 at 9:36 PM Ferruh Yigit <ferruh.yi...@amd.com> wrote: >> >> On 4/19/2023 11:15 AM, Jerin Jacob wrote: >>> On Wed, Apr 19, 2023 at 3:24 PM Sivaprasad Tummala >>> <sivaprasad.tumm...@amd.com> wrote: >>>> >>>> A new API to allow power monitoring condition on event port to >>>> optimize power when no events are arriving on an event port for >>>> the worker core to process in an eventdev based pipelined application. >>>> >>>> Signed-off-by: Sivaprasad Tummala <sivaprasad.tumm...@amd.com> >>>> + * >>>> + * @param dev_id >>>> + * Eventdev id >>>> + * @param port_id >>>> + * Eventdev port id >>>> + * @param pmc >>>> + * The pointer to power-optimized monitoring condition structure. >>>> + * >>>> + * @return >>>> + * - 0: Success. >>>> + * -ENOTSUP: Operation not supported. >>>> + * -EINVAL: Invalid parameters. >>>> + * -ENODEV: Invalid device ID. >>>> + */ >>>> +__rte_experimental >>>> +int >>>> +rte_event_port_get_monitor_addr(uint8_t dev_id, uint8_t port_id, >>>> + struct rte_power_monitor_cond *pmc); >>> >>> + eventdev driver maintainers >>> >>> I think, we don't need to expose this application due to applications >>> 1)To make applications to be transparent whether power saving is enabled or >>> not? >>> 2)Some HW and Arch already supports power managent in driver and in HW >>> (Not using CPU architecture directly) >>> >>> If so, that will be translated to following, >>> a) Add rte_event_port_power_saving_ena_dis(uint8_t dev_id, uint8_t >>> port_id, bool ena) for controlling power saving in slowpath. >>> b) Create reusable PMD private function based on the CPU architecture >>> power saving primitive to cover the PMD don't have native power saving >>> support. >>> c)Update rte_event_dequeue_burst() burst of PMD callback to use (b). >>> >>> >> >> Hi Jerin, > > Hi Ferruh, > >> >> ethdev approach seems applied here. > > Understands that. But none of the NIC HW supports power management at > HW level like eventdev, so that way > for what we are doing for ethdev is a correct abstraction for ethdev. >
What I understand is there is HW based event manager and SW based ones, SW based ones can benefit more from CPU power optimizations, for HW event managers if there is not enough benefit they can just ignore the feature. >> >> In ethdev, 'rte_event_port_get_monitor_addr()' equivalent is >> 'rte_eth_get_monitor_addr()'. >> >> Although 'rte_eth_get_monitor_addr()' is public API, it is currently >> only called from Rx/Tx callback functions implemented in the power library. >> But I assume intention to make it public is to enable users to implement >> their own callback functions that has custom algorithm for the power >> management. > > If there is a use case for customizing with own callback, we can provide that. > Provided NULL is valid with default algorithm. > >> >> And probably same is true for the 'rte_event_port_get_monitor_addr()'. >> >> >> Also instead of implementing power features for withing PMDs, isn't it >> better to have a common eventdev layer for it? > > We can have rte_evetdev_pmd_* APIs as non-public APIs. > My only objection is to NOT introduce _monitor_ APIs at eventdev level, > Instead, _monitor_ is one way to do it in SW, So we need higher level > of abstraction. > I see, this seems a trade off between flexibility and usability. If application has access to _monitor_ APIs, they can be more flexible to implement their own logic. Another option can be application provides the policy with an API and monitor API used to realize the policy, but for this case it can be challenge to find and implement correct policies. >> >> For the PMDs benefit from HW event manager, just not implementing >> .get_monitor_addr() dev_ops will make them free from power related APIs. > > But application fast path code gets diverged by exposing low level primitives. > I am not clear with concern above, but for application that use default callbacks, 'rte_power_eventdev_pmgmt_port_enable()' needs to be called to enable this feature, if not called datapath is not impacted. And if not dequeue callback added at all, custom or default, data path is not impacted at all.