[PATCH] lnst.Slave.InterfaceManager: handle RTM_DELLINK with family
PF_BRIDGE properly
by Jan Tluka
If a bridge device (t_br0) is removed and another device (e.g. t_vlan0)
references it as IFLA_MASTER (ie. the device was previously added to the bridge),
an RTM_DELLINK is sent by kernel to userspace for t_vlan0 device before the
bridge device is removed.
The InterfaceManager handles all RTM_DELLINK as a notification of removal of
a device. In this case however, the RTM_DELLINK has a special meaning that the
link between t_vlan0 and t_br0 does not exist anymore, and is indicated by
PF_BRIDGE (value 7) family in the RTM_DELLINK message.
Without this patch, upon delivery of such message, the t_vlan0 device is
removed from the InterfaceManager's device list and marked as deleted. Later
on during the deconfiguration, the actual removal (ip link delete) of the
device is skipped because LNST thinks it has been already deleted.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/InterfaceManager.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py
index 858c32f1..221d386f 100644
--- a/lnst/Slave/InterfaceManager.py
+++ b/lnst/Slave/InterfaceManager.py
@@ -38,6 +38,7 @@ from pyroute2.netlink.rtnl import RTM_GETADDR
from pyroute2.netlink.rtnl import RTM_DELADDR
NL_GROUPS = RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR | RTMGRP_LINK
+PF_BRIDGE = 7
class InterfaceManager(object):
def __init__(self, server_handler):
@@ -127,6 +128,9 @@ class InterfaceManager(object):
dev._disable()
elif msg['header']['type'] == RTM_DELLINK:
+ if msg['family'] == PF_BRIDGE:
+ return
+
if msg['index'] in self._devices:
dev = self._devices[msg['index']]
dev._deleted = True
--
2.21.3
3 years, 5 months
[PATCH v2 0/4] Make TRex profiles extensible
by Adrian Moreno
Currently the TRex Test has a hardcoded set of streams.
In order to make it more generic and extendable, this series first refactors
the client and server code into a library that does not depend on other
LNST code. That way, a small cli appliation can be implemented to inject
traffic using the same code as LNST would. This is useful for early prototyping.
An example of such as tool is introduced: test_tools/tperf. It basically runs the
client and server as LNST would and report the aggregated throughput.
Finally, the stream can be modularized into TRex compatible modules so that:
- New stream generators can be easily implemented
- TRex tools (e.g: stl-sym) can be used for stream generator development
The current stream generation is modularized as an example: UdpSimple
Finally a new stream generator is introduced: UdpMultiflow, that creates multiple
UDP streams by modifying the source and destination ports.
Adrian Moreno (4):
lnst.Tests.TRex Create lnst-independent library
test_tools: Add tperf
lnst.TRex Use stl compatible modules to generate streams
lnst.Tests.TRex: Add UDPMultiflow
lnst/External/TRex/TRexLib.py | 215 +++++++++++++++++++++++++++++
lnst/External/TRex/UDPMultiflow.py | 39 ++++++
lnst/External/TRex/UDPSimple.py | 38 +++++
lnst/External/TRex/__init__.py | 0
lnst/External/__init__.py | 0
lnst/Tests/TRex.py | 144 ++++---------------
test_tools/tperf/tperf | 201 +++++++++++++++++++++++++++
7 files changed, 517 insertions(+), 120 deletions(-)
create mode 100644 lnst/External/TRex/TRexLib.py
create mode 100644 lnst/External/TRex/UDPMultiflow.py
create mode 100644 lnst/External/TRex/UDPSimple.py
create mode 100644 lnst/External/TRex/__init__.py
create mode 100644 lnst/External/__init__.py
create mode 100755 test_tools/tperf/tperf
--
2.26.2
3 years, 5 months
[PATCH 0/2] IPSec Recipes ping report fix
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
It seems at some point Recipe.ping_evaluate_and_report was renamed to ping_report_and_evaluate
Also the ping_config argument is no longer required.
The IPSec recipes where overriding this method, but the method signatures where never updated.
Updated the method signatures to match Recipe.ping_report_and_evaluate
Perry Gagne (2):
Recipes.ENRT.IpsecEspAeadRecipe: update ping report and evaluate
method signature
Recipes.ENRT.IpsecEspAhCompRecipe: update ping report and evaluate
method signature
lnst/Recipes/ENRT/IpsecEspAeadRecipe.py | 6 +++---
lnst/Recipes/ENRT/IpsecEspAhCompRecipe.py | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
--
2.26.2
3 years, 5 months
[PATCH] SimpleMacsecRecipe.py: Fixed issue causing undefined hw_config
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
- Added parent method call in apply_sub_configurations/remove_sub_configurations
- Also removed check for perf_reverse params that was causing an error and isnt needed anymore.
Signed-off-by: Perry Gagne <pgagne(a)redhat.com>
---
lnst/Recipes/ENRT/SimpleMacsecRecipe.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lnst/Recipes/ENRT/SimpleMacsecRecipe.py b/lnst/Recipes/ENRT/SimpleMacsecRecipe.py
index 92926b0..fded0e6 100644
--- a/lnst/Recipes/ENRT/SimpleMacsecRecipe.py
+++ b/lnst/Recipes/ENRT/SimpleMacsecRecipe.py
@@ -39,12 +39,6 @@ class SimpleMacsecRecipe(CommonHWSubConfigMixin, BaseEnrtRecipe):
self.wait_tentative_ips(configuration.test_wide_devices)
- if (self.params.ping_parallel or self.params.ping_bidirect or
- self.params.perf_reverse):
- logging.debug("Parallel pings or reverse perf tests are "
- "not supported for this recipe, ping_parallel"
- "/ping_bidirect/perf_reverse will be ignored.")
-
configuration.endpoint1 = host1.eth0
configuration.endpoint2 = host2.eth0
configuration.host1 = host1
@@ -80,6 +74,7 @@ class SimpleMacsecRecipe(CommonHWSubConfigMixin, BaseEnrtRecipe):
yield new_config
def apply_sub_configuration(self, config):
+ super().apply_sub_configuration(config)
if not config.encrypt:
config.endpoint1.up()
config.endpoint2.up()
@@ -119,6 +114,7 @@ class SimpleMacsecRecipe(CommonHWSubConfigMixin, BaseEnrtRecipe):
del host.msec0
config.endpoint1.down()
config.endpoint2.down()
+ super().remove_sub_configuration(config)
def generate_ping_configurations(self, config):
if not config.encrypt:
--
2.26.2
3 years, 5 months
Re: Module dependency issue
by Ondrej Lichtner
Hi Adrian,
adding Cc to lnst-developers as the discussed changes may be relevant to
a wider audience.
replies inline.
On Tue, Jun 23, 2020 at 10:38:20AM +0200, Adrian Moreno wrote:
> Hi Ondrej,
>
> I'm having a problem (which I think it's the second time I hit), when moving the
> TRex library files.
>
> My current file hierarchy
>
> lnst/Tests/
> total 64K
> -rw-r--r--. 1 amorenoz adrian 3.8K Aug 29 2019 BaseTestModule.py
> -rw-r--r--. 1 amorenoz adrian 3.8K Aug 29 2019 CPUStatMonitor.py
> -rw-r--r-- 1 amorenoz adrian 636 Jun 23 10:32 __init__.py
> -rw-r--r--. 1 amorenoz adrian 4.4K Aug 29 2019 Iperf.py
> -rw-r--r--. 1 amorenoz adrian 23K Aug 29 2019 Netperf.py
> -rw-r--r--. 1 amorenoz adrian 3.3K Aug 29 2019 PacketAssert.py
> -rw-r--r-- 1 amorenoz adrian 3.8K Apr 16 18:04 Ping.py
> -rw-r--r--. 1 amorenoz adrian 1.8K Oct 23 2019 TestPMD.py
> drwxr-xr-x 3 amorenoz adrian 4.0K Jun 23 09:16 TRex
>
> lnst/Tests/TRex/
> total 24K
> -rw-r--r-- 1 amorenoz adrian 0 Jun 23 08:46 __init__.py
> -rw-r--r-- 1 amorenoz adrian 1.8K Jun 23 08:33 TestModule.py <- The wrapper
> -rw-r--r-- 1 amorenoz adrian 7.1K Jun 23 09:07 TRexLib.py <- The library
> -rw-r--r-- 1 amorenoz adrian 1.4K Jun 23 09:07 UDPMultiflow.py
> -rw-r--r-- 1 amorenoz adrian 989 Jun 23 09:07 UDPSimple.py
>
>
> The problem is that when I:
>
> from lnst.Tests.TRex.TRexLib import TRexCli, TRexSrv, TRexParams
>
> I get:
> Traceback (most recent call last):
> File "/usr/lib64/python3.6/pdb.py", line 1667, in main
> pdb._runscript(mainpyfile)
> File "/usr/lib64/python3.6/pdb.py", line 1548, in _runscript
> self.run(statement)
> File "/usr/lib64/python3.6/bdb.py", line 434, in run
> exec(cmd, globals, locals)
> File "<string>", line 1, in <module>
> File "/root/lnst/test_tools/tperf/tperf", line 26, in <module>
> from lnst.Tests.TRex.TRexLib import TRexCli, TRexSrv, TRexParams
> File "/root/lnst/test_tools/tperf/../../lnst/Tests/__init__.py", line 15, in
> <module>
> from lnst.Tests.Ping import Ping
> File "/root/lnst/test_tools/tperf/../../lnst/Tests/Ping.py", line 8, in <module>
> from lnst.Tests.BaseTestModule import BaseTestModule, TestModuleError
> File "/root/lnst/test_tools/tperf/../../lnst/Tests/BaseTestModule.py", line
> 19, in <module>
> from lnst.Common.Logs import log_exc_traceback
> File "/root/lnst/test_tools/tperf/../../lnst/Common/Logs.py", line 16, in <module>
> from lnst.Common.LoggingHandler import TransmitHandler
> File "/root/lnst/test_tools/tperf/../../lnst/Common/LoggingHandler.py", line
> 20, in <module>
> from lnst.Common.ConnectionHandler import send_data
> File "/root/lnst/test_tools/tperf/../../lnst/Common/ConnectionHandler.py",
> line 19, in <module>
> from pyroute2 import IPRSocket
> ModuleNotFoundError: No module named 'pyroute2'
I checked and we can at least remove the pyroute2 import from the
ConnectionHandler, that seems to be unused and probably left-over from
when I changed some stuff here...
>
> The reason is that
>
> lnst.Tests.__init__.py contains:
>
> from lnst.Tests.Ping import Ping
> from lnst.Tests.PacketAssert import PacketAssert
> from lnst.Tests.Iperf import IperfClient, IperfServer
>
>
> Why is that needed and, can we remove them?
The idea here was so that in a Recipe you can just do:
from lnst.Tests import Ping
Just removing the __init__.py contents will mean that all the recipes
that import this way also need to be updated so I'm not sure that's the
best approach.
I have just now learned that what I attempted to do here is now called
"namespace package", I was also not aware that the __init__.py of a
package is called even if you're only importing a subpackage, that seems
rather unfortunate... but makes sense from what I see in python docs.
Thinking about it more this looks like it was a bad idea because it
makes the test modules "depend on each other" - even if you only want to
run Ping, you still need to parse source of all the other modules, in
turn requiring all of their dependencies as well.
I would still like to be able to do
from lnst.Tests import Ping, TRexClient
and have it in such a way that only doing
from lnst.Tests import TRexClient
will not even look at the ping source code... I think I'll have to look
a bit more into how to do this thing dynamically.
So to improve the situation for now:
* remove pyroute2 from ConnectionHandler.py
* maybe move log_exc_traceback to somewhere where it doesn't end up
importing anything wrt. lnst connections at all... maybe
lnst.Common.Utils
Would this improve the situation? Do you maybe have some better ideas?
-Ondrej
3 years, 5 months
[RFC PATCH 0/3] Make TRex profiles extensible
by Adrian Moreno
Currently the TRex Test has a hardcoded set of streams.
In order to make it more generic and extendable, this RFC first refactors
the client and server code into a library that does not depend on other
LNST code. That way, a small cli appliation can be implemented to inject
traffic using the same code as LNST would. This is useful for early prototyping.
An example of such as tool is introduced: test_tools/tperf. It basically runs the
client and server as LNST would and report the aggregated throughput.
Finally, the stream can be modularized into TRex compatible modules so that:
- New stream generators can be easily implemented
- TRex tools (e.g: stl-sym) can be used for stream generator development
The current stream generation is modularized as an example: udp_simple
I'm only a sporadic contributor to LNST so sending this RFC to get some feedback.
Adrian Moreno (3):
lnst.Tests.TRex Refactor TRex client and server
test_tools: Add tperf
lnst.TRex Use stl compatible modules to generate streams
lnst/TRex/TRex.py | 205 ++++++++++++++++++++++++++++++++++++++++
lnst/TRex/__init__.py | 0
lnst/TRex/udp_simple.py | 38 ++++++++
lnst/Tests/TRex.py | 137 ++++-----------------------
test_tools/tperf/tperf | 192 +++++++++++++++++++++++++++++++++++++
5 files changed, 452 insertions(+), 120 deletions(-)
create mode 100644 lnst/TRex/TRex.py
create mode 100644 lnst/TRex/__init__.py
create mode 100644 lnst/TRex/udp_simple.py
create mode 100755 test_tools/tperf/tperf
--
2.26.2
3 years, 5 months
[PATCH] SimpleMacsecRecipe.py: Fixed issue with not hw_config not being defined - Added parent method call in apply_sub_configurations/remove_sub_configurations - Also removed check for perf_reverse params that was causing an error and isnt needed anymore.
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
Signed-off-by: Perry Gagne <pgagne(a)redhat.com>
---
lnst/Recipes/ENRT/SimpleMacsecRecipe.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lnst/Recipes/ENRT/SimpleMacsecRecipe.py b/lnst/Recipes/ENRT/SimpleMacsecRecipe.py
index 92926b0..fded0e6 100644
--- a/lnst/Recipes/ENRT/SimpleMacsecRecipe.py
+++ b/lnst/Recipes/ENRT/SimpleMacsecRecipe.py
@@ -39,12 +39,6 @@ class SimpleMacsecRecipe(CommonHWSubConfigMixin, BaseEnrtRecipe):
self.wait_tentative_ips(configuration.test_wide_devices)
- if (self.params.ping_parallel or self.params.ping_bidirect or
- self.params.perf_reverse):
- logging.debug("Parallel pings or reverse perf tests are "
- "not supported for this recipe, ping_parallel"
- "/ping_bidirect/perf_reverse will be ignored.")
-
configuration.endpoint1 = host1.eth0
configuration.endpoint2 = host2.eth0
configuration.host1 = host1
@@ -80,6 +74,7 @@ class SimpleMacsecRecipe(CommonHWSubConfigMixin, BaseEnrtRecipe):
yield new_config
def apply_sub_configuration(self, config):
+ super().apply_sub_configuration(config)
if not config.encrypt:
config.endpoint1.up()
config.endpoint2.up()
@@ -119,6 +114,7 @@ class SimpleMacsecRecipe(CommonHWSubConfigMixin, BaseEnrtRecipe):
del host.msec0
config.endpoint1.down()
config.endpoint2.down()
+ super().remove_sub_configuration(config)
def generate_ping_configurations(self, config):
if not config.encrypt:
--
2.26.2
3 years, 5 months
[PATCH] add PerfReversibleFlowMixin to BondRecipe
by aloughla@redhat.com
From: Aniss Loughlam <aloughla(a)redhat.com>
Signed-off-by: Aniss Loughlam <aloughla(a)redhat.com>
---
lnst/Recipes/ENRT/BondRecipe.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py
index abad65a..751d196 100644
--- a/lnst/Recipes/ENRT/BondRecipe.py
+++ b/lnst/Recipes/ENRT/BondRecipe.py
@@ -6,10 +6,12 @@ from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import (
OffloadSubConfigMixin)
from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import (
CommonHWSubConfigMixin)
+from lnst.Recipes.ENRT.ConfigMixins.PerfReversibleFlowMixin import (
+ PerfReversibleFlowMixin)
from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints
from lnst.Devices import BondDevice
-class BondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
+class BondRecipe(PerfReversibleFlowMixin, CommonHWSubConfigMixin, OffloadSubConfigMixin,
BaseEnrtRecipe):
"""
This recipe implements Enrt testing for a network scenario that looks
--
2.25.4
3 years, 5 months
[PATCH] Recipes.ENRT: add pause_frames_dev_list to
VlansOverBondRecipe
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index a2e9947d..f703bcf9 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -291,3 +291,18 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
"""
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0]
+
+ @property
+ def pause_frames_dev_list(self):
+ """
+ The `pause_frames_dev_list` property value for this scenario is a list
+ of the physical devices carrying data of the configured VLAN tunnels:
+
+ host1.eth0, host1.eth1 and host2.eth0
+
+ For detailed explanation of this property see
+ :any:`PauseFramesHWConfigMixin` and
+ :any:`PauseFramesHWConfigMixin.pause_frames_dev_list`.
+ """
+ host1, host2 = self.matched.host1, self.matched.host2
+ return [host1.eth0, host1.eth1, host2.eth0]
--
2.21.3
3 years, 6 months