Merge branch 'hns3-fixes'
Huazhong Tan says: ==================== net: hns3: fixes for -net There are some fixes about reset issue and a use-after-free of self-test. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
eadede5f93
@ -4127,9 +4127,8 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)
|
||||
|
||||
hns3_put_ring_config(priv);
|
||||
|
||||
hns3_dbg_uninit(handle);
|
||||
|
||||
out_netdev_free:
|
||||
hns3_dbg_uninit(handle);
|
||||
free_netdev(netdev);
|
||||
}
|
||||
|
||||
|
@ -180,18 +180,21 @@ static void hns3_lb_check_skb_data(struct hns3_enet_ring *ring,
|
||||
{
|
||||
struct hns3_enet_tqp_vector *tqp_vector = ring->tqp_vector;
|
||||
unsigned char *packet = skb->data;
|
||||
u32 len = skb_headlen(skb);
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < skb->len; i++)
|
||||
len = min_t(u32, len, HNS3_NIC_LB_TEST_PACKET_SIZE);
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
if (packet[i] != (unsigned char)(i & 0xff))
|
||||
break;
|
||||
|
||||
/* The packet is correctly received */
|
||||
if (i == skb->len)
|
||||
if (i == HNS3_NIC_LB_TEST_PACKET_SIZE)
|
||||
tqp_vector->rx_group.total_packets++;
|
||||
else
|
||||
print_hex_dump(KERN_ERR, "selftest:", DUMP_PREFIX_OFFSET, 16, 1,
|
||||
skb->data, skb->len, true);
|
||||
skb->data, len, true);
|
||||
|
||||
dev_kfree_skb_any(skb);
|
||||
}
|
||||
|
@ -9859,7 +9859,7 @@ retry:
|
||||
set_bit(HCLGE_STATE_RST_HANDLING, &hdev->state);
|
||||
hdev->reset_type = HNAE3_FLR_RESET;
|
||||
ret = hclge_reset_prepare(hdev);
|
||||
if (ret) {
|
||||
if (ret || hdev->reset_pending) {
|
||||
dev_err(&hdev->pdev->dev, "fail to prepare FLR, ret=%d\n",
|
||||
ret);
|
||||
if (hdev->reset_pending ||
|
||||
|
@ -1793,6 +1793,11 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev)
|
||||
if (hdev->reset_type == HNAE3_VF_FUNC_RESET) {
|
||||
hclgevf_build_send_msg(&send_msg, HCLGE_MBX_RESET, 0);
|
||||
ret = hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0);
|
||||
if (ret) {
|
||||
dev_err(&hdev->pdev->dev,
|
||||
"failed to assert VF reset, ret = %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
hdev->rst_stats.vf_func_rst_cnt++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user