From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33E25C3A59F for ; Thu, 29 Aug 2019 18:19:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D9C32166E for ; Thu, 29 Aug 2019 18:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567102749; bh=4L+TXUYoB3dgZIU4fHI0aqRn5eB6IbrmF5Emxq6NFfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DEmtjDZTfQ8+MgHf+ZcZy8a3bZgCvReebhFTGnc6tx8CRqWowtuav/jcqsQDn/gcq +ShJASgwrBIjKJ/nOsyP/fE0s/T/EVw6AdysdKEbw8m3dNSnUtDQeWdU7zTKm/sVYw cYmcA4rum16SvkJGJlCiJMxrsaKf+aWaYsMZWrQE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730356AbfH2SSN (ORCPT ); Thu, 29 Aug 2019 14:18:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:60380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729543AbfH2SSI (ORCPT ); Thu, 29 Aug 2019 14:18:08 -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 C3E192166E; Thu, 29 Aug 2019 18:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567102687; bh=4L+TXUYoB3dgZIU4fHI0aqRn5eB6IbrmF5Emxq6NFfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rnl+FZ94yq9m/8bqaHT7uwbi6shbuui8VKVSlHbnTXf/KwsH80+bGaNAgx+rThzCW mGKMNt0Q0jhPB8sH0nTN8Kg+/uQKWMNiTowgyN9Y+6trAhKJ4vRUCUP+R4Sfn536eg k0W9SHY8u67ybP0y67Ta/Ul4f7/0UGGeybsrT9Q4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thomas Falcon , Hangbin Liu , Jakub Kicinski , Sasha Levin , linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.4 04/15] ibmveth: Convert multicast list size for little-endian system Date: Thu, 29 Aug 2019 14:17:51 -0400 Message-Id: <20190829181802.9619-4-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190829181802.9619-1-sashal@kernel.org> References: <20190829181802.9619-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 70b3253e7ed5e..b46fc37c1a947 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -1555,7 +1555,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; @@ -1577,8 +1577,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"); @@ -1595,7 +1596,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