diff mbox

[ovs-dev,V10,23/33] netdev-linux: Disallow setting policing when configured with hw offload

Message ID 1496922410-36853-24-git-send-email-roid@mellanox.com
State Superseded
Headers show

Commit Message

Roi Dayan June 8, 2017, 11:46 a.m. UTC
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>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
---
 lib/netdev-linux.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Flavio Leitner June 9, 2017, 8:14 p.m. UTC | #1
On Thu, Jun 08, 2017 at 02:46:40PM +0300, Roi Dayan wrote:
> 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>
> Reviewed-by: Simon Horman <simon.horman@netronome.com>
> ---

Acked-by: Flavio Leitner <fbl@sysclose.org>
diff mbox

Patch

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 44dfac5..ce0a153 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -2087,6 +2087,14 @@  netdev_linux_set_policing(struct netdev *netdev_,
     int ifindex;
     int error;
 
+    if (netdev_is_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. */