Skip to content

Commit aeae268

Browse files
authored
[vs][dash-engine] Ensure attached ports of dash-engine being UP while starting dash-engine (#21452)
Why I did it If the attached ports of dash-engine are not UP, the dash-engine will not be able to receive any packets. The below is the log when starting up dash-engine without the attached ports being UP: Calling target program-options parser Adding interface eth1 as port 0 [09:18:14.056] [bmv2] [D] [thread 7] Adding interface eth1 as port 0 [09:18:14.102] [bmv2] [E] [thread 7] Add port operation failed Adding interface eth2 as port 1 [09:18:14.102] [bmv2] [D] [thread 7] Adding interface eth2 as port 1 [09:18:14.150] [bmv2] [E] [thread 7] Add port operation failed Work item tracking Microsoft ADO 30887888: How I did it If the attached ports of dash-engine are not UP, ensure them to be UP before starting dash-engine How to verify it The dash-engine runs with ports added successfully. Adding interface eth1 as port 0 [09:40:16.810] [bmv2] [D] [thread 11] Adding interface eth1 as port 0 Adding interface eth2 as port 1 [09:40:16.863] [bmv2] [D] [thread 11] Adding interface eth2 as port 1
1 parent 8433642 commit aeae268

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

platform/vs/docker-dash-engine.mk

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ $(DOCKER_DASH_ENGINE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM)
1212

1313
$(DOCKER_DASH_ENGINE)_CONTAINER_NAME = dash_engine
1414
$(DOCKER_DASH_ENGINE)_CONTAINER_PRIVILEGED = true
15+
$(DOCKER_DASH_ENGINE)_RUN_OPT += --privileged -t

platform/vs/docker-dash-engine/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive
66

77
RUN apt-get update
88

9-
RUN apt-get install -f -y supervisor rsyslog python3-pip
9+
RUN apt-get install -f -y net-tools supervisor rsyslog python3-pip
1010
RUN pip3 install supervisord-dependent-startup
1111

1212
COPY ["start.sh", "/usr/bin/"]
+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
#!/usr/bin/env bash
22

3-
simple_switch_grpc --interface 0@eth1 --interface 1@eth2 --log-console --no-p4
3+
PORT1=eth1
4+
PORT2=eth2
5+
6+
[[ $(cat /sys/class/net/$PORT1/operstate) != up ]] && ifconfig $PORT1 up
7+
[[ $(cat /sys/class/net/$PORT2/operstate) != up ]] && ifconfig $PORT2 up
8+
9+
simple_switch_grpc --interface 0@$PORT1 --interface 1@$PORT2 --log-console --no-p4

0 commit comments

Comments
 (0)