Skip to content

Commit

Permalink
Block redundant learning events (#923)
Browse files Browse the repository at this point in the history
  • Loading branch information
grafnu authored Sep 22, 2021
1 parent 98aa10b commit 4ca3be1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:

test_fot:
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: Set up python 3.8
Expand All @@ -180,14 +180,11 @@ jobs:
if: ${{ always() }}
run: |
cd forch
bin/setup_stack devices 5 faux-mac-prefix "9a:99:57:1e" skip-conn-check dhcp fot
timeout 15m bin/run_test_set fot
bin/retry_cmd bin/run_fot_test vxlan
- name: run dts integration tests
if: ${{ always() }}
run: |
cd forch
bin/setup_stack devices 5 faux-mac-prefix "9a:99:57:1e" skip-conn-check dhcp fot dts localhost
timeout 15m bin/run_test_set fot
bin/retry_cmd bin/run_fot_test dts localhost
- name: post-run logs
if: ${{ always() }}
run: |
Expand Down
5 changes: 5 additions & 0 deletions daq/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def __init__(self):
def new_device(self, mac, port_info=None, vlan=None):
"""Adding a new device"""
assert mac not in self._devices, "Device with mac: %s is already added." % mac
LOGGER.info('Creating new device %s on %s, port info %s', mac, vlan, bool(port_info))
device = Device()
device.mac = mac
self._devices[mac] = device
Expand Down Expand Up @@ -465,6 +466,10 @@ def _handle_port_learn(self, dpid, port, target_mac):
def _handle_device_learn(self, target_mac, vid):
if not self._devices.get(target_mac):
LOGGER.info('Learning %s on vid %s', target_mac, vid)
else:
LOGGER.debug('Ignoring redundant learn %s on vid %s', target_mac, vid)
return

device = self._devices.create_if_absent(target_mac, vlan=vid)
device.dhcp_mode = DhcpMode.EXTERNAL

Expand Down
2 changes: 1 addition & 1 deletion etc/FORCH_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.63
0.64

0 comments on commit 4ca3be1

Please sign in to comment.