Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3200807pxb; Mon, 9 Nov 2020 05:27:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZ4sJvGK0YYp3BuKjRQFCOW6QZg8UW5vSvkHPf8l75RomhoUKg/CHITywF+jbqJDsR0WEs X-Received: by 2002:a17:906:3a8d:: with SMTP id y13mr15438023ejd.460.1604928461751; Mon, 09 Nov 2020 05:27:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928461; cv=none; d=google.com; s=arc-20160816; b=FC1kfNwM9xRwS6+n9bkBB7mpeJMp4dW5QYdS9WxDv7omer+qrrSQPdDDMBs9CuqHh3 OthRK7mpvy6Ejk59Rb2GDyaBB7f5iBLnbAM1vJijTPcsBZHBg4nMdzHSrWFj6th3waG/ rvHxKM/DGZlrFAthhtrgQYYr+lCxBOxIWMXePvKowNrmlZDGbKqbsxsXdAcl2FZQhSD3 yTslA3Fqnzg05xuUAd23/bQzZywRgqNjj9BTgG1/7+N76ktk+fVUMNpbPOIkiIJz0hK3 rJWRF1WB6ymez5cOpaxtgtCVWiF85yQdToypi8UDPWBwNUP5ubbGxxZqoFK7QRfzhSGM 4WpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JQ6v4aLt9PbYf0WJputEVBBulV/Nf26IR0zzzHT1he0=; b=Mq7Sm+uv9D9G6HLOPxleua7KQtZ1QPklGvOVYXZe+VmwpTcfM0xVn8qEXDw0rswTw6 5VBVzY1mc3ZibP13zWlMl0qMzdW27kwkK3XfZvOyzBnRSC5nLrevn8gHr8+zbaNJs6Sz 9+2ykYOdrsb8gVaRZYa1ffCwpm0lwjduzvqkLt//mqY5CxHEN5dWJzqCqvsSkAqjsMWA LeA2MNFl3ip8QOhAX2l5ON2lobCp6BB4aGs2aQm/JwV06CwLfvF4UvxpFio6b+NHj9JV V1tanJCv4z4bFnrJeWh67HKBfNC5FPKWmrPBGM7xY0rn22EibEPkDZX3kpguTzKLJKDU sHsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tROMvRuY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si6899184edp.407.2020.11.09.05.27.18; Mon, 09 Nov 2020 05:27:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tROMvRuY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387647AbgKINZ5 (ORCPT + 99 others); Mon, 9 Nov 2020 08:25:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:44540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732531AbgKINRW (ORCPT ); Mon, 9 Nov 2020 08:17:22 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39D75206D8; Mon, 9 Nov 2020 13:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927841; bh=tzG8aeK6c6SEBJMFTmnK1dxRhxpk02RmeRg9fVEBMGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tROMvRuYeznyxNG2U7QvR6L0Lkv+UaEKtLKJ+6N4NFLRg0yhcLlGT1ee4wnnIQQsN VCg3m47S8A53s89s+TzChycBGGqzAQfbA2a6qsbpiBtRPLYjXNpy9d0aKrUT/b0Q1w 8ulQ3Xdz3q6uq7D6icW6b8vK0uH9gcmgxD9a8twU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, DENG Qingfang , Jonathan McDowell , Andrew Lunn , Jakub Kicinski Subject: [PATCH 5.9 040/133] net: dsa: qca8k: Fix port MTU setting Date: Mon, 9 Nov 2020 13:55:02 +0100 Message-Id: <20201109125032.639079509@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125030.706496283@linuxfoundation.org> References: <20201109125030.706496283@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan McDowell [ Upstream commit 99cab7107d914a71c57f5a4e6d34292425fbbb61 ] The qca8k only supports a switch-wide MTU setting, and the code to take the max of all ports was only looking at the port currently being set. Fix to examine all ports. Reported-by: DENG Qingfang Fixes: f58d2598cf70 ("net: dsa: qca8k: implement the port MTU callbacks") Signed-off-by: Jonathan McDowell Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20201030183315.GA6736@earth.li Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/qca8k.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -1219,8 +1219,8 @@ qca8k_port_change_mtu(struct dsa_switch priv->port_mtu[port] = new_mtu; for (i = 0; i < QCA8K_NUM_PORTS; i++) - if (priv->port_mtu[port] > mtu) - mtu = priv->port_mtu[port]; + if (priv->port_mtu[i] > mtu) + mtu = priv->port_mtu[i]; /* Include L2 header / FCS length */ qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_LEN);