X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fqos_sched%2Fmain.h;h=1f991c7b71834c586bbe06a260f0afa8bc2ee531;hb=dffbaf7880a8d753a4971971256d6c8b90e7ece1;hp=243064c51d96b0175bd67daeb4d23ebd2dae40e1;hpb=de3cfa2c9823a7e0391d4f4a355e2d78b83eec62;p=dpdk.git diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h index 243064c51d..1f991c7b71 100755 --- a/examples/qos_sched/main.h +++ b/examples/qos_sched/main.h @@ -4,32 +4,31 @@ * Copyright(c) 2010-2013 Intel Corporation. All rights reserved. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions * are met: * - * * Redistributions of source code must retain the above copyright + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * */ #ifndef _MAIN_H_ @@ -52,12 +51,14 @@ extern "C" { /* * Configurable number of RX/TX ring descriptors */ +#define APP_INTERACTIVE_DEFAULT 0 + #define APP_RX_DESC_DEFAULT 128 #define APP_TX_DESC_DEFAULT 256 #define MBUF_SIZE (1528 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) #define APP_RING_SIZE (8*1024) -#define NB_MBUF (64*1024*32) +#define NB_MBUF (2*1024*1024) #define MAX_PKT_RX_BURST 64 #define PKT_ENQUEUE 64 @@ -88,6 +89,9 @@ extern "C" { #define APP_STATS_ADD(stat,val) do {(void) (val);} while (0) #endif +#define APP_QAVG_NTIMES 10 +#define APP_QAVG_PERIOD 100 + struct thread_stat { uint64_t nb_rx; @@ -157,8 +161,12 @@ struct ring_thresh uint8_t wthresh; /**< Ring writeback threshold. */ }; +extern uint8_t interactive; +extern uint32_t qavg_period; +extern uint32_t qavg_ntimes; extern uint32_t nb_pfc; extern const char *cfg_profile; +extern int mp_size; extern struct flow_conf qos_conf[]; extern int app_pipe_to_profile[MAX_SCHED_SUBPORTS][MAX_SCHED_PIPES]; @@ -173,11 +181,20 @@ int MAIN(int argc, char **argv); int app_parse_args(int argc, char **argv); int app_init(void); +void prompt(void); void app_rx_thread(struct thread_conf **qconf); void app_tx_thread(struct thread_conf **qconf); void app_worker_thread(struct thread_conf **qconf); void app_mixed_thread(struct thread_conf **qconf); +void app_stat(void); +int subport_stat(uint8_t port_id, uint32_t subport_id); +int pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q); +int qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc); +int qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc); +int qavg_subport(uint8_t port_id, uint32_t subport_id); #ifdef __cplusplus }