On Tue, 2 Feb 2021 20:39:50 +0800 Huazhong Tan wrote:
> From: Yufeng Mo <moyuf...@huawei.com>
> 
> 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 <moyuf...@huawei.com>
> Signed-off-by: Huazhong Tan <tanhuazh...@huawei.com>

> @@ -9659,7 +9663,7 @@ int hclge_set_vport_mtu(struct hclge_vport *vport, int 
> new_mtu)
>       /* HW supprt 2 layer vlan */
>       max_frm_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN;
>       if (max_frm_size < HCLGE_MAC_MIN_FRAME ||
> -         max_frm_size > HCLGE_MAC_MAX_FRAME)
> +         max_frm_size > hdev->ae_dev->dev_specs.max_pkt_len)
>               return -EINVAL;
>  
>       max_frm_size = max(max_frm_size, HCLGE_MAC_DEFAULT_FRAME);

Don't you have to adjust netdev->max_mtu as well when device specifies
max_pkt_len different than HCLGE_MAC_MAX_FRAME?

Reply via email to