sched: enable CMAN at runtime
PATCH 1/1 sched: enable CMAN at runtime
Added changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 14 +-- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 53 ++------- lib/sched/rte_sched.h | 1 + 12 files changed, 370 insertions(+), 140 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -#undef RTE_SCHED_CMAN -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN #define WRED_SUPPORTED 1 -#else -#define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +0 -4
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +7 -7
@@ -229,13 +229,15 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,return 0 ; } -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p) {int j, k; subport_p->cman_params->cman_mode = cman_p.cman_mode; +if (subport_p->cman_params->cman_mode ==RTE_SCHED_CMAN_NONE ) +return ; +for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) {if (subport_p->cman_params->cman_mode ==RTE_SCHED_CMAN_RED ) {
@@ -261,7 +263,6 @@ void set_subport_cman_params(struct rte_sched_subport_params *subport_p, } } } -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport_params)
@@ -276,12 +277,14 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpomemset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , .red_params = { }, }; +if (cman_params.cman_mode !=RTE_SCHED_CMAN_NONE ) { + cman_params.cman_mode =RTE_SCHED_CMAN_NONE ; + } +if (rte_cfgfile_has_section (cfg,"red" )) { cman_params.cman_mode =RTE_SCHED_CMAN_RED ;
@@ -387,7 +390,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } -#endif /* RTE_SCHED_CMAN */ for (i =0 ; i <MAX_SCHED_SUBPORTS ; i++) {char sec_name[CFG_NAME_LEN ];
@@ -465,9 +467,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } } -#ifdef RTE_SCHED_CMAN set_subport_cman_params (subport_params+i, cman_params); -#endif } }
examples/qos_sched/cfg_file.h +0 -2
@@ -12,10 +12,8 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p); -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport);
examples/qos_sched/init.c +0 -4
@@ -201,7 +201,6 @@ static struct rte_sched_subport_profile_params }, }; -#ifdef RTE_SCHED_CMANstruct rte_sched_cman_params cman_params = { .cman_mode =RTE_SCHED_CMAN_RED , .red_params = {
@@ -271,7 +270,6 @@ struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ] = { {
@@ -281,9 +279,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = { .n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params), .n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES, -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ }, };
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +65 -65
133 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +12 -41
117 lines not on this page · raw message
lib/sched/rte_sched.h +1 -0
@@ -126,6 +126,7 @@ extern "C" {* information, refer RFC8033. */ enum rte_sched_cman_mode { +RTE_SCHED_CMAN_NONE ,/**< no RED|PIE cfg available */ RTE_SCHED_CMAN_RED ,/**< Random Early Detection (RED) */ RTE_SCHED_CMAN_PIE ,/**< Proportional Integral Controller Enhanced (PIE) */ };
Signature · 13 lines
2.25.1 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH v2 1/1 sched: enable CMAN at runtime
Added changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
Log: v2 change in rte_sched.h to avoid ABI breakage.
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 14 +-- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 53 ++------- lib/sched/rte_sched.h | 2 + 12 files changed, 371 insertions(+), 140 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -#undef RTE_SCHED_CMAN -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN #define WRED_SUPPORTED 1 -#else -#define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +0 -4
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +7 -7
@@ -229,13 +229,15 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,return 0 ; } -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p) {int j, k; subport_p->cman_params->cman_mode = cman_p.cman_mode; +if (subport_p->cman_params->cman_mode ==RTE_SCHED_CMAN_NONE ) +return ; +for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) {if (subport_p->cman_params->cman_mode ==RTE_SCHED_CMAN_RED ) {
@@ -261,7 +263,6 @@ void set_subport_cman_params(struct rte_sched_subport_params *subport_p, } } } -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport_params)
@@ -276,12 +277,14 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpomemset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , .red_params = { }, }; +if (cman_params.cman_mode !=RTE_SCHED_CMAN_NONE ) { + cman_params.cman_mode =RTE_SCHED_CMAN_NONE ; + } +if (rte_cfgfile_has_section (cfg,"red" )) { cman_params.cman_mode =RTE_SCHED_CMAN_RED ;
@@ -387,7 +390,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } -#endif /* RTE_SCHED_CMAN */ for (i =0 ; i <MAX_SCHED_SUBPORTS ; i++) {char sec_name[CFG_NAME_LEN ];
@@ -465,9 +467,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } } -#ifdef RTE_SCHED_CMAN set_subport_cman_params (subport_params+i, cman_params); -#endif } }
examples/qos_sched/cfg_file.h +0 -2
@@ -12,10 +12,8 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p); -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport);
examples/qos_sched/init.c +0 -4
@@ -201,7 +201,6 @@ static struct rte_sched_subport_profile_params }, }; -#ifdef RTE_SCHED_CMANstruct rte_sched_cman_params cman_params = { .cman_mode =RTE_SCHED_CMAN_RED , .red_params = {
@@ -271,7 +270,6 @@ struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ] = { {
@@ -281,9 +279,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = { .n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params), .n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES, -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ }, };
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +65 -65
133 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +12 -41
117 lines not on this page · raw message
lib/sched/rte_sched.h +2 -0
@@ -128,6 +128,8 @@ extern "C" {enum rte_sched_cman_mode {RTE_SCHED_CMAN_RED ,/**< Random Early Detection (RED) */ RTE_SCHED_CMAN_PIE ,/**< Proportional Integral Controller Enhanced (PIE) */ +/* New enum RTE_SCHED_CMAN_NONE added at the end to avoid ABI breakage */ +RTE_SCHED_CMAN_NONE ,/**< no RED|PIE cfg available */ };/*
Signature · 13 lines
2.25.1 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Quoted 47 lines
-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Thursday, May 12, 2022 2:11 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v2] sched: enable CMAN at runtimeAdded changes to enable CMAN (RED or PIE) at init from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
Log: v2 change in
rte_sched.hto avoid ABI breakage.Signed-off-by Marcin Danilewicz <[email protected]>--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 14 +-- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 53 ++------- lib/sched/rte_sched.h | 2 + 12 files changed, 371 insertions(+), 140 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfglib/sched/rte_sched.h +0
-0@@ -128,6 +128,8 @@ extern "C" {enum rte_sched_cman_mode {RTE_SCHED_CMAN_RED ,/**< Random Early Detection (RED) */ RTE_SCHED_CMAN_PIE ,/**< Proportional Integral Controller Enhanced (PIE) */
lib/sched/rte_sched.h +1
-0+/* New enum RTE_SCHED_CMAN_NONE added at the end to avoid ABI breakage */
lib/sched/rte_sched.h extern "C" { · line 133
Quoted 2 lines
lib/sched/rte_sched.h +1
-0+ RTE_SCHED_CMAN_NONE, /**< no RED|PIE cfg available */ };
Can you please explain why you need to add the new RTE_SCHED_CMAN_NONE value to this enumeration and what is the ABI breakage that you are trying to avoid?
The library expects the struct rte_sched_subport_params:: cman_params to be NULL when the CMAN is disabled, why is this not enough to detect that CMAN is disabled? I suggest to keep the current approach.
Quoted 4 lines
/*
--
2.25.1
Hi Cristian,
Quoted 9 lines
Can you please explain why you need to add the new
RTE_SCHED_CMAN_NONEvalue to this enumeration and what is the ABI breakage that you are trying to avoid?The library expects the struct
rte_sched_subport_params::cman_paramsto be NULL when the CMAN is disabled, why is this not enough to detect that CMAN is disabled? I suggest to keep the current approach.
Well, that above was just another approach. I'll have look to follow your advice, because there should be a third case when no RED or PIR config was found in files.
So I used third enum to detect this case, like here:
lib/sched/rte_sched.c rte_sched_cman_config(struct rte_sched_port *port, · line 1160
Quoted 3 lines
(quoted diff) +1
-0+ else if (params->cman_params->cman_mode ==
RTE_SCHED_CMAN_NONE)lib/sched/rte_sched.c +1
-0+return 1 ;
Also I got this advice to move RTE_SCHED_CMAN_NONE to the bottom to remove ABI warnings, because structure in header file has changed without change in map files (?) for that?
Here is some more detailed log with errors:
1 data member change:
type of 'rte_sched_cman_params* rte_sched_subport_params::cman_params' changed:
in pointed to type 'struct rte_sched_cman_params' at rte_sched.h:166:1:
type size hasn't changed
1 data member change:
type of 'rte_sched_cman_mode rte_sched_cman_params::cman_mode' changed:
type size hasn't changed
1 enumerator insertion:
'rte_sched_cman_mode::RTE_SCHED_CMAN_NONE' value '0'
2 enumerator changes:
'rte_sched_cman_mode::RTE_SCHED_CMAN_RED' from value '0' to '1' at rte_sched.h:128:1 'rte_sched_cman_mode::RTE_SCHED_CMAN_PIE' from value '1' to '2' at rte_sched.h:128:1
Error: ABI issue reported for 'abidiff --suppr devtools/libabigail.abignore --no-added-syms --headers-dir1 reference/usr/local/include --headers-dir2 install/usr/local/include reference/dump/librte_sched.dump install/dump/librte_sched.dump' ABIDIFF_ABI_CHANGE, this change requires a review (abidiff flagged this as a potential issue).
Kind Regards,
/Marcin
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
+this time to dpdk.org , to test removal of automatic footer
Hi Cristian,
< snip >
Quoted 5 lines
Quoted 5 lines
+++
b/lib/sched/rte_sched.hlib/sched/rte_sched.h +0
-0@@ -128,6 +128,8 @@ extern "C" {enum rte_sched_cman_mode {RTE_SCHED_CMAN_RED ,/**< Random Early Detection (RED) */ RTE_SCHED_CMAN_PIE ,/**< Proportional Integral Controller
< snip >
Quoted 4 lines
Can you please explain why you need to add the new
RTE_SCHED_CMAN_NONEvalue to this enumeration and what is the ABI breakage that you are trying to avoid?
well, it was third value for cases when no RED or PIE is configured from config file
Initially I have found this error:
1 data member change:
type of 'rte_sched_cman_params* rte_sched_subport_params::cman_params' changed:
in pointed to type 'struct rte_sched_cman_params' at rte_sched.h:166:1:
type size hasn't changed
1 data member change:
type of 'rte_sched_cman_mode rte_sched_cman_params::cman_mode' changed:
type size hasn't changed
1 enumerator insertion:
'rte_sched_cman_mode::RTE_SCHED_CMAN_NONE' value '0'
2 enumerator changes:
'rte_sched_cman_mode::RTE_SCHED_CMAN_RED' from value '0' to '1' at rte_sched.h:128:1 'rte_sched_cman_mode::RTE_SCHED_CMAN_PIE' from value '1' to '2' at rte_sched.h:128:1
Error: ABI issue reported for 'abidiff --suppr devtools/libabigail.abignore --no-added-syms --headers-dir1 reference/usr/local/include --headers-dir2 install/usr/local/include reference /dump/librte_sched.dump install/dump/librte_sched.dump'ABIDIFF_ABI_CHANGE, this change requires a review (abidiff flagged this as a potential issue).
Then I moved RTE_SCHED_CMAN_NONE to the end of existing enum, as advices. That removed error above.
In that moment, I needed quick fix for discussion about change for showing approach. Not final fix.
< snip >
Quoted 3 lines
The library expects the struct
rte_sched_subport_params::cman_paramsto be NULL when the CMAN is disabled, why is this not enough to detect that CMAN is disabled? I suggest to keep the current approach.
Ok, I'll try to use NULL instead.
Kind Regards,
/Marcin
Hi Marcin,
Comments inline below.
Quoted 34 lines
-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Thursday, May 12, 2022 2:11 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v2] sched: enable CMAN at runtimeAdded changes to enable CMAN (RED or PIE) at init from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
Log: v2 change in
rte_sched.hto avoid ABI breakage.Signed-off-by Marcin Danilewicz <[email protected]>--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 14 +-- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 53 ++------- lib/sched/rte_sched.h | 2 + 12 files changed, 371 insertions(+), 140 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
<snip>
Quoted 4 lines
lib/sched/rte_sched.c +0
-0
<snip>
Quoted 7 lines
lib/sched/rte_sched.c +0
-1-#ifdef RTE_SCHED_CMAN static int rte_sched_red_config(struct rte_sched_port *port, struct rte_sched_subport *s,@@ -1161,9 +1156,11 @@ rte_sched_cman_config(struct rte_sched_port *port, else if (params->cman_params->cman_mode ==
lib/sched/rte_sched.c rte_sched_cman_config(struct rte_sched_port · line 1169
Quoted 10 lines
lib/sched/rte_sched.c +3
-1RTE_SCHED_CMAN_PIE)return rte_sched_pie_config (port, s, params, n_subports); + else if (params->cman_params->cman_mode == RTE_SCHED_CMAN_NONE) + return 1; +return -EINVAL ; } -#endif
Yes, you do need to remove the #ifdef ... #endif around this function, but no, you don't need to change this function, as it is only called when params->cman_params != NULL, i.e. CMAN is enabled. As mentioned before, there is no need to add the CMAN_NONE to the enumeration, as the CMAN_NONE value is equivalent to params->cman_params being set to NULL.
Quoted 24 lines
int
rte_sched_subport_config(structrte_sched_port*port,lib/sched/rte_sched.c +5
-5@@ -1254,19 +1251,20 @@ rte_sched_subport_config(struct rte_sched_port *port, s->n_pipe_profiles = params->n_pipe_profiles; s->n_max_pipe_profiles = params->n_max_pipe_profiles; -#ifdef RTE_SCHED_CMAN + s->cman_enabled = false; +if (params->cman_params !=NULL ) { - s->cman_enabled = true; status =rte_sched_cman_config (port, s, params, n_subports);if (status) { -RTE_LOG (NOTICE ,SCHED , -"%s: CMAN configuration fails\n" , __func__); -return status; +if (status !=1 ) { + RTE_LOG(NOTICE, SCHED, + "%s: CMAN configuration
lib/sched/rte_sched.c rte_sched_subport_config(struct · line 1269
Quoted 10 lines
lib/sched/rte_sched.c +4
-3fails\n", __func__); + return status; + } + }else { + s->cman_enabled = true; } - }else { - s->cman_enabled = false; } -#endif
Same comment here: yes, remove the #ifdef ... #endif, but no need to change this code fragment, as it sets correctly the s->cman_enabled flag, which is then the only flag used by the rest of the code. Again, no need to have a CMAN_NONE in the enumeration, as the same is achieved by setting params->cman_params to NULL.
lib/sched/rte_sched.c rte_sched_port_update_queue_stats_on_drop(struct rte_sched_subport *subport, · line 1828
Quoted 13 lines
lib/sched/rte_sched.c +0
-0/* Scheduling loop detection */ s->pipe_loop =RTE_SCHED_PIPE_INVALID ;@@ -1825,14 +1823,10 @@rte_sched_port_update_queue_stats_on_drop(struct
rte_sched_subport*subport,lib/sched/rte_sched.c +0
-2qe->stats.n_pkts_dropped +=1 ; qe->stats.n_bytes_dropped += pkt_len; -#ifdef RTE_SCHED_CMAN if (subport->cman_enabled) qe->stats.n_pkts_cman_dropped += n_pkts_cman_dropped; -#endif }
Please don't forget to remove the __rte_unused attribute for the n_pkts_cman_dropped in the function parameters, right?
<snip>
Regards,
Cristian
Hi Cristian,
Please find answers inline.
<snip>
Quoted 1 line
Quoted 1 line
Log: v2 change in
rte_sched.hto avoid ABI breakage.
<snip>
Lessons learned, so I have fixed also positioning of this above.
<snip>
Quoted 5 lines
Quoted 4 lines
lib/sched/rte_sched.c index renamed from lib/sched/rte_sched.c +0
-0
ec74bee939..db14934832100644lib/sched/rte_sched.c +0
-0
<snip>
Quoted 5 lines
Same comment here: yes, remove the #ifdef ... #endif, but no need to change this code fragment, as it sets correctly the
s->cman_enabledflag, which is then the only flag used by the rest of the code. Again, no need to have aCMAN_NONEin the enumeration, as the same is achieved by settingparams->cman_paramsto NULL.
Yes, with that approach this is better.
<snip>
Quoted 8 lines
lib/sched/rte_sched.c rte_sched_port_update_queue_stats_on_drop(struct rte_sched_subport *subport, · line 1827
Quoted 4 lines
lib/sched/rte_sched.c +0
-0qe->stats.n_pkts_dropped +=1 ; qe->stats.n_bytes_dropped += pkt_len; -#ifdef RTE_SCHED_CMANif (subport->cman_enabled) qe->stats.n_pkts_cman_dropped += n_pkts_cman_dropped;-#endif }
Please don't forget to remove the
__rte_unusedattribute for then_pkts_cman_droppedin the function parameters, right?
Nice spot. Looks like this was there for some time.
Regards,
Marcin
PATCH v3 1/1 sched: enable CMAN at runtime
In reply to Marcin DanilewiczAdded changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
---
Log: v2 change in rte_sched.h to avoid ABI breakage.
v3 changes from comments
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 11 +- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 359 insertions(+), 141 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -#undef RTE_SCHED_CMAN -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN #define WRED_SUPPORTED 1 -#else -#define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +0 -4
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +4 -7
@@ -229,11 +229,14 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,return 0 ; } -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p) {int j, k; + +if (subport_p->cman_params !=NULL ) +return ; + subport_p->cman_params->cman_mode = cman_p.cman_mode;for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) {
@@ -261,7 +264,6 @@ void set_subport_cman_params(struct rte_sched_subport_params *subport_p, } } } -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport_params)
@@ -276,9 +278,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpomemset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , .red_params = { }, };
@@ -387,7 +387,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } -#endif /* RTE_SCHED_CMAN */ for (i =0 ; i <MAX_SCHED_SUBPORTS ; i++) {char sec_name[CFG_NAME_LEN ];
@@ -465,9 +464,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } } -#ifdef RTE_SCHED_CMAN set_subport_cman_params (subport_params+i, cman_params); -#endif } }
examples/qos_sched/cfg_file.h +0 -2
@@ -12,10 +12,8 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p); -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport);
examples/qos_sched/init.c +0 -4
@@ -201,7 +201,6 @@ static struct rte_sched_subport_profile_params }, }; -#ifdef RTE_SCHED_CMANstruct rte_sched_cman_params cman_params = { .cman_mode =RTE_SCHED_CMAN_RED , .red_params = {
@@ -271,7 +270,6 @@ struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ] = { {
@@ -281,9 +279,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = { .n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params), .n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES, -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ }, };
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +65 -65
133 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +5 -42
130 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 13 lines
-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Wednesday, June 8, 2022 10:42 AM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v3] sched: enable CMAN at runtimeAdded changes to enable CMAN (RED or PIE) at init from profile configuration file.
Quoted 8 lines
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
Signed-off-by Marcin Danilewicz <[email protected]>---
Log: v2 change inrte_sched.hto avoid ABI breakage.
v3 changes from comments
---
Marcin,
Your patch does not apply cleanly on top of DPDK main latest, can you please fix.
Regards,
Cristian
Hi Cristian,
Ok, let me check.
BR,
/Marcin
Quoted 38 lines
-----Original Message-----
From: Dumitrescu, Cristian <[email protected]>
Sent: Wednesday, June 8, 2022 1:59 PM
To: Danilewicz, MarcinX <[email protected]>; [email protected]; Singh, Jasvinder <[email protected]>
Cc: Ajmera, Megha <[email protected]>; Liu, Yu Y <[email protected]>
Subject: RE: [PATCH v3] sched: enable CMAN at runtimeQuoted 11 lines
-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Wednesday, June 8, 2022 10:42 AM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v3] sched: enable CMAN at runtimeAdded changes to enable CMAN (RED or PIE) at init from profile configuration file.
Quoted 8 lines
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
Signed-off-by Marcin Danilewicz <[email protected]>---
Log: v2 change inrte_sched.hto avoid ABI breakage.
v3 changes from comments
---Marcin,
Your patch does not apply cleanly on top of DPDK main latest, can you please fix.
Regards,
Cristian
PATCH v4 1/1 sched: enable CMAN at runtime
In reply to Marcin DanilewiczAdded changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
---
Log: v2 change in rte_sched.h to avoid ABI breakage.
v3 changes from comments
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 11 +- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 359 insertions(+), 141 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -#undef RTE_SCHED_CMAN -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN #define WRED_SUPPORTED 1 -#else -#define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +0 -4
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +4 -7
@@ -229,11 +229,14 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,return 0 ; } -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p) {int j, k; + +if (subport_p->cman_params !=NULL ) +return ; + subport_p->cman_params->cman_mode = cman_p.cman_mode;for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) {
@@ -261,7 +264,6 @@ void set_subport_cman_params(struct rte_sched_subport_params *subport_p, } } } -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport_params)
@@ -276,9 +278,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpomemset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , .red_params = { }, };
@@ -387,7 +387,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } -#endif /* RTE_SCHED_CMAN */ for (i =0 ; i <MAX_SCHED_SUBPORTS ; i++) {char sec_name[CFG_NAME_LEN ];
@@ -465,9 +464,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } } -#ifdef RTE_SCHED_CMAN set_subport_cman_params (subport_params+i, cman_params); -#endif } }
examples/qos_sched/cfg_file.h +0 -2
@@ -12,10 +12,8 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p); -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport);
examples/qos_sched/init.c +0 -4
@@ -201,7 +201,6 @@ static struct rte_sched_subport_profile_params }, }; -#ifdef RTE_SCHED_CMANstruct rte_sched_cman_params cman_params = { .cman_mode =RTE_SCHED_CMAN_RED , .red_params = {
@@ -271,7 +270,6 @@ struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ] = { {
@@ -281,9 +279,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = { .n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params), .n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES, -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ }, };
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +65 -65
133 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +5 -42
130 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 20 lines
-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Monday, June 13, 2022 10:09 AM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v4] sched: enable CMAN at runtimeAdded changes to enable CMAN (RED or PIE) at init from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
Signed-off-by Marcin Danilewicz <[email protected]>---
Log: v2 change inrte_sched.hto avoid ABI breakage.
v3 changes from comments
Quoted 16 lines
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 11 +- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 359 insertions(+), 141 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
Marcin,
Code changes look good to me, but still not able to cleanly apply this patch on top of DPDK latest with git am, can you please make sure this gets fixed?
Applying: sched: enable CMAN at runtime
error: patch failed: config/rte_config.h:88
error: config/rte_config.h: patch does not apply
Patch failed at 0001 sched: enable CMAN at runtime
Use 'git am --show-current-patch' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Regards,
Cristian
PATCH v5 1/1 ched: enable CMAN at runtime
In reply to Marcin DanilewiczAdded changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
---
Log: v2 change in rte_sched.h to avoid ABI breakage.
v3 changes from comments
v4 rebase to 22.07-rc1
v5 rebase to main latest
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 11 +- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 359 insertions(+), 141 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -// RTE_SCHED_CMAN is not set -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN #define WRED_SUPPORTED 1 -#else -#define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +0 -4
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +4 -7
@@ -229,11 +229,14 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,return 0 ; } -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p) {int j, k; + +if (subport_p->cman_params !=NULL ) +return ; + subport_p->cman_params->cman_mode = cman_p.cman_mode;for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) {
@@ -261,7 +264,6 @@ void set_subport_cman_params(struct rte_sched_subport_params *subport_p, } } } -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport_params)
@@ -276,9 +278,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpomemset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , .red_params = { }, };
@@ -387,7 +387,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } -#endif /* RTE_SCHED_CMAN */ for (i =0 ; i <MAX_SCHED_SUBPORTS ; i++) {char sec_name[CFG_NAME_LEN ];
@@ -465,9 +464,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } } -#ifdef RTE_SCHED_CMAN set_subport_cman_params (subport_params+i, cman_params); -#endif } }
examples/qos_sched/cfg_file.h +0 -2
@@ -12,10 +12,8 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p); -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport);
examples/qos_sched/init.c +0 -4
@@ -201,7 +201,6 @@ static struct rte_sched_subport_profile_params }, }; -#ifdef RTE_SCHED_CMANstruct rte_sched_cman_params cman_params = { .cman_mode =RTE_SCHED_CMAN_RED , .red_params = {
@@ -271,7 +270,6 @@ struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ] = { {
@@ -281,9 +279,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = { .n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params), .n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES, -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ }, };
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +65 -65
133 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +5 -42
130 lines not on this page · raw message
Signature · 1 line
2.25.1
RE: [PATCH v5] ched: enable CMAN at runtime
Quoted 10 lines
-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Monday, June 20, 2022 2:57 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v5] ched: enable CMAN at runtime
Title: ched -> sched
RE: [PATCH v5] ched: enable CMAN at runtime
<snip>
Quoted 4 lines
Quoted 2 lines
Subject: [PATCH v5] ched: enable CMAN at runtime
Title: ched -> sched
Indeed!
BR,
/Marcin
PATCH v6 1/1 sched: enable CMAN at runtime
In reply to Marcin DanilewiczAdded changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
---
Log: v2 change in rte_sched.h to avoid ABI breakage.
v3 changes from comments
v4 rebase to 22.07-rc1
v5 rebase to main latest
v6 commit message fixed
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 11 +- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 130 ++++++++++----------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 359 insertions(+), 141 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -// RTE_SCHED_CMAN is not set -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN #define WRED_SUPPORTED 1 -#else -#define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +0 -4
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +4 -7
@@ -229,11 +229,14 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,return 0 ; } -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p) {int j, k; + +if (subport_p->cman_params !=NULL ) +return ; + subport_p->cman_params->cman_mode = cman_p.cman_mode;for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) {
@@ -261,7 +264,6 @@ void set_subport_cman_params(struct rte_sched_subport_params *subport_p, } } } -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport_params)
@@ -276,9 +278,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpomemset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , .red_params = { }, };
@@ -387,7 +387,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } -#endif /* RTE_SCHED_CMAN */ for (i =0 ; i <MAX_SCHED_SUBPORTS ; i++) {char sec_name[CFG_NAME_LEN ];
@@ -465,9 +464,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } } -#ifdef RTE_SCHED_CMAN set_subport_cman_params (subport_params+i, cman_params); -#endif } }
examples/qos_sched/cfg_file.h +0 -2
@@ -12,10 +12,8 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p); -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport);
examples/qos_sched/init.c +0 -4
@@ -201,7 +201,6 @@ static struct rte_sched_subport_profile_params }, }; -#ifdef RTE_SCHED_CMANstruct rte_sched_cman_params cman_params = { .cman_mode =RTE_SCHED_CMAN_RED , .red_params = {
@@ -271,7 +270,6 @@ struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ] = { {
@@ -281,9 +279,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = { .n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params), .n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES, -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ }, };
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +65 -65
133 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +5 -42
130 lines not on this page · raw message
Signature · 1 line
2.25.1
Hi Marcin,
The code changes in the library (rte-sched.c) look good to me, but I do have some questions for the qos_sched app and the Soft NIC driver on how CMAN gets enabled/disabled.
How do we control whether congestion management (CMAN) should be disabled on enabled (WRED/PIE)? It looks to me like you are always enabling WRED by default, which is incorrect: we should have CMAN disabled by default (in init.c).
My preferred way to configure CMAN is:
a) CMAN should be disabled by default
b) If the CMAN parameters get configured in the profile.cfg, then and only then CMAN should be enabled according to the configuration.
In init.c, we can safely set the subport CMAN parameters to NULL as the built-in default when the profile.cfg is not provided, so we can safely remove the WRED params from there.
In cfg_file.c, we need to have a good way to disable/enable CMAN.
In profile.cfg, please remove the WRED lines as opposed to commenting them out.
Is this OK with you?
Also, have you tested the qos_sched app and the Soft NIC driver with all 3 configuration files?
Thanks,
Cristian
Hi Cristian,
<SNIP>
Quoted 3 lines
The code changes in the library (
rte-sched.c) look good to me, but I do have some questions for theqos_schedapp and the Soft NIC driver on how CMAN gets enabled/disabled.
That was open q from start. We finally found a time to discuss this.
Quoted 4 lines
How do we control whether congestion management (CMAN) should be disabled on enabled (WRED/PIE)? It looks to me like you are always enabling WRED by default, which is incorrect: we should have CMAN disabled by default (in
init.c).
Cannot disagree.
Quoted 4 lines
My preferred way to configure CMAN is:
a) CMAN should be disabled by default
b) If the CMAN parameters get configured in the profile.cfg, then and only then CMAN should be enabled according to the configuration.
OK
Quoted 3 lines
In
init.c, we can safely set the subport CMAN parameters to NULL as the built-in default when the profile.cfg is not provided, so we can safely remove the WRED params from there.
Agree
Quoted 1 line
In
cfg_file.c, we need to have a good way to disable/enable CMAN.
Let me provide something and then you will have a look at it.
Quoted 2 lines
In profile.cfg, please remove the WRED lines as opposed to commenting them out.
OK
Quoted 1 line
Is this OK with you?
That's perfectly fine and looks good.
Quoted 2 lines
Also, have you tested the
qos_schedapp and the Soft NIC driver with all 3 configuration files?
Obviously yes, but not the last time. And I will repeat such testing as the last thing.
Kind Regards,
/Marcin
PATCH v7 1/1 sched: enable CMAN at runtime
In reply to Marcin DanilewiczAdded changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
---
Log: v2 change in rte_sched.h to avoid ABI breakage.
v3 changes from comments
v4 rebase to 22.07-rc1
v5 rebase to main latest
v6 commit message fixed
v7 changes from comments
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 11 +- examples/qos_sched/cfg_file.h | 2 - examples/qos_sched/init.c | 4 - examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 135 +-------------------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 295 insertions(+), 210 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -// RTE_SCHED_CMAN is not set -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN -#define WRED_SUPPORTED 1 -#else #define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +0 -4
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +4 -7
@@ -229,11 +229,14 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,return 0 ; } -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p) {int j, k; + +if (subport_p->cman_params !=NULL ) +return ; + subport_p->cman_params->cman_mode = cman_p.cman_mode;for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) {
@@ -261,7 +264,6 @@ void set_subport_cman_params(struct rte_sched_subport_params *subport_p, } } } -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport_params)
@@ -276,9 +278,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpomemset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , .red_params = { }, };
@@ -387,7 +387,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } -#endif /* RTE_SCHED_CMAN */ for (i =0 ; i <MAX_SCHED_SUBPORTS ; i++) {char sec_name[CFG_NAME_LEN ];
@@ -465,9 +464,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo } } } -#ifdef RTE_SCHED_CMAN set_subport_cman_params (subport_params+i, cman_params); -#endif } }
examples/qos_sched/cfg_file.h +0 -2
@@ -12,10 +12,8 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN void set_subport_cman_params (struct rte_sched_subport_params *subport_p,struct rte_sched_cman_params cman_p); -#endif int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport);
examples/qos_sched/init.c +0 -4
@@ -201,7 +201,6 @@ static struct rte_sched_subport_profile_params }, }; -#ifdef RTE_SCHED_CMANstruct rte_sched_cman_params cman_params = { .cman_mode =RTE_SCHED_CMAN_RED , .red_params = {
@@ -271,7 +270,6 @@ struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ] = { {
@@ -281,9 +279,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = { .n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params), .n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES, -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ }, };
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +1 -134
139 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +5 -42
130 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v8 1/1 sched: enable CMAN at runtime
Added changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
---
Log: v2 change in rte_sched.h to avoid ABI breakage.
v3 changes from comments
v4 rebase to 22.07-rc1
v5 rebase to main latest
v6 commit message fixed
v7 changes from comments
v8 with changes from comments
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 47 +------- examples/qos_sched/cfg_file.h | 5 - examples/qos_sched/init.c | 76 +----------- examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 135 +-------------------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 296 insertions(+), 320 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -// RTE_SCHED_CMAN is not set -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN -#define WRED_SUPPORTED 1 -#else #define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +0 -4
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +4 -43
77 lines not on this page · raw message
examples/qos_sched/cfg_file.h +0 -5
@@ -12,11 +12,6 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN -void set_subport_cman_params (struct rte_sched_subport_params *subport_p, -struct rte_sched_cman_params cman_p); -#endif -int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport); int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +1 -75
88 lines not on this page · raw message
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +1 -134
139 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +5 -42
130 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 193 lines
Added changes to enable CMAN (RED or PIE) at init from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
Signed-off-by Marcin Danilewicz <[email protected]>---
Log: v2 change inrte_sched.hto avoid ABI breakage.
v3 changes from comments
v4 rebase to 22.07-rc1
v5 rebase to main latest
v6 commit message fixed
v7 changes from comments
v8 with changes from comments--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 47 +------- examples/qos_sched/cfg_file.h | 5 - examples/qos_sched/init.c | 76 +----------- examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 135 +-------------------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 296 insertions(+), 320 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfgconfig/rte_config.h index renamed from config/rte_config.h +0
-0
46549cb062..ae56a86394100644config/rte_config.h +0
-3@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -// RTE_SCHED_CMAN is not set -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1drivers/net/softnic/rte_eth_softnic_tm.c +0
-6@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN -#define WRED_SUPPORTED 1 -#else #define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) { @@ -2325,12 +2319,6 @@
wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)drivers/net/softnic/rte_eth_softnic_tm.c +0
-6} } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {examples/ip_pipeline/tmgr.c index renamed from examples/ip_pipeline/tmgr.c +0
-0
b138e885cf..e68e9961be100644examples/ip_pipeline/tmgr.c +0
-0@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles; static struct
rte_sched_pipe_paramsexamples/ip_pipeline/tmgr.c +1
-1pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = { /* Traffic Class 0 Colors Green / Yellow / Red */ @@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2= 9},
examples/ip_pipeline/tmgr.c +0
-1}, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef
RTE_SCHED_CMANexamples/ip_pipeline/tmgr.c +0
-1.cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ }; static struct tmgr_port_list tmgr_port_list; diff --git
a/examples/qos_sched/cfg_file.cb/examples/qos_sched/cfg_file.cindex450482f07d..7f4114bd56100644examples/qos_sched/cfg_file.c +2
-0@@ -23,6 +23,8 @@uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE ];uint32_t n_active_queues; +struct rte_sched_cman_params cman_params; +int cfg_load_port (struct rte_cfgfile *cfg,struct rte_sched_port_params *port_params) { @@ -229,40 +231,6 @@ cfg_load_subport_profile(struct
rte_cfgfile*cfg,examples/qos_sched/cfg_file.c +0
-3return 0 ; } -#ifdef RTE_SCHED_CMAN -void set_subport_cman_params (struct rte_sched_subport_params *subport_p, - struct rte_sched_cman_params
cman_p)examples/qos_sched/cfg_file.c +0
-9-{ -int j, k; - subport_p->cman_params->cman_mode = cman_p.cman_mode; - -for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) { -if (subport_p->cman_params->cman_mode == -RTE_SCHED_CMAN_RED ) { -for (k =0 ; k <RTE_COLORS ; k++) { - subport_p->cman_params-Quoted 1 line
red_params[j][k].min_th =
examples/qos_sched/cfg_file.c +0
-2- cman_p.red_params[j][k].min_th; - subport_p->cman_params-Quoted 1 line
red_params[j][k].max_th =
examples/qos_sched/cfg_file.c +0
-2- cman_p.red_params[j][k].max_th; - subport_p->cman_params-Quoted 1 line
red_params[j][k].maxp_inv =
examples/qos_sched/cfg_file.c +0
-2- cman_p.red_params[j][k].maxp_inv; - subport_p->cman_params-Quoted 1 line
red_params[j][k].wq_log2 =
examples/qos_sched/cfg_file.c +0
-6- cman_p.red_params[j][k].wq_log2; - } - }else { - subport_p->cman_params->pie_params[j].qdelay_ref = - cman_p.pie_params[j].qdelay_ref; - subport_p->cman_params-Quoted 1 line
pie_params[j].dp_update_interval =
examples/qos_sched/cfg_file.c +0
-10- cman_p.pie_params[j].dp_update_interval; - subport_p->cman_params->pie_params[j].max_burst = - cman_p.pie_params[j].max_burst; - subport_p->cman_params->pie_params[j].tailq_th = - cman_p.pie_params[j].tailq_th; - } - } -} -#endif -int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params
*subport_params) { @@ -276,11 +244,7 @@ cfg_load_subport(structrte_cfgfile*cfg, structrte_sched_subport_params*subpoexamples/qos_sched/cfg_file.c +1
-5memset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN -struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , - .red_params = { }, - }; + subport_params->cman_params =NULL ;if (rte_cfgfile_has_section (cfg,"red" )) { cman_params.cman_mode = RTE_SCHED_CMAN_RED; @@ -387,7 +351,6 @@ cfg_load_subport(struct
rte_cfgfile*cfg, structrte_sched_subport_params*subpo
examples/qos_sched/cfg_file.c
Quoted 2 lines
examples/qos_sched/cfg_file.c +0
-0} }
Here only mode is set to RTE_SCHED_CMAN_RED. But I could not find the place where cman_params are set from cfg_file (for e.g. red_params). Can you clarify?
<snip>
Quoted 3 lines
Here only mode is set to
RTE_SCHED_CMAN_RED. But I could not find the place wherecman_paramsare set fromcfg_file(for e.g.red_params). Can you clarify?
Look beyond that particular change. All this is joined work. I am adding final touch to what I've started, he continued and now we all are close to push changes.
Take a look here at that particular file history:06135957c4b (Wojciech Liguzinski 2021-11-04 11:03:34 +0000 353)06135957c4b (Wojciech Liguzinski 2021-11-04 11:03:34 +0000 354) if (rte_cfgfile_has_section(cfg, "pie")) {06135957c4b (Wojciech Liguzinski 2021-11-04 11:03:34 +0000 355) cman_params.cman_mode = RTE_SCHED_CMAN_PIE;06135957c4b (Wojciech Liguzinski 2021-11-04 11:03:34 +0000 356)06135957c4b (Wojciech Liguzinski 2021-11-04 11:03:34 +0000 357) for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {06135957c4b (Wojciech Liguzinski 2021-11-04 11:03:34 +0000 358) char str[32];
Hope that helps 😊
Quoted 17 lines
-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Tuesday, July 5, 2022 6:06 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v8] sched: enable CMAN at runtimeAdded changes to enable CMAN (RED or PIE) at init from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
Signed-off-by Marcin Danilewicz <[email protected]>
Quoted 8 lines
---
Log: v2 change inrte_sched.hto avoid ABI breakage.
v3 changes from comments
v4 rebase to 22.07-rc1
v5 rebase to main latest
v6 commit message fixed
v7 changes from comments
v8 with changes from comments
You need to explicitly mention the changes done in each version to help reviewer easily locate the changes.
Quoted 95 lines
config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 4 - examples/qos_sched/cfg_file.c | 47 +------- examples/qos_sched/cfg_file.h | 5 - examples/qos_sched/init.c | 76 +----------- examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 135 +-------------------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 296 insertions(+), 320 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfgconfig/rte_config.h index renamed from config/rte_config.h +0
-0
46549cb062..ae56a86394100644config/rte_config.h +0
-3@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -// RTE_SCHED_CMAN is not set -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1drivers/net/softnic/rte_eth_softnic_tm.c +0
-6@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN -#define WRED_SUPPORTED 1 -#else #define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) { @@ -2325,12 +2319,6 @@
wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id)drivers/net/softnic/rte_eth_softnic_tm.c +0
-6} } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper * tm_tc_shared_shaper_get(struct rte_eth_dev *dev, struct tm_node
*tc_node) { diff --gita/examples/ip_pipeline/tmgr.cb/examples/ip_pipeline/tmgr.cindexb138e885cf..e68e9961be100644examples/ip_pipeline/tmgr.c +0
-0@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles; static struct
rte_sched_pipe_paramsexamples/ip_pipeline/tmgr.c +1
-1pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = { /* Traffic Class 0 Colors Green / Yellow / Red */ @@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12 ][2 ] = {.min_th =32 , .max_th =64 , .maxp_inv =10 ,.wq_log2 = 9},
examples/ip_pipeline/tmgr.c +0
-1}, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef
RTE_SCHED_CMAN
examples/ip_pipeline/tmgr.c static const struct rte_sched_subport_params subport_params_default = { · line 98
Quoted 3 lines
examples/ip_pipeline/tmgr.c +0
-1.cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };
Similar to what is discussed for qos_sched sample app, set cman_params to NULL and remove default parameters for "static struct rte_sched_cman_params cman_params" above.
Quoted 65 lines
static struct
tmgr_port_listtmgr_port_list; diff --gita/examples/qos_sched/cfg_file.cb/examples/qos_sched/cfg_file.cindex450482f07d..7f4114bd56100644examples/qos_sched/cfg_file.c +2
-0@@ -23,6 +23,8 @@uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE ];uint32_t n_active_queues; +struct rte_sched_cman_params cman_params; +int cfg_load_port (struct rte_cfgfile *cfg,struct rte_sched_port_params *port_params) { @@ -229,40 +231,6 @@ cfg_load_subport_profile(struct
rte_cfgfile*cfg,examples/qos_sched/cfg_file.c +0
-2return 0 ; } -#ifdef RTE_SCHED_CMAN -void set_subport_cman_params(struct rte_sched_subport_params
*subport_p,examples/qos_sched/cfg_file.c +0
-1-struct rte_sched_cman_params
cman_p)examples/qos_sched/cfg_file.c +0
-9-{ -int j, k; - subport_p->cman_params->cman_mode = cman_p.cman_mode; - -for (j =0 ; j <RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ; j++) { -if (subport_p->cman_params->cman_mode == -RTE_SCHED_CMAN_RED ) { -for (k =0 ; k <RTE_COLORS ; k++) { - subport_p->cman_params-Quoted 1 line
red_params[j][k].min_th =
examples/qos_sched/cfg_file.c +0
-2- cman_p.red_params[j][k].min_th; - subport_p->cman_params-Quoted 1 line
red_params[j][k].max_th =
examples/qos_sched/cfg_file.c +0
-2- cman_p.red_params[j][k].max_th; - subport_p->cman_params-Quoted 1 line
red_params[j][k].maxp_inv =
examples/qos_sched/cfg_file.c +0
-2- cman_p.red_params[j][k].maxp_inv; - subport_p->cman_params-Quoted 1 line
red_params[j][k].wq_log2 =
examples/qos_sched/cfg_file.c +0
-4- cman_p.red_params[j][k].wq_log2; - } - }else { - subport_p->cman_params-Quoted 1 line
pie_params[j].qdelay_ref =
examples/qos_sched/cfg_file.c +0
-2- cman_p.pie_params[j].qdelay_ref; - subport_p->cman_params-Quoted 1 line
pie_params[j].dp_update_interval =
examples/qos_sched/cfg_file.c +0
-2- cman_p.pie_params[j].dp_update_interval; - subport_p->cman_params-Quoted 1 line
pie_params[j].max_burst =
examples/qos_sched/cfg_file.c +0
-8- cman_p.pie_params[j].max_burst; - subport_p->cman_params->pie_params[j].tailq_th = - cman_p.pie_params[j].tailq_th; - } - } -} -#endif -int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params
*subport_params) { @@ -276,11 +244,7 @@ cfg_load_subport(structrte_cfgfile*cfg, structrte_sched_subport_params*subpo
examples/qos_sched/cfg_file.c cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo · line 247
Quoted 9 lines
examples/qos_sched/cfg_file.c +1
-5memset (active_queues,0 ,sizeof (active_queues)); n_active_queues =0 ; -#ifdef RTE_SCHED_CMAN -struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , - .red_params = { }, - }; + subport_params->cman_params =NULL ;
No need to set subport_params->cman_params again to null as it is already set to NULL in init.c.
Quoted 19 lines
examples/qos_sched/cfg_file.c +0
-0if (rte_cfgfile_has_section (cfg,"red" )) { cman_params.cman_mode = RTE_SCHED_CMAN_RED; @@ -387,7 +351,6 @@ cfg_load_subport(struct
rte_cfgfile*cfg, structrte_sched_subport_params*subpoexamples/qos_sched/cfg_file.c +0
-1} } -#endif /* RTE_SCHED_CMAN */ for (i =0 ; i <MAX_SCHED_SUBPORTS ; i++) {char sec_name[CFG_NAME_LEN ];@@ -465,9 +428,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct
rte_sched_subport_params*subpoexamples/qos_sched/cfg_file.c +0
-2} } } -#ifdef RTE_SCHED_CMAN - set_subport_cman_params(subport_params+i,
cman_params);
examples/qos_sched/cfg_file.c cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo · line 431
Quoted 2 lines
examples/qos_sched/cfg_file.c +1
-1-#endif + subport_params[i].cman_params = &cman_params;
Since cman_params_is global variable, memory is allocated regardless of whether cman mechanism is enabled or disabled. So subport_params->cman_params will never point to NULL even when red/pie is disabled. Define local flag "cman_enabled" and set his flag if red or pie is enabled and check this flag to set subport_params[i].cman_params to cman_params.
<snip>
Quoted 11 lines
Quoted 9 lines
Signed-off-by Marcin Danilewicz <[email protected]>---
Log: v2 change inrte_sched.hto avoid ABI breakage.
v3 changes from comments
v4 rebase to 22.07-rc1
v5 rebase to main latest
v6 commit message fixed
v7 changes from comments
v8 with changes from comments
Quoted 2 lines
You need to explicitly mention the changes done in each version to help reviewer easily locate the changes.
Yes, yes. I am going to provide more detailed changes and explaining history on what changes was made. This split development over time is the best example to show that need.
<snip>
Quoted 6 lines
examples/ip_pipeline/tmgr.c static const struct rte_sched_subport_params · line 97
Quoted 5 lines
examples/ip_pipeline/tmgr.c +0
-0@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef
RTE_SCHED_CMAN
Quoted 8 lines
examples/ip_pipeline/tmgr.c static const struct rte_sched_subport_params subport_params_default = { · line 98
Quoted 3 lines
examples/ip_pipeline/tmgr.c +0
-1.cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ };Similar to what is discussed for
qos_schedsample app, setcman_paramsto NULL and remove default parameters for "static structrte_sched_cman_paramscman_params" above.
Sure, that will be done.
Quoted 9 lines
examples/qos_sched/cfg_file.c cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo · line 247
Quoted 6 lines
examples/qos_sched/cfg_file.c +1
-5-#ifdef RTE_SCHED_CMAN -struct rte_sched_cman_params cman_params = { - .cman_mode =RTE_SCHED_CMAN_RED , - .red_params = { }, - }; + subport_params->cman_params =NULL ;No need to set
subport_params->cman_paramsagain to null as it is already set to NULL ininit.c.
Sure, app_load_cfg_profile -> cfg_load_subport is also not called several times, just once
<snip>
Quoted 9 lines
examples/qos_sched/cfg_file.c cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo · line 431
Quoted 6 lines
drivers/net/softnic/rte_eth_softnic_tm.c +0
-2} -#ifdef RTE_SCHED_CMAN - set_subport_cman_params(subport_params+i,
cman_params);examples/qos_sched/cfg_file.c +1
-1-#endif + subport_params[i].cman_params = &cman_params;Since
cman_params_isglobal variable, memory is allocated regardless of whether cman mechanism is enabled or disabled. So subport_params-
Quoted 3 lines
Quoted 1 line
cman_paramswill never point to NULL even when red/pie is disabled.Define local flag "
cman_enabled" and set his flag if red or pie is enabled and check this flag to set subport_params[i].cman_params tocman_params.
Ah .. nice spot. But, cant we do that with additional check, using what we have? For an instance:
If (cman_params.cman_mode == RTE_SCHED_CMAN_PIE || cman_params.cman_mode == RTE_SCHED_CMAN_RED) { Then set subport_params[i].cman_params to cman_params.
}
BR,
/Marcin
<snip>
Quoted 11 lines
Quoted 11 lines
examples/qos_sched/cfg_file.c cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo · line 431
Quoted 5 lines
(quoted diff) +0
-2-#ifdef RTE_SCHED_CMAN - set_subport_cman_params(subport_params+i,
cman_params);examples/qos_sched/cfg_file.c +1
-1-#endif + subport_params[i].cman_params = &cman_params;Since
cman_params_isglobal variable, memory is allocated regardless of whether cman mechanism is enabled or disabled. So subport_params-Quoted 1 line
cman_paramswill never point to NULL even when red/pie is disabled.Define local flag "
cman_enabled" and set his flag if red or pie is enabled and check this flag to set subport_params[i].cman_params to
Quoted 8 lines
cman_params.
Ah .. nice spot. But, cant we do that with additional check, using what we have?
For an instance:
If (cman_params.cman_mode ==RTE_SCHED_CMAN_PIE|| cman_params.cman_mode ==RTE_SCHED_CMAN_RED) { Then set subport_params[i].cman_params tocman_params.
}
Yes, this is correct as well.
<snip>
Quoted 7 lines
Quoted 5 lines
For an instance:
If (cman_params.cman_mode ==RTE_SCHED_CMAN_PIE|| cman_params.cman_mode ==RTE_SCHED_CMAN_RED) { Then set subport_params[i].cman_params tocman_params. }Yes, this is correct as well.
I'm happy to hear that.
PATCH v9 1/1 sched: enable CMAN at runtime
In reply to Marcin DanilewiczAdded changes to enable CMAN (RED or PIE) at init
from profile configuration file.
By default CMAN code is enable but not in use, when there is no RED or PIE profile configured.
---
Log: v2 change in rte_sched.h to avoid ABI breakage.
v3 changes from comments
v4 rebase to 22.07-rc1
v5 rebase to main latest
v6 commit message fixed
v7 changes from comments
v8 with changes from comments
v9 changes from comments
tmgr.c
cman_params set to null qos_sched/cfg_file.c
removed redundant cman_params to NULL assignement subport_params[].cman_params assigned only when CMAN enabled
--- config/rte_config.h | 3 - drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- examples/ip_pipeline/tmgr.c | 6 +- examples/qos_sched/cfg_file.c | 49 +------- examples/qos_sched/cfg_file.h | 5 - examples/qos_sched/init.c | 76 +----------- examples/qos_sched/main.h | 2 - examples/qos_sched/profile.cfg | 135 +-------------------- examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ lib/sched/rte_sched.c | 47 +------- 11 files changed, 298 insertions(+), 322 deletions(-) create mode 100644 examples/qos_sched/profile_pie.cfg create mode 100644 examples/qos_sched/profile_red.cfg
config/rte_config.h +0 -3
@@ -88,9 +88,6 @@/* rte_power defines */ #define RTE_MAX_LCORE_FREQS 64 -/* rte_sched defines */ -// RTE_SCHED_CMAN is not set -/* rte_graph defines */ #define RTE_GRAPH_BURST_SIZE 256#define RTE_LIBRTE_GRAPH_STATS 1
drivers/net/softnic/rte_eth_softnic_tm.c +0 -12
@@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev,return 0 ; } -#ifdef RTE_SCHED_CMAN -#define WRED_SUPPORTED 1 -#else #define WRED_SUPPORTED 0 -#endif #define STATS_MASK_DEFAULT \ (RTE_TM_STATS_N_PKTS | \
@@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, uint32_t tc_id)return NULL ; } -#ifdef RTE_SCHED_CMAN -static void wred_profiles_set (struct rte_eth_dev *dev,uint32_t subport_id) {
@@ -2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) } } -#else - -#define wred_profiles_set (dev, subport_id) - -#endif -static struct tm_shared_shaper *tm_tc_shared_shaper_get (struct rte_eth_dev *dev,struct tm_node *tc_node) {
examples/ip_pipeline/tmgr.c +1 -5
@@ -17,7 +17,6 @@ static uint32_t n_subport_profiles;static struct rte_sched_pipe_params pipe_profile[TMGR_PIPE_PROFILE_MAX ]; -#ifdef RTE_SCHED_CMANstatic struct rte_sched_cman_params cman_params = { .red_params = {/* Traffic Class 0 Colors Green / Yellow / Red */
@@ -86,7 +85,6 @@ static struct rte_sched_cman_params cman_params = { [12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}, }, }; -#endif /* RTE_SCHED_CMAN */ static uint32_t n_pipe_profiles;
@@ -96,9 +94,7 @@ static const struct rte_sched_subport_params subport_params_default = { .pipe_profiles = pipe_profile, .n_pipe_profiles = 0, /* filled at run time */ .n_max_pipe_profiles = RTE_DIM(pipe_profile), -#ifdef RTE_SCHED_CMAN - .cman_params = &cman_params, -#endif /* RTE_SCHED_CMAN */ + .cman_params = NULL, };static struct tmgr_port_list tmgr_port_list;
examples/qos_sched/cfg_file.c +5 -44
79 lines not on this page · raw message
examples/qos_sched/cfg_file.h +0 -5
@@ -12,11 +12,6 @@ int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);int cfg_load_pipe (struct rte_cfgfile *cfg,struct rte_sched_pipe_params *pipe); -#ifdef RTE_SCHED_CMAN -void set_subport_cman_params (struct rte_sched_subport_params *subport_p, -struct rte_sched_cman_params cman_p); -#endif -int cfg_load_subport (struct rte_cfgfile *cfg,struct rte_sched_subport_params *subport); int cfg_load_subport_profile(struct rte_cfgfile *cfg,
examples/qos_sched/init.c +1 -75
88 lines not on this page · raw message
examples/qos_sched/main.h +0 -2
@@ -153,9 +153,7 @@ extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];extern uint32_t n_active_queues;extern struct rte_sched_port_params port_params; -#ifdef RTE_SCHED_CMAN extern struct rte_sched_cman_params cman_params; -#endif extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS ];int app_parse_args (int argc,char **argv);
examples/qos_sched/profile.cfg +1 -134
139 lines not on this page · raw message
examples/qos_sched/profile_pie.cfg new file +142 -0
142 lines not on this page · raw message
examples/qos_sched/profile_red.cfg new file +143 -0
143 lines not on this page · raw message
lib/sched/rte_sched.c +5 -42
130 lines not on this page · raw message
Signature · 1 line
2.25.1