From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 4/6] rte_sched: allow reading without clearing Date: Mon, 11 May 2015 14:53:48 +0200 Message-ID: <2579875.fqTZsmi9Ai@xps13> References: <1430327080-12642-1-git-send-email-stephen@networkplumber.org> <1430327080-12642-5-git-send-email-stephen@networkplumber.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by dpdk.org (Postfix) with ESMTP id 0EFB9C408 for ; Mon, 11 May 2015 14:54:30 +0200 (CEST) Received: by wiun10 with SMTP id n10so95157000wiu.1 for ; Mon, 11 May 2015 05:54:29 -0700 (PDT) In-Reply-To: <1430327080-12642-5-git-send-email-stephen@networkplumber.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-04-29 10:04, Stephen Hemminger: > The rte_sched statistics API should allow reading statistics without > clearing. Make auto-clear optional. >=20 > Signed-off-by: Stephen Hemminger > --- > app/test/test_sched.c | 4 ++-- > examples/qos_sched/stats.c | 16 +++++++++++----- > lib/librte_sched/rte_sched.c | 44 ++++++++++++++++++++++------------= ---------- > lib/librte_sched/rte_sched.h | 18 ++++++++++-------- [...] This API change needs more adjustments in the example app: examples/qos_sched/stats.c: In function =E2=80=98subport_stat=E2=80=99:= examples/qos_sched/stats.c:263:9: error: too few arguments to function = =E2=80=98rte_sched_subport_read_stats=E2=80=99 rte_sched_subport_read_stats(port, subport_id, &stats, tc_ov);= ^ examples/qos_sched/stats.c: In function =E2=80=98pipe_stat=E2=80=99: examples/qos_sched/stats.c:309:25: error: too few arguments to function= =E2=80=98rte_sched_queue_read_stats=E2=80=99 rte_sched_queue_read_stats(port, queue_id + (i= * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + j), &stats, &qlen); ^ [...] > --- a/lib/librte_sched/rte_sched.h > +++ b/lib/librte_sched/rte_sched.h > @@ -308,14 +308,15 @@ rte_sched_port_get_memory_footprint(struct rte_= sched_port_params *params); > * @param tc_ov > * Pointer to pre-allocated 4-entry array where the oversubscripti= on status for > * each of the 4 subport traffic classes should be stored. > + * @parm clear > + * Reset statistics after read > * @return > * 0 upon success, error code otherwise > */ > int > -rte_sched_subport_read_stats(struct rte_sched_port *port, > -=09uint32_t subport_id, > -=09struct rte_sched_subport_stats *stats, > -=09uint32_t *tc_ov); > +rte_sched_subport_read_stats(struct rte_sched_port *port, uint32_t s= ubport_id, > +=09=09=09 struct rte_sched_subport_stats *stats, > +=09=09=09 uint32_t *tc_ov, int clear); > =20 > /** > * Hierarchical scheduler queue statistics read > @@ -329,14 +330,15 @@ rte_sched_subport_read_stats(struct rte_sched_p= ort *port, > * counters should be stored > * @param qlen > * Pointer to pre-allocated variable where the current queue lengt= h should be stored. > + * @parm clear > + * Reset statistics after read > * @return > * 0 upon success, error code otherwise > */ > int > -rte_sched_queue_read_stats(struct rte_sched_port *port, > -=09uint32_t queue_id, > -=09struct rte_sched_queue_stats *stats, > -=09uint16_t *qlen); > +rte_sched_queue_read_stats(struct rte_sched_port *port, uint32_t que= ue_id, > +=09=09=09 struct rte_sched_queue_stats *stats, > +=09=09=09 uint16_t *qlen, int clear); > =20 > /* > * Run-time >=20 What about ABI versioning? compatibility?