From 9f860d10ff35b53fa8b55729a60fbb5664823bdc Mon Sep 17 00:00:00 2001
From: Adam Wujek <adam.wujek@cern.ch>
Date: Tue, 17 Jul 2018 16:38:28 +0200
Subject: [PATCH] Kconfig: introduce option for reduced lldpd frame size

It may be useful in networks which require low latency.

Signed-off-by: Adam Wujek <adam.wujek@cern.ch>
---
 Kconfig                                       | 8 ++++++++
 userspace/rootfs_override/etc/init.d/lldpd.sh | 6 +++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/Kconfig b/Kconfig
index eb36d0adf..75ddfb390 100644
--- a/Kconfig
+++ b/Kconfig
@@ -934,6 +934,14 @@ config LLDPD_MANAGEMENT_PORT_DISABLE
 	depends on !LLDPD_DISABLE
 	help
 	  Disable LLDP traffic on management port.
+
+config LLDPD_MINIMUM_FRAME_SIZE
+	bool "Send only minimum information via LLDP"
+	default n
+	depends on !LLDPD_DISABLE
+	help
+	  Send only minimum information via LLDP. May be useful in networks
+	  which require low latency.
 endmenu
 
 config HTTPD_DISABLE
diff --git a/userspace/rootfs_override/etc/init.d/lldpd.sh b/userspace/rootfs_override/etc/init.d/lldpd.sh
index 71b613cef..29a13b34f 100755
--- a/userspace/rootfs_override/etc/init.d/lldpd.sh
+++ b/userspace/rootfs_override/etc/init.d/lldpd.sh
@@ -51,7 +51,11 @@ start() {
     echo "# This configuration file was generated by $0 at startup" > $LLDPD_CONFIG
     echo "# If you would like to change a lldpd configuration in runtime please consider using lldpcli" >> $LLDPD_CONFIG
     echo "configure system hostname '$(hostname)'" >> $LLDPD_CONFIG
-    echo "configure system description  'WR-SWITCH: $(/wr/bin/wrsw_version)'" >> $LLDPD_CONFIG
+    if [ "$CONFIG_LLDPD_MINIMUM_FRAME_SIZE" = "y" ]; then 
+	echo "configure system description  'WR-SWITCH'" >> $LLDPD_CONFIG
+    else
+	echo "configure system description  'WR-SWITCH: $(/wr/bin/wrsw_version)'" >> $LLDPD_CONFIG
+    fi
     if [ "$CONFIG_LLDPD_MANAGEMENT_PORT_DISABLE" = "y" ]; then
 	echo "configure system interface pattern '!eth*'" >> $LLDPD_CONFIG
     fi
-- 
GitLab