Skip to content

Commit e6a20f7

Browse files
committed
ft-orchestration enable rss-queues setting for more input types for cento, nprobe and yaf
1 parent 3992980 commit e6a20f7

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

tools/ft-orchestration/src/probe/cento.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,20 +202,13 @@ def _switch_to_zc(self, interface_name: str):
202202
return
203203

204204
driver = driver.split(" ")[1].strip()
205-
if driver.endswith("_zc"):
206-
driver = driver[:-3]
205+
if not driver.endswith("_zc"):
207206
Tool(
208207
f"pf_ringcfg --configure-driver {driver} --rss-queues 0",
209208
executor=self._executor,
210209
sudo=self._sudo,
211210
).run()
212211
time.sleep(5)
213-
Tool(
214-
f"pf_ringcfg --configure-driver {driver} --rss-queues {self._settings.rss_queues}",
215-
executor=self._executor,
216-
sudo=self._sudo,
217-
).run()
218-
time.sleep(5)
219212

220213
def _switch_back_zc(self, interface_name: str):
221214
driver, _ = Tool(
@@ -234,11 +227,19 @@ def _switch_back_zc(self, interface_name: str):
234227
sudo=self._sudo,
235228
).run()
236229

230+
def _set_rss_queues(self, interface_name):
231+
Tool(
232+
f"ethtool --set-channels {interface_name} combined {self._settings.rss_queues}",
233+
executor=self._executor,
234+
sudo=self._sudo,
235+
).run()
236+
237237
def _before_start(self):
238238
interface_names = {name.split("@")[0] for name in self._interfaces}
239239
for ifc in interface_names:
240240
if ifc.startswith("zc:"):
241241
self._switch_to_zc(ifc.split(":", 1)[-1])
242+
self._set_rss_queues(ifc.split(":", 1)[-1])
242243

243244
def start(self):
244245
"""Start the probe."""

tools/ft-orchestration/src/probe/nprobe.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,19 @@ def _switch_back_zc(self, interface_name: str):
237237
sudo=self._sudo,
238238
).run()
239239

240+
def _set_rss_queues(self, interface_name):
241+
Tool(
242+
f"ethtool --set-channels {interface_name} combined {self._settings.rss_queues}",
243+
executor=self._executor,
244+
sudo=self._sudo,
245+
).run()
246+
240247
def _before_start(self):
241248
interface_names = {name.split("@")[0] for name in self._interfaces}
242249
for ifc in interface_names:
243250
if ifc.startswith("zc:"):
244251
self._switch_to_zc(ifc.split(":", 1)[-1])
245-
queues, _ = Tool(
246-
f"ethtool -n {ifc.split(':', 1)[-1]} | head -n1 | cut -c1",
247-
executor=self._executor,
248-
sudo=self._sudo,
249-
).run()
250-
self._settings.rss_queues = int(queues)
252+
self._set_rss_queues(ifc.split(":", 1)[-1])
251253

252254
def start(self):
253255
"""Start the probe."""

tools/ft-orchestration/src/probe/yaf.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def set_prefilter(self, ip_ranges: list[str]) -> None:
469469
raise NotImplementedError
470470

471471

472-
class YafZC(Yaf):
472+
class YafPfring(Yaf):
473473
def __init__(
474474
self,
475475
executor: Executor,
@@ -521,10 +521,18 @@ def _duplicate_executor(self, executor: Executor, num: int = 1) -> List[Executor
521521

522522
return executors
523523

524+
def _set_rss_queues(self, interface_name):
525+
Tool(
526+
f"ethtool --set-channels {interface_name} combined {self._rss_queues}",
527+
executor=self._executor,
528+
sudo=self._sudo,
529+
).run()
530+
524531
def _before_start(self):
525532
for ifc in self._interfaces:
526533
if ifc.startswith("zc:"):
527534
self._switch_to_zc(ifc.split(":", 1)[-1])
535+
self._set_rss_queues(ifc.split(":", 1)[-1])
528536

529537
def start(self):
530538
"""Start the probe."""
@@ -590,11 +598,6 @@ def _switch_to_zc(self, interface_name: str):
590598
sudo=self._sudo,
591599
).run()
592600
time.sleep(5)
593-
Tool(
594-
f"ethtool --set-channels {interface_name} combined {self._rss_queues}",
595-
executor=self._executor,
596-
sudo=self._sudo,
597-
).run()
598601

599602
def _switch_back_zc(self, interface_name: str):
600603
driver = self._get_driver(interface_name)

0 commit comments

Comments
 (0)