From patchwork Tue Sep 12 08:52:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 812736 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 3xrz7t2cZnz9s81 for ; Tue, 12 Sep 2017 18:52:25 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 65856B00; Tue, 12 Sep 2017 08:52:22 +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 47253AB7 for ; Tue, 12 Sep 2017 08:52:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id DF671127 for ; Tue, 12 Sep 2017 08:52:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58484356D6 for ; Tue, 12 Sep 2017 08:52:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 58484356D6 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=nusiddiq@redhat.com Received: from numans.blr.redhat.com (ovpn-116-107.sin2.redhat.com [10.67.116.107]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B2D817AA0; Tue, 12 Sep 2017 08:52:17 +0000 (UTC) From: nusiddiq@redhat.com To: dev@openvswitch.org Date: Tue, 12 Sep 2017 14:22:03 +0530 Message-Id: <20170912085203.30026-1-nusiddiq@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 12 Sep 2017 08:52:20 +0000 (UTC) X-Spam-Status: No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] ofproto: Include patch ports in mtu overriden check 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: Numan Siddique When a patch port is deleted from the bridge (with no other ports in the bridge) and if the bridge was set to an MTU by the user earlier, the MTU of the bridge is overriden to 1500. Please see the below link for the steps to reproduce the issue. This patch fixes this issue. Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-September/338665.html Signed-off-by: Numan Siddique --- ofproto/ofproto.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 7541af0b2..9950897b8 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2721,18 +2721,20 @@ init_ports(struct ofproto *p) } static bool -ofport_is_internal(const struct ofproto *p, const struct ofport *port) +ofport_is_internal_or_patch(const struct ofproto *p, const struct ofport *port) { return !strcmp(netdev_get_type(port->netdev), - ofproto_port_open_type(p->type, "internal")); + ofproto_port_open_type(p->type, "internal")) || + !strcmp(netdev_get_type(port->netdev), + ofproto_port_open_type(p->type, "patch")); } -/* If 'port' is internal and if the user didn't explicitly specify an mtu - * through the database, we have to override it. */ +/* If 'port' is internal or patch and if the user didn't explicitly specify an + * mtu through the database, we have to override it. */ static bool ofport_is_mtu_overridden(const struct ofproto *p, const struct ofport *port) { - return ofport_is_internal(p, port) + return ofport_is_internal_or_patch(p, port) && !netdev_mtu_is_user_config(port->netdev); }