Skip to content

Commit 5f8621c

Browse files
author
Paolo Abeni
committed
Merge branch 'there-are-some-bugfix-for-the-hns3-ethernet-driver'
Jijie Shao says: ==================== There are some bugfix for the HNS3 ethernet driver ==================== Link: https://lore.kernel.org/r/20230918074840.2650978-1-shaojijie@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents 8070274 + 0770063 commit 5f8621c

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3353,6 +3353,15 @@ static void hns3_set_default_feature(struct net_device *netdev)
33533353
NETIF_F_HW_TC);
33543354

33553355
netdev->hw_enc_features |= netdev->vlan_features | NETIF_F_TSO_MANGLEID;
3356+
3357+
/* The device_version V3 hardware can't offload the checksum for IP in
3358+
* GRE packets, but can do it for NvGRE. So default to disable the
3359+
* checksum and GSO offload for GRE.
3360+
*/
3361+
if (ae_dev->dev_version > HNAE3_DEVICE_VERSION_V2) {
3362+
netdev->features &= ~NETIF_F_GSO_GRE;
3363+
netdev->features &= ~NETIF_F_GSO_GRE_CSUM;
3364+
}
33563365
}
33573366

33583367
static int hns3_alloc_buffer(struct hns3_enet_ring *ring,

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3564,9 +3564,14 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)
35643564
static void hclge_clear_event_cause(struct hclge_dev *hdev, u32 event_type,
35653565
u32 regclr)
35663566
{
3567+
#define HCLGE_IMP_RESET_DELAY 5
3568+
35673569
switch (event_type) {
35683570
case HCLGE_VECTOR0_EVENT_PTP:
35693571
case HCLGE_VECTOR0_EVENT_RST:
3572+
if (regclr == BIT(HCLGE_VECTOR0_IMPRESET_INT_B))
3573+
mdelay(HCLGE_IMP_RESET_DELAY);
3574+
35703575
hclge_write_dev(&hdev->hw, HCLGE_MISC_RESET_STS_REG, regclr);
35713576
break;
35723577
case HCLGE_VECTOR0_EVENT_MBX:
@@ -7348,6 +7353,12 @@ static int hclge_del_cls_flower(struct hnae3_handle *handle,
73487353
ret = hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, rule->location,
73497354
NULL, false);
73507355
if (ret) {
7356+
/* if tcam config fail, set rule state to TO_DEL,
7357+
* so the rule will be deleted when periodic
7358+
* task being scheduled.
7359+
*/
7360+
hclge_update_fd_list(hdev, HCLGE_FD_TO_DEL, rule->location, NULL);
7361+
set_bit(HCLGE_STATE_FD_TBL_CHANGED, &hdev->state);
73517362
spin_unlock_bh(&hdev->fd_rule_lock);
73527363
return ret;
73537364
}
@@ -8824,7 +8835,7 @@ static void hclge_update_overflow_flags(struct hclge_vport *vport,
88248835
if (mac_type == HCLGE_MAC_ADDR_UC) {
88258836
if (is_all_added)
88268837
vport->overflow_promisc_flags &= ~HNAE3_OVERFLOW_UPE;
8827-
else
8838+
else if (hclge_is_umv_space_full(vport, true))
88288839
vport->overflow_promisc_flags |= HNAE3_OVERFLOW_UPE;
88298840
} else {
88308841
if (is_all_added)

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,8 @@ static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev)
18551855
unsigned long delta = round_jiffies_relative(HZ);
18561856
struct hnae3_handle *handle = &hdev->nic;
18571857

1858-
if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state))
1858+
if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state) ||
1859+
test_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state))
18591860
return;
18601861

18611862
if (time_is_after_jiffies(hdev->last_serv_processed + HZ)) {

0 commit comments

Comments
 (0)