Skip to content

Commit a0e824e

Browse files
author
Pavel Siska
committed
ipfixprobed: fix DPDK parser
fix queue size and workers affinity
1 parent 6b053db commit a0e824e

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

init/config2args.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ def get_cpus_for_pci_device(pci_address: str) -> list[int]:
6363
"""
6464
# Get the NUMA node
6565
numa_path = Path(f"/sys/bus/pci/devices/{pci_address}/numa_node")
66-
if not numa_path.exists():
67-
raise FileNotFoundError(f"NUMA node info for PCI address {pci_address} does not exist.")
68-
69-
numa_node = numa_path.read_text().strip()
70-
if numa_node == "-1":
71-
raise ValueError(f"Device {pci_address} is not assigned to any NUMA node.")
66+
numa_node = 0
67+
if numa_path.exists():
68+
numa_node = numa_path.read_text().strip()
69+
if numa_node == "-1":
70+
numa_node = 0
7271

7372
# Run lscpu to get CPU information
7473
result = subprocess.run(["lscpu"], capture_output=True, text=True, check=True)
@@ -138,11 +137,18 @@ def process_input_dpdk_plugin(settings):
138137
workers_cpu_list = cpu_list[:rx_queues]
139138

140139
# Main parameter for DPDK with $eal_opts
141-
primary_param = f"-i \"dpdk;p={','.join(str(i) for i in range(nic_count))};"
140+
first_cpu = workers_cpu_list[0]
141+
if first_cpu is not None:
142+
primary_param = f"-i \"dpdk@{first_cpu};p={','.join(str(i) for i in range(nic_count))};"
143+
else:
144+
primary_param = f"-i \"dpdk;p={','.join(str(i) for i in range(nic_count))};"
145+
142146
burst_size = settings.get("burst_size", 64)
143147
if burst_size is not None:
144148
primary_param += f"b={burst_size};"
145149

150+
primary_param += f"q={rx_queues};"
151+
146152
mempool_size = settings.get("mempool_size", 8192)
147153
if mempool_size is not None:
148154
primary_param += f"m={mempool_size};"
@@ -153,11 +159,7 @@ def process_input_dpdk_plugin(settings):
153159
primary_param += f"eal={eal}\""
154160

155161
params = []
156-
first_cpu = workers_cpu_list[0]
157-
if first_cpu is not None:
158-
params.append(f"{primary_param}@{first_cpu}")
159-
else:
160-
params.append(primary_param)
162+
params.append(primary_param)
161163

162164
for i in range(1, rx_queues):
163165
cpu = workers_cpu_list[i]

0 commit comments

Comments
 (0)