rte_sched: patches against 2.o
cover rte_sched: patches against 2.o
This is a subset of earlier patches for QoS (rte_sched) subsystem. Only changes were to fix whitespace and update against DPDK 2.0
Stephen Hemminger (6):
rte_sched: make RED optional at runtime
rte_sched: expand scheduler hierarchy for more VLAN's
rte_sched: keep track of RED drops
rte_sched: allow reading without clearing
rte_sched: don't put tabs in log messages
rte_sched: use correct log level
app/test/test_sched.c | 4 +- examples/qos_sched/stats.c | 16 ++++-- lib/librte_mbuf/rte_mbuf.h | 5 +- lib/librte_sched/rte_sched.c | 113 ++++++++++++++++++++++++++++--------------- lib/librte_sched/rte_sched.h | 62 +++++++++++++++--------- 5 files changed, 130 insertions(+), 70 deletions(-)
Signature · 1 line
2.1.4
PATCH 1/6 rte_sched: make RED optional at runtime
In reply to a message not in the archiveFrom: Stephen Hemminger <[email protected]>
Want to be able to build with RTE_SCHED_RED enabled but allow disabling RED on a per-queue basis at runtime.
RED is disabled unless min/max thresholds set.
--- lib/librte_sched/rte_sched.c | 9 +++++++++ 1 file changed, 9 insertions(+)
lib/librte_sched/rte_sched.c +9 -0
@@ -636,6 +636,12 @@ rte_sched_port_config(struct rte_sched_port_params *params)uint32_t j;for (j =0 ; j < e_RTE_METER_COLORS; j++) { +/* if min/max are both zero, then RED is disabled */ +if ((params->red_params[i][j].min_th | + params->red_params[i][j].max_th) ==0 ) { +continue ; + } + if (rte_red_config_init(&port->red_config[i][j], params->red_params[i][j].wq_log2, params->red_params[i][j].min_th,
@@ -1069,6 +1075,9 @@ rte_sched_port_red_drop(struct rte_sched_port *port, struct rte_mbuf *pkt, uint3 color =rte_sched_port_pkt_read_color (pkt); red_cfg = &port->red_config[tc_index][color]; +if ((red_cfg->min_th | red_cfg->max_th) ==0 ) +return 0 ; + qe = port->queue_extra + qindex; red = &qe->red;
Signature · 1 line
2.1.4
PATCH 2/6 rte_sched: expand scheduler hierarchy for more VLAN's
In reply to a message not in the archiveFrom: Stephen Hemminger <[email protected]>
The QoS subport is limited to 8 bits in original code.
But customers demanded ability to support full number of VLAN's (4096) therefore use the full part of the tag field of mbuf.
Resize the pipe as well to allow for more pipes in future and avoid expensive bitfield access.
--- lib/librte_mbuf/rte_mbuf.h | 5 ++++- lib/librte_sched/rte_sched.h | 38 ++++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 15 deletions(-)
lib/librte_mbuf/rte_mbuf.h +4 -1
@@ -285,7 +285,10 @@ struct rte_mbuf {/**< First 4 flexible bytes or FD ID, dependent on PKT_RX_FDIR_* flag in ol_flags. */ } fdir;/**< Filter identifier if FDIR enabled */ -uint32_t sched;/**< Hierarchical scheduler */ +struct { +uint32_t lo; +uint32_t hi; + } sched;/**< Hierarchical scheduler */ uint32_t usr;/**< User defined tags. See rte_distributor_process() */ } hash;/**< hash information */
lib/librte_sched/rte_sched.h +24 -14
@@ -195,16 +195,20 @@ struct rte_sched_port_params {#endif }; -/** Path through the scheduler hierarchy used by the scheduler enqueue operation to -identify the destination queue for the current packet. Stored in the field hash.sched -of struct rte_mbuf of each packet, typically written by the classification stage and read by -scheduler enqueue.*/ +/* +* Path through the scheduler hierarchy used by the scheduler enqueue +* operation to identify the destination queue for the current +* packet. Stored in the field pkt.hash.sched of struct rte_mbuf of +* each packet, typically written by the classification stage and read +* by scheduler enqueue. +*/ struct rte_sched_port_hierarchy { -uint32_t queue:2 ;/**< Queue ID (0 .. 3) */ -uint32_t traffic_class:2 ;/**< Traffic class ID (0 .. 3)*/ -uint32_t pipe:20 ;/**< Pipe ID */ -uint32_t subport:6 ;/**< Subport ID */ -uint32_t color:2 ;/**< Color */ +uint16_t queue:2 ;/**< Queue ID (0 .. 3) */ +uint16_t traffic_class:2 ;/**< Traffic class ID (0 .. 3)*/ +uint16_t color:2 ;/**< Color */ +uint16_t unused:10 ; +uint16_t subport;/**< Subport ID */ +uint32_t pipe;/**< Pipe ID */ };/*
@@ -350,12 +354,15 @@ rte_sched_queue_read_stats(struct rte_sched_port *port,*/ static inline void rte_sched_port_pkt_write (struct rte_mbuf *pkt, -uint32_t subport,uint32_t pipe,uint32_t traffic_class,uint32_t queue,enum rte_meter_color color) +uint32_t subport,uint32_t pipe, +uint32_t traffic_class, +uint32_t queue,enum rte_meter_color color) { -struct rte_sched_port_hierarchy *sched = (struct rte_sched_port_hierarchy *) &pkt->hash.sched; +struct rte_sched_port_hierarchy *sched + = (struct rte_sched_port_hierarchy *) &pkt->hash.sched; - sched->color = (uint32_t ) color; sched->subport = subport; + sched->color = (uint32_t ) color; sched->pipe = pipe; sched->traffic_class = traffic_class; sched->queue = queue;
@@ -379,9 +386,12 @@ rte_sched_port_pkt_write(struct rte_mbuf *pkt,* */ static inline void -rte_sched_port_pkt_read_tree_path (struct rte_mbuf *pkt,uint32_t *subport,uint32_t *pipe,uint32_t *traffic_class,uint32_t *queue) +rte_sched_port_pkt_read_tree_path (struct rte_mbuf *pkt,uint32_t *subport, +uint32_t *pipe,uint32_t *traffic_class, +uint32_t *queue) { -struct rte_sched_port_hierarchy *sched = (struct rte_sched_port_hierarchy *) &pkt->hash.sched; +struct rte_sched_port_hierarchy *sched + = (struct rte_sched_port_hierarchy *) &pkt->hash.sched; *subport = sched->subport; *pipe = sched->pipe;
Signature · 1 line
2.1.4
PATCH 3/6 rte_sched: keep track of RED drops
In reply to a message not in the archiveFrom: Stephen Hemminger <[email protected]>
Add new statistic to keep track of drops due to RED.
--- lib/librte_sched/rte_sched.c | 31 ++++++++++++++++++++++++++----- lib/librte_sched/rte_sched.h | 6 ++++++ 2 files changed, 32 insertions(+), 5 deletions(-)
lib/librte_sched/rte_sched.c +26 -5
@@ -1028,7 +1028,9 @@ rte_sched_port_update_subport_stats(struct rte_sched_port *port, uint32_t qindex }static inline void -rte_sched_port_update_subport_stats_on_drop (struct rte_sched_port *port,uint32_t qindex,struct rte_mbuf *pkt) +rte_sched_port_update_subport_stats_on_drop (struct rte_sched_port *port, +uint32_t qindex, +struct rte_mbuf *pkt,uint32_t red) {struct rte_sched_subport *s = port->subport + (qindex /rte_sched_port_queues_per_subport (port));uint32_t tc_index = (qindex >>2 ) &0x3 ;
@@ -1036,6 +1038,9 @@ rte_sched_port_update_subport_stats_on_drop(struct rte_sched_port *port, uint32_ s->stats.n_pkts_tc_dropped[tc_index] +=1 ; s->stats.n_bytes_tc_dropped[tc_index] += pkt_len; +#ifdef RTE_SCHED_RED + s->stats.n_pkts_red_dropped[tc_index] += red; +#endif } static inline void
@@ -1049,13 +1054,18 @@ rte_sched_port_update_queue_stats(struct rte_sched_port *port, uint32_t qindex, }static inline void -rte_sched_port_update_queue_stats_on_drop (struct rte_sched_port *port,uint32_t qindex,struct rte_mbuf *pkt) +rte_sched_port_update_queue_stats_on_drop (struct rte_sched_port *port, +uint32_t qindex, +struct rte_mbuf *pkt,uint32_t red) {struct rte_sched_queue_extra *qe = port->queue_extra + qindex;uint32_t pkt_len = pkt->pkt_len; qe->stats.n_pkts_dropped +=1 ; qe->stats.n_bytes_dropped += pkt_len; +#ifdef RTE_SCHED_RED + qe->stats.n_pkts_red_dropped += red; +#endif }#endif /* RTE_SCHED_COLLECT_STATS */
@@ -1206,12 +1216,23 @@ rte_sched_port_enqueue_qwa(struct rte_sched_port *port, uint32_t qindex, struct qlen = q->qw - q->qr;/* Drop the packet (and update drop stats) when queue is full */ -if (unlikely (rte_sched_port_red_drop (port, pkt, qindex, qlen) || (qlen >= qsize))) { +if (unlikely (rte_sched_port_red_drop (port, pkt, qindex, qlen))) { +#ifdef RTE_SCHED_COLLECT_STATS +rte_sched_port_update_subport_stats_on_drop (port, qindex, + pkt,1 ); +rte_sched_port_update_queue_stats_on_drop (port, qindex, pkt,1 ); +#endif rte_pktmbuf_free (pkt); +return 0 ; + } + +if (qlen >= qsize) {#ifdef RTE_SCHED_COLLECT_STATS -rte_sched_port_update_subport_stats_on_drop (port, qindex, pkt); -rte_sched_port_update_queue_stats_on_drop (port, qindex, pkt); +rte_sched_port_update_subport_stats_on_drop (port, qindex, + pkt,0 ); +rte_sched_port_update_queue_stats_on_drop (port, qindex, pkt,0 );#endif +rte_pktmbuf_free (pkt);return 0 ; }
lib/librte_sched/rte_sched.h +6 -0
@@ -140,6 +140,9 @@ struct rte_sched_subport_stats {subport for each traffic class*/ uint32_t n_bytes_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ];/**< Number of bytes dropped by the current subport for each traffic class due to subport queues being full or congested */ +#ifdef RTE_SCHED_RED +uint32_t n_pkts_red_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ];/**< Number of packets dropped by red */ +#endif };/** Pipe configuration parameters. The period and credits_per_period parameters are measured
@@ -168,6 +171,9 @@ struct rte_sched_queue_stats {/* Packets */ uint32_t n_pkts;/**< Number of packets successfully written to current queue */ uint32_t n_pkts_dropped;/**< Number of packets dropped due to current queue being full or congested */ +#ifdef RTE_SCHED_RED +uint32_t n_pkts_red_dropped; +#endif /* Bytes */ uint32_t n_bytes;/**< Number of bytes successfully written to current queue */
Signature · 1 line
2.1.4
PATCH 4/6 rte_sched: allow reading without clearing
In reply to a message not in the archiveThe rte_sched statistics API should allow reading statistics without clearing. Make auto-clear optional.
--- 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 ++++++++++-------- 4 files changed, 45 insertions(+), 37 deletions(-)
app/test/test_sched.c +2 -2
@@ -198,13 +198,13 @@ test_sched(void)struct rte_sched_subport_stats subport_stats;uint32_t tc_ov; -rte_sched_subport_read_stats (port,SUBPORT , &subport_stats, &tc_ov); +rte_sched_subport_read_stats (port,SUBPORT , &subport_stats, &tc_ov,1 );#if 0 TEST_ASSERT_EQUAL (subport_stats.n_pkts_tc[TC -1 ],10 ,"Wrong subport stats\n" );#endif struct rte_sched_queue_stats queue_stats;uint16_t qlen; -rte_sched_queue_read_stats (port,QUEUE , &queue_stats, &qlen); +rte_sched_queue_read_stats (port,QUEUE , &queue_stats, &qlen,1 );#if 0 TEST_ASSERT_EQUAL (queue_stats.n_pkts,10 ,"Wrong queue stats\n" );#endif
examples/qos_sched/stats.c +11 -5
@@ -61,7 +61,7 @@ qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8 average =0 ;for (count =0 ; count < qavg_ntimes; count++) { -rte_sched_queue_read_stats (port, queue_id, &stats, &qlen); +rte_sched_queue_read_stats (port, queue_id, &stats, &qlen,1 ); average += qlen;usleep (qavg_period); }
@@ -99,7 +99,9 @@ qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc)for (count =0 ; count < qavg_ntimes; count++) { part_average =0 ;for (i =0 ; i <RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS ; i++) { -rte_sched_queue_read_stats (port, queue_id + (tc *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + i), &stats, &qlen); +rte_sched_queue_read_stats (port, + queue_id + (tc *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + i), + &stats, &qlen,1 ); part_average += qlen; } average += part_average /RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS ;
@@ -138,7 +140,8 @@ qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id)for (count =0 ; count < qavg_ntimes; count++) { part_average =0 ;for (i =0 ; i <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS ; i++) { -rte_sched_queue_read_stats (port, queue_id + i, &stats, &qlen); +rte_sched_queue_read_stats (port, queue_id + i, + &stats, &qlen,1 ); part_average += qlen; } average += part_average / (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS );
@@ -178,7 +181,9 @@ qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) queue_id =RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + i);for (j =0 ; j <RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS ; j++) { -rte_sched_queue_read_stats (port, queue_id + (tc *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + j), &stats, &qlen); +rte_sched_queue_read_stats (port, + queue_id + (tc *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + j), + &stats, &qlen,1 ); part_average += qlen; } }
@@ -220,7 +225,8 @@ qavg_subport(uint8_t port_id, uint32_t subport_id) queue_id =RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + i);for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE *RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS ; j++) { -rte_sched_queue_read_stats (port, queue_id + j, &stats, &qlen); +rte_sched_queue_read_stats (port, queue_id + j, + &stats, &qlen,1 ); part_average += qlen; } }
lib/librte_sched/rte_sched.c +22 -22
78 lines not on this page · raw message
lib/librte_sched/rte_sched.h +10 -8
@@ -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 oversubscription 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, -uint32_t subport_id, -struct rte_sched_subport_stats *stats, -uint32_t *tc_ov); +rte_sched_subport_read_stats (struct rte_sched_port *port,uint32_t subport_id, +struct rte_sched_subport_stats *stats, +uint32_t *tc_ov,int clear);/** * Hierarchical scheduler queue statistics read
@@ -329,14 +330,15 @@ rte_sched_subport_read_stats(struct rte_sched_port *port,* counters should be stored * @param qlen * Pointer to pre-allocated variable where the current queue length 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, -uint32_t queue_id, -struct rte_sched_queue_stats *stats, -uint16_t *qlen); +rte_sched_queue_read_stats (struct rte_sched_port *port,uint32_t queue_id, +struct rte_sched_queue_stats *stats, +uint16_t *qlen,int clear);/* * Run-time
Signature · 1 line
2.1.4
PATCH 5/6 rte_sched: don't put tabs in log messages
In reply to a message not in the archiveFrom: Stephen Hemminger <[email protected]>
syslog does not like tabs in log messages; tab gets translated to #011
--- lib/librte_sched/rte_sched.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
lib/librte_sched/rte_sched.c +7 -7
@@ -495,10 +495,10 @@ rte_sched_port_log_pipe_profile(struct rte_sched_port *port, uint32_t i)struct rte_sched_pipe_profile *p = port->pipe_profiles + i; RTE_LOG(INFO, SCHED, "Low level config for pipe profile %u:\n" - "\tToken bucket: period = %u, credits per period = %u, size = %u\n" - "\tTraffic classes: period = %u, credits per period = [%u, %u, %u, %u]\n" - "\tTraffic class 3 oversubscription: weight = %hhu\n" - "\tWRR cost: [%hhu, %hhu, %hhu, %hhu], [%hhu, %hhu, %hhu, %hhu], [%hhu, %hhu, %hhu, %hhu], [%hhu, %hhu, %hhu, %hhu]\n", + " Token bucket: period = %u, credits per period = %u, size = %u\n" + " Traffic classes: period = %u, credits per period = [%u, %u, %u, %u]\n" + " Traffic class 3 oversubscription: weight = %hhu\n" + " WRR cost: [%hhu, %hhu, %hhu, %hhu], [%hhu, %hhu, %hhu, %hhu], [%hhu, %hhu, %hhu, %hhu], [%hhu, %hhu, %hhu, %hhu]\n", i,/* Token bucket */
@@ -716,9 +716,9 @@ rte_sched_port_log_subport_config(struct rte_sched_port *port, uint32_t i)struct rte_sched_subport *s = port->subport + i; RTE_LOG(INFO, SCHED, "Low level config for subport %u:\n" - "\tToken bucket: period = %u, credits per period = %u, size = %u\n" - "\tTraffic classes: period = %u, credits per period = [%u, %u, %u, %u]\n" - "\tTraffic class 3 oversubscription: wm min = %u, wm max = %u\n", + " Token bucket: period = %u, credits per period = %u, size = %u\n" + " Traffic classes: period = %u, credits per period = [%u, %u, %u, %u]\n" + " Traffic class 3 oversubscription: wm min = %u, wm max = %u\n", i,/* Token bucket */
Signature · 1 line
2.1.4
PATCH 6/6 rte_sched: use correct log level
In reply to a message not in the archiveThe setup messages should be at DEBUG level since they are not important for normal operation of system. The messages about problems should be at NOTICE or ERR level.
--- lib/librte_sched/rte_sched.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
lib/librte_sched/rte_sched.c +9 -6
@@ -448,7 +448,8 @@ rte_sched_port_get_memory_footprint(struct rte_sched_port_params *params) status =rte_sched_port_check_params (params);if (status !=0 ) { -RTE_LOG (INFO ,SCHED ,"Port scheduler params check failed (%d)\n" , status); +RTE_LOG (NOTICE ,SCHED , +"Port scheduler params check failed (%d)\n" , status);return 0 ; }
@@ -494,7 +495,7 @@ rte_sched_port_log_pipe_profile(struct rte_sched_port *port, uint32_t i) {struct rte_sched_pipe_profile *p = port->pipe_profiles + i; -RTE_LOG (INFO ,SCHED ,"Low level config for pipe profile %u:\n" +RTE_LOG (DEBUG ,SCHED ,"Low level config for pipe profile %u:\n" " Token bucket: period = %u, credits per period = %u, size = %u\n" " Traffic classes: period = %u, credits per period = [%u, %u, %u, %u]\n" " Traffic class 3 oversubscription: weight = %hhu\n"
@@ -688,7 +689,7 @@ rte_sched_port_config(struct rte_sched_port_params *params) bmp_mem_size =rte_bitmap_get_memory_footprint (n_queues_per_port); port->bmp =rte_bitmap_init (n_queues_per_port, port->bmp_array, bmp_mem_size);if (port->bmp ==NULL ) { -RTE_LOG (INFO ,SCHED ,"Bitmap init error\n" ); +RTE_LOG (ERR ,SCHED ,"Bitmap init error\n" );return NULL ; }for (i =0 ; i <RTE_SCHED_PORT_N_GRINDERS ; i ++) {
@@ -715,7 +716,7 @@ rte_sched_port_log_subport_config(struct rte_sched_port *port, uint32_t i) {struct rte_sched_subport *s = port->subport + i; - RTE_LOG(INFO, SCHED, "Low level config for subport %u:\n" + RTE_LOG(DEBUG, SCHED, "Low level config for subport %u:\n" " Token bucket: period = %u, credits per period = %u, size = %u\n" " Traffic classes: period = %u, credits per period = [%u, %u, %u, %u]\n" " Traffic class 3 oversubscription: wm min = %u, wm max = %u\n",
@@ -857,7 +858,8 @@ rte_sched_pipe_config(struct rte_sched_port *port, s->tc_ov = s->tc_ov_rate > subport_tc3_rate;if (s->tc_ov != tc3_ov) { -RTE_LOG (INFO ,SCHED ,"Subport %u TC3 oversubscription is OFF (%.4lf >= %.4lf)\n" , +RTE_LOG (DEBUG ,SCHED , +"Subport %u TC3 oversubscription is OFF (%.4lf >= %.4lf)\n" , subport_id, subport_tc3_rate, s->tc_ov_rate); }#endif
@@ -896,7 +898,8 @@ rte_sched_pipe_config(struct rte_sched_port *port, s->tc_ov = s->tc_ov_rate > subport_tc3_rate;if (s->tc_ov != tc3_ov) { -RTE_LOG (INFO ,SCHED ,"Subport %u TC3 oversubscription is ON (%.4lf < %.4lf)\n" , +RTE_LOG (DEBUG ,SCHED , +"Subport %u TC3 oversubscription is ON (%.4lf < %.4lf)\n" , subport_id, subport_tc3_rate, s->tc_ov_rate); } p->tc_ov_period_id = s->tc_ov_period_id;
Signature · 1 line
2.1.4
Quoted 28 lines
-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, April 29, 2015 6:05 PM
To: Dumitrescu, Cristian
Cc: [email protected]; Stephen Hemminger
Subject: [PATCH 0/6]rte_sched: patches against 2.oThis is a subset of earlier patches for QoS (
rte_sched) subsystem. Only changes were to fix whitespace and update against DPDK 2.0Stephen Hemminger (6):
rte_sched: make RED optional at runtime
rte_sched: expand scheduler hierarchy for more VLAN's
rte_sched: keep track of RED drops
rte_sched: allow reading without clearing
rte_sched: don't put tabs in log messages
rte_sched: use correct log levelapp/test/test_sched.c | 4 +- examples/qos_sched/stats.c | 16 ++++-- lib/librte_mbuf/rte_mbuf.h | 5 +- lib/librte_sched/rte_sched.c | 113 ++++++++++++++++++++++++++++------ --------- lib/librte_sched/rte_sched.h | 62 +++++++++++++++--------- 5 files changed, 130 insertions(+), 70 deletions(-)
Quoted 2 lines
--
2.1.4
Acked by: Cristian Dumitrescu <[email protected]>
Re: [PATCH 2/6] rte_sched: expand scheduler hierarchy for more VLAN's
In reply to Stephen Hemminger2015-04-29 10:04, Stephen Hemminger:
lib/librte_mbuf/rte_mbuf.h struct rte_mbuf { · line 291
Quoted 11 lines
lib/librte_mbuf/rte_mbuf.h +4
-1@@ -285,7 +285,10 @@ struct rte_mbuf {/**< First 4 flexible bytes or FD ID, dependent on PKT_RX_FDIR_* flag in ol_flags. */ } fdir;/**< Filter identifier if FDIR enabled */ -uint32_t sched;/**< Hierarchical scheduler */ +struct { +uint32_t lo; +uint32_t hi; + } sched;/**< Hierarchical scheduler */
Please don't use tabs to align a comment.
Re: [PATCH 4/6] rte_sched: allow reading without clearing
In reply to Stephen Hemminger2015-04-29 10:04, Stephen Hemminger:
Quoted 9 lines
The
rte_schedstatistics API should allow reading statistics without clearing. Make auto-clear optional.Signed-off-by Stephen Hemminger <[email protected]>--- 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 ‘subport_stat’:examples/qos_sched/stats.c:263:9: error: too few arguments to function ‘rte_sched_subport_read_stats’
rte_sched_subport_read_stats(port, subport_id, &stats, tc_ov);
^
examples/qos_sched/stats.c: In function ‘pipe_stat’:
examples/qos_sched/stats.c:309:25: error: too few arguments to function ‘rte_sched_queue_read_stats’
rte_sched_queue_read_stats(port, queue_id + (i * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + j), &stats, &qlen);
^[...]
Quoted 33 lines
lib/librte_sched/rte_sched.h +7
-4@@ -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 oversubscription 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, -uint32_t subport_id, -struct rte_sched_subport_stats *stats, -uint32_t *tc_ov); +rte_sched_subport_read_stats (struct rte_sched_port *port,uint32_t subport_id, +struct rte_sched_subport_stats *stats, +uint32_t *tc_ov,int clear);/** * Hierarchical scheduler queue statistics read @@ -329,14 +330,15 @@ rte_sched_subport_read_stats(struct rte_sched_port *port,* counters should be stored * @param qlen * Pointer to pre-allocated variable where the current queue length should be stored. +* @parm clear +* Reset statistics after read * @return * 0 upon success, error code otherwise */ int
lib/librte_sched/rte_sched.h rte_sched_subport_read_stats(struct rte_sched_port *port, · line 344
Quoted 10 lines
lib/librte_sched/rte_sched.h +3
-4-rte_sched_queue_read_stats(struct rte_sched_port *port, - uint32_t queue_id, - struct rte_sched_queue_stats *stats, - uint16_t *qlen); +rte_sched_queue_read_stats(struct rte_sched_port *port, uint32_t queue_id, + struct rte_sched_queue_stats *stats, + uint16_t *qlen, int clear);/* * Run-time
What about ABI versioning? compatibility?