[sflow]: Remove the ENABLE_SFLOW_DROPMON flag (#16607)
- Why I did it To simplify usability and increase adoption of the sFlow + dropmon feature without rebuilding an image. - How I did it Remove the ENABLE_SFLOW_DROPMON compilation flag, and remove unnecessary patches. - How to verify it 1. Configure the sFlow on the switch 2. Configure the Host (PTF) 3. Launch the sflowtool on Host (PTF) 4. Send the dropped packets from Host (PTF) to the switch via scapy 5. Check the L3 counters on the switch 6. Check the samples that were captured by the sflowtool on the Host (PTF) Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>
This commit is contained in:
parent
0846322e9a
commit
9d5bcdae74
@ -134,9 +134,6 @@ INCLUDE_ICCPD = n
|
||||
# INCLUDE_SFLOW - build docker-sflow for sFlow support
|
||||
INCLUDE_SFLOW = y
|
||||
|
||||
# ENABLE_SFLOW_DROPMON - support of drop packets monitoring feature for sFlow deamon
|
||||
ENABLE_SFLOW_DROPMON = n
|
||||
|
||||
# INCLUDE_MGMT_FRAMEWORK - build docker-sonic-mgmt-framework for CLI and REST server support
|
||||
INCLUDE_MGMT_FRAMEWORK = y
|
||||
|
||||
|
1
slave.mk
1
slave.mk
@ -417,7 +417,6 @@ $(info "INCLUDE_SYSTEM_TELEMETRY" : "$(INCLUDE_SYSTEM_TELEMETRY)")
|
||||
$(info "ENABLE_HOST_SERVICE_ON_START" : "$(ENABLE_HOST_SERVICE_ON_START)")
|
||||
$(info "INCLUDE_RESTAPI" : "$(INCLUDE_RESTAPI)")
|
||||
$(info "INCLUDE_SFLOW" : "$(INCLUDE_SFLOW)")
|
||||
$(info "ENABLE_SFLOW_DROPMON" : "$(ENABLE_SFLOW_DROPMON)")
|
||||
$(info "INCLUDE_NAT" : "$(INCLUDE_NAT)")
|
||||
$(info "INCLUDE_DHCP_RELAY" : "$(INCLUDE_DHCP_RELAY)")
|
||||
$(info "INCLUDE_DHCP_SERVER" : "$(INCLUDE_DHCP_SERVER)")
|
||||
|
@ -16,11 +16,6 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
stg init
|
||||
stg import -s ../patch/series
|
||||
|
||||
if [[ $(ENABLE_SFLOW_DROPMON) == y ]]; then
|
||||
stg repair
|
||||
stg import -s ../patch/dropmon/series
|
||||
fi
|
||||
|
||||
mkdir -p debian
|
||||
cp -r DEBIAN_build/* debian
|
||||
chmod u+x debian/rules
|
||||
|
@ -1,172 +0,0 @@
|
||||
From 6ad3a8ef0339041a800a41dac96370c11b72d814 Mon Sep 17 00:00:00 2001
|
||||
From: Vadym Hlushko <vadymh@nvidia.com>
|
||||
Date: Fri, 4 Feb 2022 15:11:48 +0000
|
||||
Subject: [PATCH] [dropmon] workaround - created local copy of <linux/net_dropmon.h>
|
||||
TDB: this patch will be removed when we update docker-sflow to bullseye kernel.
|
||||
|
||||
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
|
||||
---
|
||||
src/Linux/mod_dropmon.c | 2 +-
|
||||
src/Linux/my_dropmon.h | 132 ++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 133 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/Linux/my_dropmon.h
|
||||
|
||||
diff --git a/src/Linux/mod_dropmon.c b/src/Linux/mod_dropmon.c
|
||||
index 6b8ec6d..a37b157 100644
|
||||
--- a/src/Linux/mod_dropmon.c
|
||||
+++ b/src/Linux/mod_dropmon.c
|
||||
@@ -7,12 +7,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include "hsflowd.h"
|
||||
+#include "my_dropmon.h"
|
||||
#include <asm/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/genetlink.h>
|
||||
-#include <linux/net_dropmon.h>
|
||||
#include <net/if.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
diff --git a/src/Linux/my_dropmon.h b/src/Linux/my_dropmon.h
|
||||
new file mode 100644
|
||||
index 0000000..66048cc
|
||||
--- /dev/null
|
||||
+++ b/src/Linux/my_dropmon.h
|
||||
@@ -0,0 +1,132 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
+#ifndef __NET_DROPMON_H
|
||||
+#define __NET_DROPMON_H
|
||||
+
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/netlink.h>
|
||||
+
|
||||
+struct net_dm_drop_point {
|
||||
+ __u8 pc[8];
|
||||
+ __u32 count;
|
||||
+};
|
||||
+
|
||||
+#define is_drop_point_hw(x) do {\
|
||||
+ int ____i, ____j;\
|
||||
+ for (____i = 0; ____i < 8; i ____i++)\
|
||||
+ ____j |= x[____i];\
|
||||
+ ____j;\
|
||||
+} while (0)
|
||||
+
|
||||
+#define NET_DM_CFG_VERSION 0
|
||||
+#define NET_DM_CFG_ALERT_COUNT 1
|
||||
+#define NET_DM_CFG_ALERT_DELAY 2
|
||||
+#define NET_DM_CFG_MAX 3
|
||||
+
|
||||
+struct net_dm_config_entry {
|
||||
+ __u32 type;
|
||||
+ __u64 data __attribute__((aligned(8)));
|
||||
+};
|
||||
+
|
||||
+struct net_dm_config_msg {
|
||||
+ __u32 entries;
|
||||
+ struct net_dm_config_entry options[0];
|
||||
+};
|
||||
+
|
||||
+struct net_dm_alert_msg {
|
||||
+ __u32 entries;
|
||||
+ struct net_dm_drop_point points[0];
|
||||
+};
|
||||
+
|
||||
+struct net_dm_user_msg {
|
||||
+ union {
|
||||
+ struct net_dm_config_msg user;
|
||||
+ struct net_dm_alert_msg alert;
|
||||
+ } u;
|
||||
+};
|
||||
+
|
||||
+
|
||||
+/* These are the netlink message types for this protocol */
|
||||
+
|
||||
+enum {
|
||||
+ NET_DM_CMD_UNSPEC = 0,
|
||||
+ NET_DM_CMD_ALERT,
|
||||
+ NET_DM_CMD_CONFIG,
|
||||
+ NET_DM_CMD_START,
|
||||
+ NET_DM_CMD_STOP,
|
||||
+ NET_DM_CMD_PACKET_ALERT,
|
||||
+ NET_DM_CMD_CONFIG_GET,
|
||||
+ NET_DM_CMD_CONFIG_NEW,
|
||||
+ NET_DM_CMD_STATS_GET,
|
||||
+ NET_DM_CMD_STATS_NEW,
|
||||
+ _NET_DM_CMD_MAX,
|
||||
+};
|
||||
+
|
||||
+#define NET_DM_CMD_MAX (_NET_DM_CMD_MAX - 1)
|
||||
+
|
||||
+/*
|
||||
+ * Our group identifiers
|
||||
+ */
|
||||
+#define NET_DM_GRP_ALERT 1
|
||||
+
|
||||
+enum net_dm_attr {
|
||||
+ NET_DM_ATTR_UNSPEC,
|
||||
+
|
||||
+ NET_DM_ATTR_ALERT_MODE, /* u8 */
|
||||
+ NET_DM_ATTR_PC, /* u64 */
|
||||
+ NET_DM_ATTR_SYMBOL, /* string */
|
||||
+ NET_DM_ATTR_IN_PORT, /* nested */
|
||||
+ NET_DM_ATTR_TIMESTAMP, /* u64 */
|
||||
+ NET_DM_ATTR_PROTO, /* u16 */
|
||||
+ NET_DM_ATTR_PAYLOAD, /* binary */
|
||||
+ NET_DM_ATTR_PAD,
|
||||
+ NET_DM_ATTR_TRUNC_LEN, /* u32 */
|
||||
+ NET_DM_ATTR_ORIG_LEN, /* u32 */
|
||||
+ NET_DM_ATTR_QUEUE_LEN, /* u32 */
|
||||
+ NET_DM_ATTR_STATS, /* nested */
|
||||
+ NET_DM_ATTR_HW_STATS, /* nested */
|
||||
+ NET_DM_ATTR_ORIGIN, /* u16 */
|
||||
+ NET_DM_ATTR_HW_TRAP_GROUP_NAME, /* string */
|
||||
+ NET_DM_ATTR_HW_TRAP_NAME, /* string */
|
||||
+ NET_DM_ATTR_HW_ENTRIES, /* nested */
|
||||
+ NET_DM_ATTR_HW_ENTRY, /* nested */
|
||||
+ NET_DM_ATTR_HW_TRAP_COUNT, /* u32 */
|
||||
+ NET_DM_ATTR_SW_DROPS, /* flag */
|
||||
+ NET_DM_ATTR_HW_DROPS, /* flag */
|
||||
+ NET_DM_ATTR_FLOW_ACTION_COOKIE, /* binary */
|
||||
+
|
||||
+ __NET_DM_ATTR_MAX,
|
||||
+ NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 1
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * enum net_dm_alert_mode - Alert mode.
|
||||
+ * @NET_DM_ALERT_MODE_SUMMARY: A summary of recent drops is sent to user space.
|
||||
+ * @NET_DM_ALERT_MODE_PACKET: Each dropped packet is sent to user space along
|
||||
+ * with metadata.
|
||||
+ */
|
||||
+enum net_dm_alert_mode {
|
||||
+ NET_DM_ALERT_MODE_SUMMARY,
|
||||
+ NET_DM_ALERT_MODE_PACKET,
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ NET_DM_ATTR_PORT_NETDEV_IFINDEX, /* u32 */
|
||||
+ NET_DM_ATTR_PORT_NETDEV_NAME, /* string */
|
||||
+
|
||||
+ __NET_DM_ATTR_PORT_MAX,
|
||||
+ NET_DM_ATTR_PORT_MAX = __NET_DM_ATTR_PORT_MAX - 1
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ NET_DM_ATTR_STATS_DROPPED, /* u64 */
|
||||
+
|
||||
+ __NET_DM_ATTR_STATS_MAX,
|
||||
+ NET_DM_ATTR_STATS_MAX = __NET_DM_ATTR_STATS_MAX - 1
|
||||
+};
|
||||
+
|
||||
+enum net_dm_origin {
|
||||
+ NET_DM_ORIGIN_SW,
|
||||
+ NET_DM_ORIGIN_HW,
|
||||
+};
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,2 +0,0 @@
|
||||
0001-dropmon-workaround-created-local-copy-of-linux-net_dropmon.patch
|
||||
0001-sflow-enabled-drop-monitor-support-for-SONiC.patch
|
@ -1,2 +1,3 @@
|
||||
0001-host_sflow_psample.patch
|
||||
0002-host_sflow_debian.patch
|
||||
0003-sflow-enabled-drop-monitor-support-for-SONiC.patch
|
||||
|
Loading…
Reference in New Issue
Block a user