X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fqos_sched%2Fmain.h;h=0e6f264f3d5af7ec8dc5c61c2db353f78dc402c9;hb=ea0c20ea95fd5d71a10757e6598ac66233ea1495;hp=3d25a11850b27dccb329673df783b3c84a9b2ec7;hpb=1c1d4d7a923d4804f1926fc5264f9ecdd8977b04;p=dpdk.git diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h old mode 100755 new mode 100644 index 3d25a11850..0e6f264f3d --- a/examples/qos_sched/main.h +++ b/examples/qos_sched/main.h @@ -1,13 +1,13 @@ /*- * BSD LICENSE - * - * Copyright(c) 2010-2013 Intel Corporation. All rights reserved. + * + * Copyright(c) 2010-2014 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 * are met: - * + * * * 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 @@ -17,7 +17,7 @@ * * 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 @@ -40,21 +40,17 @@ extern "C" { #include -#ifdef RTE_EXEC_ENV_BAREMETAL -#error "Baremetal is not supported" -#else -#define MAIN main -#endif - #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1 /* * 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 MBUF_DATA_SIZE (1528 + RTE_PKTMBUF_HEADROOM) #define APP_RING_SIZE (8*1024) #define NB_MBUF (2*1024*1024) @@ -87,6 +83,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; @@ -156,6 +155,9 @@ 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; @@ -169,15 +171,23 @@ extern struct ring_thresh tx_thresh; extern struct rte_sched_port_params port_params; -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 }