Skip to contentSkip to conversation

sched: enable CMAN at runtime

PATCH Superseded Marcin Danilewicz 3 participants 5 messages Jul 8, 2022 – Aug 25, 2022 1 message not in the archive Network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20220708131431.148279-1-marcinx.danilewicz

#1 lore raw

PATCH v10 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
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
v10 removed ip_pipelin app build error from change
in tmgr.c

---
 config/rte_config.h                      |   3 -
 drivers/net/softnic/rte_eth_softnic_tm.c |  12 --
 examples/ip_pipeline/tmgr.c              |  75 +-----------
 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(+), 391 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
index 46549cb062..ae56a86394 100644
@@ -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
index 6a7766ba1c..3e4bed81e9 100644
@@ -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 -74

87 lines not on this page · raw message

examples/qos_sched/cfg_file.c +5 -44

79 lines not on this page · raw message

examples/qos_sched/cfg_file.h +0 -5
index 1a9dce9db5..0dc458aa71 100644
@@ -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
index 915311bac8..76a68f585f 100644
@@ -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
#2 lore raw

PATCH v11 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
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
v10 removed ip_pipeline app build error from change
in tmgr.c
v11 added cman_enabled flag instead
of testing cman_params.cman_mode variable

---
 config/rte_config.h                      |   3 -
 drivers/net/softnic/rte_eth_softnic_tm.c |  12 --
 examples/ip_pipeline/tmgr.c              |  75 +-----------
 examples/qos_sched/cfg_file.c            |  51 ++------
 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, 300 insertions(+), 391 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
index 46549cb062..ae56a86394 100644
@@ -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
index 6a7766ba1c..3e4bed81e9 100644
@@ -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 -74

87 lines not on this page · raw message

examples/qos_sched/cfg_file.c +7 -44

92 lines not on this page · raw message

examples/qos_sched/cfg_file.h +0 -5
index 1a9dce9db5..0dc458aa71 100644
@@ -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
index 915311bac8..76a68f585f 100644
@@ -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
Acked-by on v11 1/1
#3 lore raw
Quoted 29 lines

-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Friday, July 15, 2022 3:51 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v11] 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
v9 changes from comments
tmgr.c
cman_params set to null qos_sched/cfg_file.c

Quoted 8 lines

removed redundant cman_params to NULL assignement subport_params[].cman_params assigned only when CMAN enabled
v10 removed ip_pipeline app build error from change
in tmgr.c
v11 added cman_enabled flag instead
of testing cman_params.cman_mode variable
---

#4 lore raw

Hi Thomas,

Could you merge this change with the latest DPDK?

Thanks!

Kind Regards,
/Marcin

Quoted 47 lines

-----Original Message-----
From: Singh, Jasvinder <[email protected]>
Sent: Tuesday, July 26, 2022 3:49 PM
To: Danilewicz, MarcinX <[email protected]>; [email protected]; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: RE: [PATCH v11] sched: enable CMAN at runtime

Quoted 27 lines

-----Original Message-----
From: Danilewicz, MarcinX <[email protected]>
Sent: Friday, July 15, 2022 3:51 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Ajmera, Megha <[email protected]>
Subject: [PATCH v11] 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
v9 changes from comments
tmgr.c
cman_params set to null qos_sched/cfg_file.c

Quoted 8 lines

removed redundant cman_params to NULL assignement subport_params[].cman_params assigned only when CMAN enabled
v10 removed ip_pipeline app build error from change
in tmgr.c
v11 added cman_enabled flag instead
of testing cman_params.cman_mode variable
---