为什么 MTU 从 1500 更改为 9000

为什么 MTU 从 1500 更改为 9000

/var/log/message文件中我们发现了一些有趣的东西

Mar  9 07:08:32 linux54 kernel: ixgbe 0000:0b:00.1 en3j87: changing MTU from 1500 to 9000

我们可以看到接口卡 - en3j87 从 1500 MTU 更改为 9000

这正常吗?

Mar  9 07:07:33 linux54 dbus-daemon: dbus[1153]: [system] Successfully activated service 'org.freedesktop.problems'
Mar  9 07:08:30 linux54 kernel: ixgbe 0000:0b:00.1: registered PHC device on en3j87
Mar  9 07:08:30 linux54 kernel: IPv6: ADDRCONF(NETDEV_UP): en3j87: link is not ready
Mar  9 07:08:31 linux54 kernel: ixgbe 0000:0b:00.1 en3j87: detected SFP+: 5
Mar  9 07:08:31 linux54 kernel: ixgbe 0000:0b:00.1 en3j87: NIC Link is Up 10 Gbps, Flow Control: RX/TX
Mar  9 07:08:31 linux54 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): en3j87: link becomes ready
Mar  9 07:08:32 linux54 kernel: ixgbe 0000:0b:00.1: removed PHC on en3j87
Mar  9 07:08:32 linux54 kernel: ixgbe 0000:0b:00.1 en3j87: changing MTU from 1500 to 9000
Mar  9 07:08:32 linux54 kernel: ixgbe 0000:0b:00.1: registered PHC device on en3j87
Mar  9 07:08:32 linux54 kernel: IPv6: ADDRCONF(NETDEV_UP): en3j87: link is not ready
Mar  9 07:08:32 linux54 kernel: team0: Port device en3j87 added
Mar  9 07:08:32 linux54 kernel: ixgbe 0000:0b:00.1 en3j87: detected SFP+: 5
Mar  9 07:08:33 linux54 kernel: ixgbe 0000:0b:00.1 en3j87: NIC Link is Up 10 Gbps, Flow Control: RX/TX
Mar  9 07:08:33 linux54 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): en3j87: link becomes ready

答案1

这意味着您的接口已配置为使用巨型帧。如果连接正常,则无需担心,并且您将获得更高的吞吐量。 (如果有效,说明该接口所连接的网络设备也已配置了巨型帧。)

接口以传统的 1500 字节 MTU 开始,并在必要时由网络设置重新配置为 9000(在 RHEL 中,如果接口配置指定MTU=9000)。您看到的日志消息完全正常。

答案2

该消息是您的网络模块 ( ) 的特定信息ixgbe,并且完全正常(不是问题)。如果您查看该模块的源代码,文件ixgbe_main.c第 6719 行,您会注意到每当发生 MTU 更改时驱动程序都会发出通知。上下文代码片段:

static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
{
    struct ixgbe_adapter *adapter = netdev_priv(netdev);

    if (adapter->xdp_prog) {
        int new_frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN +
                     VLAN_HLEN;
        int i;

        for (i = 0; i < adapter->num_rx_queues; i++) {
            struct ixgbe_ring *ring = adapter->rx_ring[i];

            if (new_frame_size > ixgbe_rx_bufsz(ring)) {
                e_warn(probe, "Requested MTU size is not supported with XDP\n");
                return -EINVAL;
            }
        }
    }

    /*
     * For 82599EB we cannot allow legacy VFs to enable their receive
     * paths when MTU greater than 1500 is configured.  So display a
     * warning that legacy VFs will be disabled.
     */
    if ((adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) &&
        (adapter->hw.mac.type == ixgbe_mac_82599EB) &&
        (new_mtu > ETH_DATA_LEN))
        e_warn(probe, "Setting MTU > 1500 will disable legacy VFs\n");

    e_info(probe, "changing MTU from %d to %d\n", netdev->mtu, new_mtu);

    /* must set new MTU before calling down or up */
    netdev->mtu = new_mtu;

    if (netif_running(netdev))
        ixgbe_reinit_locked(adapter);

    return 0;
}

您应该收到 MTU 已更改通知的特定行:

e_info(probe, "changing MTU from %d to %d\n", netdev->mtu, new_mtu);

相关内容