From patchwork Fri Oct 13 06:01:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoshuai Li X-Patchwork-Id: 825233 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=) 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 3yCxtH5QQ5z9s82 for ; Fri, 13 Oct 2017 17:01:27 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 273FC7A8; Fri, 13 Oct 2017 06:01:24 +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 8EB55710 for ; Fri, 13 Oct 2017 06:01:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtp2203-239.mail.aliyun.com (smtp2203-239.mail.aliyun.com [121.197.203.239]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3D951A4 for ; Fri, 13 Oct 2017 06:01:20 +0000 (UTC) X-Alimail-AntiSpam: AC=CONTINUE; BC=0.1576325|-1; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03312; MF=ligs@dtdream.com; NM=1; PH=DS; RN=3; RT=3; SR=0; TI=SMTPD_---.97L8Qpp_1507874476; Received: from localhost.localdomain(mailfrom:ligs@dtdream.com ip:222.128.6.202) by smtp.aliyun-inc.com(10.147.42.135); Fri, 13 Oct 2017 14:01:17 +0800 From: Guoshuai Li To: dev@openvswitch.org Date: Fri, 13 Oct 2017 14:01:07 +0800 Message-Id: <20171013060107.23592-1-ligs@dtdream.com> X-Mailer: git-send-email 2.13.2.windows.1 X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: huwh@dtdream.com Subject: [ovs-dev] [PATCH] netdev-linux: do not remove ingress qdisc when disable policing. 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 rate limiting may be implemented in other ways (such as nova), this time need to disable rate limiting. I think it should not remove tc qdisk when ingress_policing_burst is disabled. Signed-off-by: Guoshuai Li Co-authored-by: huweihua --- lib/netdev-linux.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 2ff3e2bcc..eafe38257 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -2127,16 +2127,16 @@ netdev_linux_set_policing(struct netdev *netdev_, goto out; } - COVERAGE_INC(netdev_set_policing); - /* Remove any existing ingress qdisc. */ - error = tc_add_del_ingress_qdisc(ifindex, false); - if (error) { - VLOG_WARN_RL(&rl, "%s: removing policing failed: %s", - netdev_name, ovs_strerror(error)); - goto out; - } - if (kbits_rate) { + COVERAGE_INC(netdev_set_policing); + /* Remove any existing ingress qdisc. */ + error = tc_add_del_ingress_qdisc(ifindex, false); + if (error) { + VLOG_WARN_RL(&rl, "%s: removing policing failed: %s", + netdev_name, ovs_strerror(error)); + goto out; + } + error = tc_add_del_ingress_qdisc(ifindex, true); if (error) { VLOG_WARN_RL(&rl, "%s: adding policing qdisc failed: %s",