Thread (12 messages) flat view 12 messages, 2 authors, 2021-02-04

Re: [PATCH net-next 4/7] net: hns3: add support for obtaining the maximum frame length

From: Huazhong Tan <hidden>
Date: 2021-02-04 02:02:20

On 2021/2/4 8:56, Jakub Kicinski wrote:
On Tue, 2 Feb 2021 20:39:50 +0800 Huazhong Tan wrote:
quoted
From: Yufeng Mo <redacted>

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 <redacted>
Signed-off-by: Huazhong Tan <redacted>
@@ -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?
netdev->max_mtu should be adjusted as well, will fix it.

thanks.
.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help