net: hns3: pad the short frame before sending to the hardware
authorYunsheng Lin <linyunsheng@huawei.com>
Wed, 15 Jan 2020 02:46:45 +0000 (10:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:22:50 +0000 (08:22 +0100)
commit284678e237a55724be9182e89feeb131354eb830
tree81354771d998aac6aa4a2e3066f15cdc5757a55e
parent42667f36bcdb39796d1254185921c7314f1d3499
net: hns3: pad the short frame before sending to the hardware

[ Upstream commit 36c67349a1a1c88b9cf11d7ca7762ababdb38867 ]

The hardware can not handle short frames below or equal to 32
bytes according to the hardware user manual, and it will trigger
a RAS error when the frame's length is below 33 bytes.

This patch pads the SKB when skb->len is below 33 bytes before
sending it to hardware.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c