Skip to content

Commit f9f6512

Browse files
Jie WangPaolo Abeni
authored andcommitted
net: hns3: fix GRE checksum offload issue
The device_version V3 hardware can't offload the checksum for IP in GRE packets, but can do it for NvGRE. So default to disable the checksum and GSO offload for GRE, but keep the ability to enable it when only using NvGRE. Fixes: 76ad4f0 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Jie Wang <[email protected]> Signed-off-by: Jijie Shao <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent bd3cadd commit f9f6512

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
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,

0 commit comments

Comments
 (0)