[ovs-dev,ovs,V4,18/24] netdev-linux: Disallow setting policing when configured with hw offload

Submitted by Roi Dayan on March 13, 2017, 1:37 p.m.

Details

Message ID 1489412234-30916-19-git-send-email-roid@mellanox.com
State Superseded
Headers show

Commit Message

Roi Dayan March 13, 2017, 1:37 p.m.
From: Paul Blakey <paulb@mellanox.com>

Notify as not supported. Otherwise the ingress qdisc is being removed and
offload rules will be removed.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
---
 lib/netdev-linux.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 0828d96..124d2c3 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -2053,6 +2053,14 @@  netdev_linux_set_policing(struct netdev *netdev_,
     int error;
     int ifindex;
 
+    if (netdev_flow_api_enabled) {
+        if (kbits_rate) {
+            VLOG_WARN_RL(&rl, "%s: policing with offload isn't supported",
+                         netdev_name);
+        }
+        return EOPNOTSUPP;
+    }
+
     kbits_burst = (!kbits_rate ? 0       /* Force to 0 if no rate specified. */
                    : !kbits_burst ? 8000 /* Default to 8000 kbits if 0. */
                    : kbits_burst);       /* Stick with user-specified value. */