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 Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1881821

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

Status in MAAS:
  Triaged
Status in linux package in Ubuntu:
  Confirmed

Bug description:
  MAAS 2.7.1
  Ubuntu 18.04.4

  When attempting to commission a Cisco UCS B200 M5 blade, the
  commissioning finishes (if smartctl-validate is disabled), however on
  the machine in question in the Networking tab, it only shows 2 nics,
  eth0 and eth1.  and shows no storage.

  Going to SSH in the middle of commissioning, running lshw shows all 10
  NICs, and the disk of the proper size.

  This is causing the buckets.yaml for FCE to be inaccurate, and thus
  cannot write a bucketsconfig.yaml since the actual devices don't show
  up.

  This was tried with bionic {ga,hwe,hwe-edge} and focal ga kernels for
  commissioning, all have the same behavior.

  I was previously hitting this bug
  https://bugs.launchpad.net/maas/+bug/1878643 but applied the fix from
  comment #10, and am no longer getting any commissioning errors.

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

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to