Skip to content

Commit

Permalink
net: hns3: fix GRE checksum offload issue
Browse files Browse the repository at this point in the history
[ Upstream commit f9f6512 ]

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 <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Jie Wang authored and gregkh committed Oct 6, 2023
1 parent 430f18e commit ed6a0b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3352,6 +3352,15 @@ static void hns3_set_default_feature(struct net_device *netdev)
NETIF_F_HW_TC);

netdev->hw_enc_features |= netdev->vlan_features | NETIF_F_TSO_MANGLEID;

/* 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.
*/
if (ae_dev->dev_version > HNAE3_DEVICE_VERSION_V2) {
netdev->features &= ~NETIF_F_GSO_GRE;
netdev->features &= ~NETIF_F_GSO_GRE_CSUM;
}
}

static int hns3_alloc_buffer(struct hns3_enet_ring *ring,
Expand Down

0 comments on commit ed6a0b2

Please sign in to comment.