Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2785596imu; Mon, 19 Nov 2018 06:08:49 -0800 (PST) X-Google-Smtp-Source: AJdET5fi6XKrQRjx/6Kc8Zxy6qDsayteH/5bedcwc+KhmchPhFIRdXeIcxEiOLKQ25Qh/MpO5soU X-Received: by 2002:a62:51c1:: with SMTP id f184-v6mr23365536pfb.101.1542636528971; Mon, 19 Nov 2018 06:08:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542636528; cv=none; d=google.com; s=arc-20160816; b=SgrLyG2hr/WJmHx/0y+UgDPP7YcRx4uVhBMULYgbiqPgY7zIhzqYvqwAVhprTDiZpS 5hMBrWEu6wngdDXnpgNcVp3YoS5GBLxjNyGZoh8bPXkXg+1LfRlmEdjvu1s/+QOIFiDm sD5JimFIxrkD6d9CXPOWwMl3P7ndlquj3tR+GdLBXyCZ3IuOxihLAMbEOExP17AwHMKs xxxid+g3z1o7m7apXcZICLghvgPd89a6y9aO+ZJa9yDIoprpIcL6G6T6aZERlHRGzxB3 UuMQXdrXG9cpjGwGHfnyNQQCXv8JBSJyK1GD78XKG/mLxFl61w1AmarNbrexu+UcqVRg DU0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=mhCdAiETVWrIQMqwKso+4u6xlwCtu0trLrjF53Pm+BA=; b=u41aQBJdoIF1XNxm3oBD21q0weLUJbN4/V8lquwdECteLxHSY9kcqf5QzVxRUwiCC9 ZODD1NqaW0JzqDQlbbs/roNopsBa4L/X1S1gCfF7NhXuyNG2A9czZ/eNqfiKDVBnl08h aYpk9Iocwj3sLVip414inQy9w7xkJU7EZ/JudSsf3naGPAkwK+dEMYVcSbj3KxkmGFw1 0SJ75HHbk+dQ063j5LZoVbtsAM3BunGDvOakcfeeA0Gw9EhKcVQPtXtlN5isTIPtJotz CAgNt7H5N+eE2VXAWbWck/Xp7tfXMm2yoUyDmK6nY36/RErSZTRbCvSsfYeHOL10cNUs zh/A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s22-v6si40424156pfs.13.2018.11.19.06.08.34; Mon, 19 Nov 2018 06:08:48 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729464AbeKTAaM (ORCPT + 99 others); Mon, 19 Nov 2018 19:30:12 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:37394 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729350AbeKTAaM (ORCPT ); Mon, 19 Nov 2018 19:30:12 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A084A26FAD1D4; Mon, 19 Nov 2018 22:06:24 +0800 (CST) Received: from localhost.localdomain (10.175.34.53) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.408.0; Mon, 19 Nov 2018 22:06:20 +0800 From: Xue Chaojing To: CC: , , , , , , , Subject: [PATCH 3/4] net-next/hinic:fix a bug in set mac address Date: Mon, 19 Nov 2018 06:12:33 +0000 Message-ID: <20181119061234.12839-3-xuechaojing@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181119061234.12839-1-xuechaojing@huawei.com> References: <20181119061234.12839-1-xuechaojing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.34.53] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In add_mac_addr(), if the MAC address is a muliticast address, it will not be set, which causes the network card fail to receive the multicast packet. This patch fixes this bug. Signed-off-by: Xue Chaojing --- drivers/net/ethernet/huawei/hinic/hinic_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c index 0179b6bf124c..6d48dc62a44b 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c @@ -600,9 +600,6 @@ static int add_mac_addr(struct net_device *netdev, const u8 *addr) u16 vid = 0; int err; - if (!is_valid_ether_addr(addr)) - return -EADDRNOTAVAIL; - netif_info(nic_dev, drv, netdev, "set mac addr = %02x %02x %02x %02x %02x %02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); @@ -734,6 +731,9 @@ static void set_rx_mode(struct work_struct *work) __dev_uc_sync(nic_dev->netdev, add_mac_addr, remove_mac_addr); __dev_mc_sync(nic_dev->netdev, add_mac_addr, remove_mac_addr); + + netdev_for_each_mc_addr(ha, nic_dev->netdev) + add_mac_addr(nic_dev->netdev, ha->addr); } static void hinic_set_rx_mode(struct net_device *netdev) -- 2.17.1