Lines Matching +full:gpio +full:- +full:op +full:- +full:cfg
7 * Copyright (c) 2003-2016 Cavium, Inc.
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
219 struct octeon_device *oct = lio->oct_dev; in lio_get_link_ksettings()
222 linfo = &lio->linfo; in lio_get_link_ksettings()
227 switch (linfo->link.s.phy_type) { in lio_get_link_ksettings()
229 ecmd->base.port = PORT_TP; in lio_get_link_ksettings()
230 ecmd->base.autoneg = AUTONEG_DISABLE; in lio_get_link_ksettings()
243 if (linfo->link.s.if_mode == INTERFACE_MODE_XAUI || in lio_get_link_ksettings()
244 linfo->link.s.if_mode == INTERFACE_MODE_RXAUI || in lio_get_link_ksettings()
245 linfo->link.s.if_mode == INTERFACE_MODE_XLAUI || in lio_get_link_ksettings()
246 linfo->link.s.if_mode == INTERFACE_MODE_XFI) { in lio_get_link_ksettings()
247 dev_dbg(&oct->pci_dev->dev, "ecmd->base.transceiver is XCVR_EXTERNAL\n"); in lio_get_link_ksettings()
248 ecmd->base.transceiver = XCVR_EXTERNAL; in lio_get_link_ksettings()
250 dev_err(&oct->pci_dev->dev, "Unknown link interface mode: %d\n", in lio_get_link_ksettings()
251 linfo->link.s.if_mode); in lio_get_link_ksettings()
254 ecmd->base.port = PORT_FIBRE; in lio_get_link_ksettings()
255 ecmd->base.autoneg = AUTONEG_DISABLE; in lio_get_link_ksettings()
260 if (oct->subsystem_id == OCTEON_CN2350_25GB_SUBSYS_ID || in lio_get_link_ksettings()
261 oct->subsystem_id == OCTEON_CN2360_25GB_SUBSYS_ID) { in lio_get_link_ksettings()
270 if (oct->no_speed_setting == 0) { in lio_get_link_ksettings()
282 if (oct->no_speed_setting == 0) { in lio_get_link_ksettings()
286 oct->speed_setting = 25; in lio_get_link_ksettings()
289 if (oct->speed_setting == 10) { in lio_get_link_ksettings()
300 if (oct->speed_setting == 25) { in lio_get_link_ksettings()
312 if (oct->no_speed_setting) in lio_get_link_ksettings()
320 if (oct->props[lio->ifidx].fec == 1) { in lio_get_link_ksettings()
330 if (linfo->link.s.speed == 10000) { in lio_get_link_ksettings()
352 if (linfo->link.s.speed == 25000) { in lio_get_link_ksettings()
383 if (linfo->link.s.link_up) { in lio_get_link_ksettings()
384 ecmd->base.speed = linfo->link.s.speed; in lio_get_link_ksettings()
385 ecmd->base.duplex = linfo->link.s.duplex; in lio_get_link_ksettings()
387 ecmd->base.speed = SPEED_UNKNOWN; in lio_get_link_ksettings()
388 ecmd->base.duplex = DUPLEX_UNKNOWN; in lio_get_link_ksettings()
397 const int speed = ecmd->base.speed; in lio_set_link_ksettings()
402 oct = lio->oct_dev; in lio_set_link_ksettings()
404 linfo = &lio->linfo; in lio_set_link_ksettings()
406 if (!(oct->subsystem_id == OCTEON_CN2350_25GB_SUBSYS_ID || in lio_set_link_ksettings()
407 oct->subsystem_id == OCTEON_CN2360_25GB_SUBSYS_ID)) in lio_set_link_ksettings()
408 return -EOPNOTSUPP; in lio_set_link_ksettings()
410 if (oct->no_speed_setting) { in lio_set_link_ksettings()
411 dev_err(&oct->pci_dev->dev, "%s: Changing speed is not supported\n", in lio_set_link_ksettings()
413 return -EOPNOTSUPP; in lio_set_link_ksettings()
416 if ((ecmd->base.duplex != DUPLEX_UNKNOWN && in lio_set_link_ksettings()
417 ecmd->base.duplex != linfo->link.s.duplex) || in lio_set_link_ksettings()
418 ecmd->base.autoneg != AUTONEG_DISABLE || in lio_set_link_ksettings()
419 (ecmd->base.speed != 10000 && ecmd->base.speed != 25000 && in lio_set_link_ksettings()
420 ecmd->base.speed != SPEED_UNKNOWN)) in lio_set_link_ksettings()
421 return -EOPNOTSUPP; in lio_set_link_ksettings()
423 if ((oct->speed_boot == speed / 1000) && in lio_set_link_ksettings()
424 oct->speed_boot == oct->speed_setting) in lio_set_link_ksettings()
429 dev_dbg(&oct->pci_dev->dev, "Port speed is set to %dG\n", in lio_set_link_ksettings()
430 oct->speed_setting); in lio_set_link_ksettings()
442 oct = lio->oct_dev; in lio_get_drvinfo()
445 strscpy(drvinfo->driver, "liquidio", sizeof(drvinfo->driver)); in lio_get_drvinfo()
446 strscpy(drvinfo->fw_version, oct->fw_info.liquidio_firmware_version, in lio_get_drvinfo()
447 sizeof(drvinfo->fw_version)); in lio_get_drvinfo()
448 strscpy(drvinfo->bus_info, pci_name(oct->pci_dev), in lio_get_drvinfo()
449 sizeof(drvinfo->bus_info)); in lio_get_drvinfo()
459 oct = lio->oct_dev; in lio_get_vf_drvinfo()
462 strscpy(drvinfo->driver, "liquidio_vf", sizeof(drvinfo->driver)); in lio_get_vf_drvinfo()
463 strscpy(drvinfo->fw_version, oct->fw_info.liquidio_firmware_version, in lio_get_vf_drvinfo()
464 sizeof(drvinfo->fw_version)); in lio_get_vf_drvinfo()
465 strscpy(drvinfo->bus_info, pci_name(oct->pci_dev), in lio_get_vf_drvinfo()
466 sizeof(drvinfo->bus_info)); in lio_get_vf_drvinfo()
473 struct octeon_device *oct = lio->oct_dev; in lio_send_queue_count_update()
483 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in lio_send_queue_count_update()
487 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in lio_send_queue_count_update()
489 dev_err(&oct->pci_dev->dev, "Failed to send Queue reset command (ret: 0x%x)\n", in lio_send_queue_count_update()
491 return -1; in lio_send_queue_count_update()
502 struct octeon_device *oct = lio->oct_dev; in lio_ethtool_get_channels()
511 rx_count = CFG_GET_NUM_RXQS_NIC_IF(conf6x, lio->ifidx); in lio_ethtool_get_channels()
512 tx_count = CFG_GET_NUM_TXQS_NIC_IF(conf6x, lio->ifidx); in lio_ethtool_get_channels()
514 if (oct->sriov_info.sriov_enabled) { in lio_ethtool_get_channels()
515 max_combined = lio->linfo.num_txpciq; in lio_ethtool_get_channels()
522 combined_count = oct->num_iqs; in lio_ethtool_get_channels()
530 combined_count = oct->num_iqs; in lio_ethtool_get_channels()
533 channel->max_rx = max_rx; in lio_ethtool_get_channels()
534 channel->max_tx = max_tx; in lio_ethtool_get_channels()
535 channel->max_combined = max_combined; in lio_ethtool_get_channels()
536 channel->rx_count = rx_count; in lio_ethtool_get_channels()
537 channel->tx_count = tx_count; in lio_ethtool_get_channels()
538 channel->combined_count = combined_count; in lio_ethtool_get_channels()
548 if (!oct->msix_on) in lio_irq_reallocate_irqs()
554 oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR); in lio_irq_reallocate_irqs()
556 if (oct->msix_on) { in lio_irq_reallocate_irqs()
558 num_msix_irqs = oct->num_msix_irqs - 1; in lio_irq_reallocate_irqs()
560 num_msix_irqs = oct->num_msix_irqs; in lio_irq_reallocate_irqs()
562 msix_entries = (struct msix_entry *)oct->msix_entries; in lio_irq_reallocate_irqs()
564 if (oct->ioq_vector[i].vector) { in lio_irq_reallocate_irqs()
569 &oct->ioq_vector[i]); in lio_irq_reallocate_irqs()
570 oct->ioq_vector[i].vector = 0; in lio_irq_reallocate_irqs()
574 /* non-iov vector's argument is oct struct */ in lio_irq_reallocate_irqs()
578 pci_disable_msix(oct->pci_dev); in lio_irq_reallocate_irqs()
579 kfree(oct->msix_entries); in lio_irq_reallocate_irqs()
580 oct->msix_entries = NULL; in lio_irq_reallocate_irqs()
583 kfree(oct->irq_name_storage); in lio_irq_reallocate_irqs()
584 oct->irq_name_storage = NULL; in lio_irq_reallocate_irqs()
587 dev_err(&oct->pci_dev->dev, "OCTEON: ioq vector allocation failed\n"); in lio_irq_reallocate_irqs()
588 return -1; in lio_irq_reallocate_irqs()
592 dev_info(&oct->pci_dev->dev, "Setup interrupt failed\n"); in lio_irq_reallocate_irqs()
593 return -1; in lio_irq_reallocate_irqs()
597 oct->fn_list.enable_interrupt(oct, OCTEON_ALL_INTR); in lio_irq_reallocate_irqs()
608 struct octeon_device *oct = lio->oct_dev; in lio_ethtool_set_channels()
611 if (strcmp(oct->fw_info.liquidio_firmware_version, "1.6.1") < 0) { in lio_ethtool_set_channels()
612 dev_err(&oct->pci_dev->dev, "Minimum firmware version required is 1.6.1\n"); in lio_ethtool_set_channels()
613 return -EINVAL; in lio_ethtool_set_channels()
616 if (!channel->combined_count || channel->other_count || in lio_ethtool_set_channels()
617 channel->rx_count || channel->tx_count) in lio_ethtool_set_channels()
618 return -EINVAL; in lio_ethtool_set_channels()
620 combined_count = channel->combined_count; in lio_ethtool_set_channels()
623 if (oct->sriov_info.sriov_enabled) { in lio_ethtool_set_channels()
624 max_combined = lio->linfo.num_txpciq; in lio_ethtool_set_channels()
641 return -EINVAL; in lio_ethtool_set_channels()
645 return -EINVAL; in lio_ethtool_set_channels()
647 if (combined_count == oct->num_iqs) in lio_ethtool_set_channels()
653 dev->netdev_ops->ndo_stop(dev); in lio_ethtool_set_channels()
658 return -EINVAL; in lio_ethtool_set_channels()
661 dev->netdev_ops->ndo_open(dev); in lio_ethtool_set_channels()
672 struct octeon_device *oct_dev = lio->oct_dev; in lio_get_eeprom_len()
676 board_info = (struct octeon_board_info *)(&oct_dev->boardinfo); in lio_get_eeprom_len()
678 board_info->name, board_info->serial_number, in lio_get_eeprom_len()
679 board_info->major, board_info->minor); in lio_get_eeprom_len()
689 struct octeon_device *oct_dev = lio->oct_dev; in lio_get_eeprom()
692 if (eeprom->offset) in lio_get_eeprom()
693 return -EINVAL; in lio_get_eeprom()
695 eeprom->magic = oct_dev->pci_dev->vendor; in lio_get_eeprom()
696 board_info = (struct octeon_board_info *)(&oct_dev->boardinfo); in lio_get_eeprom()
699 board_info->name, board_info->serial_number, in lio_get_eeprom()
700 board_info->major, board_info->minor); in lio_get_eeprom()
708 struct octeon_device *oct = lio->oct_dev; in octnet_gpio_access()
718 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in octnet_gpio_access()
722 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in octnet_gpio_access()
724 dev_err(&oct->pci_dev->dev, in octnet_gpio_access()
725 "Failed to configure gpio value, ret=%d\n", ret); in octnet_gpio_access()
726 return -EINVAL; in octnet_gpio_access()
735 struct octeon_device *oct = lio->oct_dev; in octnet_id_active()
744 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in octnet_id_active()
748 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in octnet_id_active()
750 dev_err(&oct->pci_dev->dev, in octnet_id_active()
751 "Failed to configure gpio value, ret=%d\n", ret); in octnet_id_active()
752 return -EINVAL; in octnet_id_active()
762 octnet_mdio45_access(struct lio *lio, int op, int loc, int *value) in octnet_mdio45_access() argument
764 struct octeon_device *oct_dev = lio->oct_dev; in octnet_mdio45_access()
776 return -ENOMEM; in octnet_mdio45_access()
778 mdio_cmd_rsp = (struct oct_mdio_cmd_resp *)sc->virtrptr; in octnet_mdio45_access()
779 mdio_cmd = (struct oct_mdio_cmd *)sc->virtdptr; in octnet_mdio45_access()
781 mdio_cmd->op = op; in octnet_mdio45_access()
782 mdio_cmd->mdio_addr = loc; in octnet_mdio45_access()
783 if (op) in octnet_mdio45_access()
784 mdio_cmd->value1 = *value; in octnet_mdio45_access()
787 sc->iq_no = lio->linfo.txpciq[0].s.q_no; in octnet_mdio45_access()
792 init_completion(&sc->complete); in octnet_mdio45_access()
793 sc->sc_status = OCTEON_REQUEST_PENDING; in octnet_mdio45_access()
797 dev_err(&oct_dev->pci_dev->dev, in octnet_mdio45_access()
801 return -EBUSY; in octnet_mdio45_access()
810 retval = mdio_cmd_rsp->status; in octnet_mdio45_access()
812 dev_err(&oct_dev->pci_dev->dev, in octnet_mdio45_access()
814 WRITE_ONCE(sc->caller_is_done, true); in octnet_mdio45_access()
815 return -EBUSY; in octnet_mdio45_access()
818 octeon_swap_8B_data((u64 *)(&mdio_cmd_rsp->resp), in octnet_mdio45_access()
821 if (!op) in octnet_mdio45_access()
822 *value = mdio_cmd_rsp->resp.value1; in octnet_mdio45_access()
824 WRITE_ONCE(sc->caller_is_done, true); in octnet_mdio45_access()
834 struct octeon_device *oct = lio->oct_dev; in lio_set_phys_id()
839 linfo = &lio->linfo; in lio_set_phys_id()
840 cur_ver = OCT_FW_VER(oct->fw_info.ver.maj, in lio_set_phys_id()
841 oct->fw_info.ver.min, in lio_set_phys_id()
842 oct->fw_info.ver.rev); in lio_set_phys_id()
846 if (oct->chip_id == OCTEON_CN66XX) { in lio_set_phys_id()
851 } else if (oct->chip_id == OCTEON_CN68XX) { in lio_set_phys_id()
855 &lio->phy_beacon_val); in lio_set_phys_id()
861 &lio->led_ctrl_val); in lio_set_phys_id()
879 } else if (oct->chip_id == OCTEON_CN23XX_PF_VID) { in lio_set_phys_id()
881 if (linfo->link.s.phy_type == LIO_PHY_PORT_TP && in lio_set_phys_id()
887 return -EINVAL; in lio_set_phys_id()
892 if (oct->chip_id == OCTEON_CN23XX_PF_VID && in lio_set_phys_id()
893 linfo->link.s.phy_type == LIO_PHY_PORT_TP && in lio_set_phys_id()
896 else if (oct->chip_id == OCTEON_CN66XX) in lio_set_phys_id()
900 return -EINVAL; in lio_set_phys_id()
905 if (oct->chip_id == OCTEON_CN23XX_PF_VID && in lio_set_phys_id()
906 linfo->link.s.phy_type == LIO_PHY_PORT_TP && in lio_set_phys_id()
909 else if (oct->chip_id == OCTEON_CN66XX) in lio_set_phys_id()
913 return -EINVAL; in lio_set_phys_id()
918 if (oct->chip_id == OCTEON_CN66XX) { in lio_set_phys_id()
921 } else if (oct->chip_id == OCTEON_CN68XX) { in lio_set_phys_id()
925 &lio->led_ctrl_val); in lio_set_phys_id()
931 &lio->phy_beacon_val); in lio_set_phys_id()
934 } else if (oct->chip_id == OCTEON_CN23XX_PF_VID) { in lio_set_phys_id()
939 return -EINVAL; in lio_set_phys_id()
944 return -EINVAL; in lio_set_phys_id()
957 struct octeon_device *oct = lio->oct_dev; in lio_ethtool_get_ringparam()
969 rx_pending = CFG_GET_NUM_RX_DESCS_NIC_IF(conf6x, lio->ifidx); in lio_ethtool_get_ringparam()
970 tx_pending = CFG_GET_NUM_TX_DESCS_NIC_IF(conf6x, lio->ifidx); in lio_ethtool_get_ringparam()
974 rx_pending = oct->droq[0]->max_count; in lio_ethtool_get_ringparam()
975 tx_pending = oct->instr_queue[0]->max_count; in lio_ethtool_get_ringparam()
978 ering->tx_pending = tx_pending; in lio_ethtool_get_ringparam()
979 ering->tx_max_pending = tx_max_pending; in lio_ethtool_get_ringparam()
980 ering->rx_pending = rx_pending; in lio_ethtool_get_ringparam()
981 ering->rx_max_pending = rx_max_pending; in lio_ethtool_get_ringparam()
982 ering->rx_mini_pending = 0; in lio_ethtool_get_ringparam()
983 ering->rx_jumbo_pending = 0; in lio_ethtool_get_ringparam()
984 ering->rx_mini_max_pending = 0; in lio_ethtool_get_ringparam()
985 ering->rx_jumbo_max_pending = 0; in lio_ethtool_get_ringparam()
990 struct octeon_device *oct = lio->oct_dev; in lio_23xx_reconfigure_queue_count()
1006 dev_err(&oct->pci_dev->dev, "%s: Failed to allocate soft command\n", in lio_23xx_reconfigure_queue_count()
1008 return -1; in lio_23xx_reconfigure_queue_count()
1011 resp = (struct liquidio_if_cfg_resp *)sc->virtrptr; in lio_23xx_reconfigure_queue_count()
1012 vdata = (struct lio_version *)sc->virtdptr; in lio_23xx_reconfigure_queue_count()
1014 vdata->major = (__force u16)cpu_to_be16(LIQUIDIO_BASE_MAJOR_VERSION); in lio_23xx_reconfigure_queue_count()
1015 vdata->minor = (__force u16)cpu_to_be16(LIQUIDIO_BASE_MINOR_VERSION); in lio_23xx_reconfigure_queue_count()
1016 vdata->micro = (__force u16)cpu_to_be16(LIQUIDIO_BASE_MICRO_VERSION); in lio_23xx_reconfigure_queue_count()
1018 ifidx_or_pfnum = oct->pf_num; in lio_23xx_reconfigure_queue_count()
1021 if_cfg.s.num_iqueues = oct->sriov_info.num_pf_rings; in lio_23xx_reconfigure_queue_count()
1022 if_cfg.s.num_oqueues = oct->sriov_info.num_pf_rings; in lio_23xx_reconfigure_queue_count()
1023 if_cfg.s.base_queue = oct->sriov_info.pf_srn; in lio_23xx_reconfigure_queue_count()
1024 if_cfg.s.gmx_port_id = oct->pf_num; in lio_23xx_reconfigure_queue_count()
1026 sc->iq_no = 0; in lio_23xx_reconfigure_queue_count()
1031 init_completion(&sc->complete); in lio_23xx_reconfigure_queue_count()
1032 sc->sc_status = OCTEON_REQUEST_PENDING; in lio_23xx_reconfigure_queue_count()
1036 dev_err(&oct->pci_dev->dev, in lio_23xx_reconfigure_queue_count()
1040 return -EIO; in lio_23xx_reconfigure_queue_count()
1047 retval = resp->status; in lio_23xx_reconfigure_queue_count()
1049 dev_err(&oct->pci_dev->dev, in lio_23xx_reconfigure_queue_count()
1051 WRITE_ONCE(sc->caller_is_done, true); in lio_23xx_reconfigure_queue_count()
1052 return -1; in lio_23xx_reconfigure_queue_count()
1055 octeon_swap_8B_data((u64 *)(&resp->cfg_info), in lio_23xx_reconfigure_queue_count()
1058 lio->ifidx = ifidx_or_pfnum; in lio_23xx_reconfigure_queue_count()
1059 lio->linfo.num_rxpciq = hweight64(resp->cfg_info.iqmask); in lio_23xx_reconfigure_queue_count()
1060 lio->linfo.num_txpciq = hweight64(resp->cfg_info.iqmask); in lio_23xx_reconfigure_queue_count()
1061 for (j = 0; j < lio->linfo.num_rxpciq; j++) { in lio_23xx_reconfigure_queue_count()
1062 lio->linfo.rxpciq[j].u64 = in lio_23xx_reconfigure_queue_count()
1063 resp->cfg_info.linfo.rxpciq[j].u64; in lio_23xx_reconfigure_queue_count()
1066 for (j = 0; j < lio->linfo.num_txpciq; j++) { in lio_23xx_reconfigure_queue_count()
1067 lio->linfo.txpciq[j].u64 = in lio_23xx_reconfigure_queue_count()
1068 resp->cfg_info.linfo.txpciq[j].u64; in lio_23xx_reconfigure_queue_count()
1071 lio->linfo.hw_addr = resp->cfg_info.linfo.hw_addr; in lio_23xx_reconfigure_queue_count()
1072 lio->linfo.gmxport = resp->cfg_info.linfo.gmxport; in lio_23xx_reconfigure_queue_count()
1073 lio->linfo.link.u64 = resp->cfg_info.linfo.link.u64; in lio_23xx_reconfigure_queue_count()
1074 lio->txq = lio->linfo.txpciq[0].s.q_no; in lio_23xx_reconfigure_queue_count()
1075 lio->rxq = lio->linfo.rxpciq[0].s.q_no; in lio_23xx_reconfigure_queue_count()
1077 dev_info(&oct->pci_dev->dev, "Queue count updated to %d\n", in lio_23xx_reconfigure_queue_count()
1078 lio->linfo.num_rxpciq); in lio_23xx_reconfigure_queue_count()
1080 WRITE_ONCE(sc->caller_is_done, true); in lio_23xx_reconfigure_queue_count()
1088 struct octeon_device *oct = lio->oct_dev; in lio_reset_queues()
1096 dev_err(&oct->pci_dev->dev, "There were pending requests\n"); in lio_reset_queues()
1099 dev_err(&oct->pci_dev->dev, "IQ had pending instructions\n"); in lio_reset_queues()
1102 dev_err(&oct->pci_dev->dev, "Setting io queues off failed\n"); in lio_reset_queues()
1103 return -1; in lio_reset_queues()
1109 oct->fn_list.disable_io_queues(oct); in lio_reset_queues()
1111 list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list) in lio_reset_queues()
1114 if (num_qs != oct->num_iqs) { in lio_reset_queues()
1117 dev_err(&oct->pci_dev->dev, in lio_reset_queues()
1124 dev_err(&oct->pci_dev->dev, in lio_reset_queues()
1131 * re-configured. in lio_reset_queues()
1136 /* Re-configuration of queues can happen in two scenarios, SRIOV enabled in lio_reset_queues()
1149 if ((OCTEON_CN23XX_PF(oct)) && !oct->sriov_info.sriov_enabled) in lio_reset_queues()
1150 oct->fn_list.free_mbox(oct); in lio_reset_queues()
1154 if (!(oct->io_qmask.oq & BIT_ULL(i))) in lio_reset_queues()
1160 if (!(oct->io_qmask.iq & BIT_ULL(i))) in lio_reset_queues()
1166 /* For PF re-configure sriov related information */ in lio_reset_queues()
1168 !oct->sriov_info.sriov_enabled) { in lio_reset_queues()
1169 oct->sriov_info.num_pf_rings = num_qs; in lio_reset_queues()
1171 dev_err(&oct->pci_dev->dev, in lio_reset_queues()
1173 return -1; in lio_reset_queues()
1176 num_qs = oct->sriov_info.num_pf_rings; in lio_reset_queues()
1180 if (oct->fn_list.setup_device_regs(oct)) { in lio_reset_queues()
1181 dev_err(&oct->pci_dev->dev, "Failed to configure device registers\n"); in lio_reset_queues()
1182 return -1; in lio_reset_queues()
1185 /* The following are needed in case of queue count re-configuration and in lio_reset_queues()
1186 * not for descriptor count re-configuration. in lio_reset_queues()
1190 return -1; in lio_reset_queues()
1193 return -1; in lio_reset_queues()
1196 if (OCTEON_CN23XX_PF(oct) && !oct->sriov_info.sriov_enabled) { in lio_reset_queues()
1197 if (oct->fn_list.setup_mbox(oct)) { in lio_reset_queues()
1198 dev_err(&oct->pci_dev->dev, "Mailbox setup failed\n"); in lio_reset_queues()
1199 return -1; in lio_reset_queues()
1207 dev_err(&oct->pci_dev->dev, "IRQs could not be allocated\n"); in lio_reset_queues()
1208 return -1; in lio_reset_queues()
1212 if (oct->fn_list.enable_io_queues(oct)) { in lio_reset_queues()
1213 dev_err(&oct->pci_dev->dev, "Failed to enable input/output queues\n"); in lio_reset_queues()
1214 return -1; in lio_reset_queues()
1217 for (i = 0; i < oct->num_oqs; i++) in lio_reset_queues()
1218 writel(oct->droq[i]->max_count, in lio_reset_queues()
1219 oct->droq[i]->pkts_credit_reg); in lio_reset_queues()
1225 if (OCTEON_CN23XX_PF(oct) && !oct->sriov_info.sriov_enabled) { in lio_reset_queues()
1227 return -1; in lio_reset_queues()
1233 dev_err(&oct->pci_dev->dev, "I/O queues creation failed\n"); in lio_reset_queues()
1234 return -1; in lio_reset_queues()
1239 dev_err(&oct->pci_dev->dev, "Gather list allocation failed\n"); in lio_reset_queues()
1240 return -1; in lio_reset_queues()
1244 dev_err(&oct->pci_dev->dev, "lio_setup_rx_oom_poll_fn failed\n"); in lio_reset_queues()
1251 if (oct->sriov_info.sriov_enabled || OCTEON_CN23XX_VF(oct)) in lio_reset_queues()
1253 return -1; in lio_reset_queues()
1267 struct octeon_device *oct = lio->oct_dev; in lio_ethtool_set_ringparam()
1271 return -EINVAL; in lio_ethtool_set_ringparam()
1273 if (ering->rx_mini_pending || ering->rx_jumbo_pending) in lio_ethtool_set_ringparam()
1274 return -EINVAL; in lio_ethtool_set_ringparam()
1276 rx_count = clamp_t(u32, ering->rx_pending, CN23XX_MIN_OQ_DESCRIPTORS, in lio_ethtool_set_ringparam()
1278 tx_count = clamp_t(u32, ering->tx_pending, CN23XX_MIN_IQ_DESCRIPTORS, in lio_ethtool_set_ringparam()
1281 rx_count_old = oct->droq[0]->max_count; in lio_ethtool_set_ringparam()
1282 tx_count_old = oct->instr_queue[0]->max_count; in lio_ethtool_set_ringparam()
1290 netdev->netdev_ops->ndo_stop(netdev); in lio_ethtool_set_ringparam()
1296 CFG_SET_NUM_TX_DESCS_NIC_IF(octeon_get_conf(oct), lio->ifidx, in lio_ethtool_set_ringparam()
1299 CFG_SET_NUM_RX_DESCS_NIC_IF(octeon_get_conf(oct), lio->ifidx, in lio_ethtool_set_ringparam()
1302 if (lio_reset_queues(netdev, oct->num_iqs)) in lio_ethtool_set_ringparam()
1306 netdev->netdev_ops->ndo_open(netdev); in lio_ethtool_set_ringparam()
1314 CFG_SET_NUM_TX_DESCS_NIC_IF(octeon_get_conf(oct), lio->ifidx, in lio_ethtool_set_ringparam()
1317 CFG_SET_NUM_RX_DESCS_NIC_IF(octeon_get_conf(oct), lio->ifidx, in lio_ethtool_set_ringparam()
1319 return -EINVAL; in lio_ethtool_set_ringparam()
1326 return lio->msg_enable; in lio_get_msglevel()
1333 if ((msglvl ^ lio->msg_enable) & NETIF_MSG_HW) { in lio_set_msglevel()
1342 lio->msg_enable = msglvl; in lio_set_msglevel()
1349 lio->msg_enable = msglvl; in lio_vf_set_msglevel()
1359 struct octeon_device *oct = lio->oct_dev; in lio_get_pauseparam()
1361 pause->autoneg = 0; in lio_get_pauseparam()
1363 pause->tx_pause = oct->tx_pause; in lio_get_pauseparam()
1364 pause->rx_pause = oct->rx_pause; in lio_get_pauseparam()
1374 struct octeon_device *oct = lio->oct_dev; in lio_set_pauseparam()
1376 struct oct_link_info *linfo = &lio->linfo; in lio_set_pauseparam()
1380 if (oct->chip_id != OCTEON_CN23XX_PF_VID) in lio_set_pauseparam()
1381 return -EINVAL; in lio_set_pauseparam()
1383 if (linfo->link.s.duplex == 0) { in lio_set_pauseparam()
1385 if (pause->rx_pause || pause->tx_pause) in lio_set_pauseparam()
1386 return -EINVAL; in lio_set_pauseparam()
1390 if (pause->autoneg == AUTONEG_ENABLE) in lio_set_pauseparam()
1391 return -EINVAL; in lio_set_pauseparam()
1397 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no; in lio_set_pauseparam()
1401 if (pause->rx_pause) { in lio_set_pauseparam()
1409 if (pause->tx_pause) { in lio_set_pauseparam()
1417 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl); in lio_set_pauseparam()
1419 dev_err(&oct->pci_dev->dev, in lio_set_pauseparam()
1421 return -EINVAL; in lio_set_pauseparam()
1424 oct->rx_pause = pause->rx_pause; in lio_set_pauseparam()
1425 oct->tx_pause = pause->tx_pause; in lio_set_pauseparam()
1436 struct octeon_device *oct_dev = lio->oct_dev; in lio_get_ethtool_stats()
1443 netdev->netdev_ops->ndo_get_stats64(netdev, &lstats); in lio_get_ethtool_stats()
1444 /*sum of oct->droq[oq_no]->stats->rx_pkts_received */ in lio_get_ethtool_stats()
1446 /*sum of oct->instr_queue[iq_no]->stats.tx_done */ in lio_get_ethtool_stats()
1448 /*sum of oct->droq[oq_no]->stats->rx_bytes_received */ in lio_get_ethtool_stats()
1450 /*sum of oct->instr_queue[iq_no]->stats.tx_tot_bytes */ in lio_get_ethtool_stats()
1453 oct_dev->link_stats.fromwire.fcs_err + in lio_get_ethtool_stats()
1454 oct_dev->link_stats.fromwire.jabber_err + in lio_get_ethtool_stats()
1455 oct_dev->link_stats.fromwire.l2_err + in lio_get_ethtool_stats()
1456 oct_dev->link_stats.fromwire.frame_err; in lio_get_ethtool_stats()
1458 /*sum of oct->droq[oq_no]->stats->rx_dropped + in lio_get_ethtool_stats()
1459 *oct->droq[oq_no]->stats->dropped_nodispatch + in lio_get_ethtool_stats()
1460 *oct->droq[oq_no]->stats->dropped_toomany + in lio_get_ethtool_stats()
1461 *oct->droq[oq_no]->stats->dropped_nomem in lio_get_ethtool_stats()
1464 oct_dev->link_stats.fromwire.fifo_err + in lio_get_ethtool_stats()
1465 oct_dev->link_stats.fromwire.dmac_drop + in lio_get_ethtool_stats()
1466 oct_dev->link_stats.fromwire.red_drops + in lio_get_ethtool_stats()
1467 oct_dev->link_stats.fromwire.fw_err_pko + in lio_get_ethtool_stats()
1468 oct_dev->link_stats.fromwire.fw_err_link + in lio_get_ethtool_stats()
1469 oct_dev->link_stats.fromwire.fw_err_drop; in lio_get_ethtool_stats()
1470 /*sum of oct->instr_queue[iq_no]->stats.tx_dropped */ in lio_get_ethtool_stats()
1472 oct_dev->link_stats.fromhost.max_collision_fail + in lio_get_ethtool_stats()
1473 oct_dev->link_stats.fromhost.max_deferral_fail + in lio_get_ethtool_stats()
1474 oct_dev->link_stats.fromhost.total_collisions + in lio_get_ethtool_stats()
1475 oct_dev->link_stats.fromhost.fw_err_pko + in lio_get_ethtool_stats()
1476 oct_dev->link_stats.fromhost.fw_err_link + in lio_get_ethtool_stats()
1477 oct_dev->link_stats.fromhost.fw_err_drop + in lio_get_ethtool_stats()
1478 oct_dev->link_stats.fromhost.fw_err_pki; in lio_get_ethtool_stats()
1481 /*per_core_stats[cvmx_get_core_num()].link_stats[mdata->from_ifidx]. in lio_get_ethtool_stats()
1484 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_total_sent); in lio_get_ethtool_stats()
1486 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_total_fwd); in lio_get_ethtool_stats()
1488 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_pko); in lio_get_ethtool_stats()
1490 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_pki); in lio_get_ethtool_stats()
1492 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_link); in lio_get_ethtool_stats()
1496 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_drop); in lio_get_ethtool_stats()
1499 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_tso); in lio_get_ethtool_stats()
1503 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_tso_fwd); in lio_get_ethtool_stats()
1507 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_tso); in lio_get_ethtool_stats()
1511 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_tx_vxlan); in lio_get_ethtool_stats()
1514 data[i++] = oct_dev->link_stats.fromhost.fw_total_mcast_sent; in lio_get_ethtool_stats()
1515 data[i++] = oct_dev->link_stats.fromhost.fw_total_bcast_sent; in lio_get_ethtool_stats()
1519 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.total_pkts_sent); in lio_get_ethtool_stats()
1521 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.total_bytes_sent); in lio_get_ethtool_stats()
1523 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.mcast_pkts_sent); in lio_get_ethtool_stats()
1525 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.bcast_pkts_sent); in lio_get_ethtool_stats()
1527 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.ctl_sent); in lio_get_ethtool_stats()
1529 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.total_collisions); in lio_get_ethtool_stats()
1531 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.one_collision_sent); in lio_get_ethtool_stats()
1534 CVM_CAST64(oct_dev->link_stats.fromhost.multi_collision_sent); in lio_get_ethtool_stats()
1536 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.max_collision_fail); in lio_get_ethtool_stats()
1538 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.max_deferral_fail); in lio_get_ethtool_stats()
1540 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fifo_err); in lio_get_ethtool_stats()
1542 data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.runts); in lio_get_ethtool_stats()
1548 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_total_rcvd); in lio_get_ethtool_stats()
1552 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_total_fwd); in lio_get_ethtool_stats()
1554 data[i++] = oct_dev->link_stats.fromwire.fw_total_mcast; in lio_get_ethtool_stats()
1555 data[i++] = oct_dev->link_stats.fromwire.fw_total_bcast; in lio_get_ethtool_stats()
1557 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.jabber_err); in lio_get_ethtool_stats()
1559 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.l2_err); in lio_get_ethtool_stats()
1561 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.frame_err); in lio_get_ethtool_stats()
1565 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_err_pko); in lio_get_ethtool_stats()
1567 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_err_link); in lio_get_ethtool_stats()
1568 /*per_core_stats[cvmx_get_core_num()].link_stats[lro_ctx->ifidx]. in lio_get_ethtool_stats()
1571 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_err_drop); in lio_get_ethtool_stats()
1573 /*per_core_stats[cvmx_get_core_num()].link_stats[lro_ctx->ifidx]. in lio_get_ethtool_stats()
1576 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_rx_vxlan); in lio_get_ethtool_stats()
1577 /*per_core_stats[cvmx_get_core_num()].link_stats[lro_ctx->ifidx]. in lio_get_ethtool_stats()
1580 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_rx_vxlan_err); in lio_get_ethtool_stats()
1586 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_pkts); in lio_get_ethtool_stats()
1590 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_octs); in lio_get_ethtool_stats()
1592 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_total_lro); in lio_get_ethtool_stats()
1594 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts); in lio_get_ethtool_stats()
1598 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts_port); in lio_get_ethtool_stats()
1602 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts_seq); in lio_get_ethtool_stats()
1607 CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts_tsval); in lio_get_ethtool_stats()
1613 CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts_timer); in lio_get_ethtool_stats()
1615 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fwd_rate); in lio_get_ethtool_stats()
1617 /* mac: link-level stats */ in lio_get_ethtool_stats()
1619 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.total_rcvd); in lio_get_ethtool_stats()
1621 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.bytes_rcvd); in lio_get_ethtool_stats()
1623 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.total_bcst); in lio_get_ethtool_stats()
1625 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.total_mcst); in lio_get_ethtool_stats()
1626 /*wqe->word2.err_code or wqe->word2.err_level */ in lio_get_ethtool_stats()
1627 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.runts); in lio_get_ethtool_stats()
1629 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.ctl_rcvd); in lio_get_ethtool_stats()
1631 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fifo_err); in lio_get_ethtool_stats()
1633 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.dmac_drop); in lio_get_ethtool_stats()
1634 /*wqe->word2.err_code or wqe->word2.err_level */ in lio_get_ethtool_stats()
1635 data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fcs_err); in lio_get_ethtool_stats()
1636 /*lio->link_changes*/ in lio_get_ethtool_stats()
1637 data[i++] = CVM_CAST64(lio->link_changes); in lio_get_ethtool_stats()
1640 if (!(oct_dev->io_qmask.iq & BIT_ULL(j))) in lio_get_ethtool_stats()
1644 data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_done); in lio_get_ethtool_stats()
1647 CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_tot_bytes); in lio_get_ethtool_stats()
1650 CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_dropped); in lio_get_ethtool_stats()
1653 CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_iq_busy); in lio_get_ethtool_stats()
1656 CVM_CAST64(oct_dev->instr_queue[j]->stats.sgentry_sent); in lio_get_ethtool_stats()
1661 CVM_CAST64(oct_dev->instr_queue[j]->stats.instr_posted); in lio_get_ethtool_stats()
1664 oct_dev->instr_queue[j]->stats.instr_processed); in lio_get_ethtool_stats()
1667 oct_dev->instr_queue[j]->stats.instr_dropped); in lio_get_ethtool_stats()
1670 CVM_CAST64(oct_dev->instr_queue[j]->stats.bytes_sent); in lio_get_ethtool_stats()
1673 data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_gso); in lio_get_ethtool_stats()
1675 data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_vxlan); in lio_get_ethtool_stats()
1678 CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_restart); in lio_get_ethtool_stats()
1683 if (!(oct_dev->io_qmask.oq & BIT_ULL(j))) in lio_get_ethtool_stats()
1689 CVM_CAST64(oct_dev->droq[j]->stats.rx_pkts_received); in lio_get_ethtool_stats()
1692 CVM_CAST64(oct_dev->droq[j]->stats.rx_bytes_received); in lio_get_ethtool_stats()
1694 data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.dropped_nomem + in lio_get_ethtool_stats()
1695 oct_dev->droq[j]->stats.dropped_toomany + in lio_get_ethtool_stats()
1696 oct_dev->droq[j]->stats.rx_dropped); in lio_get_ethtool_stats()
1698 CVM_CAST64(oct_dev->droq[j]->stats.dropped_nomem); in lio_get_ethtool_stats()
1700 CVM_CAST64(oct_dev->droq[j]->stats.dropped_toomany); in lio_get_ethtool_stats()
1702 CVM_CAST64(oct_dev->droq[j]->stats.rx_dropped); in lio_get_ethtool_stats()
1706 CVM_CAST64(oct_dev->droq[j]->stats.pkts_received); in lio_get_ethtool_stats()
1708 CVM_CAST64(oct_dev->droq[j]->stats.bytes_received); in lio_get_ethtool_stats()
1710 CVM_CAST64(oct_dev->droq[j]->stats.dropped_nodispatch); in lio_get_ethtool_stats()
1713 CVM_CAST64(oct_dev->droq[j]->stats.rx_vxlan); in lio_get_ethtool_stats()
1715 CVM_CAST64(oct_dev->droq[j]->stats.rx_alloc_failure); in lio_get_ethtool_stats()
1726 struct octeon_device *oct_dev = lio->oct_dev; in lio_vf_get_ethtool_stats()
1732 netdev->netdev_ops->ndo_get_stats64(netdev, &lstats); in lio_vf_get_ethtool_stats()
1733 /* sum of oct->droq[oq_no]->stats->rx_pkts_received */ in lio_vf_get_ethtool_stats()
1735 /* sum of oct->instr_queue[iq_no]->stats.tx_done */ in lio_vf_get_ethtool_stats()
1737 /* sum of oct->droq[oq_no]->stats->rx_bytes_received */ in lio_vf_get_ethtool_stats()
1739 /* sum of oct->instr_queue[iq_no]->stats.tx_tot_bytes */ in lio_vf_get_ethtool_stats()
1743 /* sum of oct->droq[oq_no]->stats->rx_dropped + in lio_vf_get_ethtool_stats()
1744 * oct->droq[oq_no]->stats->dropped_nodispatch + in lio_vf_get_ethtool_stats()
1745 * oct->droq[oq_no]->stats->dropped_toomany + in lio_vf_get_ethtool_stats()
1746 * oct->droq[oq_no]->stats->dropped_nomem in lio_vf_get_ethtool_stats()
1749 /* sum of oct->instr_queue[iq_no]->stats.tx_dropped */ in lio_vf_get_ethtool_stats()
1751 oct_dev->link_stats.fromhost.fw_err_drop; in lio_vf_get_ethtool_stats()
1753 data[i++] = oct_dev->link_stats.fromwire.fw_total_mcast; in lio_vf_get_ethtool_stats()
1754 data[i++] = oct_dev->link_stats.fromhost.fw_total_mcast_sent; in lio_vf_get_ethtool_stats()
1755 data[i++] = oct_dev->link_stats.fromwire.fw_total_bcast; in lio_vf_get_ethtool_stats()
1756 data[i++] = oct_dev->link_stats.fromhost.fw_total_bcast_sent; in lio_vf_get_ethtool_stats()
1758 /* lio->link_changes */ in lio_vf_get_ethtool_stats()
1759 data[i++] = CVM_CAST64(lio->link_changes); in lio_vf_get_ethtool_stats()
1761 for (vj = 0; vj < oct_dev->num_iqs; vj++) { in lio_vf_get_ethtool_stats()
1762 j = lio->linfo.txpciq[vj].s.q_no; in lio_vf_get_ethtool_stats()
1766 data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_done); in lio_vf_get_ethtool_stats()
1769 oct_dev->instr_queue[j]->stats.tx_tot_bytes); in lio_vf_get_ethtool_stats()
1772 oct_dev->instr_queue[j]->stats.tx_dropped); in lio_vf_get_ethtool_stats()
1775 oct_dev->instr_queue[j]->stats.tx_iq_busy); in lio_vf_get_ethtool_stats()
1778 oct_dev->instr_queue[j]->stats.sgentry_sent); in lio_vf_get_ethtool_stats()
1783 oct_dev->instr_queue[j]->stats.instr_posted); in lio_vf_get_ethtool_stats()
1786 CVM_CAST64(oct_dev->instr_queue[j]->stats.instr_processed); in lio_vf_get_ethtool_stats()
1789 CVM_CAST64(oct_dev->instr_queue[j]->stats.instr_dropped); in lio_vf_get_ethtool_stats()
1792 oct_dev->instr_queue[j]->stats.bytes_sent); in lio_vf_get_ethtool_stats()
1794 data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_gso); in lio_vf_get_ethtool_stats()
1796 data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_vxlan); in lio_vf_get_ethtool_stats()
1799 oct_dev->instr_queue[j]->stats.tx_restart); in lio_vf_get_ethtool_stats()
1803 for (vj = 0; vj < oct_dev->num_oqs; vj++) { in lio_vf_get_ethtool_stats()
1804 j = lio->linfo.rxpciq[vj].s.q_no; in lio_vf_get_ethtool_stats()
1809 oct_dev->droq[j]->stats.rx_pkts_received); in lio_vf_get_ethtool_stats()
1812 oct_dev->droq[j]->stats.rx_bytes_received); in lio_vf_get_ethtool_stats()
1813 data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.dropped_nomem + in lio_vf_get_ethtool_stats()
1814 oct_dev->droq[j]->stats.dropped_toomany + in lio_vf_get_ethtool_stats()
1815 oct_dev->droq[j]->stats.rx_dropped); in lio_vf_get_ethtool_stats()
1816 data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.dropped_nomem); in lio_vf_get_ethtool_stats()
1817 data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.dropped_toomany); in lio_vf_get_ethtool_stats()
1818 data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.rx_dropped); in lio_vf_get_ethtool_stats()
1821 data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.pkts_received); in lio_vf_get_ethtool_stats()
1822 data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.bytes_received); in lio_vf_get_ethtool_stats()
1824 CVM_CAST64(oct_dev->droq[j]->stats.dropped_nodispatch); in lio_vf_get_ethtool_stats()
1826 data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.rx_vxlan); in lio_vf_get_ethtool_stats()
1828 CVM_CAST64(oct_dev->droq[j]->stats.rx_alloc_failure); in lio_vf_get_ethtool_stats()
1834 struct octeon_device *oct_dev = lio->oct_dev; in lio_get_priv_flags_strings()
1837 switch (oct_dev->chip_id) { in lio_get_priv_flags_strings()
1849 netif_info(lio, drv, lio->netdev, "Unknown Chip !!\n"); in lio_get_priv_flags_strings()
1857 struct octeon_device *oct_dev = lio->oct_dev; in lio_get_strings()
1871 if (!(oct_dev->io_qmask.iq & BIT_ULL(i))) in lio_get_strings()
1874 sprintf(data, "tx-%d-%s", i, in lio_get_strings()
1882 if (!(oct_dev->io_qmask.oq & BIT_ULL(i))) in lio_get_strings()
1885 sprintf(data, "rx-%d-%s", i, in lio_get_strings()
1896 netif_info(lio, drv, lio->netdev, "Unknown Stringset !!\n"); in lio_get_strings()
1906 struct octeon_device *oct_dev = lio->oct_dev; in lio_vf_get_strings()
1919 if (!(oct_dev->io_qmask.iq & BIT_ULL(i))) in lio_vf_get_strings()
1922 sprintf(data, "tx-%d-%s", i, in lio_vf_get_strings()
1930 if (!(oct_dev->io_qmask.oq & BIT_ULL(i))) in lio_vf_get_strings()
1933 sprintf(data, "rx-%d-%s", i, in lio_vf_get_strings()
1944 netif_info(lio, drv, lio->netdev, "Unknown Stringset !!\n"); in lio_vf_get_strings()
1951 struct octeon_device *oct_dev = lio->oct_dev; in lio_get_priv_flags_ss_count()
1953 switch (oct_dev->chip_id) { in lio_get_priv_flags_ss_count()
1959 return -EOPNOTSUPP; in lio_get_priv_flags_ss_count()
1961 netif_info(lio, drv, lio->netdev, "Unknown Chip !!\n"); in lio_get_priv_flags_ss_count()
1962 return -EOPNOTSUPP; in lio_get_priv_flags_ss_count()
1969 struct octeon_device *oct_dev = lio->oct_dev; in lio_get_sset_count()
1974 ARRAY_SIZE(oct_iq_stats_strings) * oct_dev->num_iqs + in lio_get_sset_count()
1975 ARRAY_SIZE(oct_droq_stats_strings) * oct_dev->num_oqs); in lio_get_sset_count()
1979 return -EOPNOTSUPP; in lio_get_sset_count()
1986 struct octeon_device *oct_dev = lio->oct_dev; in lio_vf_get_sset_count()
1991 ARRAY_SIZE(oct_iq_stats_strings) * oct_dev->num_iqs + in lio_vf_get_sset_count()
1992 ARRAY_SIZE(oct_droq_stats_strings) * oct_dev->num_oqs); in lio_vf_get_sset_count()
1996 return -EOPNOTSUPP; in lio_vf_get_sset_count()
2007 struct octeon_device *oct_dev = lio->oct_dev; in octnet_get_intrmod_cfg()
2016 return -ENOMEM; in octnet_get_intrmod_cfg()
2018 resp = (struct oct_intrmod_resp *)sc->virtrptr; in octnet_get_intrmod_cfg()
2021 sc->iq_no = lio->linfo.txpciq[0].s.q_no; in octnet_get_intrmod_cfg()
2026 init_completion(&sc->complete); in octnet_get_intrmod_cfg()
2027 sc->sc_status = OCTEON_REQUEST_PENDING; in octnet_get_intrmod_cfg()
2032 return -EINVAL; in octnet_get_intrmod_cfg()
2036 * response arrived or timed-out. in octnet_get_intrmod_cfg()
2040 return -ENODEV; in octnet_get_intrmod_cfg()
2042 if (resp->status) { in octnet_get_intrmod_cfg()
2043 dev_err(&oct_dev->pci_dev->dev, in octnet_get_intrmod_cfg()
2045 WRITE_ONCE(sc->caller_is_done, true); in octnet_get_intrmod_cfg()
2046 return -ENODEV; in octnet_get_intrmod_cfg()
2049 octeon_swap_8B_data((u64 *)&resp->intrmod, in octnet_get_intrmod_cfg()
2051 memcpy(intr_cfg, &resp->intrmod, sizeof(struct oct_intrmod_cfg)); in octnet_get_intrmod_cfg()
2052 WRITE_ONCE(sc->caller_is_done, true); in octnet_get_intrmod_cfg()
2062 struct oct_intrmod_cfg *cfg; in octnet_set_intrmod_cfg() local
2064 struct octeon_device *oct_dev = lio->oct_dev; in octnet_set_intrmod_cfg()
2073 return -ENOMEM; in octnet_set_intrmod_cfg()
2075 cfg = (struct oct_intrmod_cfg *)sc->virtdptr; in octnet_set_intrmod_cfg()
2077 memcpy(cfg, intr_cfg, sizeof(struct oct_intrmod_cfg)); in octnet_set_intrmod_cfg()
2078 octeon_swap_8B_data((u64 *)cfg, (sizeof(struct oct_intrmod_cfg)) / 8); in octnet_set_intrmod_cfg()
2080 sc->iq_no = lio->linfo.txpciq[0].s.q_no; in octnet_set_intrmod_cfg()
2085 init_completion(&sc->complete); in octnet_set_intrmod_cfg()
2086 sc->sc_status = OCTEON_REQUEST_PENDING; in octnet_set_intrmod_cfg()
2091 return -EINVAL; in octnet_set_intrmod_cfg()
2095 * response arrived or timed-out. in octnet_set_intrmod_cfg()
2101 retval = sc->sc_status; in octnet_set_intrmod_cfg()
2103 dev_info(&oct_dev->pci_dev->dev, in octnet_set_intrmod_cfg()
2104 "Rx-Adaptive Interrupt moderation %s\n", in octnet_set_intrmod_cfg()
2105 (intr_cfg->rx_enable) ? in octnet_set_intrmod_cfg()
2107 WRITE_ONCE(sc->caller_is_done, true); in octnet_set_intrmod_cfg()
2111 dev_err(&oct_dev->pci_dev->dev, in octnet_set_intrmod_cfg()
2113 WRITE_ONCE(sc->caller_is_done, true); in octnet_set_intrmod_cfg()
2114 return -ENODEV; in octnet_set_intrmod_cfg()
2123 struct octeon_device *oct = lio->oct_dev; in lio_get_intr_coalesce()
2128 return -ENODEV; in lio_get_intr_coalesce()
2130 switch (oct->chip_id) { in lio_get_intr_coalesce()
2134 intr_coal->rx_coalesce_usecs = oct->rx_coalesce_usecs; in lio_get_intr_coalesce()
2135 intr_coal->rx_max_coalesced_frames = in lio_get_intr_coalesce()
2136 oct->rx_max_coalesced_frames; in lio_get_intr_coalesce()
2139 intr_coal->tx_max_coalesced_frames = in lio_get_intr_coalesce()
2140 oct->tx_max_coalesced_frames; in lio_get_intr_coalesce()
2146 (struct octeon_cn6xxx *)oct->chip; in lio_get_intr_coalesce()
2149 intr_coal->rx_coalesce_usecs = in lio_get_intr_coalesce()
2150 CFG_GET_OQ_INTR_TIME(cn6xxx->conf); in lio_get_intr_coalesce()
2151 intr_coal->rx_max_coalesced_frames = in lio_get_intr_coalesce()
2152 CFG_GET_OQ_INTR_PKT(cn6xxx->conf); in lio_get_intr_coalesce()
2154 iq = oct->instr_queue[lio->linfo.txpciq[0].s.q_no]; in lio_get_intr_coalesce()
2155 intr_coal->tx_max_coalesced_frames = iq->fill_threshold; in lio_get_intr_coalesce()
2159 netif_info(lio, drv, lio->netdev, "Unknown Chip !!\n"); in lio_get_intr_coalesce()
2160 return -EINVAL; in lio_get_intr_coalesce()
2163 intr_coal->use_adaptive_rx_coalesce = in lio_get_intr_coalesce()
2165 intr_coal->rate_sample_interval = in lio_get_intr_coalesce()
2167 intr_coal->pkt_rate_high = in lio_get_intr_coalesce()
2169 intr_coal->pkt_rate_low = in lio_get_intr_coalesce()
2171 intr_coal->rx_max_coalesced_frames_high = in lio_get_intr_coalesce()
2173 intr_coal->rx_coalesce_usecs_high = in lio_get_intr_coalesce()
2175 intr_coal->rx_coalesce_usecs_low = in lio_get_intr_coalesce()
2177 intr_coal->rx_max_coalesced_frames_low = in lio_get_intr_coalesce()
2182 intr_coal->use_adaptive_tx_coalesce = in lio_get_intr_coalesce()
2184 intr_coal->tx_max_coalesced_frames_high = in lio_get_intr_coalesce()
2186 intr_coal->tx_max_coalesced_frames_low = in lio_get_intr_coalesce()
2199 if (intrmod_cfg->rx_enable || intrmod_cfg->tx_enable) { in oct_cfg_adaptive_intr()
2200 intrmod_cfg->check_intrvl = intr_coal->rate_sample_interval; in oct_cfg_adaptive_intr()
2201 intrmod_cfg->maxpkt_ratethr = intr_coal->pkt_rate_high; in oct_cfg_adaptive_intr()
2202 intrmod_cfg->minpkt_ratethr = intr_coal->pkt_rate_low; in oct_cfg_adaptive_intr()
2204 if (intrmod_cfg->rx_enable) { in oct_cfg_adaptive_intr()
2205 intrmod_cfg->rx_maxcnt_trigger = in oct_cfg_adaptive_intr()
2206 intr_coal->rx_max_coalesced_frames_high; in oct_cfg_adaptive_intr()
2207 intrmod_cfg->rx_maxtmr_trigger = in oct_cfg_adaptive_intr()
2208 intr_coal->rx_coalesce_usecs_high; in oct_cfg_adaptive_intr()
2209 intrmod_cfg->rx_mintmr_trigger = in oct_cfg_adaptive_intr()
2210 intr_coal->rx_coalesce_usecs_low; in oct_cfg_adaptive_intr()
2211 intrmod_cfg->rx_mincnt_trigger = in oct_cfg_adaptive_intr()
2212 intr_coal->rx_max_coalesced_frames_low; in oct_cfg_adaptive_intr()
2214 if (intrmod_cfg->tx_enable) { in oct_cfg_adaptive_intr()
2215 intrmod_cfg->tx_maxcnt_trigger = in oct_cfg_adaptive_intr()
2216 intr_coal->tx_max_coalesced_frames_high; in oct_cfg_adaptive_intr()
2217 intrmod_cfg->tx_mincnt_trigger = in oct_cfg_adaptive_intr()
2218 intr_coal->tx_max_coalesced_frames_low; in oct_cfg_adaptive_intr()
2231 struct octeon_device *oct = lio->oct_dev; in oct_cfg_rx_intrcnt()
2235 switch (oct->chip_id) { in oct_cfg_rx_intrcnt()
2239 (struct octeon_cn6xxx *)oct->chip; in oct_cfg_rx_intrcnt()
2241 if (!intr_coal->rx_max_coalesced_frames) in oct_cfg_rx_intrcnt()
2245 intr_coal->rx_max_coalesced_frames; in oct_cfg_rx_intrcnt()
2248 CFG_SET_OQ_INTR_PKT(cn6xxx->conf, rx_max_coalesced_frames); in oct_cfg_rx_intrcnt()
2254 if (!intr_coal->rx_max_coalesced_frames) in oct_cfg_rx_intrcnt()
2255 rx_max_coalesced_frames = intrmod->rx_frames; in oct_cfg_rx_intrcnt()
2258 intr_coal->rx_max_coalesced_frames; in oct_cfg_rx_intrcnt()
2259 for (q_no = 0; q_no < oct->num_oqs; q_no++) { in oct_cfg_rx_intrcnt()
2260 q_no += oct->sriov_info.pf_srn; in oct_cfg_rx_intrcnt()
2266 (rx_max_coalesced_frames - 1)); in oct_cfg_rx_intrcnt()
2269 intrmod->rx_frames = rx_max_coalesced_frames; in oct_cfg_rx_intrcnt()
2270 oct->rx_max_coalesced_frames = rx_max_coalesced_frames; in oct_cfg_rx_intrcnt()
2276 if (!intr_coal->rx_max_coalesced_frames) in oct_cfg_rx_intrcnt()
2277 rx_max_coalesced_frames = intrmod->rx_frames; in oct_cfg_rx_intrcnt()
2280 intr_coal->rx_max_coalesced_frames; in oct_cfg_rx_intrcnt()
2281 for (q_no = 0; q_no < oct->num_oqs; q_no++) { in oct_cfg_rx_intrcnt()
2287 (rx_max_coalesced_frames - 1)); in oct_cfg_rx_intrcnt()
2290 intrmod->rx_frames = rx_max_coalesced_frames; in oct_cfg_rx_intrcnt()
2291 oct->rx_max_coalesced_frames = rx_max_coalesced_frames; in oct_cfg_rx_intrcnt()
2295 return -EINVAL; in oct_cfg_rx_intrcnt()
2304 struct octeon_device *oct = lio->oct_dev; in oct_cfg_rx_intrtime()
2308 switch (oct->chip_id) { in oct_cfg_rx_intrtime()
2312 (struct octeon_cn6xxx *)oct->chip; in oct_cfg_rx_intrtime()
2313 if (!intr_coal->rx_coalesce_usecs) in oct_cfg_rx_intrtime()
2316 rx_coalesce_usecs = intr_coal->rx_coalesce_usecs; in oct_cfg_rx_intrtime()
2324 CFG_SET_OQ_INTR_TIME(cn6xxx->conf, rx_coalesce_usecs); in oct_cfg_rx_intrtime()
2331 if (!intr_coal->rx_coalesce_usecs) in oct_cfg_rx_intrtime()
2332 rx_coalesce_usecs = intrmod->rx_usecs; in oct_cfg_rx_intrtime()
2334 rx_coalesce_usecs = intr_coal->rx_coalesce_usecs; in oct_cfg_rx_intrtime()
2337 for (q_no = 0; q_no < oct->num_oqs; q_no++) { in oct_cfg_rx_intrtime()
2338 q_no += oct->sriov_info.pf_srn; in oct_cfg_rx_intrtime()
2341 (intrmod->rx_frames | in oct_cfg_rx_intrtime()
2345 intrmod->rx_usecs = rx_coalesce_usecs; in oct_cfg_rx_intrtime()
2346 oct->rx_coalesce_usecs = rx_coalesce_usecs; in oct_cfg_rx_intrtime()
2353 if (!intr_coal->rx_coalesce_usecs) in oct_cfg_rx_intrtime()
2354 rx_coalesce_usecs = intrmod->rx_usecs; in oct_cfg_rx_intrtime()
2356 rx_coalesce_usecs = intr_coal->rx_coalesce_usecs; in oct_cfg_rx_intrtime()
2360 for (q_no = 0; q_no < oct->num_oqs; q_no++) { in oct_cfg_rx_intrtime()
2363 (intrmod->rx_frames | in oct_cfg_rx_intrtime()
2367 intrmod->rx_usecs = rx_coalesce_usecs; in oct_cfg_rx_intrtime()
2368 oct->rx_coalesce_usecs = rx_coalesce_usecs; in oct_cfg_rx_intrtime()
2372 return -EINVAL; in oct_cfg_rx_intrtime()
2383 struct octeon_device *oct = lio->oct_dev; in oct_cfg_tx_intrcnt()
2389 switch (oct->chip_id) { in oct_cfg_tx_intrcnt()
2397 if (!intr_coal->tx_max_coalesced_frames) in oct_cfg_tx_intrcnt()
2401 iq_intr_pkt = intr_coal->tx_max_coalesced_frames & in oct_cfg_tx_intrcnt()
2403 for (q_no = 0; q_no < oct->num_iqs; q_no++) { in oct_cfg_tx_intrcnt()
2404 inst_cnt_reg = (oct->instr_queue[q_no])->inst_cnt_reg; in oct_cfg_tx_intrcnt()
2408 ((u64)(iq_intr_pkt - 1) in oct_cfg_tx_intrcnt()
2413 intrmod->tx_frames = iq_intr_pkt; in oct_cfg_tx_intrcnt()
2414 oct->tx_max_coalesced_frames = iq_intr_pkt; in oct_cfg_tx_intrcnt()
2418 return -EINVAL; in oct_cfg_tx_intrcnt()
2430 struct octeon_device *oct = lio->oct_dev; in lio_set_intr_coalesce()
2435 switch (oct->chip_id) { in lio_set_intr_coalesce()
2440 if ((intr_coal->tx_max_coalesced_frames >= db_min) && in lio_set_intr_coalesce()
2441 (intr_coal->tx_max_coalesced_frames <= db_max)) { in lio_set_intr_coalesce()
2442 for (j = 0; j < lio->linfo.num_txpciq; j++) { in lio_set_intr_coalesce()
2443 q_no = lio->linfo.txpciq[j].s.q_no; in lio_set_intr_coalesce()
2444 oct->instr_queue[q_no]->fill_threshold = in lio_set_intr_coalesce()
2445 intr_coal->tx_max_coalesced_frames; in lio_set_intr_coalesce()
2448 dev_err(&oct->pci_dev->dev, in lio_set_intr_coalesce()
2449 "LIQUIDIO: Invalid tx-frames:%d. Range is min:%d max:%d\n", in lio_set_intr_coalesce()
2450 intr_coal->tx_max_coalesced_frames, in lio_set_intr_coalesce()
2452 return -EINVAL; in lio_set_intr_coalesce()
2459 return -EINVAL; in lio_set_intr_coalesce()
2462 intrmod.rx_enable = intr_coal->use_adaptive_rx_coalesce ? 1 : 0; in lio_set_intr_coalesce()
2463 intrmod.tx_enable = intr_coal->use_adaptive_tx_coalesce ? 1 : 0; in lio_set_intr_coalesce()
2470 if (!intr_coal->use_adaptive_rx_coalesce) { in lio_set_intr_coalesce()
2479 oct->rx_coalesce_usecs = in lio_set_intr_coalesce()
2481 oct->rx_max_coalesced_frames = in lio_set_intr_coalesce()
2485 if (!intr_coal->use_adaptive_tx_coalesce) { in lio_set_intr_coalesce()
2490 oct->tx_max_coalesced_frames = in lio_set_intr_coalesce()
2505 info->so_timestamping = in lio_get_ts_info()
2511 if (lio->ptp_clock) in lio_get_ts_info()
2512 info->phc_index = ptp_clock_index(lio->ptp_clock); in lio_get_ts_info()
2514 info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON); in lio_get_ts_info()
2516 info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) | in lio_get_ts_info()
2529 struct octeon_device *oct = lio->oct_dev; in lio_get_regs_len()
2531 switch (oct->chip_id) { in lio_get_regs_len()
2544 u8 pf_num = oct->pf_num; in cn23xx_read_csr_reg()
2553 reg = CN23XX_SLI_PKT_MAC_RINFO64(oct->pcie_port, oct->pf_num); in cn23xx_read_csr_reg()
2556 reg, oct->pcie_port, oct->pf_num, in cn23xx_read_csr_reg()
2560 reg = CN23XX_SLI_MAC_PF_INT_ENB64(oct->pcie_port, oct->pf_num); in cn23xx_read_csr_reg()
2563 reg, oct->pcie_port, oct->pf_num, in cn23xx_read_csr_reg()
2567 reg = CN23XX_SLI_MAC_PF_INT_SUM64(oct->pcie_port, oct->pf_num); in cn23xx_read_csr_reg()
2570 reg, oct->pcie_port, oct->pf_num, in cn23xx_read_csr_reg()
2579 reg = 0x27300 + oct->pcie_port * CN23XX_MAC_INT_OFFSET + in cn23xx_read_csr_reg()
2580 (oct->pf_num) * CN23XX_PF_INT_OFFSET; in cn23xx_read_csr_reg()
2583 oct->pcie_port, oct->pf_num, (u64)octeon_read_csr64(oct, reg)); in cn23xx_read_csr_reg()
2586 reg = 0x27200 + oct->pcie_port * CN23XX_MAC_INT_OFFSET + in cn23xx_read_csr_reg()
2587 (oct->pf_num) * CN23XX_PF_INT_OFFSET; in cn23xx_read_csr_reg()
2590 reg, oct->pcie_port, oct->pf_num, in cn23xx_read_csr_reg()
2771 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2778 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2785 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2792 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2799 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2806 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2813 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2820 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2826 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2833 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2840 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2847 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2854 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2861 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2868 for (i = 0; i < (oct->sriov_info.rings_per_vf); i++) { in cn23xx_vf_read_csr_reg()
2919 for (i = 0; i < oct->num_oqs; i++) { in cn6xxx_read_csr_reg()
2976 reg = lio_pci_readq(oct, CN6XXX_BAR1_REG(i, oct->pcie_port)); in cn6xxx_read_csr_reg()
2978 CN6XXX_BAR1_REG(i, oct->pcie_port), i, reg); in cn6xxx_read_csr_reg()
2995 pci_read_config_dword(oct->pci_dev, (i * 4), &val); in cn6xxx_read_config_reg()
3001 pci_read_config_dword(oct->pci_dev, (i * 4), &val); in cn6xxx_read_config_reg()
3015 struct octeon_device *oct = lio->oct_dev; in lio_get_regs()
3017 regs->version = OCT_ETHTOOL_REGSVER; in lio_get_regs()
3019 switch (oct->chip_id) { in lio_get_regs()
3035 dev_err(&oct->pci_dev->dev, "%s Unknown chipid: %d\n", in lio_get_regs()
3036 __func__, oct->chip_id); in lio_get_regs()
3044 return lio->oct_dev->priv_flags; in lio_get_priv_flags()
3052 lio_set_priv_flag(lio->oct_dev, OCT_PRIV_FLAG_TX_BYTES, in lio_set_priv_flags()
3061 struct octeon_device *oct = lio->oct_dev; in lio_get_fecparam()
3063 fec->active_fec = ETHTOOL_FEC_NONE; in lio_get_fecparam()
3064 fec->fec = ETHTOOL_FEC_NONE; in lio_get_fecparam()
3066 if (oct->subsystem_id == OCTEON_CN2350_25GB_SUBSYS_ID || in lio_get_fecparam()
3067 oct->subsystem_id == OCTEON_CN2360_25GB_SUBSYS_ID) { in lio_get_fecparam()
3068 if (oct->no_speed_setting == 1) in lio_get_fecparam()
3072 fec->fec = (ETHTOOL_FEC_RS | ETHTOOL_FEC_OFF); in lio_get_fecparam()
3073 if (oct->props[lio->ifidx].fec == 1) in lio_get_fecparam()
3074 fec->active_fec = ETHTOOL_FEC_RS; in lio_get_fecparam()
3076 fec->active_fec = ETHTOOL_FEC_OFF; in lio_get_fecparam()
3086 struct octeon_device *oct = lio->oct_dev; in lio_set_fecparam()
3088 if (oct->subsystem_id == OCTEON_CN2350_25GB_SUBSYS_ID || in lio_set_fecparam()
3089 oct->subsystem_id == OCTEON_CN2360_25GB_SUBSYS_ID) { in lio_set_fecparam()
3090 if (oct->no_speed_setting == 1) in lio_set_fecparam()
3091 return -EOPNOTSUPP; in lio_set_fecparam()
3093 if (fec->fec & ETHTOOL_FEC_OFF) in lio_set_fecparam()
3095 else if (fec->fec & ETHTOOL_FEC_RS) in lio_set_fecparam()
3098 return -EOPNOTSUPP; in lio_set_fecparam()
3100 return -EOPNOTSUPP; in lio_set_fecparam()
3176 struct octeon_device *oct = lio->oct_dev; in liquidio_set_ethtool_ops()
3179 netdev->ethtool_ops = &lio_vf_ethtool_ops; in liquidio_set_ethtool_ops()
3181 netdev->ethtool_ops = &lio_ethtool_ops; in liquidio_set_ethtool_ops()