From patchwork Tue Jun 13 15:03:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roi Dayan X-Patchwork-Id: 775297 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wnCwR3kywz9s81 for ; Wed, 14 Jun 2017 01:14:15 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 63C0BC26; Tue, 13 Jun 2017 15:04:45 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp2.linuxfoundation.org (smtp2.linux-foundation.org [172.17.192.36]) by mail.linuxfoundation.org (Postfix) with ESMTPS id BCDF4C00 for ; Tue, 13 Jun 2017 15:04:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by smtp2.linuxfoundation.org (Postfix) with ESMTP id DA88C1DABC for ; Tue, 13 Jun 2017 15:04:37 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from roid@mellanox.com) with ESMTPS (AES256-SHA encrypted); 13 Jun 2017 18:04:25 +0300 Received: from dev-r-vrt-189.mtr.labs.mlnx (dev-r-vrt-189.mtr.labs.mlnx [10.212.189.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v5DF4Kuf027434; Tue, 13 Jun 2017 18:04:25 +0300 From: Roi Dayan To: dev@openvswitch.org Date: Tue, 13 Jun 2017 18:03:33 +0300 Message-Id: <1497366235-20892-12-git-send-email-roid@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1497366235-20892-1-git-send-email-roid@mellanox.com> References: <1497366235-20892-1-git-send-email-roid@mellanox.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp2.linux-foundation.org Cc: Shahar Klein , Hadar Hen Zion , Rony Efraim , Flavio Leitner , Jiri Pirko , Marcelo Ricardo Leitner , Simon Horman , Or Gerlitz , Andy Gospodarek Subject: [ovs-dev] [PATCH V11 11/33] netdev-tc-offloads: Implement netdev flow flush using tc interface 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Paul Blakey Signed-off-by: Paul Blakey Reviewed-by: Roi Dayan Reviewed-by: Simon Horman Acked-by: Flavio Leitner --- lib/netdev-tc-offloads.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c index d050adb..918c4c9 100644 --- a/lib/netdev-tc-offloads.c +++ b/lib/netdev-tc-offloads.c @@ -36,10 +36,20 @@ VLOG_DEFINE_THIS_MODULE(netdev_tc_offloads); +static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(60, 5); + int -netdev_tc_flow_flush(struct netdev *netdev OVS_UNUSED) +netdev_tc_flow_flush(struct netdev *netdev) { - return EOPNOTSUPP; + int ifindex = netdev_get_ifindex(netdev); + + if (ifindex < 0) { + VLOG_ERR_RL(&error_rl, "failed to get ifindex for %s: %s", + netdev_get_name(netdev), ovs_strerror(-ifindex)); + return -ifindex; + } + + return tc_flush(ifindex); } int