[ovs-dev] netdev: Fix to disable netdev flow offloading
diff mbox series

Message ID CAAbBHCcTXmX4YvOM=DWmkeDJ1tQMvCpJ74PdJCYLH+tijRNJew@mail.gmail.com
State New
Headers show
Series
  • [ovs-dev] netdev: Fix to disable netdev flow offloading
Related show

Commit Message

Cyprian Lech June 5, 2019, 1:15 p.m. UTC
From e0d636846fcb37e6d0eeb93aeb1ad89fb392e126 Mon Sep 17 00:00:00 2001
From: Cyprian Lech <clech@plume.com>
Date: Wed, 5 Jun 2019 14:20:08 +0200
Subject: [PATCH] netdev: Fix to disable netdev flow offloading

Netdev flow functions were called although
hw-offload was disabled, e.g. netdev_flow_dump_create.

It fixes problem:
netlink_socket(revalidator5)|INFO|netlink dump request error (Operation not
supported)

Fixes: 53611f7b05 ("other-config: Add hw-offload switch to control netdev
flow offloading")
Signed-off-by: Cyprian Lech <clech@plume.com>
---
 lib/netdev.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

             : EOPNOTSUPP);
@@ -2174,6 +2182,10 @@ netdev_flow_dump_destroy(struct netdev_flow_dump
*dump)
 {
     const struct netdev_class *class = dump->netdev->netdev_class;

+    if (!netdev_is_flow_api_enabled()) {
+        return EOPNOTSUPP;
+    }
+
     return (class->flow_dump_destroy
             ? class->flow_dump_destroy(dump)
             : EOPNOTSUPP);
@@ -2187,6 +2199,10 @@ netdev_flow_dump_next(struct netdev_flow_dump *dump,
struct match *match,
 {
     const struct netdev_class *class = dump->netdev->netdev_class;

+    if (!netdev_is_flow_api_enabled()) {
+        return EOPNOTSUPP;
+    }
+
     return (class->flow_dump_next
             ? class->flow_dump_next(dump, match, actions, stats, attrs,
                                     ufid, rbuffer, wbuffer)
@@ -2201,6 +2217,10 @@ netdev_flow_put(struct netdev *netdev, struct match
*match,
 {
     const struct netdev_class *class = netdev->netdev_class;

+    if (!netdev_is_flow_api_enabled()) {
+        return EOPNOTSUPP;
+    }
+
     return (class->flow_put
             ? class->flow_put(netdev, match, actions, act_len, ufid,
                               info, stats)
@@ -2215,6 +2235,10 @@ netdev_flow_get(struct netdev *netdev, struct match
*match,
 {
     const struct netdev_class *class = netdev->netdev_class;

+    if (!netdev_is_flow_api_enabled()) {
+        return EOPNOTSUPP;
+    }
+
     return (class->flow_get
             ? class->flow_get(netdev, match, actions, ufid, stats, attrs,
buf)
             : EOPNOTSUPP);
@@ -2226,6 +2250,10 @@ netdev_flow_del(struct netdev *netdev, const
ovs_u128 *ufid,
 {
     const struct netdev_class *class = netdev->netdev_class;

+    if (!netdev_is_flow_api_enabled()) {
+        return EOPNOTSUPP;
+    }
+
     return (class->flow_del
             ? class->flow_del(netdev, ufid, stats)
             : EOPNOTSUPP);

Comments

Ilya Maximets June 5, 2019, 2:17 p.m. UTC | #1
On 05.06.2019 16:15, Cyprian Lech wrote:
>>From e0d636846fcb37e6d0eeb93aeb1ad89fb392e126 Mon Sep 17 00:00:00 2001
> From: Cyprian Lech <clech@plume.com>
> Date: Wed, 5 Jun 2019 14:20:08 +0200
> Subject: [PATCH] netdev: Fix to disable netdev flow offloading
> 
> Netdev flow functions were called although
> hw-offload was disabled, e.g. netdev_flow_dump_create.
> 
> It fixes problem:
> netlink_socket(revalidator5)|INFO|netlink dump request error (Operation not
> supported)
> 
> Fixes: 53611f7b05 ("other-config: Add hw-offload switch to control netdev
> flow offloading")
> Signed-off-by: Cyprian Lech <clech@plume.com>
> ---

Hi Cyprian.
Thanks for your work! We have a different approach to fix this kind of issues
by implementing dynamic assignment of offload API.
You may take a look at the patches here:
    https://patchwork.ozlabs.org/project/openvswitch/list/?series=108029

I'm going to apply them soon.

Best regards, Ilya Maximets.

Patch
diff mbox series

diff --git a/lib/netdev.c b/lib/netdev.c
index 45b50f26c..4f5147e6e 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -2154,6 +2154,10 @@  netdev_flow_flush(struct netdev *netdev)
 {
     const struct netdev_class *class = netdev->netdev_class;

+    if (!netdev_is_flow_api_enabled()) {
+        return EOPNOTSUPP;
+    }
+
     return (class->flow_flush
             ? class->flow_flush(netdev)
             : EOPNOTSUPP);
@@ -2164,6 +2168,10 @@  netdev_flow_dump_create(struct netdev *netdev,
struct netdev_flow_dump **dump)
 {
     const struct netdev_class *class = netdev->netdev_class;

+    if (!netdev_is_flow_api_enabled()) {
+        return EOPNOTSUPP;
+    }
+
     return (class->flow_dump_create
             ? class->flow_dump_create(netdev, dump)