Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8873486imu; Thu, 15 Nov 2018 20:03:18 -0800 (PST) X-Google-Smtp-Source: AJdET5eW8iaO6/sYUZQ0SWaxrCylK/r0hEZ/hYhj/WlWsdfcp2m+gL9oxI6v+DAanmZ+en9LHBnO X-Received: by 2002:a63:de4c:: with SMTP id y12mr8435427pgi.198.1542340998222; Thu, 15 Nov 2018 20:03:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542340998; cv=none; d=google.com; s=arc-20160816; b=psTKPCB5AEWbvQExl1YJ20q9OGRwqHBV+A8aXsbpnx9asK6hLVAXuWfDml3J/IG4sX lifL5xKvVn4ZimgTYAVb1iDB/6Td6V73rRoIN1Fsx1oisbVv1n/vEsDA+X64CYiR7y5A UAtRDUKNJv3/e0CFh0aqtkiiIpHZQvuVCErARSofRnW3xtUeTi+PUqCBRLbE8lJuzZ8a YwJRiCBhsezoJJD8N/2zXUkFvGn8FWUU6x7uLO/n3ON7dQn0g3huOoc/v6ID8mc99AFl 8pPs8kApO4DUhlV5IdnZNYJu3ttpPPZgufCmb11XC7Xtw9a3/qgWzK8Zxu1Do2PAURFi fT9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=XfXUgF4YudYfojo/NysGLylE7ZNozPFW91E2iNo9Fnc=; b=G9M5nNwbFNYt+3jHPAtCt7BST3pxmuOx2SJQkkgJksHJl3I+6r8QkbHO01CXrkpXb6 SlD8CS44MohrRy1ZsTQBpu5Ov0lByOOyGaTg+fgRGioXpfXO5jqHveyIFOSCBAt0sQUa dvW5IuIShDQmaU9w0av2wvqXMWCzlCo+oP4za/QMd48GsCJ9igXLCjJzm/XjICna8Mv7 YLcpqq9F+5csPPHKUkqVzy6norjvhPy0UL8BCuOTZ5x76BVhsTT+O+bWyKiRAV4I4puC fq6ylWpLV3eehCsdgN+DivVtnIS/KjCheuj08xVu0LOcD4Ex97PQHFjszk02SapauCsX s/TQ== 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 n11-v6si258590plg.87.2018.11.15.20.03.03; Thu, 15 Nov 2018 20:03:18 -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 S1727370AbeKPOK5 (ORCPT + 99 others); Fri, 16 Nov 2018 09:10:57 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:36585 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727110AbeKPOK5 (ORCPT ); Fri, 16 Nov 2018 09:10:57 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id EF9BD35F567C3; Fri, 16 Nov 2018 12:00:10 +0800 (CST) Received: from localhost.localdomain (10.175.34.53) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.408.0; Fri, 16 Nov 2018 12:00:03 +0800 From: Xue Chaojing To: CC: , , , , , , , Subject: [PATCH 1/3] net-next/hinic:fix a bug in set mac address Date: Thu, 15 Nov 2018 20:05:46 +0000 Message-ID: <20181115200548.5326-1-xuechaojing@huawei.com> X-Mailer: git-send-email 2.17.1 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 fdf2bdb6b0d0..cefd441bb117 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]); @@ -733,6 +730,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