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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 EAEE6C4332F for ; Sun, 8 Sep 2019 12:44:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C017C218AF for ; Sun, 8 Sep 2019 12:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946685; bh=i0KQj4flXuocLpw+5+pNDsTA/Ti5gXeouuUUqgiGBHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yXJpeipSWOpVo8ysm86Np/10DmTXrEH9Nly+WIlJk9HI3e1yfHFwYWN3vErEea5kj ceWXyhndXGOt9W9yD5GUrm01Iy896Pzd/S6jMl1kF/sHcifp/4Ijj2RUHLoIE01ruu oNHW1oqXHs7iHwgIWc2mFswNWM83qfb7pPye3lew= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729898AbfIHMop (ORCPT ); Sun, 8 Sep 2019 08:44:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728979AbfIHMon (ORCPT ); Sun, 8 Sep 2019 08:44:43 -0400 Received: from localhost (unknown [62.28.240.114]) (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 7D21F2081B; Sun, 8 Sep 2019 12:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946683; bh=i0KQj4flXuocLpw+5+pNDsTA/Ti5gXeouuUUqgiGBHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UOn8Ybz0E7WsznOv+uMm/KSahZPt1kZfVexDWxjrs5SxZbYz5Q6T3P6J1Gu++Vj9W JtU1nuSYwhBpSrCL3hFrV9RwgEzWYvJ/YmIRM9F04oGUWZzW/vJaCsOctNoMuRoSXO J79oXsW0rkG+jOChAHse3skVhCeNNEzM2wnfBp9o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangbin Liu , Thomas Falcon , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.9 04/26] ibmveth: Convert multicast list size for little-endian system Date: Sun, 8 Sep 2019 13:41:43 +0100 Message-Id: <20190908121058.402845762@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121057.216802689@linuxfoundation.org> References: <20190908121057.216802689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 955f658f3b65f..de9897c8e9331 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -1557,7 +1557,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; @@ -1579,8 +1579,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"); @@ -1597,7 +1598,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