From patchwork Mon Mar 13 13:36:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roi Dayan X-Patchwork-Id: 738131 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 3vhf7G4yrJz9s0Z for ; Tue, 14 Mar 2017 00:37:30 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1FDEABC9; Mon, 13 Mar 2017 13:37:26 +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 747ACB75 for ; Mon, 13 Mar 2017 13:37:24 +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 smtp1.linuxfoundation.org (Postfix) with ESMTP id 62A88248 for ; Mon, 13 Mar 2017 13:37:23 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from roid@mellanox.com) with ESMTPS (AES256-SHA encrypted); 13 Mar 2017 15:37:21 +0200 Received: from r-vnc05.mtr.labs.mlnx (r-vnc05.mtr.labs.mlnx [10.208.0.115]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v2DDbJZC028197; Mon, 13 Mar 2017 15:37:20 +0200 From: Roi Dayan To: dev@openvswitch.org Date: Mon, 13 Mar 2017 15:36:57 +0200 Message-Id: <1489412234-30916-8-git-send-email-roid@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1489412234-30916-1-git-send-email-roid@mellanox.com> References: <1489412234-30916-1-git-send-email-roid@mellanox.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Shahar Klein , Hadar Hen Zion , Rony Efraim , Jiri Pirko , Marcelo Ricardo Leitner , Simon Horman , Or Gerlitz , Andy Gospodarek Subject: [ovs-dev] [PATCH ovs V4 07/24] 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 --- lib/netdev-tc-offloads.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c index 946c2a6..2ea7fe3 100644 --- a/lib/netdev-tc-offloads.c +++ b/lib/netdev-tc-offloads.c @@ -75,10 +75,20 @@ VLOG_DEFINE_THIS_MODULE(netdev_tc_offloads); +static struct vlog_rate_limit rl_err = VLOG_RATE_LIMIT_INIT(9999, 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(&rl_err, "failed to get ifindex for %s: %s", + netdev_get_name(netdev), ovs_strerror(-ifindex)); + return -ifindex; + } + + return tc_flush(ifindex); } int