aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/Constants.py5
-rw-r--r--resources/libraries/python/TrafficGenerator.py18
2 files changed, 23 insertions, 0 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py
index c21c5b8cc5..8937e6cfc0 100644
--- a/resources/libraries/python/Constants.py
+++ b/resources/libraries/python/Constants.py
@@ -197,6 +197,11 @@ class Constants:
# TRex number of cores
TREX_CORE_COUNT = get_int_from_env(u"TREX_CORE_COUNT", 8)
+ # TRex set number of RX/TX descriptors
+ # Set to 0 to use default values
+ TREX_TX_DESCRIPTORS_COUNT = get_int_from_env(u"TREX_TX_DESCRIPTORS_COUNT", 0)
+ TREX_RX_DESCRIPTORS_COUNT = get_int_from_env(u"TREX_RX_DESCRIPTORS_COUNT", 0)
+
# Trex force start regardless ports state
TREX_SEND_FORCE = get_pessimistic_bool_from_env(u"TREX_SEND_FORCE")
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index 9a9519e248..c0d1b4ec63 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -343,6 +343,24 @@ class TrafficGenerator(AbstractMeasurer):
f"EOF'",
sudo=True, message=u"T-Rex config generation!"
)
+
+ if Constants.TREX_RX_DESCRIPTORS_COUNT != 0:
+ exec_cmd_no_error(
+ self._node,
+ f"sh -c 'cat << EOF >> /etc/trex_cfg.yaml\n"
+ f" rx_desc: {Constants.TREX_RX_DESCRIPTORS_COUNT}\n"
+ f"EOF'",
+ sudo=True, message=u"T-Rex rx_desc modification!"
+ )
+
+ if Constants.TREX_TX_DESCRIPTORS_COUNT != 0:
+ exec_cmd_no_error(
+ self._node,
+ f"sh -c 'cat << EOF >> /etc/trex_cfg.yaml\n"
+ f" tx_desc: {Constants.TREX_TX_DESCRIPTORS_COUNT}\n"
+ f"EOF'",
+ sudo=True, message=u"T-Rex tx_desc modification!"
+ )
else:
raise ValueError(u"Unknown OSI layer!")