That speed comes from
drivers/net/ethernet/cisco/enic/enic_ethtool.c:enic_get_ksettings.

static int enic_get_ksettings(struct net_device *netdev,
                              struct ethtool_link_ksettings *ecmd)
{
        struct enic *enic = netdev_priv(netdev);
        struct ethtool_link_settings *base = &ecmd->base;

        ethtool_link_ksettings_add_link_mode(ecmd, supported,
                                             10000baseT_Full);
        ethtool_link_ksettings_add_link_mode(ecmd, supported, FIBRE);
        ethtool_link_ksettings_add_link_mode(ecmd, advertising,
                                             10000baseT_Full);
        ethtool_link_ksettings_add_link_mode(ecmd, advertising, FIBRE);
        base->port = PORT_FIBRE;

        if (netif_carrier_ok(netdev)) {
                base->speed = vnic_dev_port_speed(enic->vdev);
                base->duplex = DUPLEX_FULL;
        } else {
                base->speed = SPEED_UNKNOWN;
                base->duplex = DUPLEX_UNKNOWN;
        }

        base->autoneg = AUTONEG_DISABLE;

        return 0;
}

vnic_dev_port_speed comes from the hardware at function
drivers/net/ethernet/cisco/enic/vnic_dev.c:vnic_dev_notify_setcmd.

static int vnic_dev_notify_setcmd(struct vnic_dev *vdev,
        void *notify_addr, dma_addr_t notify_pa, u16 intr)
{
        u64 a0, a1;
        int wait = 1000;
        int r;

        memset(notify_addr, 0, sizeof(struct vnic_devcmd_notify));
        vdev->notify = notify_addr;
        vdev->notify_pa = notify_pa;

        a0 = (u64)notify_pa;
        a1 = ((u64)intr << 32) & 0x0000ffff00000000ULL;
        a1 += sizeof(struct vnic_devcmd_notify);

        r = vnic_dev_cmd(vdev, CMD_NOTIFY, &a0, &a1, wait);
        vdev->notify_sz = (r == 0) ? (u32)a1 : 0;
        return r;
}

struct vnic_devcmd_notify {
        u32 csum;               /* checksum over following words */

        u32 link_state;         /* link up == 1 */
        u32 port_speed;         /* effective port speed (rate limit) */
        u32 mtu;                /* MTU */
        u32 msglvl;             /* requested driver msg lvl */
        u32 uif;                /* uplink interface */
        u32 status;             /* status bits (see VNIC_STF_*) */
        u32 error;              /* error code (see ERR_*) for first ERR */
        u32 link_down_cnt;      /* running count of link down transitions */
        u32 perbi_rebuild_cnt;  /* running count of perbi rebuilds */
};

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1881821

Title:
  Kernel does not report interface speed correctly for Cisco UCS B200 M5
  blade

To manage notifications about this bug go to:
https://bugs.launchpad.net/maas/+bug/1881821/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to