aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
diff options
context:
space:
mode:
authorYufeng Mo <moyufeng@huawei.com>2021-02-05 16:32:47 +0800
committerJakub Kicinski <kuba@kernel.org>2021-02-06 14:36:05 -0800
commite070c8b91ac1c7810c8448b1e5534d1895a0c7f4 (patch)
tree1cd742d7f9b677416a4da6548e456aca8333e887 /drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
parentnet: hns3: optimize the code when update the tc info (diff)
downloadlinux-dev-e070c8b91ac1c7810c8448b1e5534d1895a0c7f4.tar.xz
linux-dev-e070c8b91ac1c7810c8448b1e5534d1895a0c7f4.zip
net: hns3: add support for obtaining the maximum frame size
Since the newer hardware may supports different frame size, so add support to obtain the capability from the firmware instead of the fixed value. Signed-off-by: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_enet.h')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_enet.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index 0a7b606e7c93..d70af1d0d554 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -56,9 +56,8 @@ enum hns3_nic_state {
#define HNS3_RING_MIN_PENDING 72
#define HNS3_RING_BD_MULTIPLE 8
/* max frame size of mac */
-#define HNS3_MAC_MAX_FRAME 9728
-#define HNS3_MAX_MTU \
- (HNS3_MAC_MAX_FRAME - (ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN))
+#define HNS3_MAX_MTU(max_frm_size) \
+ ((max_frm_size) - (ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN))
#define HNS3_BD_SIZE_512_TYPE 0
#define HNS3_BD_SIZE_1024_TYPE 1