From patchwork Wed Jun 5 13:15:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyprian Lech X-Patchwork-Id: 1110480 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=plume.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=plume-com.20150623.gappssmtp.com header.i=@plume-com.20150623.gappssmtp.com header.b="FRB114Yn"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Jq4p6qPHz9s7h for ; Wed, 5 Jun 2019 23:14:18 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1F4DAB65; Wed, 5 Jun 2019 13:14:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 482AD9F0 for ; Wed, 5 Jun 2019 13:14:14 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 898826D6 for ; Wed, 5 Jun 2019 13:14:13 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id k8so20168710iot.1 for ; Wed, 05 Jun 2019 06:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plume-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=zzqHZDU9Wr1HoTM65Me4AsnO4jVeheIAH3EzlS+XChY=; b=FRB114YnTeIG7R54DYg8s5JID+pQ9ANEoTm5IuB079DjTUkjhoH1sZbCA8s/SsO3zA 5iHar8fxxmk3ACbb2rz49rBb4HyGAWblzJq48hlUggCk4vWglU+3arCqAdaN7NLtYtCu at4drIxJJ04e2AhppCFCcxXiMmtvpwSZDLeZLfG+T1G/0v9Q2Zj5RTH2KqT4dyU38ssM 48v3mIezQ2UeliJn2H1eLxRM1XXI+Xeh1IWoshhZiEv22bgWWZI15nQe/kMk+MPyCJXj pSoRTHFywI9lXO5KeMGnd8b6+IIW64DsRaU0atCW8a2PZARgqpzP6KPbCB1iSYt4i3hH BJUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zzqHZDU9Wr1HoTM65Me4AsnO4jVeheIAH3EzlS+XChY=; b=lkw6r0tHWQ7nmlnfZAUSyLGtUAPjcHr0jWvgen3Hc/G2hxq5SHspBJKjMY0cwoYPd9 4moxfeHF5RzPopLcs5m4PKgz5jyZUcTH86TOfsrKmKmTyN1nFDBrwwkxiFp2w0B5VpN0 YBEz18bXVZaPnbUO4ALRca1N1IQCqud3R9jYInFSoXxfk2GCigUPe+k1sU1whtgIBNIp F0pXIXkchQ3Ya8ojq0QLIJJE466hXjrjWoBr1Q+K2ilSlUBjgqmh/9b9AlpTiBofY05J 5pivkyq+XqCJefnSwbwgLg+Pp3YuO44NfVrTLjzPXc/wrueej0ij84hemK3B4LEJMIfd Hdpg== X-Gm-Message-State: APjAAAXv5VUmYml1MC7zux+aBv7Y7tXIYeDnn9q7NLa6aZKnPV5Q4e5B BF4P9xKAAbVb3IS/dJMfM3NFx/ujJiktKnbvPzQk2CPjojTczw== X-Google-Smtp-Source: APXvYqzIOkAEKVjA8/y7bGbupeK0tb8M67PafgCLsf0XUxVKTlVNGR3MzvXTaa0z06Q9spphQEI2PledBe/7itdmh7U= X-Received: by 2002:a5d:8845:: with SMTP id t5mr12696251ios.37.1559740452487; Wed, 05 Jun 2019 06:14:12 -0700 (PDT) MIME-Version: 1.0 From: Cyprian Lech Date: Wed, 5 Jun 2019 15:15:39 +0200 Message-ID: To: dev@openvswitch.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Content-Filtered-By: Mailman/MimeDel 2.1.12 Subject: [ovs-dev] netdev: Fix to disable netdev flow offloading X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From e0d636846fcb37e6d0eeb93aeb1ad89fb392e126 Mon Sep 17 00:00:00 2001 From: Cyprian Lech 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 --- 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); 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)