diff mbox series

[ovs-dev,v26,2/8] ovs-kmod-ctl: Load kernel module psample

Message ID 20230329114259.110297-3-cmi@nvidia.com
State Changes Requested
Headers show
Series Add offload support for sFlow | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Chris Mi March 29, 2023, 11:42 a.m. UTC
Load kernel module psample to receive sampled packets from TC.
Before removing kernel module psample, remove act_sample first.

Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
---
 utilities/ovs-kmod-ctl.in | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Eelco Chaudron April 12, 2023, 2:04 p.m. UTC | #1
On 29 Mar 2023, at 13:42, Chris Mi wrote:

> Update kernel UAPI to support psample and the tc sample action.
>
> Signed-off-by: Chris Mi <cmi@nvidia.com>
> Reviewed-by: Roi Dayan <roid@nvidia.com>
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
> ---

Thanks for incorporating the requested changes. Explicitly acking v26:

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Eelco Chaudron April 12, 2023, 2:05 p.m. UTC | #2
Oops, I replied with patch 1 to path 2 :(

So here we go for patch 2:


On 29 Mar 2023, at 13:42, Chris Mi wrote:

> Load kernel module psample to receive sampled packets from TC.
> Before removing kernel module psample, remove act_sample first.
>
> Signed-off-by: Chris Mi <cmi@nvidia.com>
> Reviewed-by: Roi Dayan <roid@nvidia.com>
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
> ---

No changes in v26 for this patch, explicitly acking it:

Acked-by: Eelco Chaudron <echaudro@redhat.com>


On 12 Apr 2023, at 16:04, Eelco Chaudron wrote:

> On 29 Mar 2023, at 13:42, Chris Mi wrote:
>
>> Update kernel UAPI to support psample and the tc sample action.
>>
>> Signed-off-by: Chris Mi <cmi@nvidia.com>
>> Reviewed-by: Roi Dayan <roid@nvidia.com>
>> Acked-by: Eelco Chaudron <echaudro@redhat.com>
>> ---
>
> Thanks for incorporating the requested changes. Explicitly acking v26:
>
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
Chris Mi April 26, 2023, 2:30 a.m. UTC | #3
On 4/12/2023 10:05 PM, Eelco Chaudron wrote:
> Oops, I replied with patch 1 to path 2 :(
>
> So here we go for patch 2:
>
>
> On 29 Mar 2023, at 13:42, Chris Mi wrote:
>
>> Load kernel module psample to receive sampled packets from TC.
>> Before removing kernel module psample, remove act_sample first.
>>
>> Signed-off-by: Chris Mi<cmi@nvidia.com>
>> Reviewed-by: Roi Dayan<roid@nvidia.com>
>> Acked-by: Eelco Chaudron<echaudro@redhat.com>
>> ---
> No changes in v26 for this patch, explicitly acking it:
>
> Acked-by: Eelco Chaudron<echaudro@redhat.com>
Thanks for the review.
>
>
> On 12 Apr 2023, at 16:04, Eelco Chaudron wrote:
>
>> On 29 Mar 2023, at 13:42, Chris Mi wrote:
>>
>>> Update kernel UAPI to support psample and the tc sample action.
>>>
>>> Signed-off-by: Chris Mi<cmi@nvidia.com>
>>> Reviewed-by: Roi Dayan<roid@nvidia.com>
>>> Acked-by: Eelco Chaudron<echaudro@redhat.com>
>>> ---
>> Thanks for incorporating the requested changes. Explicitly acking v26:
>>
>> Acked-by: Eelco Chaudron<echaudro@redhat.com>
diff mbox series

Patch

diff --git a/utilities/ovs-kmod-ctl.in b/utilities/ovs-kmod-ctl.in
index 19f100964..6fa945a83 100644
--- a/utilities/ovs-kmod-ctl.in
+++ b/utilities/ovs-kmod-ctl.in
@@ -28,6 +28,14 @@  for dir in "$sbindir" "$bindir" /sbin /bin /usr/sbin /usr/bin; do
 done
 
 insert_mods () {
+    # Try loading psample kernel module.
+    modinfo psample > /dev/null 2>&1
+    if test $? = 0; then
+        action "Inserting psample module" modprobe psample
+    else
+        log_warning_msg "No psample module, can't offload sFlow action"
+    fi
+
     # Try loading openvswitch kernel module.
     action "Inserting openvswitch module" modprobe openvswitch
 }
@@ -95,6 +103,12 @@  remove_kmods() {
     if test -e /sys/module/vxlan; then
         action "Forcing removal of vxlan module" rmmod vxlan
     fi
+    if test -e /sys/module/act_sample; then
+        action "Forcing removal of act_sample module" rmmod act_sample
+    fi
+    if test -e /sys/module/psample; then
+        action "Forcing removal of psample module" rmmod psample
+    fi
 }
 
 usage () {