Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2671364ybl; Thu, 29 Aug 2019 11:15:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhzmhKk2+Z1yyUpzdqPchM6duUGDaPQ9K/ongJOBo79akk2/MvPhSJBYhAuELLPJDk8dMI X-Received: by 2002:a63:5a4d:: with SMTP id k13mr9311015pgm.174.1567102529417; Thu, 29 Aug 2019 11:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567102529; cv=none; d=google.com; s=arc-20160816; b=tb8sa+p1gtzdxOyF89Chx1cDw0/smlGyPaSjpH7BYepSK5Pw/xtZ1Kd/htE/X+GjPU CyxvHE2rJTLtLrn5qmUBNomeMgxqEtJw9krY1MxW8UIvbHwpD2/UlMD0nkwprQi+mAU3 e8icp6q/JXb1hFtocn77x6RAu/5wkfvD1Of1AAeT/n1lloGu8c5lXZpfEuvNRt6XfmSb hjONR36FooaOQQSZKQuBXj+qC96fCve3tNJ37CW4aW8hzOrNdmJP5tmowGXD6+imm+MT oJjcav929w14MHbsQd4F+ukR0iHgR1V0JoSudUmhhdUt/U1SmkiYU6RrdDtRIFrK8pVS LO9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R3Fo7vsmu5+FhK16LtQprU0LZgIo6sckThGa8dJZSm4=; b=YG7aSoAEQNb1WHBXyLKd61HC+Ybe/KUCPVATrVRv/09v6jHXnycrnJBeqHgsmAJhFA TfLNTXPpOFEeX4svv/pFUPuVAMiqLpBU71ENkB/xHtjMRQS+DNRtiO0++KRuXKmPAr2l mNaqnRxKUoBAnMuvl9V+KOuOxDOaxq+feBngJ+CgfsIbLZrW4AJK980ohHDO52xdL1Lh BZRQbHNkvvsbnT10VXaUyjHoUsMwsgD2tzMAb9qUUmRGJeScB7cMZf0pMppStlX0vNUV S+HOmUEt0eHQ1AUCzTPzlq36eNE1rSPy7IM17IxG9SvVG+huwLxJ+eAbvhCm3KFAmFbE brVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=om5qpb4c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k25si3234151pfi.265.2019.08.29.11.15.14; Thu, 29 Aug 2019 11:15:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=om5qpb4c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728673AbfH2SN6 (ORCPT + 99 others); Thu, 29 Aug 2019 14:13:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:55624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728606AbfH2SNy (ORCPT ); Thu, 29 Aug 2019 14:13:54 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 73E4123405; Thu, 29 Aug 2019 18:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567102433; bh=+2KGPUyGeLbKlAPqtEd7NmKzuZE+W+nvBoALCjkf4ww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=om5qpb4cx6Jbo+LDoS4LB5hQ4Zt3CISCs/u87j7Zww74XG4zlxpbmODWLqVOA36kw 7x/7RjriQzuYzkwW+lk0I2Y12EF2fTJ0QBgEuUMT0Y21Wg6h+2OdeK6mjcY8VFaUgx GvIVnzeaRqR3WxKsefEW6WHHp33q7Z9BEvCJaRwg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thomas Falcon , Hangbin Liu , Jakub Kicinski , Sasha Levin , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.2 22/76] ibmveth: Convert multicast list size for little-endian system Date: Thu, 29 Aug 2019 14:12:17 -0400 Message-Id: <20190829181311.7562-22-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190829181311.7562-1-sashal@kernel.org> References: <20190829181311.7562-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Falcon [ Upstream commit 66cf4710b23ab2adda11155684a2c8826f4fe732 ] The ibm,mac-address-filters property defines the maximum number of addresses the hypervisor's multicast filter list can support. It is encoded as a big-endian integer in the OF device tree, but the virtual ethernet driver does not convert it for use by little-endian systems. As a result, the driver is not behaving as it should on affected systems when a large number of multicast addresses are assigned to the device. Reported-by: Hangbin Liu Signed-off-by: Thomas Falcon Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmveth.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index d654c234aaf75..c5be4ebd84373 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -1605,7 +1605,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) struct net_device *netdev; struct ibmveth_adapter *adapter; unsigned char *mac_addr_p; - unsigned int *mcastFilterSize_p; + __be32 *mcastFilterSize_p; long ret; unsigned long ret_attr; @@ -1627,8 +1627,9 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) return -EINVAL; } - mcastFilterSize_p = (unsigned int *)vio_get_attribute(dev, - VETH_MCAST_FILTER_SIZE, NULL); + mcastFilterSize_p = (__be32 *)vio_get_attribute(dev, + VETH_MCAST_FILTER_SIZE, + NULL); if (!mcastFilterSize_p) { dev_err(&dev->dev, "Can't find VETH_MCAST_FILTER_SIZE " "attribute\n"); @@ -1645,7 +1646,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) adapter->vdev = dev; adapter->netdev = netdev; - adapter->mcastFilterSize = *mcastFilterSize_p; + adapter->mcastFilterSize = be32_to_cpu(*mcastFilterSize_p); adapter->pool_config = 0; netif_napi_add(netdev, &adapter->napi, ibmveth_poll, 16); -- 2.20.1