This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/sflow/hsflowd/patch/dropmon/0001-sflow-enabled-drop-monitor-support-for-SONiC.patch
Vadym Hlushko 12ed51d85f [sflow + dropmon] added the ENABLE_SFLOW_DROPMON build flag. Added patches for sflow repo. (#10370)
* [sflow + dropmon] added INCLUDE_SFLOW_DROPMON flag, added patches for hsflowd
*Added a capability of monitoring dropped packets for the sFlow daemon in order to improve network - monitoring, diagnostic, and troubleshooting. The drop monitor service allows the sFlow daemon to export another type of sample - dropped packets as Discard samples alongside Counter samples and Packet Flow samples.

Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
2022-07-07 21:19:34 +00:00

61 lines
1.9 KiB
Diff

From 4bdd892662c08a396066ba6a1c55eac3f8aa0a5f Mon Sep 17 00:00:00 2001
From: Vadym Hlushko <vadymh@nvidia.com>
Date: Tue, 25 Jan 2022 12:59:40 +0000
Subject: [PATCH] [sflow] enabled drop monitor support for SONiC
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
---
src/Linux/Makefile | 2 +-
src/Linux/hsflowd.c | 8 ++++++++
src/Linux/scripts/hsflowd.conf.sonic | 2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/Linux/Makefile b/src/Linux/Makefile
index 8128cf2..cf538e7 100644
--- a/src/Linux/Makefile
+++ b/src/Linux/Makefile
@@ -34,7 +34,7 @@ FEATURES_DENT= DENT PSAMPLE SYSTEMD DROPMON
FEATURES_EOS= EAPI
FEATURES_OS10= OS10 DBUS SYSTEMD
FEATURES_OPX= OPX DBUS SYSTEMD
-FEATURES_SONIC= SONIC PSAMPLE DOCKER
+FEATURES_SONIC= SONIC PSAMPLE DOCKER DROPMON
FEATURES_XEN= XEN OVS
FEATURES_HOST= NFLOG PCAP TCP DOCKER KVM OVS DBUS SYSTEMD
diff --git a/src/Linux/hsflowd.c b/src/Linux/hsflowd.c
index 5d94e79..25031d1 100644
--- a/src/Linux/hsflowd.c
+++ b/src/Linux/hsflowd.c
@@ -1877,6 +1877,14 @@ extern "C" {
sp->psample.ingress = YES;
sp->psample.egress = NO;
sp->psample.group = 1;
+ // drop-monitor support
+ myLog(LOG_INFO, "drop-monitor support for SONiC");
+ sp->dropmon.dropmon = YES;
+ sp->dropmon.group = 1;
+ sp->dropmon.start = NO;
+ sp->dropmon.limit = 1000;
+ sp->dropmon.sw = NO;
+ sp->dropmon.hw = YES;
#endif /* HSP_LOAD_SONIC */
#ifdef HSP_LOAD_XEN
diff --git a/src/Linux/scripts/hsflowd.conf.sonic b/src/Linux/scripts/hsflowd.conf.sonic
index e675730..fb52a54 100644
--- a/src/Linux/scripts/hsflowd.conf.sonic
+++ b/src/Linux/scripts/hsflowd.conf.sonic
@@ -4,6 +4,8 @@
sflow {
# sonic {} loaded automatically
# psample {} loaded automatically
+ # packet drop monitoring:
+ dropmon { group=1 start=on limit=1000 sw=off hw=on }
# ====== detect new interfaces ======
refreshAdaptors=60
# ====== Agent IP selection ======
--
2.17.1