summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
diff options
context:
space:
mode:
authorWeihang Li <liweihang@hisilicon.com>2019-06-07 10:03:13 +0800
committerDavid S. Miller <davem@davemloft.net>2019-06-09 13:20:59 -0700
commit9b2f3477d1edbb1bc52e78cb935976b10380b801 (patch)
treec889a994368c39b2fc7d10cae229cbb1c14a9679 /drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
parent63cbf7a9414291597ec2fd1d8bc5040a2711f1e7 (diff)
net: hns3: fix some coding style issues
This patch fixes some coding style issues reported by some static code analysis tools and code review, such as modify some comments, rename some variables, log some errors in detail, and fixes some alignment errors. BTW, these cleanups do not change the logic of code. Signed-off-by: Weihang Li <liweihang@hisilicon.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> Signed-off-by: HuiSong Li <lihuisong@huawei.com> Signed-off-by: Jian Shen <shenjian15@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index 49b40723bcfa..6ce724d54280 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -150,6 +150,12 @@ static void hns3_lp_setup_skb(struct sk_buff *skb)
packet = skb_put(skb, HNS3_NIC_LB_TEST_PACKET_SIZE);
memcpy(ethh->h_dest, ndev->dev_addr, ETH_ALEN);
+
+ /* The dst mac addr of loopback packet is the same as the host'
+ * mac addr, the SSU component may loop back the packet to host
+ * before the packet reaches mac or serdes, which will defect
+ * the purpose of mac or serdes selftest.
+ */
ethh->h_dest[5] += 0x1f;
eth_zero_addr(ethh->h_source);
ethh->h_proto = htons(ETH_P_ARP);