Skip to content

Commit

Permalink
Restore neighbor table to kernel during system warm-reboot (#2213)
Browse files Browse the repository at this point in the history
* Restore neighbor table to kernel during system warm-reboot

Added a service: "restore_neighbors" to restore neighbor table into
kernel during system warm reboot. The service is started by supervisord
in swss docker when the docker is started.

In case system warm reboot is enabled, it will try to restore the neighbor
table from appDB into kernel through netlink API calls and update the neighbor
table by sending arp/ns requests to all neighbor entries, then it sets the
stateDB flag for neighsyncd to continue the reconciliation process.

-- Added tcpdump python-scapy debian package into orchagent and vs dockers.
-- Added python module: pyroute2 netifaces into orchagent and vc dockers.
-- Workarounded tcpdump issue in the vs docker

Signed-off-by: Zhenggen Xu <zxu@linkedin.com>

* Move the restore_neighbors.py to sonic-swss submodule
Made changes to makefiles accordingly

Make dockerfile.j2 changes and supervisord config changes

Add python monotonic lib for time access

Signed-off-by: Zhenggen Xu <zxu@linkedin.com>

* Added PYTHON_SWSSCOMMON as swss runtime dependency

Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
  • Loading branch information
zhenggen-xu authored and lguohan committed Nov 10, 2018
1 parent 61fe8fd commit 51a7661
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dockers/docker-fpm-frr/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update

# Install required packages
RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4 libc-ares2 iproute
RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4 libc-ares2 iproute libpython2.7

{% if docker_fpm_frr_debs.strip() -%}
# Copy locally-built Debian package dependencies
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-fpm-quagga/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update

# Install required packages
RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4
RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4 libpython2.7

{% if docker_fpm_quagga_debs.strip() -%}
# Copy locally-built Debian package dependencies
Expand Down
8 changes: 6 additions & 2 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

RUN apt-get install -f -y ifupdown arping libdbus-1-3 libdaemon0 libjansson4
RUN apt-get install -f -y ifupdown arping libdbus-1-3 libdaemon0 libjansson4 libpython2.7

RUN apt-get install -f -y ndisc6
RUN apt-get install -f -y ndisc6 tcpdump python-scapy
## Install redis-tools dependencies
## TODO: implicitly install dependencies
RUN apt-get -y install libjemalloc1

RUN apt-get install -y libelf1 libmnl0

RUN pip install setuptools
RUN pip install pyroute2==0.5.3 netifaces==0.10.7
RUN pip install monotonic==1.5

COPY \
{% for deb in docker_orchagent_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-orchagent/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ supervisorctl start rsyslogd

supervisorctl start orchagent

supervisorctl start restore_neighbors

supervisorctl start portsyncd

supervisorctl start intfsyncd
Expand Down
11 changes: 11 additions & 0 deletions dockers/docker-orchagent/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,14 @@ autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

[program:restore_neighbors]
command=/usr/bin/restore_neighbors.py
priority=15
autostart=false
autorestart=false
startsecs=0
startretries=0
stdout_logfile=syslog
stderr_logfile=syslog

2 changes: 1 addition & 1 deletion dockers/docker-teamd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4
RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4 libpython2.7

## Install redis-tools dependencies
## TODO: implicitly install dependencies
Expand Down
9 changes: 8 additions & 1 deletion platform/vs/docker-sonic-vs/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ RUN apt-get install -y net-tools \
libmnl0 \
logrotate \
apt-utils \
psmisc
psmisc \
tcpdump \
python-scapy

RUN pip install setuptools
RUN pip install py2_ipaddress
RUN pip install six
RUN pip install pyroute2==0.5.3 netifaces==0.10.7
RUN pip install monotonic==1.5

{% if docker_sonic_vs_debs.strip() -%}
# Copy locally-built Debian package dependencies
Expand Down Expand Up @@ -87,6 +91,9 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/configdb-load.sh", "/usr/bin/"]
COPY ["files/arp_update", "/usr/bin"]

# Workaround the tcpdump issue
RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump

RUN echo "docker-sonic-vs" > /etc/hostname
RUN touch /etc/quagga/zebra.conf

Expand Down
10 changes: 10 additions & 0 deletions platform/vs/docker-sonic-vs/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,13 @@ autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

[program:restore_neighbors]
command=/usr/bin/restore_neighbors.py
priority=19
autostart=false
autorestart=false
startsecs=0
startretries=0
stdout_logfile=syslog
stderr_logfile=syslog
2 changes: 1 addition & 1 deletion rules/swss.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SWSS = swss_1.0.0_amd64.deb
$(SWSS)_SRC_PATH = $(SRC_PATH)/sonic-swss
$(SWSS)_DEPENDS += $(LIBSAIREDIS_DEV) $(LIBSAIMETADATA_DEV) $(LIBTEAM_DEV) \
$(LIBTEAMDCT) $(LIBTEAM_UTILS) $(LIBSWSSCOMMON_DEV)
$(SWSS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBTEAM) $(LIBSWSSCOMMON)
$(SWSS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBTEAM) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON)
SONIC_DPKG_DEBS += $(SWSS)

SWSS_DBG = swss-dbg_1.0.0_amd64.deb
Expand Down

0 comments on commit 51a7661

Please sign in to comment.