linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xue Chaojing <xuechaojing@huawei.com>
To: <davem@davemloft.net>
Cc: <linux-kernel@vger.kernel.org>, <xuechaojing@huawei.com>,
	<netdev@vger.kernel.org>, <wulike1@huawei.com>,
	<chiqijun@huawei.com>, <fy.wang@huawei.com>, <tony.qu@huawei.com>,
	<luoshaokai@huawei.com>
Subject: [PATCH 3/4] net-next/hinic:fix a bug in set mac address
Date: Mon, 19 Nov 2018 06:12:33 +0000	[thread overview]
Message-ID: <20181119061234.12839-3-xuechaojing@huawei.com> (raw)
In-Reply-To: <20181119061234.12839-1-xuechaojing@huawei.com>

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 <xuechaojing@huawei.com>
---
 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


  parent reply	other threads:[~2018-11-19 14:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19  6:12 [PATCH 1/4] net-next/hinic:replace multiply and division operators Xue Chaojing
2018-11-19  6:12 ` [PATCH 2/4] net-next/hinic:add rx checksum offload for HiNIC Xue Chaojing
2018-11-19  6:12 ` Xue Chaojing [this message]
2018-11-19  6:12 ` [PATCH 4/4] net-next/hinic: fix a bug in rx data flow Xue Chaojing
2018-11-19 23:01 ` [PATCH 1/4] net-next/hinic:replace multiply and division operators David Miller
2018-11-20  2:21   ` 答复: " xuechaojing
2018-11-20  3:00     ` David Miller
2018-11-20  5:47 Xue Chaojing
2018-11-20  5:47 ` [PATCH 3/4] net-next/hinic:fix a bug in set mac address Xue Chaojing
2018-11-20 18:38   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181119061234.12839-3-xuechaojing@huawei.com \
    --to=xuechaojing@huawei.com \
    --cc=chiqijun@huawei.com \
    --cc=davem@davemloft.net \
    --cc=fy.wang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luoshaokai@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=tony.qu@huawei.com \
    --cc=wulike1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).