From f03f5fabd49437f771eb6860e1a9ec99db261a5e Mon Sep 17 00:00:00 2001 From: Vadym Hlushko Date: Fri, 17 Jun 2022 16:23:20 +0300 Subject: [PATCH 1/2] [sflow + dropmon] Add patch which add Nvivia-specific flag for the psample driver Signed-off-by: Vadym Hlushko --- ...apsulate-packet-metadata-in-a-struct.patch | 2 +- ...e-Add-additional-metadata-attributes.patch | 2 +- ...dded-define-PSAMPLE_MD_EXTENDED_ATTR.patch | 28 +++++++++++++++++++ patch/series | 1 + 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 patch/0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch diff --git a/patch/0001-psample-Encapsulate-packet-metadata-in-a-struct.patch b/patch/0001-psample-Encapsulate-packet-metadata-in-a-struct.patch index 47d71b973..736d53c91 100644 --- a/patch/0001-psample-Encapsulate-packet-metadata-in-a-struct.patch +++ b/patch/0001-psample-Encapsulate-packet-metadata-in-a-struct.patch @@ -4,7 +4,7 @@ Date: Sun, 14 Mar 2021 14:19:30 +0200 [backport of upstream commit a03e99d39f1943ec88f6fd3b0b9f34c20663d401] -Subject: [PATCH 1/2] psample: Encapsulate packet metadata in a struct +Subject: [PATCH 1/3] psample: Encapsulate packet metadata in a struct Currently, callers of psample_sample_packet() pass three metadata attributes: Ingress port, egress port and truncated size. Subsequent diff --git a/patch/0002-psample-Add-additional-metadata-attributes.patch b/patch/0002-psample-Add-additional-metadata-attributes.patch index b64fcdd75..f3bbc6b66 100644 --- a/patch/0002-psample-Add-additional-metadata-attributes.patch +++ b/patch/0002-psample-Add-additional-metadata-attributes.patch @@ -4,7 +4,7 @@ Date: Sun, 14 Mar 2021 14:19:31 +0200 [backport of upstream commit 07e1a5809b595df6e125504dff6245cb2c8ed3de] -Subject: [PATCH 2/2] psample: Add additional metadata attributes +Subject: [PATCH 2/3] psample: Add additional metadata attributes Extend psample to report the following attributes when available: diff --git a/patch/0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch b/patch/0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch new file mode 100644 index 000000000..9e09cc8a6 --- /dev/null +++ b/patch/0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch @@ -0,0 +1,28 @@ +From 7dbf2689eb841c51dca4dad51b0941c06aa09e26 Mon Sep 17 00:00:00 2001 +From: Vadym Hlushko +Date: Mon, 11 Apr 2022 15:41:46 +0000 +Subject: [PATCH 3/3] psample: Add Nvidia-specific wrapper function for the psample driver + +Add a variable to notify the psample driver to use a wrapper function, +which does preprocess before sending the sample packet to the userspace application. + +Signed-off-by: Vadym Hlushko +--- + include/net/psample.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/net/psample.h b/include/net/psample.h +index e328c5127..b7c79f634 100644 +--- a/include/net/psample.h ++++ b/include/net/psample.h +@@ -14,6 +14,8 @@ struct psample_group { + struct rcu_head rcu; + }; + ++#define PSAMPLE_MD_EXTENDED_ATTR 1 ++ + struct psample_metadata { + u32 trunc_size; + int in_ifindex; +-- +2.17.1 diff --git a/patch/series b/patch/series index 661c5e000..ae1fc38fd 100755 --- a/patch/series +++ b/patch/series @@ -142,6 +142,7 @@ cisco-hwmon-pmbus_core-pec-support-check.patch # sFlow + dropmon support 0001-psample-Encapsulate-packet-metadata-in-a-struct.patch 0002-psample-Add-additional-metadata-attributes.patch +0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch # # Marvell platform patches for 4.19 From fc4841c5f6b0b098d029b89c98f277ced2a7ccd4 Mon Sep 17 00:00:00 2001 From: Vadym Hlushko Date: Fri, 24 Jun 2022 11:15:01 +0300 Subject: [PATCH 2/2] Correct patch name Signed-off-by: Vadym Hlushko --- ...003-psample-define-the-macro-PSAMPLE_MD_EXTENDED_ATTR.patch} | 0 patch/series | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename patch/{0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch => 0003-psample-define-the-macro-PSAMPLE_MD_EXTENDED_ATTR.patch} (100%) diff --git a/patch/0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch b/patch/0003-psample-define-the-macro-PSAMPLE_MD_EXTENDED_ATTR.patch similarity index 100% rename from patch/0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch rename to patch/0003-psample-define-the-macro-PSAMPLE_MD_EXTENDED_ATTR.patch diff --git a/patch/series b/patch/series index ae1fc38fd..4ab10c059 100755 --- a/patch/series +++ b/patch/series @@ -142,7 +142,7 @@ cisco-hwmon-pmbus_core-pec-support-check.patch # sFlow + dropmon support 0001-psample-Encapsulate-packet-metadata-in-a-struct.patch 0002-psample-Add-additional-metadata-attributes.patch -0003-psample-added-define-PSAMPLE_MD_EXTENDED_ATTR.patch +0003-psample-define-the-macro-PSAMPLE_MD_EXTENDED_ATTR.patch # # Marvell platform patches for 4.19