From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"thomas.monjalon@6wind.com" <thomas.monjalon@6wind.com>,
"balasubramanian.manoharan@cavium.com"
<balasubramanian.manoharan@cavium.com>,
"hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
"shreyansh.jain@nxp.com" <shreyansh.jain@nxp.com>
Subject: Re: [dpdk-dev] [PATCH v3 2/2] ethdev: add hierarchical scheduler API
Date: Mon, 10 Apr 2017 19:30:12 +0530 [thread overview]
Message-ID: <20170410140011.GA7276@jerin> (raw)
In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D8912652789730@IRSMSX108.ger.corp.intel.com>
-----Original Message-----
> Date: Fri, 7 Apr 2017 17:47:40 +0000
> From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>, "thomas.monjalon@6wind.com"
> <thomas.monjalon@6wind.com>, "balasubramanian.manoharan@cavium.com"
> <balasubramanian.manoharan@cavium.com>, "hemant.agrawal@nxp.com"
> <hemant.agrawal@nxp.com>, "shreyansh.jain@nxp.com"
> <shreyansh.jain@nxp.com>
> Subject: RE: [PATCH v3 2/2] ethdev: add hierarchical scheduler API
>
> Hi Jerin,
>
> Thanks for your review!
>
> >
> > Thanks Cristian for v3.
> >
> > From Cavium HW perceptive, v3 is in relatively good shape to consume it,
> > Except the below mentioned two pointers.
> >
> > 1) We strongly believes, application explicitly need to give level id, while
> > creating topology(i.e rte_tm_node_add()). Reasons are,
> >
> > - In the capability side we are exposing nr_levels etc
> > - I think, _All_ the HW implementation expects to be connected from
> > level-n to leveln-1. IMO, Its better to express that in API.
> > - For the SW implementations, which don't care abut the specific level id for
> > the
> > connection can ignore the level id passed by the application.
> > Let the definition be "level" aware.
> >
>
> The current API proposal creates a new node and connects it to its parent in a single step, so when a new node is added its level if completely known based on its parent level.
>
> Therefore, specifying the level of the node when the node is added is redundant and therefore not needed. My concern is this requirement can introduce inconsistency into the API, as the user can specify a level ID for the new node that is different than (parent node level ID + 1).
Yes. I think, its better if we return error if implementation does not
supports in such case.
>
> But based on private conversation it looks to me that you guys have a strong opinion on this, so I am taking the action to identify a (nice) way to implement your requirement and do it.
OK
>
> > 2) There are lot of capability in the TM definition. I don't have strong option
> > here as TM stuff comes in control path.
> >
> > So expect point (1), generally we are fine with V3.
> >
>
> This is good news!
>
> > Detailed comments below,
> >
> > > +
> >
> > This definition is not used anywhere
>
> This is the typical value to be passed to the shaper profile adjust parameter. Will take the action to document this.
OK
>
> >
> > > +/**
> > > + * Color
> > > + */
> > > +enum rte_tm_color {
> > > + RTE_TM_STATS_N_BYTES_QUEUED = 1 << 9,
> >
> > I think, For bitmask, it is better to add ULL.
> > example:
> > RTE_TM_STATS_N_BYTES_QUEUED = 1ULL << 9,
>
> The enum fields are uint32_t, not uint64_t; therefore, we cannot use uint64_t constants. This is why all enums in DPDK are using uint32_t values. I am not sure, there might be a way to use uint64_t constants by relying on compiler extensions, by I wanted to keep ourselves out of trouble :).
OK
>
>
> > > +};
> >
> > I think, The above definitions are used as "uint64_t stats_mask" in
> > the remaining sections. How about changing to "enum rte_tm_stats_type
> > stats_mask"
> > instead of uint64_t stats_mask?
> >
>
> The mask is a collection of flags (so multiple enum flags are typically enabled in this mask, e.g. stats_mask = RTE_TM_STATS_N_PKT | RTE_TM_STATS_N_BYTES | ...), therefore it cannot be of the same type as the enum.
>
> I am taking the action to document that stats_mask is built out by using this specific enum flags.
OK
>
> > > +
> > > +/**
> > > + * Traffic manager dynamic updates
> > > +struct rte_tm_level_capabilities {
> >
> > IMO, level can be either leaf or nonleaf. If so, following struct makes more
> > sense to me
> >
> > int is_leaf;
> > uint32_t n_nodes_max;
> > union {
> > struct rte_tm_node_capabilities nonleaf;
> > struct rte_tm_node_capabilities leaf;
> > };
> >
>
> This was the way it was done in previous versions, but Hemant rightly observed that leaf nodes typically have different capabilities as non-leaf nodes, hence the current solution.
OK. But still it has to be union. Right? because a level can be either leaf
or non-leaf(not both).
>
> > > + * (see enum rte_tm_dynamic_update_type).
> > > + */
> > > + uint64_t dynamic_update_mask;
> >
> > IMO, It is better to change as
> > enum rte_tm_dynamic_update_type dynamic_update_mask
> > instead of
> > uint64_t dynamic_update_mask;
> >
>
> Same answer as for the other enum above (mask is not equal to a single enum value, but a set of enum flags; basically each bit of the mask corresponds to a different enum value).
OK
I think, we can add "@see enum rte_tm_dynamic_update_type" scheme in
the header file wherever there is a `reference to other element in the
header file.
reference: http://dpdk.org/browse/dpdk/tree/lib/librte_eventdev/rte_eventdev.h#n257
> > > +
> > > + union {
> > > + /**< Parameters only valid for non-leaf nodes. */
> > > + struct {
> > > + /**< For each priority, indicates whether the children
> > > + * nodes sharing the same priority are to be
> > scheduled
> > > + * by WFQ or by WRR. When NULL, it indicates that
> > WFQ
> > > + * is to be used for all priorities. When non-NULL, it
> > > + * points to a pre-allocated array of *n_priority*
> > > + * elements, with a non-zero value element
> > indicating
> > > + * WFQ and a zero value element for WRR.
> > > + */
> > > + int *scheduling_mode_per_priority;
> > > +
> > > + /**< Number of priorities. */
> > > + uint32_t n_priorities;
> > > + } nonleaf;
> >
> >
> > Since we are adding all node "connecting" parameter in rte_tm_node_add().
> > How about adding WFQ vs WRR as boolean value in rte_tm_node_add() to
> > maintain
> > the consistency
>
> This is not about the parent node managing this new node as one of its children nodes, it is about how this new node will manage its future children nodes, hence the reason to put it here.
So, Is it same as rte_tm_node_scheduling_mode_update()? if so, then we
may not need this here. if not, what is the use case we are trying to achieve
here?
>
> >
> > How about new error type in "enum rte_tm_error_type" to specify the
> > connection
> > error due to requested mode WFQ or WRR not supported.
> >
>
> I think we already have it, it is called: RTE_TM_ERROR_TYPE_NODE_PARAMS_SCHEDULING_MODE.
I think, explicit error code may help, something like
RTE_TM_ERROR_TYPE_NODE_PARAMS_SCHEDULING_WFQ
and
RTE_TM_ERROR_TYPE_NODE_PARAMS_SCHEDULING_WRR
>
> > > +
> > > +/**
> > > +/**
> > > + * Traffic manager get number of leaf nodes
> > > + *
> > > + * Each leaf node sits on on top of a TX queue of the current Ethernet
> > port.
> > > + * Therefore, the set of leaf nodes is predefined, their number is always
> > equal
> > > + * to N (where N is the number of TX queues configured for the current
> > port)
> > > + * and their IDs are 0 .. (N-1).
> > > + *
> > > + * @param port_id
> > > + * The port identifier of the Ethernet device.
> > > + * @param n_leaf_nodes
> > > + * Number of leaf nodes for the current port.
> > > + * @param error
> > > + * Error details. Filled in only on error, when not NULL.
> > > + * @return
> > > + * 0 on success, non-zero error code otherwise.
> > > + */
> > > +int
> > > +rte_tm_get_leaf_nodes(uint8_t port_id,
> > > + uint32_t *n_leaf_nodes,
> > > + struct rte_tm_error *error);
> >
> > In order to keep consistency with rest of the API, IMO, the API
> > name can be changed to rte_tm_leaf_nodes_get()
> >
>
> IMO this is not a node API, it is a port API, hence the attempt to avoid rte_tm_node_XYZ().
>
> Maybe a longer but less confusing name is: rte_tm_get_number_of_leaf_nodes()?
No strong opinion here. Shorter version may be rte_tm_leaf_nodes_count()
prev parent reply other threads:[~2017-04-10 14:00 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-04 1:10 [dpdk-dev] [PATCH v3 0/2] ethdev: abstraction layer for QoS hierarchical scheduler Cristian Dumitrescu
2017-03-04 1:10 ` [dpdk-dev] [PATCH v3 1/2] ethdev: add capability control API Cristian Dumitrescu
2017-03-06 10:32 ` Thomas Monjalon
2017-03-06 16:35 ` Dumitrescu, Cristian
2017-03-06 16:57 ` Thomas Monjalon
2017-03-06 18:28 ` Dumitrescu, Cristian
2017-03-06 20:21 ` Thomas Monjalon
2017-03-06 20:41 ` Wiles, Keith
2017-03-06 20:54 ` Stephen Hemminger
2017-03-07 10:14 ` Dumitrescu, Cristian
2017-03-07 12:56 ` Thomas Monjalon
2017-03-07 19:17 ` Wiles, Keith
2017-03-06 16:36 ` Dumitrescu, Cristian
2017-05-19 17:12 ` [dpdk-dev] [PATCH v4 0/2] ethdev: abstraction layer for QoS traffic management Cristian Dumitrescu
2017-05-19 17:12 ` [dpdk-dev] [PATCH v4 1/2] ethdev: add traffic management ops get API Cristian Dumitrescu
2017-06-09 16:51 ` [dpdk-dev] [PATCH v5 0/2] ethdev: abstraction layer for QoS traffic management Cristian Dumitrescu
2017-06-09 16:51 ` [dpdk-dev] [PATCH v5 1/2] ethdev: add traffic management ops get API Cristian Dumitrescu
2017-06-09 16:51 ` [dpdk-dev] [PATCH v5 2/2] ethdev: add traffic management API Cristian Dumitrescu
2017-06-12 3:36 ` Jerin Jacob
2017-06-12 10:24 ` Dumitrescu, Cristian
2017-06-12 13:35 ` [dpdk-dev] [PATCH v6 0/2] ethdev: abstraction layer for QoS traffic management Cristian Dumitrescu
2017-06-12 13:35 ` [dpdk-dev] [PATCH v6 1/2] ethdev: add traffic management ops get API Cristian Dumitrescu
2017-06-12 13:35 ` [dpdk-dev] [PATCH v6 2/2] ethdev: add traffic management API Cristian Dumitrescu
2017-06-27 13:24 ` [dpdk-dev] [PATCH v6 0/2] ethdev: abstraction layer for QoS traffic management Dumitrescu, Cristian
2017-05-19 17:12 ` [dpdk-dev] [PATCH v4 2/2] ethdev: add traffic management API Cristian Dumitrescu
2017-05-19 17:34 ` Stephen Hemminger
2017-05-22 14:25 ` Dumitrescu, Cristian
2017-05-24 11:28 ` Hemant Agrawal
2017-05-31 13:45 ` Jerin Jacob
2017-05-31 17:05 ` Manoharan, Balasubramanian
2017-03-04 1:10 ` [dpdk-dev] [PATCH v3 2/2] ethdev: add hierarchical scheduler API Cristian Dumitrescu
2017-03-06 10:38 ` Thomas Monjalon
2017-03-06 16:59 ` Dumitrescu, Cristian
2017-03-06 20:07 ` Thomas Monjalon
2017-03-07 19:29 ` Dumitrescu, Cristian
2017-03-08 9:51 ` O'Driscoll, Tim
2017-03-10 18:37 ` Dumitrescu, Cristian
2017-03-15 12:43 ` Thomas Monjalon
2017-03-16 16:23 ` Dumitrescu, Cristian
2017-03-16 17:29 ` Thomas Monjalon
2017-03-16 17:40 ` Dumitrescu, Cristian
2017-03-16 18:10 ` Thomas Monjalon
2017-03-16 19:06 ` Dumitrescu, Cristian
2017-03-24 19:55 ` Dumitrescu, Cristian
2017-03-06 16:15 ` Stephen Hemminger
2017-03-06 18:17 ` Dumitrescu, Cristian
2017-03-16 17:35 ` Thomas Monjalon
2017-03-30 10:32 ` Hemant Agrawal
2017-04-07 16:51 ` Dumitrescu, Cristian
2017-04-07 13:20 ` Jerin Jacob
2017-04-07 17:47 ` Dumitrescu, Cristian
2017-04-10 14:00 ` Jerin Jacob [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170410140011.GA7276@jerin \
--to=jerin.jacob@caviumnetworks.com \
--cc=balasubramanian.manoharan@cavium.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=shreyansh.jain@nxp.com \
--cc=thomas.monjalon@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).